l3lab/ntp-mathlib huggingface dataset:
theorem iIndepFun.indepFun_prod_mk [IsMarkovKernel κ] (hf_Indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (fun a => (f i a, f j a)) (f k) κ μ := by
  classical
  have h_right : f k =
    (fun p : ∀ j : ({k} : Finset ι), β j => p ⟨k, Finset.mem_singleton_self k⟩) ∘
    fun a (j : ({k} : Finset ι)) => f j a := rfl
  have h_meas_right :  Measurable fun p : ∀ j : ({k} : Finset ι),
    β j => p ⟨k, Finset.mem_singleton_self k⟩ := measurable_pi_apply _
  let s : Finset ι := {i, j}
  have h_left : (fun ω => (f i ω, f j ω)) = (fun p : ∀ l : s, β l =>
    (p ⟨i, Finset.mem_insert_self i _⟩,
    p ⟨j, Finset.mem_insert_of_mem (Finset.mem_singleton_self _)⟩)) ∘ fun a (j : s) => f j a := by
    ext1 a
    simp only [Prod.mk.inj_iff]
    constructor
  have h_meas_left : Measurable fun p : ∀ l : s, β l =>
    (p ⟨i, Finset.mem_insert_self i _⟩,
    p ⟨j, Finset.mem_insert_of_mem (Finset.mem_singleton_self _)⟩) :=
      Measurable.prod (measurable_pi_apply _) (measurable_pi_apply _)
  rw [h_left, h_right]
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_Indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
h_right : f k = (fun p => p { val := k, property := (_ : k ∈ {k}) }) ∘ fun a j => f (↑j) a
h_meas_right : Measurable fun p => p { val := k, property := (_ : k ∈ {k}) }
s : Finset ι := {i, j}
h_left :
  (fun ω => (f i ω, f j ω)) =
    (fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })) ∘ fun a j =>
      f (↑j) a
h_meas_left :
  Measurable fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })
⊢ IndepFun
    ((fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })) ∘
      fun a j => f (↑j) a)
    ((fun p => p { val := k, property := (_ : k ∈ {k}) }) ∘ fun a j => f (↑j) a) κ

Next tactic:
refine' (hf_Indep.indepFun_finset s {k} _ hf_meas).comp h_meas_left h_meas_right
theorem iIndepFun.indepFun_prod_mk [IsMarkovKernel κ] (hf_Indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (fun a => (f i a, f j a)) (f k) κ μ := by
  classical
  have h_right : f k =
    (fun p : ∀ j : ({k} : Finset ι), β j => p ⟨k, Finset.mem_singleton_self k⟩) ∘
    fun a (j : ({k} : Finset ι)) => f j a := rfl
  have h_meas_right :  Measurable fun p : ∀ j : ({k} : Finset ι),
    β j => p ⟨k, Finset.mem_singleton_self k⟩ := measurable_pi_apply _
  let s : Finset ι := {i, j}
  have h_left : (fun ω => (f i ω, f j ω)) = (fun p : ∀ l : s, β l =>
    (p ⟨i, Finset.mem_insert_self i _⟩,
    p ⟨j, Finset.mem_insert_of_mem (Finset.mem_singleton_self _)⟩)) ∘ fun a (j : s) => f j a := by
    ext1 a
    simp only [Prod.mk.inj_iff]
    constructor
  have h_meas_left : Measurable fun p : ∀ l : s, β l =>
    (p ⟨i, Finset.mem_insert_self i _⟩,
    p ⟨j, Finset.mem_insert_of_mem (Finset.mem_singleton_self _)⟩) :=
      Measurable.prod (measurable_pi_apply _) (measurable_pi_apply _)
  rw [h_left, h_right]
  refine' (hf_Indep.indepFun_finset s {k} _ hf_meas).comp h_meas_left h_meas_right
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_Indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
h_right : f k = (fun p => p { val := k, property := (_ : k ∈ {k}) }) ∘ fun a j => f (↑j) a
h_meas_right : Measurable fun p => p { val := k, property := (_ : k ∈ {k}) }
s : Finset ι := {i, j}
h_left :
  (fun ω => (f i ω, f j ω)) =
    (fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })) ∘ fun a j =>
      f (↑j) a
h_meas_left :
  Measurable fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })
⊢ Disjoint s {k}

