l3lab/ntp-mathlib huggingface dataset:
theorem iIndepSets.indepSets {s : ι → Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} (h_indep : iIndepSets s κ μ) {i j : ι} (hij : i ≠ j) :
    IndepSets (s i) (s j) κ μ := by
  classical
  intro t₁ t₂ ht₁ ht₂
  have hf_m : ∀ x : ι, x ∈ ({i, j} : Finset ι) → ite (x = i) t₁ t₂ ∈ s x := by
    intro x hx
    cases' Finset.mem_insert.mp hx with hx hx
    · simp [hx, ht₁]
    · simp [Finset.mem_singleton.mp hx, hij.symm, ht₂]
  have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true, eq_self_iff_true]
  have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false]
  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]
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
s : ι → Set (Set Ω)
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndepSets s κ
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ 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 ∈ {i, j}, if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
⊢ ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t₁ ∩ t₂) = ↑↑(κ a) t₁ * ↑↑(κ a) t₂

Next tactic:
filter_upwards [h_indep {i, j} hf_m] with a h_indep'
theorem iIndepSets.indepSets {s : ι → Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} (h_indep : iIndepSets s κ μ) {i j : ι} (hij : i ≠ j) :
    IndepSets (s i) (s j) κ μ := by
  classical
  intro t₁ t₂ ht₁ ht₂
  have hf_m : ∀ x : ι, x ∈ ({i, j} : Finset ι) → ite (x = i) t₁ t₂ ∈ s x := by
    intro x hx
    cases' Finset.mem_insert.mp hx with hx hx
    · simp [hx, ht₁]
    · simp [Finset.mem_singleton.mp hx, hij.symm, ht₂]
  have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true, eq_self_iff_true]
  have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false]
  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]
  filter_upwards [h_indep {i, j} hf_m] with a h_indep'
  

Proof state:
case h
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
s : ι → Set (Set Ω)
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndepSets s κ
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ 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 ∈ {i, j}, if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
a : α
h_indep' : ↑↑(κ a) (⋂ i_1 ∈ {i, j}, if i_1 = i then t₁ else t₂) = ∏ i_1 in {i, j}, ↑↑(κ a) (if i_1 = i then t₁ else t₂)
⊢ ↑↑(κ a) (t₁ ∩ t₂) = ↑↑(κ a) t₁ * ↑↑(κ a) t₂

Next tactic:
have h_prod : (∏ t : ι in ({i, j} : Finset ι), κ a (ite (t = i) t₁ t₂))
      = κ a (ite (i = i) t₁ t₂) * κ a (ite (j = i) t₁ t₂) := by
    simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff,
      Finset.mem_singleton]
theorem iIndepSets.indepSets {s : ι → Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} (h_indep : iIndepSets s κ μ) {i j : ι} (hij : i ≠ j) :
    IndepSets (s i) (s j) κ μ := by
  classical
  intro t₁ t₂ ht₁ ht₂
  have hf_m : ∀ x : ι, x ∈ ({i, j} : Finset ι) → ite (x = i) t₁ t₂ ∈ s x := by
    intro x hx
    cases' Finset.mem_insert.mp hx with hx hx
    · simp [hx, ht₁]
    · simp [Finset.mem_singleton.mp hx, hij.symm, ht₂]
  have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true, eq_self_iff_true]
  have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false]
  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]
  filter_upwards [h_indep {i, j} hf_m] with a h_indep'
  have h_prod : (∏ t : ι in ({i, j} : Finset ι), κ a (ite (t = i) t₁ t₂))
      = κ a (ite (i = i) t₁ t₂) * κ a (ite (j = i) t₁ t₂) := by
    

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
s : ι → Set (Set Ω)
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndepSets s κ
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ 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 ∈ {i, j}, if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
a : α
h_indep' : ↑↑(κ a) (⋂ i_1 ∈ {i, j}, if i_1 = i then t₁ else t₂) = ∏ i_1 in {i, j}, ↑↑(κ a) (if i_1 = i then t₁ else t₂)
⊢ ∏ t in {i, j}, ↑↑(κ a) (if t = i then t₁ else t₂) =
    ↑↑(κ a) (if i = i then t₁ else t₂) * ↑↑(κ a) (if j = i then t₁ else t₂)

