File: Mathlib/Probability/Kernel/Composition.lean

full_name: ProbabilityTheory.Kernel.compProdFun
code: /-- Auxiliary function for the definition of the composition-product of two kernels.
For all `a : α`, `compProdFun κ η a` is a countably additive function with value zero on the empty
set, and the composition-product of kernels is defined in `Kernel.compProd` through
`Measure.ofMeasurable`. -/
noncomputable def compProdFun (κ : Kernel α β) (η : Kernel (α × β) γ) (a : α) (s : Set (β × γ)) :
    ℝ≥0∞ 
goal: ℝ≥0∞

full_name: ProbabilityTheory.Kernel.compProdFun_empty
code: theorem compProdFun_empty (κ : Kernel α β) (η : Kernel (α × β) γ) (a : α) :
    compProdFun κ η a ∅ = 0 
goal: κ.compProdFun η a ∅ = 0

full_name: ProbabilityTheory.Kernel.compProdFun_iUnion
code: theorem compProdFun_iUnion (κ : Kernel α β) (η : Kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
    (f : ℕ → Set (β × γ)) (hf_meas : ∀ i, MeasurableSet (f i))
    (hf_disj : Pairwise (Disjoint on f)) :
    compProdFun κ η a (⋃ i, f i) = ∑' i, compProdFun κ η a (f i) 
goal: κ.compProdFun η a (⋃ i, f i) = ∑' (i : ℕ), κ.compProdFun η a (f i)

full_name: ProbabilityTheory.Kernel.compProdFun_tsum_right
code: theorem compProdFun_tsum_right (κ : Kernel α β) (η : Kernel (α × β) γ) [IsSFiniteKernel η] (a : α)
    (hs : MeasurableSet s) : compProdFun κ η a s = ∑' n, compProdFun κ (seq η n) a s 
goal: κ.compProdFun η a s = ∑' (n : ℕ), κ.compProdFun (η.seq n) a s

full_name: ProbabilityTheory.Kernel.compProdFun_tsum_left
code: theorem compProdFun_tsum_left (κ : Kernel α β) (η : Kernel (α × β) γ) [IsSFiniteKernel κ] (a : α)
    (s : Set (β × γ)) : compProdFun κ η a s = ∑' n, compProdFun (seq κ n) η a s 
goal: κ.compProdFun η a s = ∑' (n : ℕ), (κ.seq n).compProdFun η a s

full_name: ProbabilityTheory.Kernel.compProdFun_eq_tsum
code: theorem compProdFun_eq_tsum (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    compProdFun κ η a s = ∑' (n) (m), compProdFun (seq κ n) (seq η m) a s 
goal: κ.compProdFun η a s = ∑' (n : ℕ) (m : ℕ), (κ.seq n).compProdFun (η.seq m) a s

full_name: ProbabilityTheory.Kernel.measurable_compProdFun_of_finite
code: /-- Auxiliary lemma for `measurable_compProdFun`. -/
theorem measurable_compProdFun_of_finite (κ : Kernel α β) [IsFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsFiniteKernel η] (hs : MeasurableSet s) : Measurable fun a => compProdFun κ η a s 
goal: Measurable fun a => κ.compProdFun η a s

full_name: ProbabilityTheory.Kernel.measurable_compProdFun
code: theorem measurable_compProdFun (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (hs : MeasurableSet s) : Measurable fun a => compProdFun κ η a s 
goal: Measurable fun a => κ.compProdFun η a s

full_name: ProbabilityTheory.Kernel.compProd
code: /-- 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 α (β × γ) 
goal: ProbabilityTheory.Kernel α (β × γ)

full_name: ProbabilityTheory.«_aux_Mathlib_Probability_Kernel_Composition___macroRules_ProbabilityTheory_term_⊗ₖ__1»
code: scoped[ProbabilityTheory] infixl:100 " ⊗ₖ " => ProbabilityTheory.Kernel.compProd
goal: Lean.Macro

full_name: ProbabilityTheory._aux_Mathlib_Probability_Kernel_Composition___unexpand_ProbabilityTheory_Kernel_compProd_1
code: scoped[ProbabilityTheory] infixl:100 " ⊗ₖ " => ProbabilityTheory.Kernel.compProd
goal: Lean.PrettyPrinter.Unexpander

full_name: ProbabilityTheory.Kernel.compProd_apply_eq_compProdFun
code: theorem compProd_apply_eq_compProdFun (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = compProdFun κ η a s 
goal: ((κ.compProd η) a) s = κ.compProdFun η a s

full_name: ProbabilityTheory.Kernel.compProd_of_not_isSFiniteKernel_left
code: theorem compProd_of_not_isSFiniteKernel_left (κ : Kernel α β) (η : Kernel (α × β) γ)
    (h : ¬ IsSFiniteKernel κ) :
    κ ⊗ₖ η = 0 
goal: κ.compProd η = 0

full_name: ProbabilityTheory.Kernel.compProd_of_not_isSFiniteKernel_right
code: theorem compProd_of_not_isSFiniteKernel_right (κ : Kernel α β) (η : Kernel (α × β) γ)
    (h : ¬ IsSFiniteKernel η) :
    κ ⊗ₖ η = 0 
goal: κ.compProd η = 0

full_name: ProbabilityTheory.Kernel.compProd_apply
code: theorem compProd_apply (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a 
goal: ((κ.compProd η) a) s = ∫⁻ (b : β), (η (a, b)) {c | (b, c) ∈ s} ∂κ a

full_name: ProbabilityTheory.Kernel.le_compProd_apply
code: theorem le_compProd_apply (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (s : Set (β × γ)) :
    ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a ≤ (κ ⊗ₖ η) a s 
goal: ∫⁻ (b : β), (η (a, b)) {c | (b, c) ∈ s} ∂κ a ≤ ((κ.compProd η) a) s

full_name: ProbabilityTheory.Kernel.compProd_zero_left
code: @[simp]
lemma compProd_zero_left (κ : Kernel (α × β) γ) :
    (0 : Kernel α β) ⊗ₖ κ = 0 
goal: ProbabilityTheory.Kernel.compProd 0 κ = 0

full_name: ProbabilityTheory.Kernel.compProd_zero_right
code: @[simp]
lemma compProd_zero_right (κ : Kernel α β) (γ : Type*) [MeasurableSpace γ] :
    κ ⊗ₖ (0 : Kernel (α × β) γ) = 0 
goal: κ.compProd 0 = 0

full_name: ProbabilityTheory.Kernel.ae_kernel_lt_top
code: theorem ae_kernel_lt_top (a : α) (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
    ∀ᵐ b ∂κ a, η (a, b) (Prod.mk b ⁻¹' s) < ∞ 
goal: ∀ᵐ (b : β) ∂κ a, (η (a, b)) (Prod.mk b ⁻¹' s) < ⊤

full_name: ProbabilityTheory.Kernel.compProd_null
code: theorem compProd_null (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = 0 ↔ (fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 
goal: ((κ.compProd η) a) s = 0 ↔ (fun b => (η (a, b)) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0

full_name: ProbabilityTheory.Kernel.ae_null_of_compProd_null
code: theorem ae_null_of_compProd_null (h : (κ ⊗ₖ η) a s = 0) :
    (fun b => η (a, b) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0 
goal: (fun b => (η (a, b)) (Prod.mk b ⁻¹' s)) =ᵐ[κ a] 0

full_name: ProbabilityTheory.Kernel.ae_ae_of_ae_compProd
code: theorem ae_ae_of_ae_compProd {p : β × γ → Prop} (h : ∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) :
    ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c) 
goal: ∀ᵐ (b : β) ∂κ a, ∀ᵐ (c : γ) ∂η (a, b), p (b, c)

full_name: ProbabilityTheory.Kernel.ae_compProd_of_ae_ae
code: lemma ae_compProd_of_ae_ae {p : β × γ → Prop} (hp : MeasurableSet {x | p x})
    (h : ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c)) :
    ∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc 
goal: ∀ᵐ (bc : β × γ) ∂(κ.compProd η) a, p bc

full_name: ProbabilityTheory.Kernel.ae_compProd_iff
code: lemma ae_compProd_iff {p : β × γ → Prop} (hp : MeasurableSet {x | p x}) :
    (∀ᵐ bc ∂(κ ⊗ₖ η) a, p bc) ↔ ∀ᵐ b ∂κ a, ∀ᵐ c ∂η (a, b), p (b, c) 
goal: (∀ᵐ (bc : β × γ) ∂(κ.compProd η) a, p bc) ↔ ∀ᵐ (b : β) ∂κ a, ∀ᵐ (c : γ) ∂η (a, b), p (b, c)

full_name: ProbabilityTheory.Kernel.compProd_restrict
code: theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht : MeasurableSet t) :
    Kernel.restrict κ hs ⊗ₖ Kernel.restrict η ht = Kernel.restrict (κ ⊗ₖ η) (hs.prod ht) 
goal: (κ.restrict hs).compProd (η.restrict ht) = (κ.compProd η).restrict ⋯

full_name: ProbabilityTheory.Kernel.compProd_restrict_left
code: theorem compProd_restrict_left {s : Set β} (hs : MeasurableSet s) :
    Kernel.restrict κ hs ⊗ₖ η = Kernel.restrict (κ ⊗ₖ η) (hs.prod MeasurableSet.univ) 
goal: (κ.restrict hs).compProd η = (κ.compProd η).restrict ⋯

full_name: ProbabilityTheory.Kernel.compProd_restrict_right
code: theorem compProd_restrict_right {t : Set γ} (ht : MeasurableSet t) :
    κ ⊗ₖ Kernel.restrict η ht = Kernel.restrict (κ ⊗ₖ η) (MeasurableSet.univ.prod ht) 
goal: κ.compProd (η.restrict ht) = (κ.compProd η).restrict ⋯

full_name: ProbabilityTheory.Kernel.lintegral_compProd'
code: /-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_compProd' (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) {f : β → γ → ℝ≥0∞} (hf : Measurable (Function.uncurry f)) :
    ∫⁻ bc, f bc.1 bc.2 ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f b c ∂η (a, b) ∂κ a 
goal: ∫⁻ (bc : β × γ), f bc.1 bc.2 ∂(κ.compProd η) a = ∫⁻ (b : β), ∫⁻ (c : γ), f b c ∂η (a, b) ∂κ a

full_name: ProbabilityTheory.Kernel.lintegral_compProd
code: /-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_compProd (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) :
    ∫⁻ bc, f bc ∂(κ ⊗ₖ η) a = ∫⁻ b, ∫⁻ c, f (b, c) ∂η (a, b) ∂κ a 
goal: ∫⁻ (bc : β × γ), f bc ∂(κ.compProd η) a = ∫⁻ (b : β), ∫⁻ (c : γ), f (b, c) ∂η (a, b) ∂κ a

full_name: ProbabilityTheory.Kernel.lintegral_compProd₀
code: /-- Lebesgue integral against the composition-product of two kernels. -/
theorem lintegral_compProd₀ (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : AEMeasurable f ((κ ⊗ₖ η) a)) :
    ∫⁻ z, f z ∂(κ ⊗ₖ η) a = ∫⁻ x, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a 
goal: ∫⁻ (z : β × γ), f z ∂(κ.compProd η) a = ∫⁻ (x : β), ∫⁻ (y : γ), f (x, y) ∂η (a, x) ∂κ a

full_name: ProbabilityTheory.Kernel.setLIntegral_compProd
code: theorem setLIntegral_compProd (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {s : Set β} {t : Set γ}
    (hs : MeasurableSet s) (ht : MeasurableSet t) :
    ∫⁻ z in s ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫⁻ x in s, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a 
goal: ∫⁻ (z : β × γ) in s ×ˢ t, f z ∂(κ.compProd η) a = ∫⁻ (x : β) in s, ∫⁻ (y : γ) in t, f (x, y) ∂η (a, x) ∂κ a

full_name: ProbabilityTheory.Kernel.setLIntegral_compProd_univ_right
code: theorem setLIntegral_compProd_univ_right (κ : Kernel α β) [IsSFiniteKernel κ]
    (η : Kernel (α × β) γ) [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f)
    {s : Set β} (hs : MeasurableSet s) :
    ∫⁻ z in s ×ˢ Set.univ, f z ∂(κ ⊗ₖ η) a = ∫⁻ x in s, ∫⁻ y, f (x, y) ∂η (a, x) ∂κ a 
goal: ∫⁻ (z : β × γ) in s ×ˢ Set.univ, f z ∂(κ.compProd η) a = ∫⁻ (x : β) in s, ∫⁻ (y : γ), f (x, y) ∂η (a, x) ∂κ a

full_name: ProbabilityTheory.Kernel.setLIntegral_compProd_univ_left
code: theorem setLIntegral_compProd_univ_left (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) {f : β × γ → ℝ≥0∞} (hf : Measurable f) {t : Set γ}
    (ht : MeasurableSet t) :
    ∫⁻ z in Set.univ ×ˢ t, f z ∂(κ ⊗ₖ η) a = ∫⁻ x, ∫⁻ y in t, f (x, y) ∂η (a, x) ∂κ a 
goal: ∫⁻ (z : β × γ) in Set.univ ×ˢ t, f z ∂(κ.compProd η) a = ∫⁻ (x : β), ∫⁻ (y : γ) in t, f (x, y) ∂η (a, x) ∂κ a

full_name: ProbabilityTheory.Kernel.compProd_eq_tsum_compProd
code: theorem compProd_eq_tsum_compProd (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (hs : MeasurableSet s) :
    (κ ⊗ₖ η) a s = ∑' (n : ℕ) (m : ℕ), (seq κ n ⊗ₖ seq η m) a s 
goal: ((κ.compProd η) a) s = ∑' (n : ℕ) (m : ℕ), (((κ.seq n).compProd (η.seq m)) a) s

full_name: ProbabilityTheory.Kernel.compProd_eq_sum_compProd
code: theorem compProd_eq_sum_compProd (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] : κ ⊗ₖ η = Kernel.sum fun n => Kernel.sum fun m => seq κ n ⊗ₖ seq η m 
goal: κ.compProd η = ProbabilityTheory.Kernel.sum fun n => ProbabilityTheory.Kernel.sum fun m => (κ.seq n).compProd (η.seq m)

full_name: ProbabilityTheory.Kernel.compProd_eq_sum_compProd_left
code: theorem compProd_eq_sum_compProd_left (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ) :
    κ ⊗ₖ η = Kernel.sum fun n => seq κ n ⊗ₖ η 
goal: κ.compProd η = ProbabilityTheory.Kernel.sum fun n => (κ.seq n).compProd η

full_name: ProbabilityTheory.Kernel.compProd_eq_sum_compProd_right
code: theorem compProd_eq_sum_compProd_right (κ : Kernel α β) (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] : κ ⊗ₖ η = Kernel.sum fun n => κ ⊗ₖ seq η n 
goal: κ.compProd η = ProbabilityTheory.Kernel.sum fun n => κ.compProd (η.seq n)

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.compProd
code: instance IsMarkovKernel.compProd (κ : Kernel α β) [IsMarkovKernel κ] (η : Kernel (α × β) γ)
    [IsMarkovKernel η] : IsMarkovKernel (κ ⊗ₖ η) 
goal: ProbabilityTheory.IsMarkovKernel (κ.compProd η)

full_name: ProbabilityTheory.Kernel.compProd_apply_univ_le
code: theorem compProd_apply_univ_le (κ : Kernel α β) (η : Kernel (α × β) γ) [IsFiniteKernel η] (a : α) :
    (κ ⊗ₖ η) a Set.univ ≤ κ a Set.univ * IsFiniteKernel.bound η 
goal: ((κ.compProd η) a) Set.univ ≤ (κ a) Set.univ * ProbabilityTheory.IsFiniteKernel.bound η

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.compProd
code: instance IsFiniteKernel.compProd (κ : Kernel α β) [IsFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsFiniteKernel η] : IsFiniteKernel (κ ⊗ₖ η) 
goal: ProbabilityTheory.IsFiniteKernel (κ.compProd η)

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.compProd
code: instance IsSFiniteKernel.compProd (κ : Kernel α β) (η : Kernel (α × β) γ) :
    IsSFiniteKernel (κ ⊗ₖ η) 
goal: ProbabilityTheory.IsSFiniteKernel (κ.compProd η)

full_name: ProbabilityTheory.Kernel.compProd_add_left
code: lemma compProd_add_left (μ κ : Kernel α β) (η : Kernel (α × β) γ)
    [IsSFiniteKernel μ] [IsSFiniteKernel κ] [IsSFiniteKernel η] :
    (μ + κ) ⊗ₖ η = μ ⊗ₖ η + κ ⊗ₖ η 
goal: (μ + κ).compProd η = μ.compProd η + κ.compProd η

full_name: ProbabilityTheory.Kernel.compProd_add_right
code: lemma compProd_add_right (μ : Kernel α β) (κ η : Kernel (α × β) γ)
    [IsSFiniteKernel μ] [IsSFiniteKernel κ] [IsSFiniteKernel η] :
    μ ⊗ₖ (κ + η) = μ ⊗ₖ κ + μ ⊗ₖ η 
goal: μ.compProd (κ + η) = μ.compProd κ + μ.compProd η

full_name: ProbabilityTheory.Kernel.comapRight_compProd_id_prod
code: lemma comapRight_compProd_id_prod {δ : Type*} {mδ : MeasurableSpace δ}
    (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ) [IsSFiniteKernel η]
    {f : δ → γ} (hf : MeasurableEmbedding f) :
    comapRight (κ ⊗ₖ η) (MeasurableEmbedding.id.prod_mk hf) = κ ⊗ₖ (comapRight η hf) 
goal: (κ.compProd η).comapRight ⋯ = κ.compProd (η.comapRight hf)

full_name: ProbabilityTheory.Kernel.map
code: /-- The pushforward of a kernel along a measurable function.
We include measurability in the assumptions instead of using junk values
to make sure that typeclass inference can infer that the `map` of a Markov kernel
is again a Markov kernel. -/
noncomputable def map (κ : Kernel α β) (f : β → γ) (hf : Measurable f) : Kernel α γ 
goal: ProbabilityTheory.Kernel α γ

full_name: ProbabilityTheory.Kernel.map_apply
code: theorem map_apply (κ : Kernel α β) (hf : Measurable f) (a : α) : map κ f hf a = (κ a).map f 
goal: (κ.map f hf) a = MeasureTheory.Measure.map f (κ a)

full_name: ProbabilityTheory.Kernel.map_apply'
code: theorem map_apply' (κ : Kernel α β) (hf : Measurable f) (a : α) {s : Set γ} (hs : MeasurableSet s) :
    map κ f hf a s = κ a (f ⁻¹' s) 
goal: ((κ.map f hf) a) s = (κ a) (f ⁻¹' s)

full_name: ProbabilityTheory.Kernel.map_zero
code: @[simp]
lemma map_zero (hf : Measurable f) : Kernel.map (0 : Kernel α β) f hf = 0 
goal: ProbabilityTheory.Kernel.map 0 f hf = 0

full_name: ProbabilityTheory.Kernel.map_id
code: @[simp]
lemma map_id (κ : Kernel α β) : map κ id measurable_id = κ 
goal: κ.map id ⋯ = κ

full_name: ProbabilityTheory.Kernel.map_id'
code: @[simp]
lemma map_id' (κ : Kernel α β) : map κ (fun a ↦ a) measurable_id = κ 
goal: κ.map (fun a => a) ⋯ = κ

full_name: ProbabilityTheory.Kernel.lintegral_map
code: 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 
goal: ∫⁻ (b : γ), g' b ∂(κ.map f hf) a = ∫⁻ (a : β), g' (f a) ∂κ a

full_name: ProbabilityTheory.Kernel.sum_map_seq
code: theorem sum_map_seq (κ : Kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
    (Kernel.sum fun n => map (seq κ n) f hf) = map κ f hf 
goal: (ProbabilityTheory.Kernel.sum fun n => (κ.seq n).map f hf) = κ.map f hf

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.map
code: instance IsMarkovKernel.map (κ : Kernel α β) [IsMarkovKernel κ] (hf : Measurable f) :
    IsMarkovKernel (map κ f hf) 
goal: ProbabilityTheory.IsMarkovKernel (κ.map f hf)

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.map
code: instance IsFiniteKernel.map (κ : Kernel α β) [IsFiniteKernel κ] (hf : Measurable f) :
    IsFiniteKernel (map κ f hf) 
goal: ProbabilityTheory.IsFiniteKernel (κ.map f hf)

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.map
code: instance IsSFiniteKernel.map (κ : Kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
    IsSFiniteKernel (map κ f hf) 
goal: ProbabilityTheory.IsSFiniteKernel (κ.map f hf)

full_name: ProbabilityTheory.Kernel.map_const
code: @[simp]
lemma map_const (μ : Measure α) {f : α → β} (hf : Measurable f) :
    map (const γ μ) f hf = const γ (μ.map f) 
goal: (ProbabilityTheory.Kernel.const γ μ).map f hf = ProbabilityTheory.Kernel.const γ (MeasureTheory.Measure.map f μ)

full_name: ProbabilityTheory.Kernel.comap
code: /-- Pullback of a kernel, such that for each set s `comap κ g hg c s = κ (g c) s`.
We include measurability in the assumptions instead of using junk values
to make sure that typeclass inference can infer that the `comap` of a Markov kernel
is again a Markov kernel. -/
def comap (κ : Kernel α β) (g : γ → α) (hg : Measurable g) : Kernel γ β 
goal: ProbabilityTheory.Kernel γ β

full_name: ProbabilityTheory.Kernel.comap_apply
code: theorem comap_apply (κ : Kernel α β) (hg : Measurable g) (c : γ) : comap κ g hg c = κ (g c) 
goal: (κ.comap g hg) c = κ (g c)

full_name: ProbabilityTheory.Kernel.comap_apply'
code: theorem comap_apply' (κ : Kernel α β) (hg : Measurable g) (c : γ) (s : Set β) :
    comap κ g hg c s = κ (g c) s 
goal: ((κ.comap g hg) c) s = (κ (g c)) s

full_name: ProbabilityTheory.Kernel.comap_zero
code: @[simp]
lemma comap_zero (hg : Measurable g) : Kernel.comap (0 : Kernel α β) g hg = 0 
goal: ProbabilityTheory.Kernel.comap 0 g hg = 0

full_name: ProbabilityTheory.Kernel.comap_id
code: @[simp]
lemma comap_id (κ : Kernel α β) : comap κ id measurable_id = κ 
goal: κ.comap id ⋯ = κ

full_name: ProbabilityTheory.Kernel.comap_id'
code: @[simp]
lemma comap_id' (κ : Kernel α β) : comap κ (fun a ↦ a) measurable_id = κ 
goal: κ.comap (fun a => a) ⋯ = κ

full_name: ProbabilityTheory.Kernel.lintegral_comap
code: theorem lintegral_comap (κ : Kernel α β) (hg : Measurable g) (c : γ) (g' : β → ℝ≥0∞) :
    ∫⁻ b, g' b ∂comap κ g hg c = ∫⁻ b, g' b ∂κ (g c) 
goal: ∫⁻ (b : β), g' b ∂(κ.comap g hg) c = ∫⁻ (b : β), g' b ∂κ (g c)

full_name: ProbabilityTheory.Kernel.sum_comap_seq
code: theorem sum_comap_seq (κ : Kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
    (Kernel.sum fun n => comap (seq κ n) g hg) = comap κ g hg 
goal: (ProbabilityTheory.Kernel.sum fun n => (κ.seq n).comap g hg) = κ.comap g hg

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.comap
code: instance IsMarkovKernel.comap (κ : Kernel α β) [IsMarkovKernel κ] (hg : Measurable g) :
    IsMarkovKernel (comap κ g hg) 
goal: ProbabilityTheory.IsMarkovKernel (κ.comap g hg)

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.comap
code: instance IsFiniteKernel.comap (κ : Kernel α β) [IsFiniteKernel κ] (hg : Measurable g) :
    IsFiniteKernel (comap κ g hg) 
goal: ProbabilityTheory.IsFiniteKernel (κ.comap g hg)

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.comap
code: instance IsSFiniteKernel.comap (κ : Kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) :
    IsSFiniteKernel (comap κ g hg) 
goal: ProbabilityTheory.IsSFiniteKernel (κ.comap g hg)

full_name: ProbabilityTheory.Kernel.comap_map_comm
code: lemma comap_map_comm (κ : Kernel β γ) {f : α → β} {g : γ → δ}
    (hf : Measurable f) (hg : Measurable g) :
    comap (map κ g hg) f hf = map (comap κ f hf) g hg 
goal: (κ.map g hg).comap f hf = (κ.comap f hf).map g hg

full_name: ProbabilityTheory.Kernel.prodMkLeft
code: /-- Define a `Kernel (γ × α) β` from a `Kernel α β` by taking the comap of the projection. -/
def prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : Kernel α β) : Kernel (γ × α) β 
goal: ProbabilityTheory.Kernel (γ × α) β

full_name: ProbabilityTheory.Kernel.prodMkRight
code: /-- Define a `Kernel (α × γ) β` from a `Kernel α β` by taking the comap of the projection. -/
def prodMkRight (γ : Type*) [MeasurableSpace γ] (κ : Kernel α β) : Kernel (α × γ) β 
goal: ProbabilityTheory.Kernel (α × γ) β

full_name: ProbabilityTheory.Kernel.prodMkLeft_apply
code: @[simp]
theorem prodMkLeft_apply (κ : Kernel α β) (ca : γ × α) : prodMkLeft γ κ ca = κ ca.snd 
goal: (ProbabilityTheory.Kernel.prodMkLeft γ κ) ca = κ ca.2

full_name: ProbabilityTheory.Kernel.prodMkRight_apply
code: @[simp]
theorem prodMkRight_apply (κ : Kernel α β) (ca : α × γ) : prodMkRight γ κ ca = κ ca.fst 
goal: (ProbabilityTheory.Kernel.prodMkRight γ κ) ca = κ ca.1

full_name: ProbabilityTheory.Kernel.prodMkLeft_apply'
code: theorem prodMkLeft_apply' (κ : Kernel α β) (ca : γ × α) (s : Set β) :
    prodMkLeft γ κ ca s = κ ca.snd s 
goal: ((ProbabilityTheory.Kernel.prodMkLeft γ κ) ca) s = (κ ca.2) s

full_name: ProbabilityTheory.Kernel.prodMkRight_apply'
code: theorem prodMkRight_apply' (κ : Kernel α β) (ca : α × γ) (s : Set β) :
    prodMkRight γ κ ca s = κ ca.fst s 
goal: ((ProbabilityTheory.Kernel.prodMkRight γ κ) ca) s = (κ ca.1) s

full_name: ProbabilityTheory.Kernel.prodMkLeft_zero
code: @[simp]
lemma prodMkLeft_zero : Kernel.prodMkLeft α (0 : Kernel β γ) = 0 
goal: ProbabilityTheory.Kernel.prodMkLeft α 0 = 0

full_name: ProbabilityTheory.Kernel.prodMkRight_zero
code: @[simp]
lemma prodMkRight_zero : Kernel.prodMkRight α (0 : Kernel β γ) = 0 
goal: ProbabilityTheory.Kernel.prodMkRight α 0 = 0

full_name: ProbabilityTheory.Kernel.prodMkLeft_add
code: @[simp]
lemma prodMkLeft_add (κ η : Kernel α β) :
    prodMkLeft γ (κ + η) = prodMkLeft γ κ + prodMkLeft γ η 
goal: ProbabilityTheory.Kernel.prodMkLeft γ (κ + η) =
  ProbabilityTheory.Kernel.prodMkLeft γ κ + ProbabilityTheory.Kernel.prodMkLeft γ η

full_name: ProbabilityTheory.Kernel.prodMkRight_add
code: @[simp]
lemma prodMkRight_add (κ η : Kernel α β) :
    prodMkRight γ (κ + η) = prodMkRight γ κ + prodMkRight γ η 
goal: ProbabilityTheory.Kernel.prodMkRight γ (κ + η) =
  ProbabilityTheory.Kernel.prodMkRight γ κ + ProbabilityTheory.Kernel.prodMkRight γ η

full_name: ProbabilityTheory.Kernel.lintegral_prodMkLeft
code: theorem lintegral_prodMkLeft (κ : Kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) :
    ∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd 
goal: ∫⁻ (b : β), g b ∂(ProbabilityTheory.Kernel.prodMkLeft γ κ) ca = ∫⁻ (b : β), g b ∂κ ca.2

full_name: ProbabilityTheory.Kernel.lintegral_prodMkRight
code: theorem lintegral_prodMkRight (κ : Kernel α β) (ca : α × γ) (g : β → ℝ≥0∞) :
    ∫⁻ b, g b ∂prodMkRight γ κ ca = ∫⁻ b, g b ∂κ ca.fst 
goal: ∫⁻ (b : β), g b ∂(ProbabilityTheory.Kernel.prodMkRight γ κ) ca = ∫⁻ (b : β), g b ∂κ ca.1

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.prodMkLeft
code: instance IsMarkovKernel.prodMkLeft (κ : Kernel α β) [IsMarkovKernel κ] :
    IsMarkovKernel (prodMkLeft γ κ) 
goal: ProbabilityTheory.IsMarkovKernel (ProbabilityTheory.Kernel.prodMkLeft γ κ)

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.prodMkRight
code: instance IsMarkovKernel.prodMkRight (κ : Kernel α β) [IsMarkovKernel κ] :
    IsMarkovKernel (prodMkRight γ κ) 
goal: ProbabilityTheory.IsMarkovKernel (ProbabilityTheory.Kernel.prodMkRight γ κ)

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.prodMkLeft
code: instance IsFiniteKernel.prodMkLeft (κ : Kernel α β) [IsFiniteKernel κ] :
    IsFiniteKernel (prodMkLeft γ κ) 
goal: ProbabilityTheory.IsFiniteKernel (ProbabilityTheory.Kernel.prodMkLeft γ κ)

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.prodMkRight
code: instance IsFiniteKernel.prodMkRight (κ : Kernel α β) [IsFiniteKernel κ] :
    IsFiniteKernel (prodMkRight γ κ) 
goal: ProbabilityTheory.IsFiniteKernel (ProbabilityTheory.Kernel.prodMkRight γ κ)

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.prodMkLeft
code: instance IsSFiniteKernel.prodMkLeft (κ : Kernel α β) [IsSFiniteKernel κ] :
    IsSFiniteKernel (prodMkLeft γ κ) 
goal: ProbabilityTheory.IsSFiniteKernel (ProbabilityTheory.Kernel.prodMkLeft γ κ)

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.prodMkRight
code: instance IsSFiniteKernel.prodMkRight (κ : Kernel α β) [IsSFiniteKernel κ] :
    IsSFiniteKernel (prodMkRight γ κ) 
goal: ProbabilityTheory.IsSFiniteKernel (ProbabilityTheory.Kernel.prodMkRight γ κ)

full_name: ProbabilityTheory.Kernel.isSFiniteKernel_prodMkLeft_unit
code: lemma isSFiniteKernel_prodMkLeft_unit {κ : Kernel α β} :
    IsSFiniteKernel (prodMkLeft Unit κ) ↔ IsSFiniteKernel κ 
goal: ProbabilityTheory.IsSFiniteKernel (ProbabilityTheory.Kernel.prodMkLeft Unit κ) ↔ ProbabilityTheory.IsSFiniteKernel κ

full_name: ProbabilityTheory.Kernel.isSFiniteKernel_prodMkRight_unit
code: lemma isSFiniteKernel_prodMkRight_unit {κ : Kernel α β} :
    IsSFiniteKernel (prodMkRight Unit κ) ↔ IsSFiniteKernel κ 
goal: ProbabilityTheory.IsSFiniteKernel (ProbabilityTheory.Kernel.prodMkRight Unit κ) ↔ ProbabilityTheory.IsSFiniteKernel κ

full_name: ProbabilityTheory.Kernel.map_prodMkLeft
code: lemma map_prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : Kernel α β)
    {f : β → δ} (hf : Measurable f) :
    map (prodMkLeft γ κ) f hf = prodMkLeft γ (map κ f hf) 
goal: (ProbabilityTheory.Kernel.prodMkLeft γ κ).map f hf = ProbabilityTheory.Kernel.prodMkLeft γ (κ.map f hf)

full_name: ProbabilityTheory.Kernel.map_prodMkRight
code: lemma map_prodMkRight (κ : Kernel α β) (γ : Type*) [MeasurableSpace γ]
    {f : β → δ} (hf : Measurable f) :
    map (prodMkRight γ κ) f hf = prodMkRight γ (map κ f hf) 
goal: (ProbabilityTheory.Kernel.prodMkRight γ κ).map f hf = ProbabilityTheory.Kernel.prodMkRight γ (κ.map f hf)

full_name: ProbabilityTheory.Kernel.swapLeft
code: /-- Define a `Kernel (β × α) γ` from a `Kernel (α × β) γ` by taking the comap of `Prod.swap`. -/
def swapLeft (κ : Kernel (α × β) γ) : Kernel (β × α) γ 
goal: ProbabilityTheory.Kernel (β × α) γ

full_name: ProbabilityTheory.Kernel.swapLeft_apply
code: @[simp]
theorem swapLeft_apply (κ : Kernel (α × β) γ) (a : β × α) : swapLeft κ a = κ a.swap 
goal: κ.swapLeft a = κ a.swap

full_name: ProbabilityTheory.Kernel.swapLeft_apply'
code: theorem swapLeft_apply' (κ : Kernel (α × β) γ) (a : β × α) (s : Set γ) :
    swapLeft κ a s = κ a.swap s 
goal: (κ.swapLeft a) s = (κ a.swap) s

full_name: ProbabilityTheory.Kernel.lintegral_swapLeft
code: theorem lintegral_swapLeft (κ : Kernel (α × β) γ) (a : β × α) (g : γ → ℝ≥0∞) :
    ∫⁻ c, g c ∂swapLeft κ a = ∫⁻ c, g c ∂κ a.swap 
goal: ∫⁻ (c : γ), g c ∂κ.swapLeft a = ∫⁻ (c : γ), g c ∂κ a.swap

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.swapLeft
code: instance IsMarkovKernel.swapLeft (κ : Kernel (α × β) γ) [IsMarkovKernel κ] :
    IsMarkovKernel (swapLeft κ) 
goal: ProbabilityTheory.IsMarkovKernel κ.swapLeft

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.swapLeft
code: instance IsFiniteKernel.swapLeft (κ : Kernel (α × β) γ) [IsFiniteKernel κ] :
    IsFiniteKernel (swapLeft κ) 
goal: ProbabilityTheory.IsFiniteKernel κ.swapLeft

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.swapLeft
code: instance IsSFiniteKernel.swapLeft (κ : Kernel (α × β) γ) [IsSFiniteKernel κ] :
    IsSFiniteKernel (swapLeft κ) 
goal: ProbabilityTheory.IsSFiniteKernel κ.swapLeft

full_name: ProbabilityTheory.Kernel.swapLeft_prodMkLeft
code: @[simp] lemma swapLeft_prodMkLeft (κ : Kernel α β) (γ : Type*) [MeasurableSpace γ] :
    swapLeft (prodMkLeft γ κ) = prodMkRight γ κ 
goal: (ProbabilityTheory.Kernel.prodMkLeft γ κ).swapLeft = ProbabilityTheory.Kernel.prodMkRight γ κ

full_name: ProbabilityTheory.Kernel.swapLeft_prodMkRight
code: @[simp] lemma swapLeft_prodMkRight (κ : Kernel α β) (γ : Type*) [MeasurableSpace γ] :
    swapLeft (prodMkRight γ κ) = prodMkLeft γ κ 
goal: (ProbabilityTheory.Kernel.prodMkRight γ κ).swapLeft = ProbabilityTheory.Kernel.prodMkLeft γ κ

full_name: ProbabilityTheory.Kernel.swapRight
code: /-- Define a `Kernel α (γ × β)` from a `Kernel α (β × γ)` by taking the map of `Prod.swap`. -/
noncomputable def swapRight (κ : Kernel α (β × γ)) : Kernel α (γ × β) 
goal: ProbabilityTheory.Kernel α (γ × β)

full_name: ProbabilityTheory.Kernel.swapRight_apply
code: theorem swapRight_apply (κ : Kernel α (β × γ)) (a : α) : swapRight κ a = (κ a).map Prod.swap 
goal: κ.swapRight a = MeasureTheory.Measure.map Prod.swap (κ a)

full_name: ProbabilityTheory.Kernel.swapRight_apply'
code: theorem swapRight_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set (γ × β)} (hs : MeasurableSet s) :
    swapRight κ a s = κ a {p | p.swap ∈ s} 
goal: (κ.swapRight a) s = (κ a) {p | p.swap ∈ s}

full_name: ProbabilityTheory.Kernel.lintegral_swapRight
code: theorem lintegral_swapRight (κ : Kernel α (β × γ)) (a : α) {g : γ × β → ℝ≥0∞} (hg : Measurable g) :
    ∫⁻ c, g c ∂swapRight κ a = ∫⁻ bc : β × γ, g bc.swap ∂κ a 
goal: ∫⁻ (c : γ × β), g c ∂κ.swapRight a = ∫⁻ (bc : β × γ), g bc.swap ∂κ a

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.swapRight
code: instance IsMarkovKernel.swapRight (κ : Kernel α (β × γ)) [IsMarkovKernel κ] :
    IsMarkovKernel (swapRight κ) 
goal: ProbabilityTheory.IsMarkovKernel κ.swapRight

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.swapRight
code: instance IsFiniteKernel.swapRight (κ : Kernel α (β × γ)) [IsFiniteKernel κ] :
    IsFiniteKernel (swapRight κ) 
goal: ProbabilityTheory.IsFiniteKernel κ.swapRight

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.swapRight
code: instance IsSFiniteKernel.swapRight (κ : Kernel α (β × γ)) [IsSFiniteKernel κ] :
    IsSFiniteKernel (swapRight κ) 
goal: ProbabilityTheory.IsSFiniteKernel κ.swapRight

full_name: ProbabilityTheory.Kernel.fst
code: /-- Define a `Kernel α β` from a `Kernel α (β × γ)` by taking the map of the first projection. -/
noncomputable def fst (κ : Kernel α (β × γ)) : Kernel α β 
goal: ProbabilityTheory.Kernel α β

full_name: ProbabilityTheory.Kernel.fst_apply
code: theorem fst_apply (κ : Kernel α (β × γ)) (a : α) : fst κ a = (κ a).map Prod.fst 
goal: κ.fst a = MeasureTheory.Measure.map Prod.fst (κ a)

full_name: ProbabilityTheory.Kernel.fst_apply'
code: theorem fst_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set β} (hs : MeasurableSet s) :
    fst κ a s = κ a {p | p.1 ∈ s} 
goal: (κ.fst a) s = (κ a) {p | p.1 ∈ s}

full_name: ProbabilityTheory.Kernel.fst_zero
code: @[simp]
lemma fst_zero : fst (0 : Kernel α (β × γ)) = 0 
goal: ProbabilityTheory.Kernel.fst 0 = 0

full_name: ProbabilityTheory.Kernel.lintegral_fst
code: theorem lintegral_fst (κ : Kernel α (β × γ)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) :
    ∫⁻ c, g c ∂fst κ a = ∫⁻ bc : β × γ, g bc.fst ∂κ a 
goal: ∫⁻ (c : β), g c ∂κ.fst a = ∫⁻ (bc : β × γ), g bc.1 ∂κ a

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.fst
code: instance IsMarkovKernel.fst (κ : Kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (fst κ) 
goal: ProbabilityTheory.IsMarkovKernel κ.fst

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.fst
code: instance IsFiniteKernel.fst (κ : Kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (fst κ) 
goal: ProbabilityTheory.IsFiniteKernel κ.fst

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.fst
code: instance IsSFiniteKernel.fst (κ : Kernel α (β × γ)) [IsSFiniteKernel κ] :
    IsSFiniteKernel (fst κ) 
goal: ProbabilityTheory.IsSFiniteKernel κ.fst

full_name: ProbabilityTheory.Kernel.isFiniteKernel_of_isFiniteKernel_fst
code: instance (priority := 100) isFiniteKernel_of_isFiniteKernel_fst {κ : Kernel α (β × γ)}
    [h : IsFiniteKernel (fst κ)] :
    IsFiniteKernel κ 
goal: ProbabilityTheory.IsFiniteKernel κ

full_name: ProbabilityTheory.Kernel.fst_map_prod
code: lemma fst_map_prod (κ : Kernel α β) {f : β → γ} {g : β → δ}
    (hf : Measurable f) (hg : Measurable g) :
    fst (map κ (fun x ↦ (f x, g x)) (hf.prod_mk hg)) = map κ f hf 
goal: (κ.map (fun x => (f x, g x)) ⋯).fst = κ.map f hf

full_name: ProbabilityTheory.Kernel.fst_map_id_prod
code: lemma fst_map_id_prod (κ : Kernel α β) {γ : Type*} {mγ : MeasurableSpace γ}
    {f : β → γ} (hf : Measurable f) :
    fst (map κ (fun a ↦ (a, f a)) (measurable_id.prod_mk hf)) = κ 
goal: (κ.map (fun a => (a, f a)) ⋯).fst = κ

full_name: ProbabilityTheory.Kernel.fst_compProd
code: @[simp]
lemma fst_compProd (κ : Kernel α β) (η : Kernel (α × β) γ) [IsSFiniteKernel κ] [IsMarkovKernel η] :
    fst (κ ⊗ₖ η) = κ 
goal: (κ.compProd η).fst = κ

full_name: ProbabilityTheory.Kernel.fst_prodMkLeft
code: lemma fst_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : Kernel α (β × γ)) :
    fst (prodMkLeft δ κ) = prodMkLeft δ (fst κ) 
goal: (ProbabilityTheory.Kernel.prodMkLeft δ κ).fst = ProbabilityTheory.Kernel.prodMkLeft δ κ.fst

full_name: ProbabilityTheory.Kernel.fst_prodMkRight
code: lemma fst_prodMkRight (κ : Kernel α (β × γ)) (δ : Type*) [MeasurableSpace δ] :
    fst (prodMkRight δ κ) = prodMkRight δ (fst κ) 
goal: (ProbabilityTheory.Kernel.prodMkRight δ κ).fst = ProbabilityTheory.Kernel.prodMkRight δ κ.fst

full_name: ProbabilityTheory.Kernel.snd
code: /-- Define a `Kernel α γ` from a `Kernel α (β × γ)` by taking the map of the second projection. -/
noncomputable def snd (κ : Kernel α (β × γ)) : Kernel α γ 
goal: ProbabilityTheory.Kernel α γ

full_name: ProbabilityTheory.Kernel.snd_apply
code: theorem snd_apply (κ : Kernel α (β × γ)) (a : α) : snd κ a = (κ a).map Prod.snd 
goal: κ.snd a = MeasureTheory.Measure.map Prod.snd (κ a)

full_name: ProbabilityTheory.Kernel.snd_apply'
code: theorem snd_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set γ} (hs : MeasurableSet s) :
    snd κ a s = κ a {p | p.2 ∈ s} 
goal: (κ.snd a) s = (κ a) {p | p.2 ∈ s}

full_name: ProbabilityTheory.Kernel.snd_zero
code: @[simp]
lemma snd_zero : snd (0 : Kernel α (β × γ)) = 0 
goal: ProbabilityTheory.Kernel.snd 0 = 0

full_name: ProbabilityTheory.Kernel.lintegral_snd
code: theorem lintegral_snd (κ : Kernel α (β × γ)) (a : α) {g : γ → ℝ≥0∞} (hg : Measurable g) :
    ∫⁻ c, g c ∂snd κ a = ∫⁻ bc : β × γ, g bc.snd ∂κ a 
goal: ∫⁻ (c : γ), g c ∂κ.snd a = ∫⁻ (bc : β × γ), g bc.2 ∂κ a

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.snd
code: instance IsMarkovKernel.snd (κ : Kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (snd κ) 
goal: ProbabilityTheory.IsMarkovKernel κ.snd

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.snd
code: instance IsFiniteKernel.snd (κ : Kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (snd κ) 
goal: ProbabilityTheory.IsFiniteKernel κ.snd

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.snd
code: instance IsSFiniteKernel.snd (κ : Kernel α (β × γ)) [IsSFiniteKernel κ] :
    IsSFiniteKernel (snd κ) 
goal: ProbabilityTheory.IsSFiniteKernel κ.snd

full_name: ProbabilityTheory.Kernel.isFiniteKernel_of_isFiniteKernel_snd
code: instance (priority := 100) isFiniteKernel_of_isFiniteKernel_snd {κ : Kernel α (β × γ)}
    [h : IsFiniteKernel (snd κ)] :
    IsFiniteKernel κ 
goal: ProbabilityTheory.IsFiniteKernel κ

full_name: ProbabilityTheory.Kernel.snd_map_prod
code: lemma snd_map_prod (κ : Kernel α β) {f : β → γ} {g : β → δ}
    (hf : Measurable f) (hg : Measurable g) :
    snd (map κ (fun x ↦ (f x, g x)) (hf.prod_mk hg)) = map κ g hg 
goal: (κ.map (fun x => (f x, g x)) ⋯).snd = κ.map g hg

full_name: ProbabilityTheory.Kernel.snd_map_prod_id
code: lemma snd_map_prod_id (κ : Kernel α β) {γ : Type*} {mγ : MeasurableSpace γ}
    {f : β → γ} (hf : Measurable f) :
    snd (map κ (fun a ↦ (f a, a)) (hf.prod_mk measurable_id)) = κ 
goal: (κ.map (fun a => (f a, a)) ⋯).snd = κ

full_name: ProbabilityTheory.Kernel.snd_prodMkLeft
code: lemma snd_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : Kernel α (β × γ)) :
    snd (prodMkLeft δ κ) = prodMkLeft δ (snd κ) 
goal: (ProbabilityTheory.Kernel.prodMkLeft δ κ).snd = ProbabilityTheory.Kernel.prodMkLeft δ κ.snd

full_name: ProbabilityTheory.Kernel.snd_prodMkRight
code: lemma snd_prodMkRight (κ : Kernel α (β × γ)) (δ : Type*) [MeasurableSpace δ] :
    snd (prodMkRight δ κ) = prodMkRight δ (snd κ) 
goal: (ProbabilityTheory.Kernel.prodMkRight δ κ).snd = ProbabilityTheory.Kernel.prodMkRight δ κ.snd

full_name: ProbabilityTheory.Kernel.fst_swapRight
code: @[simp]
lemma fst_swapRight (κ : Kernel α (β × γ)) : fst (swapRight κ) = snd κ 
goal: κ.swapRight.fst = κ.snd

full_name: ProbabilityTheory.Kernel.snd_swapRight
code: @[simp]
lemma snd_swapRight (κ : Kernel α (β × γ)) : snd (swapRight κ) = fst κ 
goal: κ.swapRight.snd = κ.fst

full_name: ProbabilityTheory.Kernel.comp
code: /-- Composition of two kernels. -/
noncomputable def comp (η : Kernel β γ) (κ : Kernel α β) : Kernel α γ 
goal: ProbabilityTheory.Kernel α γ

full_name: ProbabilityTheory.«_aux_Mathlib_Probability_Kernel_Composition___macroRules_ProbabilityTheory_term_∘ₖ__1»
code: scoped[ProbabilityTheory] infixl:100 " ∘ₖ " => ProbabilityTheory.Kernel.comp
goal: Lean.Macro

full_name: ProbabilityTheory._aux_Mathlib_Probability_Kernel_Composition___unexpand_ProbabilityTheory_Kernel_comp_1
code: scoped[ProbabilityTheory] infixl:100 " ∘ₖ " => ProbabilityTheory.Kernel.comp
goal: Lean.PrettyPrinter.Unexpander

full_name: ProbabilityTheory.Kernel.comp_apply
code: theorem comp_apply (η : Kernel β γ) (κ : Kernel α β) (a : α) : (η ∘ₖ κ) a = (κ a).bind η 
goal: (η.comp κ) a = (κ a).bind ⇑η

full_name: ProbabilityTheory.Kernel.comp_apply'
code: theorem comp_apply' (η : Kernel β γ) (κ : Kernel α β) (a : α) {s : Set γ} (hs : MeasurableSet s) :
    (η ∘ₖ κ) a s = ∫⁻ b, η b s ∂κ a 
goal: ((η.comp κ) a) s = ∫⁻ (b : β), (η b) s ∂κ a

full_name: ProbabilityTheory.Kernel.comp_eq_snd_compProd
code: theorem comp_eq_snd_compProd (η : Kernel β γ) [IsSFiniteKernel η] (κ : Kernel α β)
    [IsSFiniteKernel κ] : η ∘ₖ κ = snd (κ ⊗ₖ prodMkLeft α η) 
goal: η.comp κ = (κ.compProd (ProbabilityTheory.Kernel.prodMkLeft α η)).snd

full_name: ProbabilityTheory.Kernel.lintegral_comp
code: theorem lintegral_comp (η : Kernel β γ) (κ : Kernel α β) (a : α) {g : γ → ℝ≥0∞}
    (hg : Measurable g) : ∫⁻ c, g c ∂(η ∘ₖ κ) a = ∫⁻ b, ∫⁻ c, g c ∂η b ∂κ a 
goal: ∫⁻ (c : γ), g c ∂(η.comp κ) a = ∫⁻ (b : β), ∫⁻ (c : γ), g c ∂η b ∂κ a

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.comp
code: instance IsMarkovKernel.comp (η : Kernel β γ) [IsMarkovKernel η] (κ : Kernel α β)
    [IsMarkovKernel κ] : IsMarkovKernel (η ∘ₖ κ) 
goal: ProbabilityTheory.IsMarkovKernel (η.comp κ)

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.comp
code: instance IsFiniteKernel.comp (η : Kernel β γ) [IsFiniteKernel η] (κ : Kernel α β)
    [IsFiniteKernel κ] : IsFiniteKernel (η ∘ₖ κ) 
goal: ProbabilityTheory.IsFiniteKernel (η.comp κ)

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.comp
code: instance IsSFiniteKernel.comp (η : Kernel β γ) [IsSFiniteKernel η] (κ : Kernel α β)
    [IsSFiniteKernel κ] : IsSFiniteKernel (η ∘ₖ κ) 
goal: ProbabilityTheory.IsSFiniteKernel (η.comp κ)

full_name: ProbabilityTheory.Kernel.comp_assoc
code: /-- Composition of kernels is associative. -/
theorem comp_assoc {δ : Type*} {mδ : MeasurableSpace δ} (ξ : Kernel γ δ) [IsSFiniteKernel ξ]
    (η : Kernel β γ) (κ : Kernel α β) : ξ ∘ₖ η ∘ₖ κ = ξ ∘ₖ (η ∘ₖ κ) 
goal: (ξ.comp η).comp κ = ξ.comp (η.comp κ)

full_name: ProbabilityTheory.Kernel.deterministic_comp_eq_map
code: theorem deterministic_comp_eq_map (hf : Measurable f) (κ : Kernel α β) :
    deterministic f hf ∘ₖ κ = map κ f hf 
goal: (ProbabilityTheory.Kernel.deterministic f hf).comp κ = κ.map f hf

full_name: ProbabilityTheory.Kernel.comp_deterministic_eq_comap
code: theorem comp_deterministic_eq_comap (κ : Kernel α β) (hg : Measurable g) :
    κ ∘ₖ deterministic g hg = comap κ g hg 
goal: κ.comp (ProbabilityTheory.Kernel.deterministic g hg) = κ.comap g hg

full_name: ProbabilityTheory.Kernel.prod
code: /-- Product of two kernels. This is meaningful only when the kernels are s-finite. -/
noncomputable def prod (κ : Kernel α β) (η : Kernel α γ) : Kernel α (β × γ) 
goal: ProbabilityTheory.Kernel α (β × γ)

full_name: ProbabilityTheory._aux_Mathlib_Probability_Kernel_Composition___unexpand_ProbabilityTheory_Kernel_prod_1
code: scoped[ProbabilityTheory] infixl:100 " ×ₖ " => ProbabilityTheory.Kernel.prod
goal: Lean.PrettyPrinter.Unexpander

full_name: ProbabilityTheory.«_aux_Mathlib_Probability_Kernel_Composition___macroRules_ProbabilityTheory_term_×ₖ__1»
code: scoped[ProbabilityTheory] infixl:100 " ×ₖ " => ProbabilityTheory.Kernel.prod
goal: Lean.Macro

full_name: ProbabilityTheory.Kernel.prod_apply'
code: theorem prod_apply' (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel α γ) [IsSFiniteKernel η]
    (a : α) {s : Set (β × γ)} (hs : MeasurableSet s) :
    (κ ×ₖ η) a s = ∫⁻ b : β, (η a) {c : γ | (b, c) ∈ s} ∂κ a 
goal: ((κ.prod η) a) s = ∫⁻ (b : β), (η a) {c | (b, c) ∈ s} ∂κ a

full_name: ProbabilityTheory.Kernel.prod_apply
code: lemma prod_apply (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel α γ) [IsSFiniteKernel η]
    (a : α) :
    (κ ×ₖ η) a = (κ a).prod (η a) 
goal: (κ.prod η) a = (κ a).prod (η a)

full_name: ProbabilityTheory.Kernel.prod_const
code: lemma prod_const (μ : Measure β) [SFinite μ] (ν : Measure γ) [SFinite ν] :
    const α μ ×ₖ const α ν = const α (μ.prod ν) 
goal: (ProbabilityTheory.Kernel.const α μ).prod (ProbabilityTheory.Kernel.const α ν) =
  ProbabilityTheory.Kernel.const α (μ.prod ν)

full_name: ProbabilityTheory.Kernel.lintegral_prod
code: theorem lintegral_prod (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel α γ) [IsSFiniteKernel η]
    (a : α) {g : β × γ → ℝ≥0∞} (hg : Measurable g) :
    ∫⁻ c, g c ∂(κ ×ₖ η) a = ∫⁻ b, ∫⁻ c, g (b, c) ∂η a ∂κ a 
goal: ∫⁻ (c : β × γ), g c ∂(κ.prod η) a = ∫⁻ (b : β), ∫⁻ (c : γ), g (b, c) ∂η a ∂κ a

full_name: ProbabilityTheory.Kernel.IsMarkovKernel.prod
code: instance IsMarkovKernel.prod (κ : Kernel α β) [IsMarkovKernel κ] (η : Kernel α γ)
    [IsMarkovKernel η] : IsMarkovKernel (κ ×ₖ η) 
goal: ProbabilityTheory.IsMarkovKernel (κ.prod η)

full_name: ProbabilityTheory.Kernel.IsFiniteKernel.prod
code: instance IsFiniteKernel.prod (κ : Kernel α β) [IsFiniteKernel κ] (η : Kernel α γ)
    [IsFiniteKernel η] : IsFiniteKernel (κ ×ₖ η) 
goal: ProbabilityTheory.IsFiniteKernel (κ.prod η)

full_name: ProbabilityTheory.Kernel.IsSFiniteKernel.prod
code: instance IsSFiniteKernel.prod (κ : Kernel α β) (η : Kernel α γ) :
    IsSFiniteKernel (κ ×ₖ η) 
goal: ProbabilityTheory.IsSFiniteKernel (κ.prod η)

full_name: ProbabilityTheory.Kernel.fst_prod
code: @[simp] lemma fst_prod (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel α γ) [IsMarkovKernel η] :
    fst (κ ×ₖ η) = κ 
goal: (κ.prod η).fst = κ

full_name: ProbabilityTheory.Kernel.snd_prod
code: @[simp] lemma snd_prod (κ : Kernel α β) [IsMarkovKernel κ] (η : Kernel α γ) [IsSFiniteKernel η] :
    snd (κ ×ₖ η) = η 
goal: (κ.prod η).snd = η