l3lab/ntp-mathlib huggingface dataset:
lemma condIndepSets_iff (s1 s2 : Set (Set Ω)) (hs1 : ∀ s ∈ s1, MeasurableSet s)
    (hs2 : ∀ s ∈ s2, MeasurableSet s) (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepSets m' hm' s1 s2 μ ↔ ∀ (t1 t2 : Set Ω) (_ : t1 ∈ s1) (_ : t2 ∈ s2),
      (μ⟦t1 ∩ t2 | m'⟧) =ᵐ[μ] (μ⟦t1 | m'⟧) * (μ⟦t2 | m'⟧) := by
  simp only [CondIndepSets, kernel.IndepSets]
  have hs1_eq : ∀ s ∈ s1, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs1 s hs)
  have hs2_eq : ∀ s ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs2 s hs)
  have hs12_eq : ∀ s ∈ s1, ∀ t ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω (s ∩ t)))
      =ᵐ[μ] μ⟦s ∩ t | m'⟧ :=
    fun s hs t ht ↦ condexpKernel_ae_eq_condexp hm' ((hs1 s hs).inter ((hs2 t ht)))
  refine ⟨fun h s t hs ht ↦ ?_, fun h s t hs ht ↦ ?_⟩ <;> specialize h s t hs ht
  · have h' := ae_eq_of_ae_eq_trim h
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h'] with ω hs_eq ht_eq hst_eq h'
    rw [← hst_eq, Pi.mul_apply, ← hs_eq, ← ht_eq, h', ENNReal.toReal_mul]
  · refine (ae_eq_trim_iff hm' ?_ ?_).mpr ?_
    · 

Proof state:
case refine_2.refine_1
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s1 s2 : Set (Set Ω)
hs1 : ∀ s ∈ s1, MeasurableSet s
hs2 : ∀ s ∈ s2, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hs1_eq : ∀ s ∈ s1, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs2_eq : ∀ s ∈ s2, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs12_eq :
  ∀ s ∈ s1,
    ∀ t ∈ s2,
      (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t))) =ᵐ[μ] μ[Set.indicator (s ∩ t) fun ω => 1|m']
s t : Set Ω
hs : s ∈ s1
ht : t ∈ s2
h : μ[Set.indicator (s ∩ t) fun ω => 1|m'] =ᵐ[μ] μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']
⊢ StronglyMeasurable fun a => ↑↑((condexpKernel μ m') a) (s ∩ t)

Next tactic:
exact stronglyMeasurable_condexpKernel ((hs1 s hs).inter ((hs2 t ht)))
lemma condIndepSets_iff (s1 s2 : Set (Set Ω)) (hs1 : ∀ s ∈ s1, MeasurableSet s)
    (hs2 : ∀ s ∈ s2, MeasurableSet s) (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepSets m' hm' s1 s2 μ ↔ ∀ (t1 t2 : Set Ω) (_ : t1 ∈ s1) (_ : t2 ∈ s2),
      (μ⟦t1 ∩ t2 | m'⟧) =ᵐ[μ] (μ⟦t1 | m'⟧) * (μ⟦t2 | m'⟧) := by
  simp only [CondIndepSets, kernel.IndepSets]
  have hs1_eq : ∀ s ∈ s1, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs1 s hs)
  have hs2_eq : ∀ s ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs2 s hs)
  have hs12_eq : ∀ s ∈ s1, ∀ t ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω (s ∩ t)))
      =ᵐ[μ] μ⟦s ∩ t | m'⟧ :=
    fun s hs t ht ↦ condexpKernel_ae_eq_condexp hm' ((hs1 s hs).inter ((hs2 t ht)))
  refine ⟨fun h s t hs ht ↦ ?_, fun h s t hs ht ↦ ?_⟩ <;> specialize h s t hs ht
  · have h' := ae_eq_of_ae_eq_trim h
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h'] with ω hs_eq ht_eq hst_eq h'
    rw [← hst_eq, Pi.mul_apply, ← hs_eq, ← ht_eq, h', ENNReal.toReal_mul]
  · refine (ae_eq_trim_iff hm' ?_ ?_).mpr ?_
    · exact stronglyMeasurable_condexpKernel ((hs1 s hs).inter ((hs2 t ht)))
    · 

Proof state:
case refine_2.refine_2
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s1 s2 : Set (Set Ω)
hs1 : ∀ s ∈ s1, MeasurableSet s
hs2 : ∀ s ∈ s2, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hs1_eq : ∀ s ∈ s1, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs2_eq : ∀ s ∈ s2, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs12_eq :
  ∀ s ∈ s1,
    ∀ t ∈ s2,
      (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t))) =ᵐ[μ] μ[Set.indicator (s ∩ t) fun ω => 1|m']
s t : Set Ω
hs : s ∈ s1
ht : t ∈ s2
h : μ[Set.indicator (s ∩ t) fun ω => 1|m'] =ᵐ[μ] μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']
⊢ StronglyMeasurable fun a => ↑↑((condexpKernel μ m') a) s * ↑↑((condexpKernel μ m') a) t

Next tactic:
refine Measurable.stronglyMeasurable (Measurable.mul ?_ ?_)
lemma condIndepSets_iff (s1 s2 : Set (Set Ω)) (hs1 : ∀ s ∈ s1, MeasurableSet s)
    (hs2 : ∀ s ∈ s2, MeasurableSet s) (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepSets m' hm' s1 s2 μ ↔ ∀ (t1 t2 : Set Ω) (_ : t1 ∈ s1) (_ : t2 ∈ s2),
      (μ⟦t1 ∩ t2 | m'⟧) =ᵐ[μ] (μ⟦t1 | m'⟧) * (μ⟦t2 | m'⟧) := by
  simp only [CondIndepSets, kernel.IndepSets]
  have hs1_eq : ∀ s ∈ s1, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs1 s hs)
  have hs2_eq : ∀ s ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs2 s hs)
  have hs12_eq : ∀ s ∈ s1, ∀ t ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω (s ∩ t)))
      =ᵐ[μ] μ⟦s ∩ t | m'⟧ :=
    fun s hs t ht ↦ condexpKernel_ae_eq_condexp hm' ((hs1 s hs).inter ((hs2 t ht)))
  refine ⟨fun h s t hs ht ↦ ?_, fun h s t hs ht ↦ ?_⟩ <;> specialize h s t hs ht
  · have h' := ae_eq_of_ae_eq_trim h
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h'] with ω hs_eq ht_eq hst_eq h'
    rw [← hst_eq, Pi.mul_apply, ← hs_eq, ← ht_eq, h', ENNReal.toReal_mul]
  · refine (ae_eq_trim_iff hm' ?_ ?_).mpr ?_
    · exact stronglyMeasurable_condexpKernel ((hs1 s hs).inter ((hs2 t ht)))
    · refine Measurable.stronglyMeasurable (Measurable.mul ?_ ?_)
      · 

Proof state:
case refine_2.refine_2.refine_1
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s1 s2 : Set (Set Ω)
hs1 : ∀ s ∈ s1, MeasurableSet s
hs2 : ∀ s ∈ s2, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hs1_eq : ∀ s ∈ s1, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs2_eq : ∀ s ∈ s2, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs12_eq :
  ∀ s ∈ s1,
    ∀ t ∈ s2,
      (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t))) =ᵐ[μ] μ[Set.indicator (s ∩ t) fun ω => 1|m']
s t : Set Ω
hs : s ∈ s1
ht : t ∈ s2
h : μ[Set.indicator (s ∩ t) fun ω => 1|m'] =ᵐ[μ] μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']
⊢ Measurable fun a => ↑↑((condexpKernel μ m') a) s

Next tactic:
exact measurable_condexpKernel (hs1 s hs)
lemma condIndepSets_iff (s1 s2 : Set (Set Ω)) (hs1 : ∀ s ∈ s1, MeasurableSet s)
    (hs2 : ∀ s ∈ s2, MeasurableSet s) (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepSets m' hm' s1 s2 μ ↔ ∀ (t1 t2 : Set Ω) (_ : t1 ∈ s1) (_ : t2 ∈ s2),
      (μ⟦t1 ∩ t2 | m'⟧) =ᵐ[μ] (μ⟦t1 | m'⟧) * (μ⟦t2 | m'⟧) := by
  simp only [CondIndepSets, kernel.IndepSets]
  have hs1_eq : ∀ s ∈ s1, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs1 s hs)
  have hs2_eq : ∀ s ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs2 s hs)
  have hs12_eq : ∀ s ∈ s1, ∀ t ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω (s ∩ t)))
      =ᵐ[μ] μ⟦s ∩ t | m'⟧ :=
    fun s hs t ht ↦ condexpKernel_ae_eq_condexp hm' ((hs1 s hs).inter ((hs2 t ht)))
  refine ⟨fun h s t hs ht ↦ ?_, fun h s t hs ht ↦ ?_⟩ <;> specialize h s t hs ht
  · have h' := ae_eq_of_ae_eq_trim h
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h'] with ω hs_eq ht_eq hst_eq h'
    rw [← hst_eq, Pi.mul_apply, ← hs_eq, ← ht_eq, h', ENNReal.toReal_mul]
  · refine (ae_eq_trim_iff hm' ?_ ?_).mpr ?_
    · exact stronglyMeasurable_condexpKernel ((hs1 s hs).inter ((hs2 t ht)))
    · refine Measurable.stronglyMeasurable (Measurable.mul ?_ ?_)
      · exact measurable_condexpKernel (hs1 s hs)
      · 

Proof state:
case refine_2.refine_2.refine_2
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s1 s2 : Set (Set Ω)
hs1 : ∀ s ∈ s1, MeasurableSet s
hs2 : ∀ s ∈ s2, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hs1_eq : ∀ s ∈ s1, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs2_eq : ∀ s ∈ s2, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs12_eq :
  ∀ s ∈ s1,
    ∀ t ∈ s2,
      (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t))) =ᵐ[μ] μ[Set.indicator (s ∩ t) fun ω => 1|m']
s t : Set Ω
hs : s ∈ s1
ht : t ∈ s2
h : μ[Set.indicator (s ∩ t) fun ω => 1|m'] =ᵐ[μ] μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']
⊢ Measurable fun a => ↑↑((condexpKernel μ m') a) t

Next tactic:
exact measurable_condexpKernel (hs2 t ht)
lemma condIndepSets_iff (s1 s2 : Set (Set Ω)) (hs1 : ∀ s ∈ s1, MeasurableSet s)
    (hs2 : ∀ s ∈ s2, MeasurableSet s) (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepSets m' hm' s1 s2 μ ↔ ∀ (t1 t2 : Set Ω) (_ : t1 ∈ s1) (_ : t2 ∈ s2),
      (μ⟦t1 ∩ t2 | m'⟧) =ᵐ[μ] (μ⟦t1 | m'⟧) * (μ⟦t2 | m'⟧) := by
  simp only [CondIndepSets, kernel.IndepSets]
  have hs1_eq : ∀ s ∈ s1, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs1 s hs)
  have hs2_eq : ∀ s ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs2 s hs)
  have hs12_eq : ∀ s ∈ s1, ∀ t ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω (s ∩ t)))
      =ᵐ[μ] μ⟦s ∩ t | m'⟧ :=
    fun s hs t ht ↦ condexpKernel_ae_eq_condexp hm' ((hs1 s hs).inter ((hs2 t ht)))
  refine ⟨fun h s t hs ht ↦ ?_, fun h s t hs ht ↦ ?_⟩ <;> specialize h s t hs ht
  · have h' := ae_eq_of_ae_eq_trim h
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h'] with ω hs_eq ht_eq hst_eq h'
    rw [← hst_eq, Pi.mul_apply, ← hs_eq, ← ht_eq, h', ENNReal.toReal_mul]
  · refine (ae_eq_trim_iff hm' ?_ ?_).mpr ?_
    · exact stronglyMeasurable_condexpKernel ((hs1 s hs).inter ((hs2 t ht)))
    · refine Measurable.stronglyMeasurable (Measurable.mul ?_ ?_)
      · exact measurable_condexpKernel (hs1 s hs)
      · exact measurable_condexpKernel (hs2 t ht)
    

Proof state:
case refine_2.refine_3
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s1 s2 : Set (Set Ω)
hs1 : ∀ s ∈ s1, MeasurableSet s
hs2 : ∀ s ∈ s2, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hs1_eq : ∀ s ∈ s1, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs2_eq : ∀ s ∈ s2, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs12_eq :
  ∀ s ∈ s1,
    ∀ t ∈ s2,
      (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t))) =ᵐ[μ] μ[Set.indicator (s ∩ t) fun ω => 1|m']
s t : Set Ω
hs : s ∈ s1
ht : t ∈ s2
h : μ[Set.indicator (s ∩ t) fun ω => 1|m'] =ᵐ[μ] μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']
⊢ (fun a => ↑↑((condexpKernel μ m') a) (s ∩ t)) =ᵐ[μ] fun a =>
    ↑↑((condexpKernel μ m') a) s * ↑↑((condexpKernel μ m') a) t

Next tactic:
filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h] with ω hs_eq ht_eq hst_eq h
lemma condIndepSets_iff (s1 s2 : Set (Set Ω)) (hs1 : ∀ s ∈ s1, MeasurableSet s)
    (hs2 : ∀ s ∈ s2, MeasurableSet s) (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepSets m' hm' s1 s2 μ ↔ ∀ (t1 t2 : Set Ω) (_ : t1 ∈ s1) (_ : t2 ∈ s2),
      (μ⟦t1 ∩ t2 | m'⟧) =ᵐ[μ] (μ⟦t1 | m'⟧) * (μ⟦t2 | m'⟧) := by
  simp only [CondIndepSets, kernel.IndepSets]
  have hs1_eq : ∀ s ∈ s1, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs1 s hs)
  have hs2_eq : ∀ s ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs2 s hs)
  have hs12_eq : ∀ s ∈ s1, ∀ t ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω (s ∩ t)))
      =ᵐ[μ] μ⟦s ∩ t | m'⟧ :=
    fun s hs t ht ↦ condexpKernel_ae_eq_condexp hm' ((hs1 s hs).inter ((hs2 t ht)))
  refine ⟨fun h s t hs ht ↦ ?_, fun h s t hs ht ↦ ?_⟩ <;> specialize h s t hs ht
  · have h' := ae_eq_of_ae_eq_trim h
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h'] with ω hs_eq ht_eq hst_eq h'
    rw [← hst_eq, Pi.mul_apply, ← hs_eq, ← ht_eq, h', ENNReal.toReal_mul]
  · refine (ae_eq_trim_iff hm' ?_ ?_).mpr ?_
    · exact stronglyMeasurable_condexpKernel ((hs1 s hs).inter ((hs2 t ht)))
    · refine Measurable.stronglyMeasurable (Measurable.mul ?_ ?_)
      · exact measurable_condexpKernel (hs1 s hs)
      · exact measurable_condexpKernel (hs2 t ht)
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h] with ω hs_eq ht_eq hst_eq h
    

Proof state:
case h
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s1 s2 : Set (Set Ω)
hs1 : ∀ s ∈ s1, MeasurableSet s
hs2 : ∀ s ∈ s2, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hs1_eq : ∀ s ∈ s1, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs2_eq : ∀ s ∈ s2, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs12_eq :
  ∀ s ∈ s1,
    ∀ t ∈ s2,
      (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t))) =ᵐ[μ] μ[Set.indicator (s ∩ t) fun ω => 1|m']
s t : Set Ω
hs : s ∈ s1
ht : t ∈ s2
h✝ : μ[Set.indicator (s ∩ t) fun ω => 1|m'] =ᵐ[μ] μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']
ω : Ω
hs_eq : ENNReal.toReal (↑↑((condexpKernel μ m') ω) s) = (μ[Set.indicator s fun ω => 1|m']) ω
ht_eq : ENNReal.toReal (↑↑((condexpKernel μ m') ω) t) = (μ[Set.indicator t fun ω => 1|m']) ω
hst_eq : ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t)) = (μ[Set.indicator (s ∩ t) fun ω => 1|m']) ω
h : (μ[Set.indicator (s ∩ t) fun ω => 1|m']) ω = (μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']) ω
⊢ ↑↑((condexpKernel μ m') ω) (s ∩ t) = ↑↑((condexpKernel μ m') ω) s * ↑↑((condexpKernel μ m') ω) t

Next tactic:
have h_ne_top : condexpKernel μ m' ω (s ∩ t) ≠ ∞ := (measure_ne_top (condexpKernel μ m' ω) _)
lemma condIndepSets_iff (s1 s2 : Set (Set Ω)) (hs1 : ∀ s ∈ s1, MeasurableSet s)
    (hs2 : ∀ s ∈ s2, MeasurableSet s) (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepSets m' hm' s1 s2 μ ↔ ∀ (t1 t2 : Set Ω) (_ : t1 ∈ s1) (_ : t2 ∈ s2),
      (μ⟦t1 ∩ t2 | m'⟧) =ᵐ[μ] (μ⟦t1 | m'⟧) * (μ⟦t2 | m'⟧) := by
  simp only [CondIndepSets, kernel.IndepSets]
  have hs1_eq : ∀ s ∈ s1, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs1 s hs)
  have hs2_eq : ∀ s ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω s)) =ᵐ[μ] μ⟦s | m'⟧ :=
    fun s hs ↦ condexpKernel_ae_eq_condexp hm' (hs2 s hs)
  have hs12_eq : ∀ s ∈ s1, ∀ t ∈ s2, (fun ω ↦ ENNReal.toReal (condexpKernel μ m' ω (s ∩ t)))
      =ᵐ[μ] μ⟦s ∩ t | m'⟧ :=
    fun s hs t ht ↦ condexpKernel_ae_eq_condexp hm' ((hs1 s hs).inter ((hs2 t ht)))
  refine ⟨fun h s t hs ht ↦ ?_, fun h s t hs ht ↦ ?_⟩ <;> specialize h s t hs ht
  · have h' := ae_eq_of_ae_eq_trim h
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h'] with ω hs_eq ht_eq hst_eq h'
    rw [← hst_eq, Pi.mul_apply, ← hs_eq, ← ht_eq, h', ENNReal.toReal_mul]
  · refine (ae_eq_trim_iff hm' ?_ ?_).mpr ?_
    · exact stronglyMeasurable_condexpKernel ((hs1 s hs).inter ((hs2 t ht)))
    · refine Measurable.stronglyMeasurable (Measurable.mul ?_ ?_)
      · exact measurable_condexpKernel (hs1 s hs)
      · exact measurable_condexpKernel (hs2 t ht)
    filter_upwards [hs1_eq s hs, hs2_eq t ht, hs12_eq s hs t ht, h] with ω hs_eq ht_eq hst_eq h
    have h_ne_top : condexpKernel μ m' ω (s ∩ t) ≠ ∞ := (measure_ne_top (condexpKernel μ m' ω) _)
    

Proof state:
case h
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s1 s2 : Set (Set Ω)
hs1 : ∀ s ∈ s1, MeasurableSet s
hs2 : ∀ s ∈ s2, MeasurableSet s
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
hs1_eq : ∀ s ∈ s1, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs2_eq : ∀ s ∈ s2, (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) s)) =ᵐ[μ] μ[Set.indicator s fun ω => 1|m']
hs12_eq :
  ∀ s ∈ s1,
    ∀ t ∈ s2,
      (fun ω => ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t))) =ᵐ[μ] μ[Set.indicator (s ∩ t) fun ω => 1|m']
s t : Set Ω
hs : s ∈ s1
ht : t ∈ s2
h✝ : μ[Set.indicator (s ∩ t) fun ω => 1|m'] =ᵐ[μ] μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']
ω : Ω
hs_eq : ENNReal.toReal (↑↑((condexpKernel μ m') ω) s) = (μ[Set.indicator s fun ω => 1|m']) ω
ht_eq : ENNReal.toReal (↑↑((condexpKernel μ m') ω) t) = (μ[Set.indicator t fun ω => 1|m']) ω
hst_eq : ENNReal.toReal (↑↑((condexpKernel μ m') ω) (s ∩ t)) = (μ[Set.indicator (s ∩ t) fun ω => 1|m']) ω
h : (μ[Set.indicator (s ∩ t) fun ω => 1|m']) ω = (μ[Set.indicator s fun ω => 1|m'] * μ[Set.indicator t fun ω => 1|m']) ω
h_ne_top : ↑↑((condexpKernel μ m') ω) (s ∩ t) ≠ ⊤
⊢ ↑↑((condexpKernel μ m') ω) (s ∩ t) = ↑↑((condexpKernel μ m') ω) s * ↑↑((condexpKernel μ m') ω) t

Next tactic:
rw [← ENNReal.ofReal_toReal h_ne_top, hst_eq, h, Pi.mul_apply, ← hs_eq, ← ht_eq,
      ← ENNReal.toReal_mul, ENNReal.ofReal_toReal]
lemma iCondIndepSets_singleton_iff (s : ι → Set Ω) (hπ : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' (fun i ↦ {s i}) μ ↔ ∀ S : Finset ι,
      μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i in S, (μ⟦s i | m'⟧) := by
  

Proof state:
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s : ι → Set Ω
hπ : ∀ (i : ι), MeasurableSet (s i)
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
⊢ (iCondIndepSets m' hm' fun i => {s i}) ↔
    ∀ (S : Finset ι), μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m'] =ᵐ[μ] ∏ i in S, μ[Set.indicator (s i) fun ω => 1|m']

Next tactic:
rw [iCondIndepSets_iff]
lemma iCondIndepSets_singleton_iff (s : ι → Set Ω) (hπ : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' (fun i ↦ {s i}) μ ↔ ∀ S : Finset ι,
      μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i in S, (μ⟦s i | m'⟧) := by
  rw [iCondIndepSets_iff]
  · 

Proof state:
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s : ι → Set Ω
hπ : ∀ (i : ι), MeasurableSet (s i)
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
⊢ (∀ (s_1 : Finset ι) {f : ι → Set Ω},
      (∀ i ∈ s_1, f i ∈ {s i}) →
        μ[Set.indicator (⋂ i ∈ s_1, f i) fun ω => 1|m'] =ᵐ[μ] ∏ i in s_1, μ[Set.indicator (f i) fun ω => 1|m']) ↔
    ∀ (S : Finset ι), μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m'] =ᵐ[μ] ∏ i in S, μ[Set.indicator (s i) fun ω => 1|m']

Next tactic:
simp only [Set.mem_singleton_iff]
lemma iCondIndepSets_singleton_iff (s : ι → Set Ω) (hπ : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' (fun i ↦ {s i}) μ ↔ ∀ S : Finset ι,
      μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i in S, (μ⟦s i | m'⟧) := by
  rw [iCondIndepSets_iff]
  · simp only [Set.mem_singleton_iff]
    

Proof state:
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s : ι → Set Ω
hπ : ∀ (i : ι), MeasurableSet (s i)
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
⊢ (∀ (s_1 : Finset ι) {f : ι → Set Ω},
      (∀ i ∈ s_1, f i = s i) →
        μ[Set.indicator (⋂ i ∈ s_1, f i) fun ω => 1|m'] =ᵐ[μ] ∏ i in s_1, μ[Set.indicator (f i) fun ω => 1|m']) ↔
    ∀ (S : Finset ι), μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m'] =ᵐ[μ] ∏ i in S, μ[Set.indicator (s i) fun ω => 1|m']

Next tactic:
refine ⟨fun h S ↦ h S (fun i _ ↦ rfl), fun h S f hf ↦ ?_⟩
lemma iCondIndepSets_singleton_iff (s : ι → Set Ω) (hπ : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' (fun i ↦ {s i}) μ ↔ ∀ S : Finset ι,
      μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i in S, (μ⟦s i | m'⟧) := by
  rw [iCondIndepSets_iff]
  · simp only [Set.mem_singleton_iff]
    refine ⟨fun h S ↦ h S (fun i _ ↦ rfl), fun h S f hf ↦ ?_⟩
    

Proof state:
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s : ι → Set Ω
hπ : ∀ (i : ι), MeasurableSet (s i)
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
h : ∀ (S : Finset ι), μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m'] =ᵐ[μ] ∏ i in S, μ[Set.indicator (s i) fun ω => 1|m']
S : Finset ι
f : ι → Set Ω
hf : ∀ i ∈ S, f i = s i
⊢ μ[Set.indicator (⋂ i ∈ S, f i) fun ω => 1|m'] =ᵐ[μ] ∏ i in S, μ[Set.indicator (f i) fun ω => 1|m']

Next tactic:
filter_upwards [h S] with a ha
lemma iCondIndepSets_singleton_iff (s : ι → Set Ω) (hπ : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' (fun i ↦ {s i}) μ ↔ ∀ S : Finset ι,
      μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i in S, (μ⟦s i | m'⟧) := by
  rw [iCondIndepSets_iff]
  · simp only [Set.mem_singleton_iff]
    refine ⟨fun h S ↦ h S (fun i _ ↦ rfl), fun h S f hf ↦ ?_⟩
    filter_upwards [h S] with a ha
    

Proof state:
case h
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s : ι → Set Ω
hπ : ∀ (i : ι), MeasurableSet (s i)
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
h : ∀ (S : Finset ι), μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m'] =ᵐ[μ] ∏ i in S, μ[Set.indicator (s i) fun ω => 1|m']
S : Finset ι
f : ι → Set Ω
hf : ∀ i ∈ S, f i = s i
a : Ω
ha : (μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m']) a = Finset.prod S (fun i => μ[Set.indicator (s i) fun ω => 1|m']) a
⊢ (μ[Set.indicator (⋂ i ∈ S, f i) fun ω => 1|m']) a = Finset.prod S (fun i => μ[Set.indicator (f i) fun ω => 1|m']) a

Next tactic:
refine Eq.trans ?_ (ha.trans ?_)
lemma iCondIndepSets_singleton_iff (s : ι → Set Ω) (hπ : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' (fun i ↦ {s i}) μ ↔ ∀ S : Finset ι,
      μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i in S, (μ⟦s i | m'⟧) := by
  rw [iCondIndepSets_iff]
  · simp only [Set.mem_singleton_iff]
    refine ⟨fun h S ↦ h S (fun i _ ↦ rfl), fun h S f hf ↦ ?_⟩
    filter_upwards [h S] with a ha
    refine Eq.trans ?_ (ha.trans ?_)
    · 

Proof state:
case h.refine_1
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s : ι → Set Ω
hπ : ∀ (i : ι), MeasurableSet (s i)
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
h : ∀ (S : Finset ι), μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m'] =ᵐ[μ] ∏ i in S, μ[Set.indicator (s i) fun ω => 1|m']
S : Finset ι
f : ι → Set Ω
hf : ∀ i ∈ S, f i = s i
a : Ω
ha : (μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m']) a = Finset.prod S (fun i => μ[Set.indicator (s i) fun ω => 1|m']) a
⊢ (μ[Set.indicator (⋂ i ∈ S, f i) fun ω => 1|m']) a = (μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m']) a

Next tactic:
congr
lemma iCondIndepSets_singleton_iff (s : ι → Set Ω) (hπ : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSets m' hm' (fun i ↦ {s i}) μ ↔ ∀ S : Finset ι,
      μ⟦⋂ i ∈ S, s i | m'⟧ =ᵐ[μ] ∏ i in S, (μ⟦s i | m'⟧) := by
  rw [iCondIndepSets_iff]
  · simp only [Set.mem_singleton_iff]
    refine ⟨fun h S ↦ h S (fun i _ ↦ rfl), fun h S f hf ↦ ?_⟩
    filter_upwards [h S] with a ha
    refine Eq.trans ?_ (ha.trans ?_)
    · congr
      

Proof state:
case h.refine_1.e_f
Ω : Type u_1
ι : Type u_2
m' mΩ : MeasurableSpace Ω
inst✝² : StandardBorelSpace Ω
inst✝¹ : Nonempty Ω
hm' : m' ≤ mΩ
s : ι → Set Ω
hπ : ∀ (i : ι), MeasurableSet (s i)
μ : Measure Ω
inst✝ : IsFiniteMeasure μ
h : ∀ (S : Finset ι), μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m'] =ᵐ[μ] ∏ i in S, μ[Set.indicator (s i) fun ω => 1|m']
S : Finset ι
f : ι → Set Ω
hf : ∀ i ∈ S, f i = s i
a : Ω
ha : (μ[Set.indicator (⋂ i ∈ S, s i) fun ω => 1|m']) a = Finset.prod S (fun i => μ[Set.indicator (s i) fun ω => 1|m']) a
⊢ (Set.indicator (⋂ i ∈ S, f i) fun ω => 1) = Set.indicator (⋂ i ∈ S, s i) fun ω => 1

Next tactic:
apply congr_arg₂