Next tactic:
simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff,
      Finset.mem_singleton]
theorem iIndepSets.indepSets {s : ι → Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} (h_indep : iIndepSets s κ μ) {i j : ι} (hij : i ≠ j) :
    IndepSets (s i) (s j) κ μ := by
  classical
  intro t₁ t₂ ht₁ ht₂
  have hf_m : ∀ x : ι, x ∈ ({i, j} : Finset ι) → ite (x = i) t₁ t₂ ∈ s x := by
    intro x hx
    cases' Finset.mem_insert.mp hx with hx hx
    · simp [hx, ht₁]
    · simp [Finset.mem_singleton.mp hx, hij.symm, ht₂]
  have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true, eq_self_iff_true]
  have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false]
  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]
  filter_upwards [h_indep {i, j} hf_m] with a h_indep'
  have h_prod : (∏ t : ι in ({i, j} : Finset ι), κ a (ite (t = i) t₁ t₂))
      = κ a (ite (i = i) t₁ t₂) * κ a (ite (j = i) t₁ t₂) := by
    simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff,
      Finset.mem_singleton]
  

Proof state:
case h
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
s : ι → Set (Set Ω)
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndepSets s κ
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ 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 ∈ {i, j}, if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
a : α
h_indep' : ↑↑(κ a) (⋂ i_1 ∈ {i, j}, if i_1 = i then t₁ else t₂) = ∏ i_1 in {i, j}, ↑↑(κ a) (if i_1 = i then t₁ else t₂)
h_prod :
  ∏ t in {i, j}, ↑↑(κ a) (if t = i then t₁ else t₂) =
    ↑↑(κ a) (if i = i then t₁ else t₂) * ↑↑(κ a) (if j = i then t₁ else t₂)
⊢ ↑↑(κ a) (t₁ ∩ t₂) = ↑↑(κ a) t₁ * ↑↑(κ a) t₂

Next tactic:
rw [h1]
theorem iIndepSets.indepSets {s : ι → Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} (h_indep : iIndepSets s κ μ) {i j : ι} (hij : i ≠ j) :
    IndepSets (s i) (s j) κ μ := by
  classical
  intro t₁ t₂ ht₁ ht₂
  have hf_m : ∀ x : ι, x ∈ ({i, j} : Finset ι) → ite (x = i) t₁ t₂ ∈ s x := by
    intro x hx
    cases' Finset.mem_insert.mp hx with hx hx
    · simp [hx, ht₁]
    · simp [Finset.mem_singleton.mp hx, hij.symm, ht₂]
  have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true, eq_self_iff_true]
  have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false]
  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]
  filter_upwards [h_indep {i, j} hf_m] with a h_indep'
  have h_prod : (∏ t : ι in ({i, j} : Finset ι), κ a (ite (t = i) t₁ t₂))
      = κ a (ite (i = i) t₁ t₂) * κ a (ite (j = i) t₁ t₂) := by
    simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff,
      Finset.mem_singleton]
  rw [h1]
  

Proof state:
case h
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
s : ι → Set (Set Ω)
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndepSets s κ
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ 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 ∈ {i, j}, if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
a : α
h_indep' : ↑↑(κ a) (⋂ i_1 ∈ {i, j}, if i_1 = i then t₁ else t₂) = ∏ i_1 in {i, j}, ↑↑(κ a) (if i_1 = i then t₁ else t₂)
h_prod :
  ∏ t in {i, j}, ↑↑(κ a) (if t = i then t₁ else t₂) =
    ↑↑(κ a) (if i = i then t₁ else t₂) * ↑↑(κ a) (if j = i then t₁ else t₂)
⊢ ↑↑(κ a) ((if i = i then t₁ else t₂) ∩ t₂) = ↑↑(κ a) (if i = i then t₁ else t₂) * ↑↑(κ a) t₂

