l3lab/ntp-mathlib huggingface dataset:
theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
    (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := 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 α β)
η : ↥(kernel (α × β) γ)
inst✝ : IsFiniteKernel η
a : α
hκ : IsSFiniteKernel κ
⊢ ↑↑((κ ⊗ₖ η) a) Set.univ ≤ ↑↑(κ a) Set.univ * IsFiniteKernel.bound η
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
inst✝ : IsFiniteKernel η
a : α
hκ : ¬IsSFiniteKernel κ
⊢ ↑↑((κ ⊗ₖ η) a) Set.univ ≤ ↑↑(κ a) Set.univ * IsFiniteKernel.bound η

Next tactic:
swap
theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
    (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := by
  by_cases hκ : IsSFiniteKernel κ
  swap
  · 

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 α β)
η : ↥(kernel (α × β) γ)
inst✝ : IsFiniteKernel η
a : α
hκ : ¬IsSFiniteKernel κ
⊢ ↑↑((κ ⊗ₖ η) a) Set.univ ≤ ↑↑(κ a) Set.univ * IsFiniteKernel.bound η

Next tactic:
rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
    (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := by
  by_cases hκ : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
    

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 α β)
η : ↥(kernel (α × β) γ)
inst✝ : IsFiniteKernel η
a : α
hκ : ¬IsSFiniteKernel κ
⊢ ↑↑(0 a) Set.univ ≤ ↑↑(κ a) Set.univ * IsFiniteKernel.bound η

Next tactic:
simp
theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
    (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := by
  by_cases hκ : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
    simp
  

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 α β)
η : ↥(kernel (α × β) γ)
inst✝ : IsFiniteKernel η
a : α
hκ : IsSFiniteKernel κ
⊢ ↑↑((κ ⊗ₖ η) a) Set.univ ≤ ↑↑(κ a) Set.univ * IsFiniteKernel.bound η

Next tactic:
rw [compProd_apply κ η a MeasurableSet.univ]
theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
    (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := by
  by_cases hκ : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
    simp
  rw [compProd_apply κ η a MeasurableSet.univ]
  

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 α β)
η : ↥(kernel (α × β) γ)
inst✝ : IsFiniteKernel η
a : α
hκ : IsSFiniteKernel κ
⊢ ∫⁻ (b : β), ↑↑(η (a, b)) {c | (b, c) ∈ Set.univ} ∂κ a ≤ ↑↑(κ a) Set.univ * IsFiniteKernel.bound η

Next tactic:
simp only [Set.mem_univ, Set.setOf_true]
theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
    (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := by
  by_cases hκ : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
    simp
  rw [compProd_apply κ η a MeasurableSet.univ]
  simp only [Set.mem_univ, Set.setOf_true]
  

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 α β)
η : ↥(kernel (α × β) γ)
inst✝ : IsFiniteKernel η
a : α
hκ : IsSFiniteKernel κ
⊢ ∫⁻ (b : β), ↑↑(η (a, b)) Set.univ ∂κ a ≤ ↑↑(κ a) Set.univ * IsFiniteKernel.bound η

Next tactic:
let Cη := IsFiniteKernel.bound η
theorem compProd_apply_univ_le (κ : kernel α β) (η : kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
    (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η := by
  by_cases hκ : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ hκ]
    simp
  rw [compProd_apply κ η a MeasurableSet.univ]
  simp only [Set.mem_univ, Set.setOf_true]
  let Cη := IsFiniteKernel.bound η
  

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 α β)
η : ↥(kernel (α × β) γ)
inst✝ : IsFiniteKernel η
a : α
hκ : IsSFiniteKernel κ
Cη : ℝ≥0∞ := IsFiniteKernel.bound η
⊢ ∫⁻ (b : β), ↑↑(η (a, b)) Set.univ ∂κ a ≤ ↑↑(κ a) Set.univ * IsFiniteKernel.bound η

Next tactic:
calc
    ∫⁻ b, η (a, b) Set.univ ∂κ a ≤ ∫⁻ _, Cη ∂κ a :=
      lintegral_mono fun b => measure_le_bound η (a, b) Set.univ
    _ = Cη * κ a Set.univ := (MeasureTheory.lintegral_const Cη)
    _ = κ a Set.univ * Cη := mul_comm _ _
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := 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 (α × β) γ)
⊢ IsSFiniteKernel (κ ⊗ₖ η)

