fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
lintegral_comap (κ : Kernel α β) (hg : Measurable g) (c : γ) (g' : β → ℝ≥0∞) : ∫⁻ b, g' b ∂comap κ g hg c = ∫⁻ b, g' b ∂κ (g c) := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
lintegral_comap
null
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] simp_rw [comap_apply' _ hg _ s]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sum_comap_seq
null
IsMarkovKernel.comap (κ : Kernel α β) [IsMarkovKernel κ] (hg : Measurable g) : IsMarkovKernel (comap κ g hg) := ⟨fun a => ⟨by rw [comap_apply' κ hg a Set.univ, measure_univ]⟩⟩
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsMarkovKernel.comap
null
IsZeroOrMarkovKernel.comap (κ : Kernel α β) [IsZeroOrMarkovKernel κ] (hg : Measurable g) : IsZeroOrMarkovKernel (comap κ g hg) := by rcases eq_zero_or_isMarkovKernel κ with rfl | h · simp only [comap_zero]; infer_instance · have := IsMarkovKernel.comap κ hg; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsZeroOrMarkovKernel.comap
null
IsFiniteKernel.comap (κ : Kernel α β) [IsFiniteKernel κ] (hg : Measurable g) : IsFiniteKernel (comap κ g hg) := by refine ⟨⟨κ.bound, κ.bound_lt_top, fun a => ?_⟩⟩ rw [comap_apply' κ hg a Set.univ] exact measure_le_bound κ _ _
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsFiniteKernel.comap
null
IsSFiniteKernel.comap (κ : Kernel α β) [IsSFiniteKernel κ] (hg : Measurable g) : IsSFiniteKernel (comap κ g hg) := ⟨⟨fun n => Kernel.comap (seq κ n) g hg, inferInstance, (sum_comap_seq κ hg).symm⟩⟩
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsSFiniteKernel.comap
null
comap_comp_right (κ : Kernel α β) {f : δ → γ} (hf : Measurable f) (hg : Measurable g) : comap κ (g ∘ f) (hg.comp hf) = (comap κ g hg).comap f hf := by ext; simp
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
comap_comp_right
null
comap_map_comm (κ : Kernel β γ) {f : α → β} {g : γ → δ} (hf : Measurable f) (hg : Measurable g) : comap (map κ g) f hf = map (comap κ f hf) g := by ext x s _ rw [comap_apply, map_apply _ hg, map_apply _ hg, comap_apply]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
comap_map_comm
null
@[simp] id_map {f : α → β} (hf : Measurable f) : Kernel.id.map f = deterministic f hf := by ext rw [Kernel.map_apply _ hf, Kernel.deterministic_apply, Kernel.id_apply, Measure.map_dirac hf] @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
id_map
null
id_comap {f : α → β} (hf : Measurable f) : Kernel.id.comap f hf = deterministic f hf := by ext rw [Kernel.comap_apply _ hf, Kernel.deterministic_apply, Kernel.id_apply]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
id_comap
null
deterministic_map {f : α → β} (hf : Measurable f) {g : β → γ} (hg : Measurable g) : (deterministic f hf).map g = deterministic (g ∘ f) (hg.comp hf) := by rw [← id_map, ← map_comp_right _ hf hg, id_map]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
deterministic_map
null
prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : Kernel α β) : Kernel (γ × α) β := comap κ Prod.snd measurable_snd
def
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkLeft
Define a `Kernel (γ × α) β` from a `Kernel α β` by taking the comap of the projection.
prodMkRight (γ : Type*) [MeasurableSpace γ] (κ : Kernel α β) : Kernel (α × γ) β := comap κ Prod.fst measurable_fst @[simp]
def
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkRight
Define a `Kernel (α × γ) β` from a `Kernel α β` by taking the comap of the projection.
prodMkLeft_apply (κ : Kernel α β) (ca : γ × α) : prodMkLeft γ κ ca = κ ca.snd := rfl @[simp]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkLeft_apply
null
prodMkRight_apply (κ : Kernel α β) (ca : α × γ) : prodMkRight γ κ ca = κ ca.fst := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkRight_apply
null
prodMkLeft_apply' (κ : Kernel α β) (ca : γ × α) (s : Set β) : prodMkLeft γ κ ca s = κ ca.snd s := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkLeft_apply'
null
prodMkRight_apply' (κ : Kernel α β) (ca : α × γ) (s : Set β) : prodMkRight γ κ ca s = κ ca.fst s := rfl @[simp]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkRight_apply'
null
prodMkLeft_zero : Kernel.prodMkLeft α (0 : Kernel β γ) = 0 := by ext x s _; simp @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkLeft_zero
null
prodMkRight_zero : Kernel.prodMkRight α (0 : Kernel β γ) = 0 := by ext x s _; simp @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkRight_zero
null
prodMkLeft_add (κ η : Kernel α β) : prodMkLeft γ (κ + η) = prodMkLeft γ κ + prodMkLeft γ η := by ext; simp @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkLeft_add
null
prodMkRight_add (κ η : Kernel α β) : prodMkRight γ (κ + η) = prodMkRight γ κ + prodMkRight γ η := by ext; simp
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
prodMkRight_add
null
sum_prodMkLeft {ι : Type*} [Countable ι] {κ : ι → Kernel α β} : Kernel.sum (fun i ↦ Kernel.prodMkLeft γ (κ i)) = Kernel.prodMkLeft γ (Kernel.sum κ) := by ext simp_rw [sum_apply, prodMkLeft_apply, sum_apply]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sum_prodMkLeft
null
sum_prodMkRight {ι : Type*} [Countable ι] {κ : ι → Kernel α β} : Kernel.sum (fun i ↦ Kernel.prodMkRight γ (κ i)) = Kernel.prodMkRight γ (Kernel.sum κ) := by ext simp_rw [sum_apply, prodMkRight_apply, sum_apply]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sum_prodMkRight
null
lintegral_prodMkLeft (κ : Kernel α β) (ca : γ × α) (g : β → ℝ≥0∞) : ∫⁻ b, g b ∂prodMkLeft γ κ ca = ∫⁻ b, g b ∂κ ca.snd := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
lintegral_prodMkLeft
null
lintegral_prodMkRight (κ : Kernel α β) (ca : α × γ) (g : β → ℝ≥0∞) : ∫⁻ b, g b ∂prodMkRight γ κ ca = ∫⁻ b, g b ∂κ ca.fst := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
lintegral_prodMkRight
null
IsMarkovKernel.prodMkLeft (κ : Kernel α β) [IsMarkovKernel κ] : IsMarkovKernel (prodMkLeft γ κ) := by rw [Kernel.prodMkLeft]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsMarkovKernel.prodMkLeft
null
IsMarkovKernel.prodMkRight (κ : Kernel α β) [IsMarkovKernel κ] : IsMarkovKernel (prodMkRight γ κ) := by rw [Kernel.prodMkRight]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsMarkovKernel.prodMkRight
null
IsZeroOrMarkovKernel.prodMkLeft (κ : Kernel α β) [IsZeroOrMarkovKernel κ] : IsZeroOrMarkovKernel (prodMkLeft γ κ) := by rw [Kernel.prodMkLeft]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsZeroOrMarkovKernel.prodMkLeft
null
IsZeroOrMarkovKernel.prodMkRight (κ : Kernel α β) [IsZeroOrMarkovKernel κ] : IsZeroOrMarkovKernel (prodMkRight γ κ) := by rw [Kernel.prodMkRight]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsZeroOrMarkovKernel.prodMkRight
null
IsFiniteKernel.prodMkLeft (κ : Kernel α β) [IsFiniteKernel κ] : IsFiniteKernel (prodMkLeft γ κ) := by rw [Kernel.prodMkLeft]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsFiniteKernel.prodMkLeft
null
IsFiniteKernel.prodMkRight (κ : Kernel α β) [IsFiniteKernel κ] : IsFiniteKernel (prodMkRight γ κ) := by rw [Kernel.prodMkRight]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsFiniteKernel.prodMkRight
null
IsSFiniteKernel.prodMkLeft (κ : Kernel α β) [IsSFiniteKernel κ] : IsSFiniteKernel (prodMkLeft γ κ) := by rw [Kernel.prodMkLeft]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsSFiniteKernel.prodMkLeft
null
IsSFiniteKernel.prodMkRight (κ : Kernel α β) [IsSFiniteKernel κ] : IsSFiniteKernel (prodMkRight γ κ) := by rw [Kernel.prodMkRight]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsSFiniteKernel.prodMkRight
null
isSFiniteKernel_prodMkLeft_unit {κ : Kernel α β} : IsSFiniteKernel (prodMkLeft Unit κ) ↔ IsSFiniteKernel κ := by refine ⟨fun _ ↦ ?_, fun _ ↦ inferInstance⟩ change IsSFiniteKernel ((prodMkLeft Unit κ).comap (fun a ↦ ((), a)) (by fun_prop)) infer_instance
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
isSFiniteKernel_prodMkLeft_unit
null
isSFiniteKernel_prodMkRight_unit {κ : Kernel α β} : IsSFiniteKernel (prodMkRight Unit κ) ↔ IsSFiniteKernel κ := by refine ⟨fun _ ↦ ?_, fun _ ↦ inferInstance⟩ change IsSFiniteKernel ((prodMkRight Unit κ).comap (fun a ↦ (a, ())) (by fun_prop)) infer_instance
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
isSFiniteKernel_prodMkRight_unit
null
map_prodMkLeft (γ : Type*) [MeasurableSpace γ] (κ : Kernel α β) (f : β → δ) : map (prodMkLeft γ κ) f = prodMkLeft γ (map κ f) := by by_cases hf : Measurable f · simp only [map, hf, ↓reduceDIte] rfl · simp [map_of_not_measurable _ hf]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
map_prodMkLeft
null
map_prodMkRight (κ : Kernel α β) (γ : Type*) {mγ : MeasurableSpace γ} (f : β → δ) : map (prodMkRight γ κ) f = prodMkRight γ (map κ f) := by by_cases hf : Measurable f · simp only [map, hf, ↓reduceDIte] rfl · simp [map_of_not_measurable _ hf]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
map_prodMkRight
null
swapLeft (κ : Kernel (α × β) γ) : Kernel (β × α) γ := comap κ Prod.swap measurable_swap @[simp]
def
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapLeft
Define a `Kernel (β × α) γ` from a `Kernel (α × β) γ` by taking the comap of `Prod.swap`.
swapLeft_zero : swapLeft (0 : Kernel (α × β) γ) = 0 := by simp [swapLeft] @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapLeft_zero
null
swapLeft_apply (κ : Kernel (α × β) γ) (a : β × α) : swapLeft κ a = κ a.swap := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapLeft_apply
null
swapLeft_apply' (κ : Kernel (α × β) γ) (a : β × α) (s : Set γ) : swapLeft κ a s = κ a.swap s := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapLeft_apply'
null
lintegral_swapLeft (κ : Kernel (α × β) γ) (a : β × α) (g : γ → ℝ≥0∞) : ∫⁻ c, g c ∂swapLeft κ a = ∫⁻ c, g c ∂κ a.swap := by rw [swapLeft_apply]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
lintegral_swapLeft
null
IsMarkovKernel.swapLeft (κ : Kernel (α × β) γ) [IsMarkovKernel κ] : IsMarkovKernel (swapLeft κ) := by rw [Kernel.swapLeft]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsMarkovKernel.swapLeft
null
IsFiniteKernel.swapLeft (κ : Kernel (α × β) γ) [IsFiniteKernel κ] : IsFiniteKernel (swapLeft κ) := by rw [Kernel.swapLeft]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsFiniteKernel.swapLeft
null
IsSFiniteKernel.swapLeft (κ : Kernel (α × β) γ) [IsSFiniteKernel κ] : IsSFiniteKernel (swapLeft κ) := by rw [Kernel.swapLeft]; infer_instance @[simp] lemma swapLeft_prodMkLeft (κ : Kernel α β) (γ : Type*) {_ : MeasurableSpace γ} : swapLeft (prodMkLeft γ κ) = prodMkRight γ κ := rfl @[simp] lemma swapLeft_prodMkRight (κ : Kernel α β) (γ : Type*) {_ : MeasurableSpace γ} : swapLeft (prodMkRight γ κ) = prodMkLeft γ κ := rfl
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsSFiniteKernel.swapLeft
null
noncomputable swapRight (κ : Kernel α (β × γ)) : Kernel α (γ × β) := mapOfMeasurable κ Prod.swap measurable_swap
def
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapRight
Define a `Kernel α (γ × β)` from a `Kernel α (β × γ)` by taking the map of `Prod.swap`. We use `mapOfMeasurable` in the definition for better defeqs.
swapRight_eq (κ : Kernel α (β × γ)) : swapRight κ = map κ Prod.swap := by simp [swapRight] @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapRight_eq
null
swapRight_zero : swapRight (0 : Kernel α (β × γ)) = 0 := by simp [swapRight]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapRight_zero
null
swapRight_apply (κ : Kernel α (β × γ)) (a : α) : swapRight κ a = (κ a).map Prod.swap := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapRight_apply
null
swapRight_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set (γ × β)} (hs : MeasurableSet s) : swapRight κ a s = κ a {p | p.swap ∈ s} := by rw [swapRight_apply, Measure.map_apply measurable_swap hs]; rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
swapRight_apply'
null
lintegral_swapRight (κ : Kernel α (β × γ)) (a : α) {g : γ × β → ℝ≥0∞} (hg : Measurable g) : ∫⁻ c, g c ∂swapRight κ a = ∫⁻ bc : β × γ, g bc.swap ∂κ a := by rw [swapRight_eq, lintegral_map _ measurable_swap a hg]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
lintegral_swapRight
null
IsMarkovKernel.swapRight (κ : Kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (swapRight κ) := by rw [Kernel.swapRight_eq]; exact IsMarkovKernel.map _ measurable_swap
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsMarkovKernel.swapRight
null
IsZeroOrMarkovKernel.swapRight (κ : Kernel α (β × γ)) [IsZeroOrMarkovKernel κ] : IsZeroOrMarkovKernel (swapRight κ) := by rw [Kernel.swapRight_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsZeroOrMarkovKernel.swapRight
null
IsFiniteKernel.swapRight (κ : Kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (swapRight κ) := by rw [Kernel.swapRight_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsFiniteKernel.swapRight
null
IsSFiniteKernel.swapRight (κ : Kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (swapRight κ) := by rw [Kernel.swapRight_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsSFiniteKernel.swapRight
null
noncomputable fst (κ : Kernel α (β × γ)) : Kernel α β := mapOfMeasurable κ Prod.fst measurable_fst
def
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst
Define a `Kernel α β` from a `Kernel α (β × γ)` by taking the map of the first projection. We use `mapOfMeasurable` for better defeqs.
fst_eq (κ : Kernel α (β × γ)) : fst κ = map κ Prod.fst := by simp [fst]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_eq
null
fst_apply (κ : Kernel α (β × γ)) (a : α) : fst κ a = (κ a).map Prod.fst := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_apply
null
fst_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set β} (hs : MeasurableSet s) : fst κ a s = κ a {p | p.1 ∈ s} := by rw [fst_apply, Measure.map_apply measurable_fst hs]; rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_apply'
null
fst_real_apply (κ : Kernel α (β × γ)) (a : α) {s : Set β} (hs : MeasurableSet s) : (fst κ a).real s = (κ a).real {p | p.1 ∈ s} := by simp [fst_apply', hs, measureReal_def] @[simp]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_real_apply
null
fst_zero : fst (0 : Kernel α (β × γ)) = 0 := by simp [fst]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_zero
null
lintegral_fst (κ : Kernel α (β × γ)) (a : α) {g : β → ℝ≥0∞} (hg : Measurable g) : ∫⁻ c, g c ∂fst κ a = ∫⁻ bc : β × γ, g bc.fst ∂κ a := by rw [fst_eq, lintegral_map _ measurable_fst a hg]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
lintegral_fst
null
IsMarkovKernel.fst (κ : Kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (fst κ) := by rw [Kernel.fst_eq]; exact IsMarkovKernel.map _ measurable_fst
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsMarkovKernel.fst
null
IsZeroOrMarkovKernel.fst (κ : Kernel α (β × γ)) [IsZeroOrMarkovKernel κ] : IsZeroOrMarkovKernel (fst κ) := by rw [Kernel.fst_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsZeroOrMarkovKernel.fst
null
IsFiniteKernel.fst (κ : Kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (fst κ) := by rw [Kernel.fst_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsFiniteKernel.fst
null
IsSFiniteKernel.fst (κ : Kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (fst κ) := by rw [Kernel.fst_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsSFiniteKernel.fst
null
fst_map_prod (κ : Kernel α β) {f : β → γ} {g : β → δ} (hg : Measurable g) : fst (map κ (fun x ↦ (f x, g x))) = map κ f := by by_cases hf : Measurable f · ext x s hs rw [fst_apply' _ _ hs, map_apply' _ (hf.prod hg) _, map_apply' _ hf _ hs] · simp only [Set.preimage, Set.mem_setOf] · exact measurable_fst hs · have : ¬ Measurable (fun x ↦ (f x, g x)) := by contrapose! hf; exact hf.fst simp [map_of_not_measurable _ hf, map_of_not_measurable _ this]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_map_prod
null
fst_map_id_prod (κ : Kernel α β) {f : β → γ} (hf : Measurable f) : fst (map κ (fun a ↦ (a, f a))) = κ := by rw [fst_map_prod _ hf, Kernel.map_id']
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_map_id_prod
null
fst_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : Kernel α (β × γ)) : fst (prodMkLeft δ κ) = prodMkLeft δ (fst κ) := rfl
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_prodMkLeft
null
fst_prodMkRight (κ : Kernel α (β × γ)) (δ : Type*) [MeasurableSpace δ] : fst (prodMkRight δ κ) = prodMkRight δ (fst κ) := rfl
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_prodMkRight
null
noncomputable snd (κ : Kernel α (β × γ)) : Kernel α γ := mapOfMeasurable κ Prod.snd measurable_snd
def
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd
Define a `Kernel α γ` from a `Kernel α (β × γ)` by taking the map of the second projection. We use `mapOfMeasurable` for better defeqs.
snd_eq (κ : Kernel α (β × γ)) : snd κ = map κ Prod.snd := by simp [snd]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_eq
null
snd_apply (κ : Kernel α (β × γ)) (a : α) : snd κ a = (κ a).map Prod.snd := rfl
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_apply
null
snd_apply' (κ : Kernel α (β × γ)) (a : α) {s : Set γ} (hs : MeasurableSet s) : snd κ a s = κ a (Prod.snd ⁻¹' s) := by rw [snd_apply, Measure.map_apply measurable_snd hs] @[simp]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_apply'
null
snd_zero : snd (0 : Kernel α (β × γ)) = 0 := by simp [snd]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_zero
null
lintegral_snd (κ : Kernel α (β × γ)) (a : α) {g : γ → ℝ≥0∞} (hg : Measurable g) : ∫⁻ c, g c ∂snd κ a = ∫⁻ bc : β × γ, g bc.snd ∂κ a := by rw [snd_eq, lintegral_map _ measurable_snd a hg]
theorem
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
lintegral_snd
null
IsMarkovKernel.snd (κ : Kernel α (β × γ)) [IsMarkovKernel κ] : IsMarkovKernel (snd κ) := by rw [Kernel.snd_eq]; exact IsMarkovKernel.map _ measurable_snd
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsMarkovKernel.snd
null
IsZeroOrMarkovKernel.snd (κ : Kernel α (β × γ)) [IsZeroOrMarkovKernel κ] : IsZeroOrMarkovKernel (snd κ) := by rw [Kernel.snd_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsZeroOrMarkovKernel.snd
null
IsFiniteKernel.snd (κ : Kernel α (β × γ)) [IsFiniteKernel κ] : IsFiniteKernel (snd κ) := by rw [Kernel.snd_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsFiniteKernel.snd
null
IsSFiniteKernel.snd (κ : Kernel α (β × γ)) [IsSFiniteKernel κ] : IsSFiniteKernel (snd κ) := by rw [Kernel.snd_eq]; infer_instance
instance
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
IsSFiniteKernel.snd
null
snd_map_prod (κ : Kernel α β) {f : β → γ} {g : β → δ} (hf : Measurable f) : snd (map κ (fun x ↦ (f x, g x))) = map κ g := by by_cases hg : Measurable g · ext x s hs rw [snd_apply' _ _ hs, map_apply' _ (hf.prod hg), map_apply' _ hg _ hs] · simp only [Set.preimage, Set.mem_setOf] · exact measurable_snd hs · have : ¬ Measurable (fun x ↦ (f x, g x)) := by contrapose! hg; exact hg.snd simp [map_of_not_measurable _ hg, map_of_not_measurable _ this]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_map_prod
null
snd_map_prod_id (κ : Kernel α β) {f : β → γ} (hf : Measurable f) : snd (map κ (fun a ↦ (f a, a))) = κ := by rw [snd_map_prod _ hf, Kernel.map_id']
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_map_prod_id
null
snd_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : Kernel α (β × γ)) : snd (prodMkLeft δ κ) = prodMkLeft δ (snd κ) := rfl
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_prodMkLeft
null
snd_prodMkRight (κ : Kernel α (β × γ)) (δ : Type*) [MeasurableSpace δ] : snd (prodMkRight δ κ) = prodMkRight δ (snd κ) := rfl @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_prodMkRight
null
fst_swapRight (κ : Kernel α (β × γ)) : fst (swapRight κ) = snd κ := by ext a s hs rw [fst_apply' _ _ hs, swapRight_apply', snd_apply' _ _ hs] · rfl · exact measurable_fst hs @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
fst_swapRight
null
snd_swapRight (κ : Kernel α (β × γ)) : snd (swapRight κ) = fst κ := by ext a s hs rw [snd_apply' _ _ hs, swapRight_apply', fst_apply' _ _ hs] · rfl · exact measurable_snd hs
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
snd_swapRight
null
noncomputable sectL (κ : Kernel (α × β) γ) (b : β) : Kernel α γ := comap κ (fun a ↦ (a, b)) (measurable_id.prodMk measurable_const) @[simp] theorem sectL_apply (κ : Kernel (α × β) γ) (b : β) (a : α) : sectL κ b a = κ (a, b) := rfl @[simp] lemma sectL_zero (b : β) : sectL (0 : Kernel (α × β) γ) b = 0 := by simp [sectL]
def
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sectL
Define a `Kernel α γ` from a `Kernel (α × β) γ` by taking the comap of `fun a ↦ (a, b)` for a given `b : β`.
comap_sectL (κ : Kernel (α × β) γ) (b : β) {f : δ → α} (hf : Measurable f) : comap (sectL κ b) f hf = comap κ (fun d ↦ (f d, b)) (hf.prodMk measurable_const) := by ext d s rw [comap_apply, sectL_apply, comap_apply] @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
comap_sectL
null
sectL_prodMkLeft (α : Type*) [MeasurableSpace α] (κ : Kernel β γ) (a : α) {b : β} : sectL (prodMkLeft α κ) b a = κ b := rfl @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sectL_prodMkLeft
null
sectL_prodMkRight (β : Type*) [MeasurableSpace β] (κ : Kernel α γ) (b : β) : sectL (prodMkRight β κ) b = κ := rfl
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sectL_prodMkRight
null
noncomputable sectR (κ : Kernel (α × β) γ) (a : α) : Kernel β γ := comap κ (fun b ↦ (a, b)) (measurable_const.prodMk measurable_id) @[simp] theorem sectR_apply (κ : Kernel (α × β) γ) (b : β) (a : α) : sectR κ a b = κ (a, b) := rfl @[simp] lemma sectR_zero (a : α) : sectR (0 : Kernel (α × β) γ) a = 0 := by simp [sectR]
def
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sectR
Define a `Kernel β γ` from a `Kernel (α × β) γ` by taking the comap of `fun b ↦ (a, b)` for a given `a : α`.
comap_sectR (κ : Kernel (α × β) γ) (a : α) {f : δ → β} (hf : Measurable f) : comap (sectR κ a) f hf = comap κ (fun d ↦ (a, f d)) (measurable_const.prodMk hf) := by ext d s rw [comap_apply, sectR_apply, comap_apply] @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
comap_sectR
null
sectR_prodMkLeft (α : Type*) [MeasurableSpace α] (κ : Kernel β γ) (a : α) : sectR (prodMkLeft α κ) a = κ := rfl @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sectR_prodMkLeft
null
sectR_prodMkRight (β : Type*) [MeasurableSpace β] (κ : Kernel α γ) (b : β) {a : α} : sectR (prodMkRight β κ) a b = κ a := rfl @[simp] lemma sectL_swapRight (κ : Kernel (α × β) γ) : sectL (swapLeft κ) = sectR κ := rfl @[simp] lemma sectR_swapRight (κ : Kernel (α × β) γ) : sectR (swapLeft κ) = sectL κ := rfl
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
sectR_prodMkRight
null
isSFiniteKernel_prodMkLeft_iff [Nonempty γ] {κ : Kernel α β} : IsSFiniteKernel (prodMkLeft γ κ) ↔ IsSFiniteKernel κ := by inhabit γ refine ⟨fun h ↦ ?_, fun _ ↦ inferInstance⟩ rw [← sectR_prodMkLeft γ κ default] infer_instance
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
isSFiniteKernel_prodMkLeft_iff
null
isSFiniteKernel_prodMkRight_iff [Nonempty γ] {κ : Kernel α β} : IsSFiniteKernel (prodMkRight γ κ) ↔ IsSFiniteKernel κ := by inhabit γ refine ⟨fun h ↦ ?_, fun _ ↦ inferInstance⟩ rw [← sectL_prodMkRight γ κ default] infer_instance
lemma
Probability
[ "Mathlib.Probability.Kernel.Basic" ]
Mathlib/Probability/Kernel/Composition/MapComap.lean
isSFiniteKernel_prodMkRight_iff
null
comp_assoc {η : Kernel β γ} : η ∘ₘ (κ ∘ₘ μ) = (η ∘ₖ κ) ∘ₘ μ := Measure.bind_bind κ.aemeasurable η.aemeasurable
lemma
Probability
[ "Mathlib.Probability.Kernel.Composition.CompNotation", "Mathlib.Probability.Kernel.Composition.KernelLemmas", "Mathlib.Probability.Kernel.Composition.MeasureCompProd" ]
Mathlib/Probability/Kernel/Composition/MeasureComp.lean
comp_assoc
null
comp_eq_comp_const_apply : κ ∘ₘ μ = (κ ∘ₖ (Kernel.const Unit μ)) () := by rw [Kernel.comp_apply, Kernel.const_apply]
lemma
Probability
[ "Mathlib.Probability.Kernel.Composition.CompNotation", "Mathlib.Probability.Kernel.Composition.KernelLemmas", "Mathlib.Probability.Kernel.Composition.MeasureCompProd" ]
Mathlib/Probability/Kernel/Composition/MeasureComp.lean
comp_eq_comp_const_apply
This lemma allows to rewrite the composition of a measure and a kernel as the composition of two kernels, which allows to transfer properties of `∘ₖ` to `∘ₘ`.
comp_eq_sum_of_countable [Countable α] [MeasurableSingletonClass α] : κ ∘ₘ μ = Measure.sum (fun ω ↦ μ {ω} • κ ω) := by ext s hs rw [Measure.sum_apply _ hs, Measure.bind_apply hs (by fun_prop)] simp [lintegral_countable', mul_comm] @[simp]
lemma
Probability
[ "Mathlib.Probability.Kernel.Composition.CompNotation", "Mathlib.Probability.Kernel.Composition.KernelLemmas", "Mathlib.Probability.Kernel.Composition.MeasureCompProd" ]
Mathlib/Probability/Kernel/Composition/MeasureComp.lean
comp_eq_sum_of_countable
null
snd_compProd (μ : Measure α) [SFinite μ] (κ : Kernel α β) [IsSFiniteKernel κ] : (μ ⊗ₘ κ).snd = κ ∘ₘ μ := by ext s hs rw [bind_apply hs κ.aemeasurable, snd_apply hs, compProd_apply] · rfl · exact measurable_snd hs
lemma
Probability
[ "Mathlib.Probability.Kernel.Composition.CompNotation", "Mathlib.Probability.Kernel.Composition.KernelLemmas", "Mathlib.Probability.Kernel.Composition.MeasureCompProd" ]
Mathlib/Probability/Kernel/Composition/MeasureComp.lean
snd_compProd
null