Next tactic:
nth_rw 2 [h2]
theorem iIndepSets.indepSets {s : ι → Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} (h_indep : iIndepSets s κ μ) {i j : ι} (hij : i ≠ j) :
    IndepSets (s i) (s j) κ μ := by
  classical
  intro t₁ t₂ ht₁ ht₂
  have hf_m : ∀ x : ι, x ∈ ({i, j} : Finset ι) → ite (x = i) t₁ t₂ ∈ s x := by
    intro x hx
    cases' Finset.mem_insert.mp hx with hx hx
    · simp [hx, ht₁]
    · simp [Finset.mem_singleton.mp hx, hij.symm, ht₂]
  have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true, eq_self_iff_true]
  have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false]
  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]
  filter_upwards [h_indep {i, j} hf_m] with a h_indep'
  have h_prod : (∏ t : ι in ({i, j} : Finset ι), κ a (ite (t = i) t₁ t₂))
      = κ a (ite (i = i) t₁ t₂) * κ a (ite (j = i) t₁ t₂) := by
    simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff,
      Finset.mem_singleton]
  rw [h1]
  nth_rw 2 [h2]
  

Proof state:
case h
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
s : ι → Set (Set Ω)
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndepSets s κ
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ 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 ∈ {i, j}, if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
a : α
h_indep' : ↑↑(κ a) (⋂ i_1 ∈ {i, j}, if i_1 = i then t₁ else t₂) = ∏ i_1 in {i, j}, ↑↑(κ a) (if i_1 = i then t₁ else t₂)
h_prod :
  ∏ t in {i, j}, ↑↑(κ a) (if t = i then t₁ else t₂) =
    ↑↑(κ a) (if i = i then t₁ else t₂) * ↑↑(κ a) (if j = i then t₁ else t₂)
⊢ ↑↑(κ a) ((if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂) = ↑↑(κ a) (if i = i then t₁ else t₂) * ↑↑(κ a) t₂

Next tactic:
nth_rw 4 [h2]
theorem iIndepSets.indepSets {s : ι → Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} (h_indep : iIndepSets s κ μ) {i j : ι} (hij : i ≠ j) :
    IndepSets (s i) (s j) κ μ := by
  classical
  intro t₁ t₂ ht₁ ht₂
  have hf_m : ∀ x : ι, x ∈ ({i, j} : Finset ι) → ite (x = i) t₁ t₂ ∈ s x := by
    intro x hx
    cases' Finset.mem_insert.mp hx with hx hx
    · simp [hx, ht₁]
    · simp [Finset.mem_singleton.mp hx, hij.symm, ht₂]
  have h1 : t₁ = ite (i = i) t₁ t₂ := by simp only [if_true, eq_self_iff_true]
  have h2 : t₂ = ite (j = i) t₁ t₂ := by simp only [hij.symm, if_false]
  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]
  filter_upwards [h_indep {i, j} hf_m] with a h_indep'
  have h_prod : (∏ t : ι in ({i, j} : Finset ι), κ a (ite (t = i) t₁ t₂))
      = κ a (ite (i = i) t₁ t₂) * κ a (ite (j = i) t₁ t₂) := by
    simp only [hij, Finset.prod_singleton, Finset.prod_insert, not_false_iff,
      Finset.mem_singleton]
  rw [h1]
  nth_rw 2 [h2]
  nth_rw 4 [h2]
  