Next tactic:
by_cases h : IsSFiniteKernel κ
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := 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 α β)
η : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ
⊢ IsSFiniteKernel (κ ⊗ₖ η)
case neg
α : 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 (κ ⊗ₖ η)

Next tactic:
swap
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := by
  by_cases h : IsSFiniteKernel κ
  swap
  · 

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 α β)
η : ↥(kernel (α × β) γ)
h : ¬IsSFiniteKernel κ
⊢ IsSFiniteKernel (κ ⊗ₖ η)

Next tactic:
rw [compProd_of_not_isSFiniteKernel_left _ _ h]
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := by
  by_cases h : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ h]
    

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 α β)
η : ↥(kernel (α × β) γ)
h : ¬IsSFiniteKernel κ
⊢ IsSFiniteKernel 0

Next tactic:
infer_instance
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := by
  by_cases h : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ h]
    infer_instance
  

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 α β)
η : ↥(kernel (α × β) γ)
h : IsSFiniteKernel κ
⊢ IsSFiniteKernel (κ ⊗ₖ η)

Next tactic:
by_cases h : IsSFiniteKernel η
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := by
  by_cases h : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ h]
    infer_instance
  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 α β)
η : ↥(kernel (α × β) γ)
h✝ : IsSFiniteKernel κ
h : IsSFiniteKernel η
⊢ IsSFiniteKernel (κ ⊗ₖ η)
case neg
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
s : Set (β × γ)
κ : ↥(kernel α β)
η : ↥(kernel (α × β) γ)
h✝ : IsSFiniteKernel κ
h : ¬IsSFiniteKernel η
⊢ IsSFiniteKernel (κ ⊗ₖ η)

Next tactic:
swap
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := by
  by_cases h : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ h]
    infer_instance
  by_cases h : IsSFiniteKernel η
  swap
  · 

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 α β)
η : ↥(kernel (α × β) γ)
h✝ : IsSFiniteKernel κ
h : ¬IsSFiniteKernel η
⊢ IsSFiniteKernel (κ ⊗ₖ η)

Next tactic:
rw [compProd_of_not_isSFiniteKernel_right _ _ h]
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := by
  by_cases h : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ h]
    infer_instance
  by_cases h : IsSFiniteKernel η
  swap
  · rw [compProd_of_not_isSFiniteKernel_right _ _ h]
    

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 α β)
η : ↥(kernel (α × β) γ)
h✝ : IsSFiniteKernel κ
h : ¬IsSFiniteKernel η
⊢ IsSFiniteKernel 0

Next tactic:
infer_instance
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := by
  by_cases h : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ h]
    infer_instance
  by_cases h : IsSFiniteKernel η
  swap
  · rw [compProd_of_not_isSFiniteKernel_right _ _ h]
    infer_instance
  

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 α β)
η : ↥(kernel (α × β) γ)
h✝ : IsSFiniteKernel κ
h : IsSFiniteKernel η
⊢ IsSFiniteKernel (κ ⊗ₖ η)

Next tactic:
rw [compProd_eq_sum_compProd]
instance IsSFiniteKernel.compProd (κ : kernel α β) (η : kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) := by
  by_cases h : IsSFiniteKernel κ
  swap
  · rw [compProd_of_not_isSFiniteKernel_left _ _ h]
    infer_instance
  by_cases h : IsSFiniteKernel η
  swap
  · rw [compProd_of_not_isSFiniteKernel_right _ _ h]
    infer_instance
  rw [compProd_eq_sum_compProd]
  

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 α β)
η : ↥(kernel (α × β) γ)
h✝ : IsSFiniteKernel κ
h : IsSFiniteKernel η
⊢ IsSFiniteKernel (kernel.sum fun n => kernel.sum fun m => seq κ n ⊗ₖ seq η m)

