l3lab/ntp-mathlib huggingface dataset:
/-- Composition-Product of kernels. For s-finite kernels, it satisfies
`∫⁻ bc, f bc ∂(compProd κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`
(see `ProbabilityTheory.kernel.lintegral_compProd`).
If either of the kernels is not s-finite, `compProd` is given the junk value 0. -/
noncomputable def compProd (κ : kernel α β) (η : kernel (α × β) γ) : kernel α (β × γ) :=
if h : IsSFiniteKernel κ ∧ IsSFiniteKernel η then
{ val := λ a ↦
    Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
      (@compProdFun_iUnion _ _ _ _ _ _ κ η h.2 a)
  property := by
    have : IsSFiniteKernel κ := h.1
    have : IsSFiniteKernel η := h.2
    refine' Measure.measurable_of_measurable_coe _ fun s hs => _
    have :
      (fun a =>
          Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
            (compProdFun_iUnion κ η a) s) =
        fun a => compProdFun κ η a s :=
      by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s✝ : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ ∧ IsSFiniteKernel η
this✝ : IsSFiniteKernel κ
this : IsSFiniteKernel η
s : Set (β × γ)
hs : MeasurableSet s
⊢ (fun a =>
      ↑↑(Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
              (_ :
                ∀ (f : ℕ → Set (β × γ)),
                  (∀ (i : ℕ), MeasurableSet (f i)) →
                    Pairwise (Disjoint on f) → compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i)))
        s) =
    fun a => compProdFun κ η a s

Next tactic:
ext1 a
/-- Composition-Product of kernels. For s-finite kernels, it satisfies
`∫⁻ bc, f bc ∂(compProd κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`
(see `ProbabilityTheory.kernel.lintegral_compProd`).
If either of the kernels is not s-finite, `compProd` is given the junk value 0. -/
noncomputable def compProd (κ : kernel α β) (η : kernel (α × β) γ) : kernel α (β × γ) :=
if h : IsSFiniteKernel κ ∧ IsSFiniteKernel η then
{ val := λ a ↦
    Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
      (@compProdFun_iUnion _ _ _ _ _ _ κ η h.2 a)
  property := by
    have : IsSFiniteKernel κ := h.1
    have : IsSFiniteKernel η := h.2
    refine' Measure.measurable_of_measurable_coe _ fun s hs => _
    have :
      (fun a =>
          Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
            (compProdFun_iUnion κ η a) s) =
        fun a => compProdFun κ η a s :=
      by ext1 a; 

Proof state:
case h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s✝ : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ ∧ IsSFiniteKernel η
this✝ : IsSFiniteKernel κ
this : IsSFiniteKernel η
s : Set (β × γ)
hs : MeasurableSet s
a : α
⊢ ↑↑(Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
            (_ :
              ∀ (f : ℕ → Set (β × γ)),
                (∀ (i : ℕ), MeasurableSet (f i)) →
                  Pairwise (Disjoint on f) → compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i)))
      s =
    compProdFun κ η a s

Next tactic:
rwa [Measure.ofMeasurable_apply]
/-- Composition-Product of kernels. For s-finite kernels, it satisfies
`∫⁻ bc, f bc ∂(compProd κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`
(see `ProbabilityTheory.kernel.lintegral_compProd`).
If either of the kernels is not s-finite, `compProd` is given the junk value 0. -/
noncomputable def compProd (κ : kernel α β) (η : kernel (α × β) γ) : kernel α (β × γ) :=
if h : IsSFiniteKernel κ ∧ IsSFiniteKernel η then
{ val := λ a ↦
    Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
      (@compProdFun_iUnion _ _ _ _ _ _ κ η h.2 a)
  property := by
    have : IsSFiniteKernel κ := h.1
    have : IsSFiniteKernel η := h.2
    refine' Measure.measurable_of_measurable_coe _ fun s hs => _
    have :
      (fun a =>
          Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
            (compProdFun_iUnion κ η a) s) =
        fun a => compProdFun κ η a s :=
      by ext1 a; rwa [Measure.ofMeasurable_apply]
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s✝ : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ ∧ IsSFiniteKernel η
this✝¹ : IsSFiniteKernel κ
this✝ : IsSFiniteKernel η
s : Set (β × γ)
hs : MeasurableSet s
this :
  (fun a =>
      ↑↑(Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
              (_ :
                ∀ (f : ℕ → Set (β × γ)),
                  (∀ (i : ℕ), MeasurableSet (f i)) →
                    Pairwise (Disjoint on f) → compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i)))
        s) =
    fun a => compProdFun κ η a s