Proof state:
case h
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
s : ι → Set (Set Ω)
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndepSets s κ
i j : ι
hij : i ≠ j
t₁ t₂ : Set Ω
ht₁ : t₁ ∈ s i
ht₂ : t₂ ∈ s j
hf_m : ∀ 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 ∈ {i, j}, if t = i then t₁ else t₂) = (if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂
a : α
h_indep' : ↑↑(κ a) (⋂ i_1 ∈ {i, j}, if i_1 = i then t₁ else t₂) = ∏ i_1 in {i, j}, ↑↑(κ a) (if i_1 = i then t₁ else t₂)
h_prod :
  ∏ t in {i, j}, ↑↑(κ a) (if t = i then t₁ else t₂) =
    ↑↑(κ a) (if i = i then t₁ else t₂) * ↑↑(κ a) (if j = i then t₁ else t₂)
⊢ ↑↑(κ a) ((if i = i then t₁ else t₂) ∩ if j = i then t₁ else t₂) =
    ↑↑(κ a) (if i = i then t₁ else t₂) * ↑↑(κ a) (if j = i then t₁ else t₂)

Next tactic:
rw [← h_inter, ← h_prod, h_indep']
theorem iIndep.indep {m : ι → MeasurableSpace Ω} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α}
    (h_indep : iIndep m κ μ) {i j : ι} (hij : i ≠ j) : Indep (m i) (m j) κ μ := by
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m : ι → MeasurableSpace Ω
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndep m κ
i j : ι
hij : i ≠ j
⊢ Indep (m i) (m j) κ

Next tactic:
change IndepSets ((fun x => MeasurableSet[m x]) i) ((fun x => MeasurableSet[m x]) j) κ μ
theorem iIndep.indep {m : ι → MeasurableSpace Ω} {_mΩ : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α}
    (h_indep : iIndep m κ μ) {i j : ι} (hij : i ≠ j) : Indep (m i) (m j) κ μ := by
  change IndepSets ((fun x => MeasurableSet[m x]) i) ((fun x => MeasurableSet[m x]) j) κ μ
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m : ι → MeasurableSpace Ω
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
h_indep : iIndep m κ
i j : ι
hij : i ≠ j
⊢ IndepSets ((fun x => MeasurableSet) i) ((fun x => MeasurableSet) j) κ

Next tactic:
exact iIndepSets.indepSets h_indep hij
theorem IndepSets.indep_aux {m₂ m : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] {p1 p2 : Set (Set Ω)} (h2 : m₂ ≤ m)
    (hp2 : IsPiSystem p2) (hpm2 : m₂ = generateFrom p2) (hyp : IndepSets p1 p2 κ μ) {t1 t2 : Set Ω}
    (ht1 : t1 ∈ p1) (ht1m : MeasurableSet[m] t1) (ht2m : MeasurableSet[m₂] t2) :
    ∀ᵐ a ∂μ, κ a (t1 ∩ t2) = κ a t1 * κ a t2 := by
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m₂ m : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
inst✝ : IsMarkovKernel κ
p1 p2 : Set (Set Ω)
h2 : m₂ ≤ m
hp2 : IsPiSystem p2
hpm2 : m₂ = generateFrom p2
hyp : IndepSets p1 p2 κ
t1 t2 : Set Ω
ht1 : t1 ∈ p1
ht1m : MeasurableSet t1
ht2m : MeasurableSet t2
⊢ ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t2) = ↑↑(κ a) t1 * ↑↑(κ a) t2

Next tactic:
refine @induction_on_inter _ (fun t ↦ ∀ᵐ a ∂μ, κ a (t1 ∩ t) = κ a t1 * κ a t) _
    m₂ hpm2 hp2 ?_ ?_ ?_ ?_ t2 ht2m
theorem IndepSets.indep_aux {m₂ m : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] {p1 p2 : Set (Set Ω)} (h2 : m₂ ≤ m)
    (hp2 : IsPiSystem p2) (hpm2 : m₂ = generateFrom p2) (hyp : IndepSets p1 p2 κ μ) {t1 t2 : Set Ω}
    (ht1 : t1 ∈ p1) (ht1m : MeasurableSet[m] t1) (ht2m : MeasurableSet[m₂] t2) :
    ∀ᵐ a ∂μ, κ a (t1 ∩ t2) = κ a t1 * κ a t2 := by
  refine @induction_on_inter _ (fun t ↦ ∀ᵐ a ∂μ, κ a (t1 ∩ t) = κ a t1 * κ a t) _
    m₂ hpm2 hp2 ?_ ?_ ?_ ?_ t2 ht2m
  · 

Proof state:
case refine_1
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m₂ m : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
inst✝ : IsMarkovKernel κ
p1 p2 : Set (Set Ω)
h2 : m₂ ≤ m
hp2 : IsPiSystem p2
hpm2 : m₂ = generateFrom p2
hyp : IndepSets p1 p2 κ
t1 t2 : Set Ω
ht1 : t1 ∈ p1
ht1m : MeasurableSet t1
ht2m : MeasurableSet t2
⊢ (fun t => ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t) ∅

