Theorem: ProbabilityTheory.iIndepSets.indepSets
File: Mathlib/Probability/Independence/Basic.lean

tactic: intro t₁ t₂ ht₁ ht₂
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
⊢ IndepSets (s i) (s j)

tactic: have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true, eq_self_iff_true]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
⊢ ↑↑μ (t₁ ∩ t₂) = ↑↑μ t₁ * ↑↑μ t₂

tactic: have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
⊢ ↑↑μ (t₁ ∩ t₂) = ↑↑μ t₁ * ↑↑μ t₂

tactic: have h_inter :
  (⋂ (t : ι) (_ : t ∈ ({i, j} : Finset ι)), ite (t = i) t₁ t₂) =
    ite (i = i) t₁ t₂ ∩ ite (j = i) t₁ t₂ :=
  by simp only [Finset.set_biInter_singleton, Finset.set_biInter_insert]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
h2 : t₂ = if j = i then t₁ else t₂
⊢ ↑↑μ (t₁ ∩ t₂) = ↑↑μ t₁ * ↑↑μ t₂

tactic: have h_prod :
  (∏ t : ι in ({i, j} : Finset ι), μ (ite (t = i) t₁ t₂)) =
    μ (ite (i = i) t₁ t₂) * μ (ite (j = i) t₁ t₂) := by
  simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff,
    Finset.mem_singleton]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
h2 : t₂ = if j = i then t₁ else t₂
h_inter : (⋂ (t : ι) (_ : t ∈ {i, j}), if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
⊢ ↑↑μ (t₁ ∩ t₂) = ↑↑μ t₁ * ↑↑μ t₂

tactic: rw [h1]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
h2 : t₂ = if j = i then t₁ else t₂
h_inter : (⋂ (t : ι) (_ : t ∈ {i, j}), if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
h_prod : ∏ t in {i, j}, ↑↑μ (if t = i then t₁ else t₂) = ↑↑μ (if i = i then t₁ else t₂) * ↑↑μ (if j = i then t₁ else t₂)
⊢ ↑↑μ (t₁ ∩ t₂) = ↑↑μ t₁ * ↑↑μ t₂

tactic: nth_rw 2 [h2]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
h2 : t₂ = if j = i then t₁ else t₂
h_inter : (⋂ (t : ι) (_ : t ∈ {i, j}), if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
h_prod : ∏ t in {i, j}, ↑↑μ (if t = i then t₁ else t₂) = ↑↑μ (if i = i then t₁ else t₂) * ↑↑μ (if j = i then t₁ else t₂)
⊢ ↑↑μ ((if i = i then t₁ else t₂) ∩ t₂) = ↑↑μ (if i = i then t₁ else t₂) * ↑↑μ t₂

tactic: nth_rw 4 [h2]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
h2 : t₂ = if j = i then t₁ else t₂
h_inter : (⋂ (t : ι) (_ : t ∈ {i, j}), if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
h_prod : ∏ t in {i, j}, ↑↑μ (if t = i then t₁ else t₂) = ↑↑μ (if i = i then t₁ else t₂) * ↑↑μ (if j = i then t₁ else t₂)
⊢ ↑↑μ ((if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂) = ↑↑μ (if i = i then t₁ else t₂) * ↑↑μ t₂

tactic: rw [← h_inter, ← h_prod, h_indep {i, j} hf_m]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
h2 : t₂ = if j = i then t₁ else t₂
h_inter : (⋂ (t : ι) (_ : t ∈ {i, j}), if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
h_prod : ∏ t in {i, j}, ↑↑μ (if t = i then t₁ else t₂) = ↑↑μ (if i = i then t₁ else t₂) * ↑↑μ (if j = i then t₁ else t₂)
⊢ ↑↑μ ((if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂) =
    ↑↑μ (if i = i then t₁ else t₂) * ↑↑μ (if j = i then t₁ else t₂)

tactic: intro x hx
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
⊢ ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x

tactic: cases' Finset.mem_insert.mp hx with hx hx
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
x : ι
hx : x ∈ {i, j}
⊢ (if x = i then t₁ else t₂) ∈ s x

tactic: simp [hx, ht₁]
state_before: case inl
Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
x : ι
hx✝ : x ∈ {i, j}
hx : x = i
⊢ (if x = i then t₁ else t₂) ∈ s x

tactic: simp [Finset.mem_singleton.mp hx, hij.symm, ht₂]
state_before: case inr
Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
x : ι
hx✝ : x ∈ {i, j}
hx : x ∈ {j}
⊢ (if x = i then t₁ else t₂) ∈ s x

tactic: simp only [if_true, eq_self_iff_true]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
⊢ t₁ = if i = i then t₁ else t₂

tactic: simp only [hij.symm, if_false]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
⊢ t₂ = if j = i then t₁ else t₂

tactic: simp only [Finset.set_biInter_singleton, Finset.set_biInter_insert]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
h2 : t₂ = if j = i then t₁ else t₂
⊢ (⋂ (t : ι) (_ : t ∈ {i, j}), if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂

tactic: simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff,
  Finset.mem_singleton]
state_before: Ω : Type u_1
ι : Type u_2
s : ι → Set (Set Ω)
inst✝ : MeasurableSpace Ω
μ : MeasureTheory.Measure Ω
h_indep : iIndepSets s
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ (x : ι), x ∈ {i, j} → (if x = i then t₁ else t₂) ∈ s x
h1 : t₁ = if i = i then t₁ else t₂
h2 : t₂ = if j = i then t₁ else t₂
h_inter : (⋂ (t : ι) (_ : t ∈ {i, j}), if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
⊢ ∏ t in {i, j}, ↑↑μ (if t = i then t₁ else t₂) = ↑↑μ (if i = i then t₁ else t₂) * ↑↑μ (if j = i then t₁ else t₂)