⊢ Measurable fun b =>
    ↑↑(Measure.ofMeasurable (fun s x => compProdFun κ η b s) (_ : compProdFun κ η b ∅ = 0)
            (_ :
              ∀ (f : ℕ → Set (β × γ)),
                (∀ (i : ℕ), MeasurableSet (f i)) →
                  Pairwise (Disjoint on f) → compProdFun κ η b (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η b (f i)))
      s

Next tactic:
rw [this]
/-- Composition-Product of kernels. For s-finite kernels, it satisfies
`∫⁻ bc, f bc ∂(compProd κ η a) = ∫⁻ b, ∫⁻ c, f (b, c) ∂(η (a, b)) ∂(κ a)`
(see `ProbabilityTheory.kernel.lintegral_compProd`).
If either of the kernels is not s-finite, `compProd` is given the junk value 0. -/
noncomputable def compProd (κ : kernel α β) (η : kernel (α × β) γ) : kernel α (β × γ) :=
if h : IsSFiniteKernel κ ∧ IsSFiniteKernel η then
{ val := λ a ↦
    Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
      (@compProdFun_iUnion _ _ _ _ _ _ κ η h.2 a)
  property := by
    have : IsSFiniteKernel κ := h.1
    have : IsSFiniteKernel η := h.2
    refine' Measure.measurable_of_measurable_coe _ fun s hs => _
    have :
      (fun a =>
          Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
            (compProdFun_iUnion κ η a) s) =
        fun a => compProdFun κ η a s :=
      by ext1 a; rwa [Measure.ofMeasurable_apply]
    rw [this]
    

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s✝ : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ ∧ IsSFiniteKernel η
this✝¹ : IsSFiniteKernel κ
this✝ : IsSFiniteKernel η
s : Set (β × γ)
hs : MeasurableSet s
this :
  (fun a =>
      ↑↑(Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
              (_ :
                ∀ (f : ℕ → Set (β × γ)),
                  (∀ (i : ℕ), MeasurableSet (f i)) →
                    Pairwise (Disjoint on f) → compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i)))
        s) =
    fun a => compProdFun κ η a s
⊢ Measurable fun a => compProdFun κ η a s

Next tactic:
exact measurable_compProdFun κ η hs
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ ↑↑((κ ⊗ₖ η) a) s = compProdFun κ η a s

Next tactic:
rw [compProd, dif_pos]
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s := by
  rw [compProd, dif_pos]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ ↑↑({
              val := fun a =>
                Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
                  (_ :
                    ∀ (f : ℕ → Set (β × γ)),
                      (∀ (i : ℕ), MeasurableSet (f i)) →
                        Pairwise (Disjoint on f) → compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i)),
              property :=
                (_ :
                  Measurable fun a =>
                    Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
                      (_ :
                        ∀ (f : ℕ → Set (β × γ)),
                          (∀ (i : ℕ), MeasurableSet (f i)) →
                            Pairwise (Disjoint on f) →
                              compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i))) }
            a)
      s =
    compProdFun κ η a s
case hc
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ IsSFiniteKernel κ ∧ IsSFiniteKernel η

Next tactic:
swap
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s := by
  rw [compProd, dif_pos]
  swap
  · 

Proof state:
case hc
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ IsSFiniteKernel κ ∧ IsSFiniteKernel η

Next tactic:
constructor
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s := by
  rw [compProd, dif_pos]
  swap
  · constructor <;> 

Proof state:
case hc.left
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ IsSFiniteKernel κ

Next tactic:
infer_instance
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s := by
  rw [compProd, dif_pos]
  swap
  · constructor <;> 

Proof state:
case hc.right
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ IsSFiniteKernel η