Next tactic:
simp only [Set.inter_empty, measure_empty, mul_zero, eq_self_iff_true,
      Filter.eventually_true]
theorem IndepSets.indep_aux {m₂ m : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] {p1 p2 : Set (Set Ω)} (h2 : m₂ ≤ m)
    (hp2 : IsPiSystem p2) (hpm2 : m₂ = generateFrom p2) (hyp : IndepSets p1 p2 κ μ) {t1 t2 : Set Ω}
    (ht1 : t1 ∈ p1) (ht1m : MeasurableSet[m] t1) (ht2m : MeasurableSet[m₂] t2) :
    ∀ᵐ a ∂μ, κ a (t1 ∩ t2) = κ a t1 * κ a t2 := by
  refine @induction_on_inter _ (fun t ↦ ∀ᵐ a ∂μ, κ a (t1 ∩ t) = κ a t1 * κ a t) _
    m₂ hpm2 hp2 ?_ ?_ ?_ ?_ t2 ht2m
  · simp only [Set.inter_empty, measure_empty, mul_zero, eq_self_iff_true,
      Filter.eventually_true]
  · 

Proof state:
case refine_2
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m₂ m : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
inst✝ : IsMarkovKernel κ
p1 p2 : Set (Set Ω)
h2 : m₂ ≤ m
hp2 : IsPiSystem p2
hpm2 : m₂ = generateFrom p2
hyp : IndepSets p1 p2 κ
t1 t2 : Set Ω
ht1 : t1 ∈ p1
ht1m : MeasurableSet t1
ht2m : MeasurableSet t2
⊢ ∀ t ∈ p2, (fun t => ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t) t

Next tactic:
exact fun t ht_mem_p2 ↦ hyp t1 t ht1 ht_mem_p2
theorem IndepSets.indep_aux {m₂ m : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] {p1 p2 : Set (Set Ω)} (h2 : m₂ ≤ m)
    (hp2 : IsPiSystem p2) (hpm2 : m₂ = generateFrom p2) (hyp : IndepSets p1 p2 κ μ) {t1 t2 : Set Ω}
    (ht1 : t1 ∈ p1) (ht1m : MeasurableSet[m] t1) (ht2m : MeasurableSet[m₂] t2) :
    ∀ᵐ a ∂μ, κ a (t1 ∩ t2) = κ a t1 * κ a t2 := by
  refine @induction_on_inter _ (fun t ↦ ∀ᵐ a ∂μ, κ a (t1 ∩ t) = κ a t1 * κ a t) _
    m₂ hpm2 hp2 ?_ ?_ ?_ ?_ t2 ht2m
  · simp only [Set.inter_empty, measure_empty, mul_zero, eq_self_iff_true,
      Filter.eventually_true]
  · exact fun t ht_mem_p2 ↦ hyp t1 t ht1 ht_mem_p2
  · 

Proof state:
case refine_3
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m₂ m : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
inst✝ : IsMarkovKernel κ
p1 p2 : Set (Set Ω)
h2 : m₂ ≤ m
hp2 : IsPiSystem p2
hpm2 : m₂ = generateFrom p2
hyp : IndepSets p1 p2 κ
t1 t2 : Set Ω
ht1 : t1 ∈ p1
ht1m : MeasurableSet t1
ht2m : MeasurableSet t2
⊢ ∀ (t : Set Ω),
    MeasurableSet t →
      (fun t => ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t) t →
        (fun t => ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t) tᶜ

