Theorem: PMF.toOuterMeasure_apply_eq_one_iff
File: Mathlib/Probability/ProbabilityMassFunction/Basic.lean

tactic: refine (p.toOuterMeasure_apply s).symm ▸ ⟨fun h a hap => ?_, fun h => ?_⟩
state_before: α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
⊢ p.toOuterMeasure s = 1 ↔ p.support ⊆ s
state_after: case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : ∑' (x : α), s.indicator (⇑p) x = 1
a : α
hap : a ∈ p.support
⊢ a ∈ s

case refine_2
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : p.support ⊆ s
⊢ ∑' (x : α), s.indicator (⇑p) x = 1

tactic: refine by_contra fun hs => ne_of_lt ?_ (h.trans p.tsum_coe.symm)
state_before: case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : ∑' (x : α), s.indicator (⇑p) x = 1
a : α
hap : a ∈ p.support
⊢ a ∈ s
state_after: case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : ∑' (x : α), s.indicator (⇑p) x = 1
a : α
hap : a ∈ p.support
hs : a ∉ s
⊢ ∑' (x : α), s.indicator (⇑p) x < ∑' (a : α), p a

tactic: have hs' : s.indicator p a = 0 := Set.indicator_apply_eq_zero.2 fun hs' => False.elim <| hs hs'
state_before: case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : ∑' (x : α), s.indicator (⇑p) x = 1
a : α
hap : a ∈ p.support
hs : a ∉ s
⊢ ∑' (x : α), s.indicator (⇑p) x < ∑' (a : α), p a
state_after: case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : ∑' (x : α), s.indicator (⇑p) x = 1
a : α
hap : a ∈ p.support
hs : a ∉ s
hs' : s.indicator (⇑p) a = 0
⊢ ∑' (x : α), s.indicator (⇑p) x < ∑' (a : α), p a

tactic: have hsa : s.indicator p a < p a := hs'.symm ▸ (p.apply_pos_iff a).2 hap
state_before: case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : ∑' (x : α), s.indicator (⇑p) x = 1
a : α
hap : a ∈ p.support
hs : a ∉ s
hs' : s.indicator (⇑p) a = 0
⊢ ∑' (x : α), s.indicator (⇑p) x < ∑' (a : α), p a
state_after: case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : ∑' (x : α), s.indicator (⇑p) x = 1
a : α
hap : a ∈ p.support
hs : a ∉ s
hs' : s.indicator (⇑p) a = 0
hsa : s.indicator (⇑p) a < p a
⊢ ∑' (x : α), s.indicator (⇑p) x < ∑' (a : α), p a

tactic: exact ENNReal.tsum_lt_tsum (p.tsum_coe_indicator_ne_top s)
  (fun x => Set.indicator_apply_le fun _ => le_rfl) hsa
state_before: case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : ∑' (x : α), s.indicator (⇑p) x = 1
a : α
hap : a ∈ p.support
hs : a ∉ s
hs' : s.indicator (⇑p) a = 0
hsa : s.indicator (⇑p) a < p a
⊢ ∑' (x : α), s.indicator (⇑p) x < ∑' (a : α), p a
state_after: no goals

tactic: suffices ∀ (x) (_ : x ∉ s), p x = 0 from
  _root_.trans (tsum_congr
    fun a => (Set.indicator_apply s p a).trans (ite_eq_left_iff.2 <| symm ∘ this a)) p.tsum_coe
state_before: case refine_2
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : p.support ⊆ s
⊢ ∑' (x : α), s.indicator (⇑p) x = 1
state_after: case refine_2
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : p.support ⊆ s
⊢ ∀ x ∉ s, p x = 0

tactic: exact fun a ha => (p.apply_eq_zero_iff a).2 <| Set.not_mem_subset h ha
state_before: case refine_2
α : Type u_1
β : Type u_2
γ : Type u_3
p : PMF α
s t : Set α
h : p.support ⊆ s
⊢ ∀ x ∉ s, p x = 0
state_after: no goals