Next tactic:
infer_instance
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s := by
  rw [compProd, dif_pos]
  swap
  · constructor <;> infer_instance
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ ↑↑({
              val := fun a =>
                Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
                  (_ :
                    ∀ (f : ℕ → Set (β × γ)),
                      (∀ (i : ℕ), MeasurableSet (f i)) →
                        Pairwise (Disjoint on f) → compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i)),
              property :=
                (_ :
                  Measurable fun a =>
                    Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
                      (_ :
                        ∀ (f : ℕ → Set (β × γ)),
                          (∀ (i : ℕ), MeasurableSet (f i)) →
                            Pairwise (Disjoint on f) →
                              compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i))) }
            a)
      s =
    compProdFun κ η a s

Next tactic:
change
    Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
        (compProdFun_iUnion κ η a) s =
      ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s := by
  rw [compProd, dif_pos]
  swap
  · constructor <;> infer_instance
  change
    Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
        (compProdFun_iUnion κ η a) s =
      ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ ↑↑(Measure.ofMeasurable (fun s x => compProdFun κ η a s) (_ : compProdFun κ η a ∅ = 0)
            (_ :
              ∀ (f : ℕ → Set (β × γ)),
                (∀ (i : ℕ), MeasurableSet (f i)) →
                  Pairwise (Disjoint on f) → compProdFun κ η a (⋃ i, f i) = ∑' (i : ℕ), compProdFun κ η a (f i)))
      s =
    ∫⁻ (b : β), ↑↑(η (a, b)) {c | (b, c) ∈ s} ∂κ a

Next tactic:
rw [Measure.ofMeasurable_apply _ hs]
theorem compProd_apply_eq_compProdFun (κ : kernel α β) [IsSFiniteKernel κ] (η : kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s := by
  rw [compProd, dif_pos]
  swap
  · constructor <;> infer_instance
  change
    Measure.ofMeasurable (fun s _ => compProdFun κ η a s) (compProdFun_empty κ η a)
        (compProdFun_iUnion κ η a) s =
      ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a
  rw [Measure.ofMeasurable_apply _ hs]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a : α
hs : MeasurableSet s
⊢ compProdFun κ η a s = ∫⁻ (b : β), ↑↑(η (a, b)) {c | (b, c) ∈ s} ∂κ a

Next tactic:
rfl
theorem compProd_of_not_isSFiniteKernel_left (κ : kernel α β) (η : kernel (α × β) γ)
    (h : ¬ IsSFiniteKernel κ) :
    κ ⊗ₖ η = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h : ¬IsSFiniteKernel κ
⊢ κ ⊗ₖ η = 0

Next tactic:
rw [compProd, dif_neg]
theorem compProd_of_not_isSFiniteKernel_left (κ : kernel α β) (η : kernel (α × β) γ)
    (h : ¬ IsSFiniteKernel κ) :
    κ ⊗ₖ η = 0 := by
  rw [compProd, dif_neg]
  

Proof state:
case hnc
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h : ¬IsSFiniteKernel κ
⊢ ¬(IsSFiniteKernel κ ∧ IsSFiniteKernel η)

Next tactic:
simp [h]
theorem compProd_of_not_isSFiniteKernel_right (κ : kernel α β) (η : kernel (α × β) γ)
    (h : ¬ IsSFiniteKernel η) :
    κ ⊗ₖ η = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h : ¬IsSFiniteKernel η
⊢ κ ⊗ₖ η = 0

Next tactic:
rw [compProd, dif_neg]
theorem compProd_of_not_isSFiniteKernel_right (κ : kernel α β) (η : kernel (α × β) γ)
    (h : ¬ IsSFiniteKernel η) :
    κ ⊗ₖ η = 0 := by
  rw [compProd, dif_neg]
  

Proof state:
case hnc
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h : ¬IsSFiniteKernel η
⊢ ¬(IsSFiniteKernel κ ∧ IsSFiniteKernel η)

Next tactic:
simp [h]
@[simp]
lemma compProd_zero_left (κ : kernel (α × β) γ) :
    (0 : kernel α β) ⊗ₖ κ = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel (α × β) γ)
⊢ 0 ⊗ₖ κ = 0

Next tactic:
by_cases h : IsSFiniteKernel κ
@[simp]
lemma compProd_zero_left (κ : kernel (α × β) γ) :
    (0 : kernel α β) ⊗ₖ κ = 0 := by
  by_cases h : IsSFiniteKernel κ
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ
⊢ 0 ⊗ₖ κ = 0

Next tactic:
ext a s hs
@[simp]
lemma compProd_zero_left (κ : kernel (α × β) γ) :
    (0 : kernel α β) ⊗ₖ κ = 0 := by
  by_cases h : IsSFiniteKernel κ
  · ext a s hs
    

Proof state:
case pos.h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s✝ : Set (β × γ)
κ : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ
a : α
s : Set (β × γ)
hs : MeasurableSet s
⊢ ↑↑((0 ⊗ₖ κ) a) s = ↑↑(0 a) s

Next tactic:
rw [kernel.compProd_apply _ _ _ hs]
@[simp]
lemma compProd_zero_left (κ : kernel (α × β) γ) :
    (0 : kernel α β) ⊗ₖ κ = 0 := by
  by_cases h : IsSFiniteKernel κ
  · ext a s hs
    rw [kernel.compProd_apply _ _ _ hs]
    

Proof state:
case pos.h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s✝ : Set (β × γ)
κ : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ
a : α
s : Set (β × γ)
hs : MeasurableSet s
⊢ ∫⁻ (b : β), ↑↑(κ (a, b)) {c | (b, c) ∈ s} ∂0 a = ↑↑(0 a) s

Next tactic:
simp
@[simp]
lemma compProd_zero_left (κ : kernel (α × β) γ) :
    (0 : kernel α β) ⊗ₖ κ = 0 := by
  by_cases h : IsSFiniteKernel κ
  · ext a s hs
    rw [kernel.compProd_apply _ _ _ hs]
    simp
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel (α × β) γ)
h : ¬IsSFiniteKernel κ
⊢ 0 ⊗ₖ κ = 0

Next tactic:
rw [kernel.compProd_of_not_isSFiniteKernel_right _ _ h]
@[simp]
lemma compProd_zero_right (κ : kernel α β) (γ : Type*) [MeasurableSpace γ] :
    κ ⊗ₖ (0 : kernel (α × β) γ) = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ✝ : Type u_4
mγ : MeasurableSpace γ✝
s : Set (β × γ✝)
κ : ↥(kernel α β)
γ : Type u_5
inst✝ : MeasurableSpace γ
⊢ κ ⊗ₖ 0 = 0

Next tactic:
by_cases h : IsSFiniteKernel κ
@[simp]
lemma compProd_zero_right (κ : kernel α β) (γ : Type*) [MeasurableSpace γ] :
    κ ⊗ₖ (0 : kernel (α × β) γ) = 0 := by
  by_cases h : IsSFiniteKernel κ
  · 

Proof state:
case pos
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ✝ : Type u_4
mγ : MeasurableSpace γ✝
s : Set (β × γ✝)
κ : ↥(kernel α β)
γ : Type u_5
inst✝ : MeasurableSpace γ
h : IsSFiniteKernel κ
⊢ κ ⊗ₖ 0 = 0

Next tactic:
ext a s hs
@[simp]
lemma compProd_zero_right (κ : kernel α β) (γ : Type*) [MeasurableSpace γ] :
    κ ⊗ₖ (0 : kernel (α × β) γ) = 0 := by
  by_cases h : IsSFiniteKernel κ
  · ext a s hs
    

Proof state:
case pos.h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ✝ : Type u_4
mγ : MeasurableSpace γ✝
s✝ : Set (β × γ✝)
κ : ↥(kernel α β)
γ : Type u_5
inst✝ : MeasurableSpace γ
h : IsSFiniteKernel κ
a : α
s : Set (β × γ)
hs : MeasurableSet s
⊢ ↑↑((κ ⊗ₖ 0) a) s = ↑↑(0 a) s

Next tactic:
rw [kernel.compProd_apply _ _ _ hs]
@[simp]
lemma compProd_zero_right (κ : kernel α β) (γ : Type*) [MeasurableSpace γ] :
    κ ⊗ₖ (0 : kernel (α × β) γ) = 0 := by
  by_cases h : IsSFiniteKernel κ
  · ext a s hs
    rw [kernel.compProd_apply _ _ _ hs]
    

Proof state:
case pos.h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ✝ : Type u_4
mγ : MeasurableSpace γ✝
s✝ : Set (β × γ✝)
κ : ↥(kernel α β)
γ : Type u_5
inst✝ : MeasurableSpace γ
h : IsSFiniteKernel κ
a : α
s : Set (β × γ)
hs : MeasurableSet s
⊢ ∫⁻ (b : β), ↑↑(0 (a, b)) {c | (b, c) ∈ s} ∂κ a = ↑↑(0 a) s

Next tactic:
simp
@[simp]
lemma compProd_zero_right (κ : kernel α β) (γ : Type*) [MeasurableSpace γ] :
    κ ⊗ₖ (0 : kernel (α × β) γ) = 0 := by
  by_cases h : IsSFiniteKernel κ
  · ext a s hs
    rw [kernel.compProd_apply _ _ _ hs]
    simp
  · 

Proof state:
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ✝ : Type u_4
mγ : MeasurableSpace γ✝
s : Set (β × γ✝)
κ : ↥(kernel α β)
γ : Type u_5
inst✝ : MeasurableSpace γ
h : ¬IsSFiniteKernel κ
⊢ κ ⊗ₖ 0 = 0

Next tactic:
rw [kernel.compProd_of_not_isSFiniteKernel_left _ _ h]
theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
    ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞ := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a✝ a : α
h2s : ↑↑((κ ⊗ₖ η) a) s ≠ ⊤
⊢ ∀ᵐ (b : β) ∂κ a, ↑↑(η (a, b)) (Prod.mk b ⁻¹' s) < ⊤

Next tactic:
let t := toMeasurable ((κ ⊗ₖ η) a) s
theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
    ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞ := by
  let t := toMeasurable ((κ ⊗ₖ η) a) s
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a✝ a : α
h2s : ↑↑((κ ⊗ₖ η) a) s ≠ ⊤
t : Set (β × γ) := toMeasurable ((κ ⊗ₖ η) a) s
⊢ ∀ᵐ (b : β) ∂κ a, ↑↑(η (a, b)) (Prod.mk b ⁻¹' s) < ⊤

Next tactic:
have : ∀ b : β, η (a, b) (Prod.mk b ⁻¹' s) ≤ η (a, b) (Prod.mk b ⁻¹' t) := fun b =>
    measure_mono (Set.preimage_mono (subset_toMeasurable _ _))
theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
    ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞ := by
  let t := toMeasurable ((κ ⊗ₖ η) a) s
  have : ∀ b : β, η (a, b) (Prod.mk b ⁻¹' s) ≤ η (a, b) (Prod.mk b ⁻¹' t) := fun b =>
    measure_mono (Set.preimage_mono (subset_toMeasurable _ _))
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a✝ a : α
h2s : ↑↑((κ ⊗ₖ η) a) s ≠ ⊤
t : Set (β × γ) := toMeasurable ((κ ⊗ₖ η) a) s
this : ∀ (b : β), ↑↑(η (a, b)) (Prod.mk b ⁻¹' s) ≤ ↑↑(η (a, b)) (Prod.mk b ⁻¹' t)
⊢ ∀ᵐ (b : β) ∂κ a, ↑↑(η (a, b)) (Prod.mk b ⁻¹' s) < ⊤

Next tactic:
have ht : MeasurableSet t := measurableSet_toMeasurable _ _
theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
    ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞ := by
  let t := toMeasurable ((κ ⊗ₖ η) a) s
  have : ∀ b : β, η (a, b) (Prod.mk b ⁻¹' s) ≤ η (a, b) (Prod.mk b ⁻¹' t) := fun b =>
    measure_mono (Set.preimage_mono (subset_toMeasurable _ _))
  have ht : MeasurableSet t := measurableSet_toMeasurable _ _
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
inst✝¹ : IsSFiniteKernel κ
η : ↥(kernel (α × β) γ)
inst✝ : IsSFiniteKernel η
a✝ a : α
h2s : ↑↑((κ ⊗ₖ η) a) s ≠ ⊤
t : Set (β × γ) := toMeasurable ((κ ⊗ₖ η) a) s
this : ∀ (b : β), ↑↑(η (a, b)) (Prod.mk b ⁻¹' s) ≤ ↑↑(η (a, b)) (Prod.mk b ⁻¹' t)
ht : MeasurableSet t
⊢ ∀ᵐ (b : β) ∂κ a, ↑↑(η (a, b)) (Prod.mk b ⁻¹' s) < ⊤

Next tactic:
have h2t : (κ ⊗ₖ η) a t ≠ ∞ := by rwa [measure_toMeasurable]