Next tactic:
intros t ht h
theorem IndepSets.indep_aux {m₂ m : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] {p1 p2 : Set (Set Ω)} (h2 : m₂ ≤ m)
    (hp2 : IsPiSystem p2) (hpm2 : m₂ = generateFrom p2) (hyp : IndepSets p1 p2 κ μ) {t1 t2 : Set Ω}
    (ht1 : t1 ∈ p1) (ht1m : MeasurableSet[m] t1) (ht2m : MeasurableSet[m₂] t2) :
    ∀ᵐ a ∂μ, κ a (t1 ∩ t2) = κ a t1 * κ a t2 := by
  refine @induction_on_inter _ (fun t ↦ ∀ᵐ a ∂μ, κ a (t1 ∩ t) = κ a t1 * κ a t) _
    m₂ hpm2 hp2 ?_ ?_ ?_ ?_ t2 ht2m
  · simp only [Set.inter_empty, measure_empty, mul_zero, eq_self_iff_true,
      Filter.eventually_true]
  · exact fun t ht_mem_p2 ↦ hyp t1 t ht1 ht_mem_p2
  · intros t ht h
    

Proof state:
case refine_3
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m₂ m : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
inst✝ : IsMarkovKernel κ
p1 p2 : Set (Set Ω)
h2 : m₂ ≤ m
hp2 : IsPiSystem p2
hpm2 : m₂ = generateFrom p2
hyp : IndepSets p1 p2 κ
t1 t2 : Set Ω
ht1 : t1 ∈ p1
ht1m : MeasurableSet t1
ht2m : MeasurableSet t2
t : Set Ω
ht : MeasurableSet t
h : ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t
⊢ ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ tᶜ) = ↑↑(κ a) t1 * ↑↑(κ a) tᶜ

Next tactic:
filter_upwards [h] with a ha
theorem IndepSets.indep_aux {m₂ m : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] {p1 p2 : Set (Set Ω)} (h2 : m₂ ≤ m)
    (hp2 : IsPiSystem p2) (hpm2 : m₂ = generateFrom p2) (hyp : IndepSets p1 p2 κ μ) {t1 t2 : Set Ω}
    (ht1 : t1 ∈ p1) (ht1m : MeasurableSet[m] t1) (ht2m : MeasurableSet[m₂] t2) :
    ∀ᵐ a ∂μ, κ a (t1 ∩ t2) = κ a t1 * κ a t2 := by
  refine @induction_on_inter _ (fun t ↦ ∀ᵐ a ∂μ, κ a (t1 ∩ t) = κ a t1 * κ a t) _
    m₂ hpm2 hp2 ?_ ?_ ?_ ?_ t2 ht2m
  · simp only [Set.inter_empty, measure_empty, mul_zero, eq_self_iff_true,
      Filter.eventually_true]
  · exact fun t ht_mem_p2 ↦ hyp t1 t ht1 ht_mem_p2
  · intros t ht h
    filter_upwards [h] with a ha
    

Proof state:
case h
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m₂ m : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
inst✝ : IsMarkovKernel κ
p1 p2 : Set (Set Ω)
h2 : m₂ ≤ m
hp2 : IsPiSystem p2
hpm2 : m₂ = generateFrom p2
hyp : IndepSets p1 p2 κ
t1 t2 : Set Ω
ht1 : t1 ∈ p1
ht1m : MeasurableSet t1
ht2m : MeasurableSet t2
t : Set Ω
ht : MeasurableSet t
h : ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t
a : α
ha : ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t
⊢ ↑↑(κ a) (t1 ∩ tᶜ) = ↑↑(κ a) t1 * ↑↑(κ a) tᶜ

Next tactic:
have : t1 ∩ tᶜ = t1 \ (t1 ∩ t) := by
      rw [Set.diff_self_inter, Set.diff_eq_compl_inter, Set.inter_comm]
