-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtactics.lean
More file actions
34 lines (29 loc) · 948 Bytes
/
tactics.lean
File metadata and controls
34 lines (29 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import probability.probability_mass_function.basic
import probability.probability_mass_function.monad
variables {α β : Type}
lemma bind_skip' (p : pmf α) (f g : α → pmf β) :
(∀ (a : α), f a = g a) → p.bind f = p.bind g :=
begin
intro ha,
ext,
simp only [pmf.bind_apply, nnreal.coe_eq],
simp_rw ha,
end
lemma bind_skip_const' (pa : pmf α) (pb : pmf β) (f : α → pmf β) :
(∀ (a : α), f a = pb) → pa.bind f = pb :=
begin
intro ha,
ext,
simp only [pmf.bind_apply, nnreal.coe_eq],
simp_rw ha,
simp [ennreal.tsum_mul_right],
end
setup_tactic_parser
meta def tactic.interactive.bind_skip (x : parse (tk "with" *> ident)?) : tactic unit :=
do `[apply bind_skip'],
let a := x.get_or_else `_,
tactic.interactive.intro a
meta def tactic.interactive.bind_skip_const (x : parse (tk "with" *> ident)?) : tactic unit :=
do `[apply bind_skip_const'],
let a := x.get_or_else `_,
tactic.interactive.intro a