-- Mathlib/Probability/ConditionalProbability.lean
lemma cond_cond_eq_cond_inter' (hms : MeasurableSet s) (hmt : MeasurableSet t) (hcs : μ s ≠ ∞) :
    μ[|s][|t] = μ[|s ∩ t]

Proof state:
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
⊢ μ[|s][|t] = μ[|s ∩ t]

Tactic:
ext u

Result:
case h
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
⊢ μ[|s][u | t] = μ[u | s ∩ t]

Proof state:
case h
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

Tactic:
obtain hst | hst := eq_or_ne (μ (s ∩ t)) 0

Result:
case h.inl
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
hst : μ (s ∩ t) = 0
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

case h.inr
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
hst : μ (s ∩ t) ≠ 0
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

Proof state:
case h.inr
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
hst : μ (s ∩ t) ≠ 0
hcs' : μ s ≠ 0
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

Tactic:
simp [*, ← mul_assoc, ← Set.inter_assoc, ENNReal.mul_inv, ENNReal.mul_inv_cancel,
  mul_right_comm _ _ (μ s)⁻¹]

Result:
no goals

Proof state:
case h.inr
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
hst : μ (s ∩ t) ≠ 0
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

Tactic:
have hcs' : μ s ≠ 0 :=
  (measure_pos_of_superset Set.inter_subset_left hst).ne'

Result:
case h.inr
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
hst : μ (s ∩ t) ≠ 0
hcs' : μ s ≠ 0
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

Proof state:
case h.inl
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
hst : μ (s ∩ t) = 0
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

Tactic:
have : μ (s ∩ t ∩ u) = 0 := measure_mono_null Set.inter_subset_left hst

Result:
case h.inl
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
hst : μ (s ∩ t) = 0
this : μ (s ∩ t ∩ u) = 0
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

Proof state:
case h.inl
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
hst : μ (s ∩ t) = 0
this : μ (s ∩ t ∩ u) = 0
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)

Tactic:
simp [this, ← Set.inter_assoc]

Result:
no goals

Proof state:
case h
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
⊢ μ[|s][u | t] = μ[u | s ∩ t]

Tactic:
rw [cond_apply hmt, cond_apply hms, cond_apply hms, cond_apply (hms.inter hmt)]

Result:
case h
Ω : Type u_1
m : MeasurableSpace Ω
μ : Measure Ω
s t : Set Ω
hms : MeasurableSet s
hmt : MeasurableSet t
hcs : μ s ≠ ⊤
u : Set Ω
a✝ : MeasurableSet u
⊢ ((μ s)⁻¹ * μ (s ∩ t))⁻¹ * ((μ s)⁻¹ * μ (s ∩ (t ∩ u))) = (μ (s ∩ t))⁻¹ * μ (s ∩ t ∩ u)