Next tactic:
rw [Finset.disjoint_singleton_right]
theorem iIndepFun.indepFun_prod_mk [IsMarkovKernel κ] (hf_Indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (fun a => (f i a, f j a)) (f k) κ μ := by
  classical
  have h_right : f k =
    (fun p : ∀ j : ({k} : Finset ι), β j => p ⟨k, Finset.mem_singleton_self k⟩) ∘
    fun a (j : ({k} : Finset ι)) => f j a := rfl
  have h_meas_right :  Measurable fun p : ∀ j : ({k} : Finset ι),
    β j => p ⟨k, Finset.mem_singleton_self k⟩ := measurable_pi_apply _
  let s : Finset ι := {i, j}
  have h_left : (fun ω => (f i ω, f j ω)) = (fun p : ∀ l : s, β l =>
    (p ⟨i, Finset.mem_insert_self i _⟩,
    p ⟨j, Finset.mem_insert_of_mem (Finset.mem_singleton_self _)⟩)) ∘ fun a (j : s) => f j a := by
    ext1 a
    simp only [Prod.mk.inj_iff]
    constructor
  have h_meas_left : Measurable fun p : ∀ l : s, β l =>
    (p ⟨i, Finset.mem_insert_self i _⟩,
    p ⟨j, Finset.mem_insert_of_mem (Finset.mem_singleton_self _)⟩) :=
      Measurable.prod (measurable_pi_apply _) (measurable_pi_apply _)
  rw [h_left, h_right]
  refine' (hf_Indep.indepFun_finset s {k} _ hf_meas).comp h_meas_left h_meas_right
  rw [Finset.disjoint_singleton_right]
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_Indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
h_right : f k = (fun p => p { val := k, property := (_ : k ∈ {k}) }) ∘ fun a j => f (↑j) a
h_meas_right : Measurable fun p => p { val := k, property := (_ : k ∈ {k}) }
s : Finset ι := {i, j}
h_left :
  (fun ω => (f i ω, f j ω)) =
    (fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })) ∘ fun a j =>
      f (↑j) a
h_meas_left :
  Measurable fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })
⊢ k ∉ s

Next tactic:
simp only [Finset.mem_insert, Finset.mem_singleton, not_or]
theorem iIndepFun.indepFun_prod_mk [IsMarkovKernel κ] (hf_Indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (fun a => (f i a, f j a)) (f k) κ μ := by
  classical
  have h_right : f k =
    (fun p : ∀ j : ({k} : Finset ι), β j => p ⟨k, Finset.mem_singleton_self k⟩) ∘
    fun a (j : ({k} : Finset ι)) => f j a := rfl
  have h_meas_right :  Measurable fun p : ∀ j : ({k} : Finset ι),
    β j => p ⟨k, Finset.mem_singleton_self k⟩ := measurable_pi_apply _
  let s : Finset ι := {i, j}
  have h_left : (fun ω => (f i ω, f j ω)) = (fun p : ∀ l : s, β l =>
    (p ⟨i, Finset.mem_insert_self i _⟩,
    p ⟨j, Finset.mem_insert_of_mem (Finset.mem_singleton_self _)⟩)) ∘ fun a (j : s) => f j a := by
    ext1 a
    simp only [Prod.mk.inj_iff]
    constructor
  have h_meas_left : Measurable fun p : ∀ l : s, β l =>
    (p ⟨i, Finset.mem_insert_self i _⟩,
    p ⟨j, Finset.mem_insert_of_mem (Finset.mem_singleton_self _)⟩) :=
      Measurable.prod (measurable_pi_apply _) (measurable_pi_apply _)
  rw [h_left, h_right]
  refine' (hf_Indep.indepFun_finset s {k} _ hf_meas).comp h_meas_left h_meas_right
  rw [Finset.disjoint_singleton_right]
  simp only [Finset.mem_insert, Finset.mem_singleton, not_or]
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_Indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
h_right : f k = (fun p => p { val := k, property := (_ : k ∈ {k}) }) ∘ fun a j => f (↑j) a
h_meas_right : Measurable fun p => p { val := k, property := (_ : k ∈ {k}) }
s : Finset ι := {i, j}
h_left :
  (fun ω => (f i ω, f j ω)) =
    (fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })) ∘ fun a j =>
      f (↑j) a
h_meas_left :
  Measurable fun p => (p { val := i, property := (_ : i ∈ {i, j}) }, p { val := j, property := (_ : j ∈ {i, j}) })
⊢ ¬k = i ∧ ¬k = j