theorem IndepSets.indep_aux {m₂ m : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] {p1 p2 : Set (Set Ω)} (h2 : m₂ ≤ m)
    (hp2 : IsPiSystem p2) (hpm2 : m₂ = generateFrom p2) (hyp : IndepSets p1 p2 κ μ) {t1 t2 : Set Ω}
    (ht1 : t1 ∈ p1) (ht1m : MeasurableSet[m] t1) (ht2m : MeasurableSet[m₂] t2) :
    ∀ᵐ a ∂μ, κ a (t1 ∩ t2) = κ a t1 * κ a t2 := by
  refine @induction_on_inter _ (fun t ↦ ∀ᵐ a ∂μ, κ a (t1 ∩ t) = κ a t1 * κ a t) _
    m₂ hpm2 hp2 ?_ ?_ ?_ ?_ t2 ht2m
  · simp only [Set.inter_empty, measure_empty, mul_zero, eq_self_iff_true,
      Filter.eventually_true]
  · exact fun t ht_mem_p2 ↦ hyp t1 t ht1 ht_mem_p2
  · intros t ht h
    filter_upwards [h] with a ha
    have : t1 ∩ tᶜ = t1 \ (t1 ∩ t) := by
      

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m₂ m : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
inst✝ : IsMarkovKernel κ
p1 p2 : Set (Set Ω)
h2 : m₂ ≤ m
hp2 : IsPiSystem p2
hpm2 : m₂ = generateFrom p2
hyp : IndepSets p1 p2 κ
t1 t2 : Set Ω
ht1 : t1 ∈ p1
ht1m : MeasurableSet t1
ht2m : MeasurableSet t2
t : Set Ω
ht : MeasurableSet t
h : ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t
a : α
ha : ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t
⊢ t1 ∩ tᶜ = t1 \ (t1 ∩ t)

Next tactic:
rw [Set.diff_self_inter, Set.diff_eq_compl_inter, Set.inter_comm]
theorem IndepSets.indep_aux {m₂ m : MeasurableSpace Ω}
    {κ : kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] {p1 p2 : Set (Set Ω)} (h2 : m₂ ≤ m)
    (hp2 : IsPiSystem p2) (hpm2 : m₂ = generateFrom p2) (hyp : IndepSets p1 p2 κ μ) {t1 t2 : Set Ω}
    (ht1 : t1 ∈ p1) (ht1m : MeasurableSet[m] t1) (ht2m : MeasurableSet[m₂] t2) :
    ∀ᵐ a ∂μ, κ a (t1 ∩ t2) = κ a t1 * κ a t2 := by
  refine @induction_on_inter _ (fun t ↦ ∀ᵐ a ∂μ, κ a (t1 ∩ t) = κ a t1 * κ a t) _
    m₂ hpm2 hp2 ?_ ?_ ?_ ?_ t2 ht2m
  · simp only [Set.inter_empty, measure_empty, mul_zero, eq_self_iff_true,
      Filter.eventually_true]
  · exact fun t ht_mem_p2 ↦ hyp t1 t ht1 ht_mem_p2
  · intros t ht h
    filter_upwards [h] with a ha
    have : t1 ∩ tᶜ = t1 \ (t1 ∩ t) := by
      rw [Set.diff_self_inter, Set.diff_eq_compl_inter, Set.inter_comm]
    

Proof state:
case h
α : Type u_1
Ω : Type u_2
ι : Type u_3
_mα : MeasurableSpace α
m₂ m : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
inst✝ : IsMarkovKernel κ
p1 p2 : Set (Set Ω)
h2 : m₂ ≤ m
hp2 : IsPiSystem p2
hpm2 : m₂ = generateFrom p2
hyp : IndepSets p1 p2 κ
t1 t2 : Set Ω
ht1 : t1 ∈ p1
ht1m : MeasurableSet t1
ht2m : MeasurableSet t2
t : Set Ω
ht : MeasurableSet t
h : ∀ᵐ (a : α) ∂μ, ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t
a : α
ha : ↑↑(κ a) (t1 ∩ t) = ↑↑(κ a) t1 * ↑↑(κ a) t
this : t1 ∩ tᶜ = t1 \ (t1 ∩ t)
⊢ ↑↑(κ a) (t1 ∩ tᶜ) = ↑↑(κ a) t1 * ↑↑(κ a) tᶜ

Next tactic:
rw [this,
      measure_diff (Set.inter_subset_left _ _) (ht1m.inter (h2 _ ht)) (measure_ne_top (κ a) _),
      measure_compl (h2 _ ht) (measure_ne_top (κ a) t), measure_univ,
      ENNReal.mul_sub (fun _ _ ↦ measure_ne_top (κ a) _), mul_one, ha]