Next tactic:
exact kernel.isSFiniteKernel_sum fun n => kernel.isSFiniteKernel_sum inferInstance
theorem map_apply' (κ : kernel α β) (hf : Measurable f) (a : α) {s : Set γ} (hs : MeasurableSet s) :
    map κ f hf a s = κ a (f ⁻¹' s) := by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
hf : Measurable f
a : α
s : Set γ
hs : MeasurableSet s
⊢ ↑↑((map κ f hf) a) s = ↑↑(κ a) (f ⁻¹' s)

Next tactic:
rw [map_apply, Measure.map_apply hf hs]
@[simp]
lemma map_zero (hf : Measurable f) : kernel.map (0 : kernel α β) f hf = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
hf : Measurable f
⊢ map 0 f hf = 0

Next tactic:
ext
@[simp]
lemma map_zero (hf : Measurable f) : kernel.map (0 : kernel α β) f hf = 0 := by
  ext; 

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
hf : Measurable f
a✝¹ : α
s✝ : Set γ
a✝ : MeasurableSet s✝
⊢ ↑↑((map 0 f hf) a✝¹) s✝ = ↑↑(0 a✝¹) s✝

Next tactic:
rw [kernel.map_apply]
@[simp]
lemma map_zero (hf : Measurable f) : kernel.map (0 : kernel α β) f hf = 0 := by
  ext; rw [kernel.map_apply]; 

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
hf : Measurable f
a✝¹ : α
s✝ : Set γ
a✝ : MeasurableSet s✝
⊢ ↑↑(Measure.map f (0 a✝¹)) s✝ = ↑↑(0 a✝¹) s✝

Next tactic:
simp
nonrec theorem lintegral_map (κ : kernel α β) (hf : Measurable f) (a : α) {g' : γ → ℝ≥0∞}
    (hg : Measurable g') : ∫⁻ b, g' b ∂map κ f hf a = ∫⁻ a, g' (f a) ∂κ a := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
hf : Measurable f
a : α
g' : γ → ℝ≥0∞
hg : Measurable g'
⊢ ∫⁻ (b : γ), g' b ∂(map κ f hf) a = ∫⁻ (a : β), g' (f a) ∂κ a

Next tactic:
rw [map_apply _ hf, lintegral_map hg hf]
theorem sum_map_seq (κ : kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
    (kernel.sum fun n => map (seq κ n) f hf) = map κ f hf := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsSFiniteKernel κ
hf : Measurable f
⊢ (kernel.sum fun n => map (seq κ n) f hf) = map κ f hf

Next tactic:
ext a s hs
theorem sum_map_seq (κ : kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
    (kernel.sum fun n => map (seq κ n) f hf) = map κ f hf := by
  ext a s hs
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsSFiniteKernel κ
hf : Measurable f
a : α
s : Set γ
hs : MeasurableSet s
⊢ ↑↑((kernel.sum fun n => map (seq κ n) f hf) a) s = ↑↑((map κ f hf) a) s

Next tactic:
rw [kernel.sum_apply, map_apply' κ hf a hs, Measure.sum_apply _ hs, ← measure_sum_seq κ,
    Measure.sum_apply _ (hf hs)]
theorem sum_map_seq (κ : kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
    (kernel.sum fun n => map (seq κ n) f hf) = map κ f hf := by
  ext a s hs
  rw [kernel.sum_apply, map_apply' κ hf a hs, Measure.sum_apply _ hs, ← measure_sum_seq κ,
    Measure.sum_apply _ (hf hs)]
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsSFiniteKernel κ
hf : Measurable f
a : α
s : Set γ
hs : MeasurableSet s
⊢ ∑' (i : ℕ), ↑↑((map (seq κ i) f hf) a) s = ∑' (i : ℕ), ↑↑((seq κ i) a) (f ⁻¹' s)

Next tactic:
simp_rw [map_apply' _ hf _ hs]
instance IsMarkovKernel.map (κ : kernel α β) [IsMarkovKernel κ] (hf : Measurable f) :
    IsMarkovKernel (map κ f hf) :=
  ⟨fun a => ⟨by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsMarkovKernel κ
hf : Measurable f
a : α
⊢ ↑↑((kernel.map κ f hf) a) Set.univ = 1

Next tactic:
rw [map_apply' κ hf a MeasurableSet.univ, Set.preimage_univ, measure_univ]
instance IsFiniteKernel.map (κ : kernel α β) [IsFiniteKernel κ] (hf : Measurable f) :
    IsFiniteKernel (map κ f hf) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsFiniteKernel κ
hf : Measurable f
⊢ IsFiniteKernel (kernel.map κ f hf)

Next tactic:
refine' ⟨⟨IsFiniteKernel.bound κ, IsFiniteKernel.bound_lt_top κ, fun a => _⟩⟩
instance IsFiniteKernel.map (κ : kernel α β) [IsFiniteKernel κ] (hf : Measurable f) :
    IsFiniteKernel (map κ f hf) := by
  refine' ⟨⟨IsFiniteKernel.bound κ, IsFiniteKernel.bound_lt_top κ, fun a => _⟩⟩
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsFiniteKernel κ
hf : Measurable f
a : α
⊢ ↑↑((kernel.map κ f hf) a) Set.univ ≤ IsFiniteKernel.bound κ

Next tactic:
rw [map_apply' κ hf a MeasurableSet.univ]
instance IsFiniteKernel.map (κ : kernel α β) [IsFiniteKernel κ] (hf : Measurable f) :
    IsFiniteKernel (map κ f hf) := by
  refine' ⟨⟨IsFiniteKernel.bound κ, IsFiniteKernel.bound_lt_top κ, fun a => _⟩⟩
  rw [map_apply' κ hf a MeasurableSet.univ]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsFiniteKernel κ
hf : Measurable f
a : α
⊢ ↑↑(κ a) (f ⁻¹' Set.univ) ≤ IsFiniteKernel.bound κ

Next tactic:
exact measure_le_bound κ a _
@[simp]
lemma map_const (μ : Measure α) {f : α → β} (hf : Measurable f) :
    map (const γ μ) f hf = const γ (μ.map f) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f✝ : β → γ
g : γ → α
μ : Measure α
f : α → β
hf : Measurable f
⊢ map (const γ μ) f hf = const γ (Measure.map f μ)

Next tactic:
ext x s hs
@[simp]
lemma map_const (μ : Measure α) {f : α → β} (hf : Measurable f) :
    map (const γ μ) f hf = const γ (μ.map f) := by
  ext x s hs
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f✝ : β → γ
g : γ → α
μ : Measure α
f : α → β
hf : Measurable f
x : γ
s : Set β
hs : MeasurableSet s
⊢ ↑↑((map (const γ μ) f hf) x) s = ↑↑((const γ (Measure.map f μ)) x) s

Next tactic:
rw [map_apply' _ _ _ hs, const_apply, const_apply, Measure.map_apply hf hs]
@[simp]
lemma comap_zero (hg : Measurable g) : kernel.comap (0 : kernel α β) g hg = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
hg : Measurable g
⊢ comap 0 g hg = 0

Next tactic:
ext
@[simp]
lemma comap_zero (hg : Measurable g) : kernel.comap (0 : kernel α β) g hg = 0 := by
  ext; 

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
hg : Measurable g
a✝¹ : γ
s✝ : Set β
a✝ : MeasurableSet s✝
⊢ ↑↑((comap 0 g hg) a✝¹) s✝ = ↑↑(0 a✝¹) s✝

Next tactic:
rw [kernel.comap_apply]
@[simp]
lemma comap_zero (hg : Measurable g) : kernel.comap (0 : kernel α β) g hg = 0 := by
  ext; rw [kernel.comap_apply]; 

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
hg : Measurable g
a✝¹ : γ
s✝ : Set β
a✝ : MeasurableSet s✝
⊢ ↑↑(0 (g a✝¹)) s✝ = ↑↑(0 a✝¹) s✝

Next tactic:
simp
theorem sum_comap_seq (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
    (kernel.sum fun n => comap (seq κ n) g hg) = comap κ g hg := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsSFiniteKernel κ
hg : Measurable g
⊢ (kernel.sum fun n => comap (seq κ n) g hg) = comap κ g hg

Next tactic:
ext a s hs
theorem sum_comap_seq (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
    (kernel.sum fun n => comap (seq κ n) g hg) = comap κ g hg := by
  ext a s hs
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsSFiniteKernel κ
hg : Measurable g
a : γ
s : Set β
hs : MeasurableSet s
⊢ ↑↑((kernel.sum fun n => comap (seq κ n) g hg) a) s = ↑↑((comap κ g hg) a) s

Next tactic:
rw [kernel.sum_apply, comap_apply' κ hg a s, Measure.sum_apply _ hs, ← measure_sum_seq κ,
    Measure.sum_apply _ hs]
theorem sum_comap_seq (κ : kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
    (kernel.sum fun n => comap (seq κ n) g hg) = comap κ g hg := by
  ext a s hs
  rw [kernel.sum_apply, comap_apply' κ hg a s, Measure.sum_apply _ hs, ← measure_sum_seq κ,
    Measure.sum_apply _ hs]
  

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsSFiniteKernel κ
hg : Measurable g
a : γ
s : Set β
hs : MeasurableSet s
⊢ ∑' (i : ℕ), ↑↑((comap (seq κ i) g hg) a) s = ∑' (i : ℕ), ↑↑((seq κ i) (g a)) s

Next tactic:
simp_rw [comap_apply' _ hg _ s]
instance IsMarkovKernel.comap (κ : kernel α β) [IsMarkovKernel κ] (hg : Measurable g) :
    IsMarkovKernel (comap κ g hg) :=
  ⟨fun a => ⟨by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsMarkovKernel κ
hg : Measurable g
a : γ
⊢ ↑↑((kernel.comap κ g hg) a) Set.univ = 1

Next tactic:
rw [comap_apply' κ hg a Set.univ, measure_univ]
instance IsFiniteKernel.comap (κ : kernel α β) [IsFiniteKernel κ] (hg : Measurable g) :
    IsFiniteKernel (comap κ g hg) := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsFiniteKernel κ
hg : Measurable g
⊢ IsFiniteKernel (kernel.comap κ g hg)

Next tactic:
refine' ⟨⟨IsFiniteKernel.bound κ, IsFiniteKernel.bound_lt_top κ, fun a => _⟩⟩
instance IsFiniteKernel.comap (κ : kernel α β) [IsFiniteKernel κ] (hg : Measurable g) :
    IsFiniteKernel (comap κ g hg) := by
  refine' ⟨⟨IsFiniteKernel.bound κ, IsFiniteKernel.bound_lt_top κ, fun a => _⟩⟩
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsFiniteKernel κ
hg : Measurable g
a : γ
⊢ ↑↑((kernel.comap κ g hg) a) Set.univ ≤ IsFiniteKernel.bound κ

Next tactic:
rw [comap_apply' κ hg a Set.univ]
instance IsFiniteKernel.comap (κ : kernel α β) [IsFiniteKernel κ] (hg : Measurable g) :
    IsFiniteKernel (comap κ g hg) := by
  refine' ⟨⟨IsFiniteKernel.bound κ, IsFiniteKernel.bound_lt_top κ, fun a => _⟩⟩
  rw [comap_apply' κ hg a Set.univ]
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
γ : Type u_4
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsFiniteKernel κ
hg : Measurable g
a : γ
⊢ ↑↑(κ (g a)) Set.univ ≤ IsFiniteKernel.bound κ

Next tactic:
exact measure_le_bound κ _ _
@[simp]
lemma prodMkLeft_zero : kernel.prodMkLeft α (0 : kernel β γ) = 0 := by
  

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
δ : Type u_4
mδ : MeasurableSpace δ
γ : Type u_5
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
⊢ prodMkLeft α 0 = 0

Next tactic:
ext x s _
@[simp]
lemma prodMkLeft_zero : kernel.prodMkLeft α (0 : kernel β γ) = 0 := by
  ext x s _; 

Proof state:
case h.h
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
δ : Type u_4
mδ : MeasurableSpace δ
γ : Type u_5
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
x : α × β
s : Set γ
a✝ : MeasurableSet s
⊢ ↑↑((prodMkLeft α 0) x) s = ↑↑(0 x) s

Next tactic:
simp [kernel.prodMkLeft_apply']
instance IsMarkovKernel.prodMkLeft (κ : kernel α β) [IsMarkovKernel κ] :
    IsMarkovKernel (prodMkLeft γ κ) := by 

Proof state:
α : Type u_1
β : Type u_2
ι : Type u_3
mα : MeasurableSpace α
mβ : MeasurableSpace β
δ : Type u_4
mδ : MeasurableSpace δ
γ : Type u_5
mγ : MeasurableSpace γ
f : β → γ
g : γ → α
κ : ↥(kernel α β)
inst✝ : IsMarkovKernel κ
⊢ IsMarkovKernel (kernel.prodMkLeft γ κ)

Next tactic:
rw [kernel.prodMkLeft]