Next tactic:
exact ⟨hik.symm, hjk.symm⟩
open Finset in
lemma iIndepFun.indepFun_prod_mk_prod_mk [IsMarkovKernel κ] (hf_indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (fun a ↦ (f i a, f j a)) (fun a ↦ (f k a, f l a)) κ μ := by
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k l : ι
hik : i ≠ k
hil : i ≠ l
hjk : j ≠ k
hjl : j ≠ l
⊢ IndepFun (fun a => (f i a, f j a)) (fun a => (f k a, f l a)) κ

Next tactic:
classical
  let g (i j : ι) (v : Π x : ({i, j} : Finset ι), β x) : β i × β j :=
    ⟨v ⟨i, mem_insert_self _ _⟩, v ⟨j, mem_insert_of_mem $ mem_singleton_self _⟩⟩
  have hg (i j : ι) : Measurable (g i j) := by measurability
  exact (hf_indep.indepFun_finset {i, j} {k, l} (by aesop) hf_meas).comp (hg i j) (hg k l)
open Finset in
lemma iIndepFun.indepFun_prod_mk_prod_mk [IsMarkovKernel κ] (hf_indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (fun a ↦ (f i a, f j a)) (fun a ↦ (f k a, f l a)) κ μ := by
  classical
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k l : ι
hik : i ≠ k
hil : i ≠ l
hjk : j ≠ k
hjl : j ≠ l
⊢ IndepFun (fun a => (f i a, f j a)) (fun a => (f k a, f l a)) κ

Next tactic:
let g (i j : ι) (v : Π x : ({i, j} : Finset ι), β x) : β i × β j :=
    ⟨v ⟨i, mem_insert_self _ _⟩, v ⟨j, mem_insert_of_mem $ mem_singleton_self _⟩⟩
open Finset in
lemma iIndepFun.indepFun_prod_mk_prod_mk [IsMarkovKernel κ] (hf_indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (fun a ↦ (f i a, f j a)) (fun a ↦ (f k a, f l a)) κ μ := by
  classical
  let g (i j : ι) (v : Π x : ({i, j} : Finset ι), β x) : β i × β j :=
    ⟨v ⟨i, mem_insert_self _ _⟩, v ⟨j, mem_insert_of_mem $ mem_singleton_self _⟩⟩
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g✝ : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k l : ι
hik : i ≠ k
hil : i ≠ l
hjk : j ≠ k
hjl : j ≠ l
g : (i j : ι) → ((x : { x // x ∈ {i, j} }) → β ↑x) → β i × β j :=
  fun i j v => (v { val := i, property := (_ : i ∈ {i, j}) }, v { val := j, property := (_ : j ∈ {i, j}) })
⊢ IndepFun (fun a => (f i a, f j a)) (fun a => (f k a, f l a)) κ

Next tactic:
have hg (i j : ι) : Measurable (g i j) := by measurability
open Finset in
lemma iIndepFun.indepFun_prod_mk_prod_mk [IsMarkovKernel κ] (hf_indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (fun a ↦ (f i a, f j a)) (fun a ↦ (f k a, f l a)) κ μ := by
  classical
  let g (i j : ι) (v : Π x : ({i, j} : Finset ι), β x) : β i × β j :=
    ⟨v ⟨i, mem_insert_self _ _⟩, v ⟨j, mem_insert_of_mem $ mem_singleton_self _⟩⟩
  have hg (i j : ι) : Measurable (g i j) := by 

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g✝ : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i✝ j✝ k l : ι
hik : i✝ ≠ k
hil : i✝ ≠ l
hjk : j✝ ≠ k
hjl : j✝ ≠ l
g : (i j : ι) → ((x : { x // x ∈ {i, j} }) → β ↑x) → β i × β j :=
  fun i j v => (v { val := i, property := (_ : i ∈ {i, j}) }, v { val := j, property := (_ : j ∈ {i, j}) })
i j : ι
⊢ Measurable (g i j)

Next tactic:
measurability
open Finset in
lemma iIndepFun.indepFun_prod_mk_prod_mk [IsMarkovKernel κ] (hf_indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (fun a ↦ (f i a, f j a)) (fun a ↦ (f k a, f l a)) κ μ := by
  classical
  let g (i j : ι) (v : Π x : ({i, j} : Finset ι), β x) : β i × β j :=
    ⟨v ⟨i, mem_insert_self _ _⟩, v ⟨j, mem_insert_of_mem $ mem_singleton_self _⟩⟩
  have hg (i j : ι) : Measurable (g i j) := by measurability
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g✝ : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k l : ι
hik : i ≠ k
hil : i ≠ l
hjk : j ≠ k
hjl : j ≠ l
g : (i j : ι) → ((x : { x // x ∈ {i, j} }) → β ↑x) → β i × β j :=
  fun i j v => (v { val := i, property := (_ : i ∈ {i, j}) }, v { val := j, property := (_ : j ∈ {i, j}) })
hg : ∀ (i j : ι), Measurable (g i j)
⊢ IndepFun (fun a => (f i a, f j a)) (fun a => (f k a, f l a)) κ

Next tactic:
exact (hf_indep.indepFun_finset {i, j} {k, l} (by aesop) hf_meas).comp (hg i j) (hg k l)
open Finset in
lemma iIndepFun.indepFun_prod_mk_prod_mk [IsMarkovKernel κ] (hf_indep : iIndepFun m f κ μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (fun a ↦ (f i a, f j a)) (fun a ↦ (f k a, f l a)) κ μ := by
  classical
  let g (i j : ι) (v : Π x : ({i, j} : Finset ι), β x) : β i × β j :=
    ⟨v ⟨i, mem_insert_self _ _⟩, v ⟨j, mem_insert_of_mem $ mem_singleton_self _⟩⟩
  have hg (i j : ι) : Measurable (g i j) := by measurability
  exact (hf_indep.indepFun_finset {i, j} {k, l} (by 

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g✝ : Ω → β'
β : ι → Type u_8
m : (i : ι) → MeasurableSpace (β i)
f : (i : ι) → Ω → β i
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun m f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k l : ι
hik : i ≠ k
hil : i ≠ l
hjk : j ≠ k
hjl : j ≠ l
g : (i j : ι) → ((x : { x // x ∈ {i, j} }) → β ↑x) → β i × β j :=
  fun i j v => (v { val := i, property := (_ : i ∈ {i, j}) }, v { val := j, property := (_ : j ∈ {i, j}) })
hg : ∀ (i j : ι), Measurable (g i j)
⊢ Disjoint {i, j} {k, l}

Next tactic:
aesop
@[to_additive]
lemma iIndepFun.indepFun_mul_left (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (f i * f j) (f k) κ μ := by
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : Type u_8
m : MeasurableSpace β
inst✝² : Mul β
inst✝¹ : MeasurableMul₂ β
f : ι → Ω → β
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun (fun x => m) f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
⊢ IndepFun (f i * f j) (f k) κ

Next tactic:
have : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ μ :=
    hf_indep.indepFun_prod_mk hf_meas i j k hik hjk
@[to_additive]
lemma iIndepFun.indepFun_mul_left (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (f i * f j) (f k) κ μ := by
  have : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ μ :=
    hf_indep.indepFun_prod_mk hf_meas i j k hik hjk
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : Type u_8
m : MeasurableSpace β
inst✝² : Mul β
inst✝¹ : MeasurableMul₂ β
f : ι → Ω → β
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun (fun x => m) f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
this : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ
⊢ IndepFun (f i * f j) (f k) κ

Next tactic:
change IndepFun ((fun p : β × β => p.fst * p.snd) ∘ fun ω => (f i ω, f j ω)) (id ∘ f k) κ μ
@[to_additive]
lemma iIndepFun.indepFun_mul_left (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (f i * f j) (f k) κ μ := by
  have : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ μ :=
    hf_indep.indepFun_prod_mk hf_meas i j k hik hjk
  change IndepFun ((fun p : β × β => p.fst * p.snd) ∘ fun ω => (f i ω, f j ω)) (id ∘ f k) κ μ
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : Type u_8
m : MeasurableSpace β
inst✝² : Mul β
inst✝¹ : MeasurableMul₂ β
f : ι → Ω → β
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun (fun x => m) f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
this : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ
⊢ IndepFun ((fun p => p.1 * p.2) ∘ fun ω => (f i ω, f j ω)) (id ∘ f k) κ

Next tactic:
exact this.comp (measurable_fst.mul measurable_snd) measurable_id
@[to_additive]
lemma iIndepFun.indepFun_div_left (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (f i / f j) (f k) κ μ := by
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : Type u_8
m : MeasurableSpace β
inst✝² : Div β
inst✝¹ : MeasurableDiv₂ β
f : ι → Ω → β
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun (fun x => m) f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
⊢ IndepFun (f i / f j) (f k) κ

Next tactic:
have : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ μ :=
    hf_indep.indepFun_prod_mk hf_meas i j k hik hjk
@[to_additive]
lemma iIndepFun.indepFun_div_left (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (f i / f j) (f k) κ μ := by
  have : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ μ :=
    hf_indep.indepFun_prod_mk hf_meas i j k hik hjk
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : Type u_8
m : MeasurableSpace β
inst✝² : Div β
inst✝¹ : MeasurableDiv₂ β
f : ι → Ω → β
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun (fun x => m) f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
this : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ
⊢ IndepFun (f i / f j) (f k) κ

Next tactic:
change IndepFun ((fun p : β × β => p.fst / p.snd) ∘ fun ω => (f i ω, f j ω)) (id ∘ f k) κ μ
@[to_additive]
lemma iIndepFun.indepFun_div_left (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    IndepFun (f i / f j) (f k) κ μ := by
  have : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ μ :=
    hf_indep.indepFun_prod_mk hf_meas i j k hik hjk
  change IndepFun ((fun p : β × β => p.fst / p.snd) ∘ fun ω => (f i ω, f j ω)) (id ∘ f k) κ μ
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : Type u_8
m : MeasurableSpace β
inst✝² : Div β
inst✝¹ : MeasurableDiv₂ β
f : ι → Ω → β
inst✝ : IsMarkovKernel κ
hf_indep : iIndepFun (fun x => m) f κ
hf_meas : ∀ (i : ι), Measurable (f i)
i j k : ι
hik : i ≠ k
hjk : j ≠ k
this : IndepFun (fun ω => (f i ω, f j ω)) (f k) κ
⊢ IndepFun ((fun p => p.1 / p.2) ∘ fun ω => (f i ω, f j ω)) (id ∘ f k) κ

Next tactic:
exact this.comp (measurable_fst.div measurable_snd) measurable_id
@[to_additive]
theorem iIndepFun.indepFun_finset_prod_of_not_mem (hf_Indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) {s : Finset ι} {i : ι} (hi : i ∉ s) :
    IndepFun (∏ j in s, f j) (f i) κ μ := by
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : Type u_8
m : MeasurableSpace β
inst✝² : CommMonoid β
inst✝¹ : MeasurableMul₂ β
f : ι → Ω → β
inst✝ : IsMarkovKernel κ
hf_Indep : iIndepFun (fun x => m) f κ
hf_meas : ∀ (i : ι), Measurable (f i)
s : Finset ι
i : ι
hi : i ∉ s
⊢ IndepFun (∏ j in s, f j) (f i) κ

Next tactic:
classical
  have h_right : f i =
    (fun p : ∀ _j : ({i} : Finset ι), β => p ⟨i, Finset.mem_singleton_self i⟩) ∘
    fun a (j : ({i} : Finset ι)) => f j a := rfl
  have h_meas_right : Measurable fun p : ∀ _j : ({i} : Finset ι), β
    => p ⟨i, Finset.mem_singleton_self i⟩ := measurable_pi_apply ⟨i, Finset.mem_singleton_self i⟩
  have h_left : ∏ j in s, f j = (fun p : ∀ _j : s, β => ∏ j, p j) ∘ fun a (j : s) => f j a := by
    ext1 a
    simp only [Function.comp_apply]
    have : (∏ j : ↥s, f (↑j) a) = (∏ j : ↥s, f ↑j) a := by rw [Finset.prod_apply]
    rw [this, Finset.prod_coe_sort]
  have h_meas_left : Measurable fun p : ∀ _j : s, β => ∏ j, p j :=
    Finset.univ.measurable_prod fun (j : ↥s) (_H : j ∈ Finset.univ) => measurable_pi_apply j
  rw [h_left, h_right]
  exact
    (hf_Indep.indepFun_finset s {i} (Finset.disjoint_singleton_left.mpr hi).symm hf_meas).comp
      h_meas_left h_meas_right
@[to_additive]
theorem iIndepFun.indepFun_finset_prod_of_not_mem (hf_Indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i)) {s : Finset ι} {i : ι} (hi : i ∉ s) :
    IndepFun (∏ j in s, f j) (f i) κ μ := by
  classical
  

Proof state:
α : Type u_1
Ω : Type u_2
ι : Type u_3
β✝ : Type u_4
β' : Type u_5
γ : Type u_6
γ' : Type u_7
_mα : MeasurableSpace α
_mΩ : MeasurableSpace Ω
κ : ↥(kernel α Ω)
μ : Measure α
f✝ : Ω → β✝
g : Ω → β'
β : Type u_8
m : MeasurableSpace β
inst✝² : CommMonoid β
inst✝¹ : MeasurableMul₂ β
f : ι → Ω → β
inst✝ : IsMarkovKernel κ
hf_Indep : iIndepFun (fun x => m) f κ
hf_meas : ∀ (i : ι), Measurable (f i)
s : Finset ι
i : ι
hi : i ∉ s
⊢ IndepFun (∏ j in s, f j) (f i) κ

Next tactic:
have h_right : f i =
    (fun p : ∀ _j : ({i} : Finset ι), β => p ⟨i, Finset.mem_singleton_self i⟩) ∘
    fun a (j : ({i} : Finset ι)) => f j a := rfl