File: Mathlib/Probability/Kernel/RadonNikodym.lean

full_name: ProbabilityTheory.Kernel.rnDerivAux
code: /-- Auxiliary function used to define `ProbabilityTheory.Kernel.rnDeriv` and
`ProbabilityTheory.Kernel.singularPart`.

This has the properties we want for a Radon-Nikodym derivative only if `κ ≪ ν`. The definition of
`rnDeriv κ η` will be built from `rnDerivAux κ (κ + η)`. -/
noncomputable
def rnDerivAux (κ η : Kernel α γ) (a : α) (x : γ) : ℝ 
goal: ℝ

full_name: ProbabilityTheory.Kernel.rnDerivAux_nonneg
code: lemma rnDerivAux_nonneg (hκη : κ ≤ η) {a : α} {x : γ} : 0 ≤ rnDerivAux κ η a x 
goal: 0 ≤ κ.rnDerivAux η a x

full_name: ProbabilityTheory.Kernel.rnDerivAux_le_one
code: lemma rnDerivAux_le_one [IsFiniteKernel η] (hκη : κ ≤ η) {a : α} :
    rnDerivAux κ η a ≤ᵐ[η a] 1 
goal: κ.rnDerivAux η a ≤ᵐ[η a] 1

full_name: ProbabilityTheory.Kernel.measurable_rnDerivAux
code: lemma measurable_rnDerivAux (κ η : Kernel α γ) :
    Measurable (fun p : α × γ ↦ Kernel.rnDerivAux κ η p.1 p.2) 
goal: Measurable fun p => κ.rnDerivAux η p.1 p.2

full_name: ProbabilityTheory.Kernel.measurable_rnDerivAux_right
code: lemma measurable_rnDerivAux_right (κ η : Kernel α γ) (a : α) :
    Measurable (fun x : γ ↦ rnDerivAux κ η a x) 
goal: Measurable fun x => κ.rnDerivAux η a x

full_name: ProbabilityTheory.Kernel.setLIntegral_rnDerivAux
code: lemma setLIntegral_rnDerivAux (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η]
    (a : α) {s : Set γ} (hs : MeasurableSet s) :
    ∫⁻ x in s, ENNReal.ofReal (rnDerivAux κ (κ + η) a x) ∂(κ + η) a = κ a s 
goal: ∫⁻ (x : γ) in s, ENNReal.ofReal (κ.rnDerivAux (κ + η) a x) ∂(κ + η) a = (κ a) s

full_name: ProbabilityTheory.Kernel.withDensity_rnDerivAux
code: lemma withDensity_rnDerivAux (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    withDensity (κ + η) (fun a x ↦ Real.toNNReal (rnDerivAux κ (κ + η) a x)) = κ 
goal: ((κ + η).withDensity fun a x => ↑(κ.rnDerivAux (κ + η) a x).toNNReal) = κ

full_name: ProbabilityTheory.Kernel.withDensity_one_sub_rnDerivAux
code: lemma withDensity_one_sub_rnDerivAux (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    withDensity (κ + η) (fun a x ↦ Real.toNNReal (1 - rnDerivAux κ (κ + η) a x)) = η 
goal: ((κ + η).withDensity fun a x => ↑(1 - κ.rnDerivAux (κ + η) a x).toNNReal) = η

full_name: ProbabilityTheory.Kernel.mutuallySingularSet
code: /-- A set of points in `α × γ` related to the absolute continuity / mutual singularity of
`κ` and `η`. -/
def mutuallySingularSet (κ η : Kernel α γ) : Set (α × γ) 
goal: Set (α × γ)

full_name: ProbabilityTheory.Kernel.mutuallySingularSetSlice
code: /-- A set of points in `α × γ` related to the absolute continuity / mutual singularity of
`κ` and `η`. That is,
* `withDensity η (rnDeriv κ η) a (mutuallySingularSetSlice κ η a) = 0`,
* `singularPart κ η a (mutuallySingularSetSlice κ η a)ᶜ = 0`.
 -/
def mutuallySingularSetSlice (κ η : Kernel α γ) (a : α) : Set γ 
goal: Set γ

full_name: ProbabilityTheory.Kernel.mem_mutuallySingularSetSlice
code: lemma mem_mutuallySingularSetSlice (κ η : Kernel α γ) (a : α) (x : γ) :
    x ∈ mutuallySingularSetSlice κ η a ↔ 1 ≤ rnDerivAux κ (κ + η) a x 
goal: x ∈ κ.mutuallySingularSetSlice η a ↔ 1 ≤ κ.rnDerivAux (κ + η) a x

full_name: ProbabilityTheory.Kernel.not_mem_mutuallySingularSetSlice
code: lemma not_mem_mutuallySingularSetSlice (κ η : Kernel α γ) (a : α) (x : γ) :
    x ∉ mutuallySingularSetSlice κ η a ↔ rnDerivAux κ (κ + η) a x < 1 
goal: x ∉ κ.mutuallySingularSetSlice η a ↔ κ.rnDerivAux (κ + η) a x < 1

full_name: ProbabilityTheory.Kernel.measurableSet_mutuallySingularSet
code: lemma measurableSet_mutuallySingularSet (κ η : Kernel α γ) :
    MeasurableSet (mutuallySingularSet κ η) 
goal: MeasurableSet (κ.mutuallySingularSet η)

full_name: ProbabilityTheory.Kernel.measurableSet_mutuallySingularSetSlice
code: lemma measurableSet_mutuallySingularSetSlice (κ η : Kernel α γ) (a : α) :
    MeasurableSet (mutuallySingularSetSlice κ η a) 
goal: MeasurableSet (κ.mutuallySingularSetSlice η a)

full_name: ProbabilityTheory.Kernel.measure_mutuallySingularSetSlice
code: lemma measure_mutuallySingularSetSlice (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η]
    (a : α) :
    η a (mutuallySingularSetSlice κ η a) = 0 
goal: (η a) (κ.mutuallySingularSetSlice η a) = 0

full_name: ProbabilityTheory.Kernel.rnDeriv
code: /-- Radon-Nikodym derivative of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def rnDeriv (κ η : Kernel α γ) (a : α) (x : γ) : ℝ≥0∞ 
goal: ℝ≥0∞

full_name: ProbabilityTheory.Kernel.wrapped._@.Mathlib.Probability.Kernel.RadonNikodym._hyg.2574
code: /-- Radon-Nikodym derivative of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def rnDeriv (κ η : Kernel α γ) (a : α) (x : γ) : ℝ≥0∞ 
goal: Subtype (Eq @ProbabilityTheory.Kernel.definition✝)

full_name: ProbabilityTheory.Kernel.rnDeriv_def
code: /-- Radon-Nikodym derivative of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def rnDeriv (κ η : Kernel α γ) (a : α) (x : γ) : ℝ≥0∞ 
goal: κ.rnDeriv η a x = ENNReal.ofReal (κ.rnDerivAux (κ + η) a x) / ENNReal.ofReal (1 - κ.rnDerivAux (κ + η) a x)

full_name: ProbabilityTheory.Kernel.definition._@.Mathlib.Probability.Kernel.RadonNikodym._hyg.2574
code: /-- Radon-Nikodym derivative of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def rnDeriv (κ η : Kernel α γ) (a : α) (x : γ) : ℝ≥0∞ 
goal: ℝ≥0∞

full_name: ProbabilityTheory.Kernel.rnDeriv_def'
code: lemma rnDeriv_def' (κ η : Kernel α γ) :
    rnDeriv κ η = fun a x ↦ ENNReal.ofReal (rnDerivAux κ (κ + η) a x)
      / ENNReal.ofReal (1 - rnDerivAux κ (κ + η) a x) 
goal: κ.rnDeriv η = fun a x => ENNReal.ofReal (κ.rnDerivAux (κ + η) a x) / ENNReal.ofReal (1 - κ.rnDerivAux (κ + η) a x)

full_name: ProbabilityTheory.Kernel.measurable_rnDeriv
code: lemma measurable_rnDeriv (κ η : Kernel α γ) :
    Measurable (fun p : α × γ ↦ rnDeriv κ η p.1 p.2) 
goal: Measurable fun p => κ.rnDeriv η p.1 p.2

full_name: ProbabilityTheory.Kernel.measurable_rnDeriv_right
code: lemma measurable_rnDeriv_right (κ η : Kernel α γ) (a : α) :
    Measurable (fun x : γ ↦ rnDeriv κ η a x) 
goal: Measurable fun x => κ.rnDeriv η a x

full_name: ProbabilityTheory.Kernel.rnDeriv_eq_top_iff
code: lemma rnDeriv_eq_top_iff (κ η : Kernel α γ) (a : α) (x : γ) :
    rnDeriv κ η a x = ∞ ↔ (a, x) ∈ mutuallySingularSet κ η 
goal: κ.rnDeriv η a x = ⊤ ↔ (a, x) ∈ κ.mutuallySingularSet η

full_name: ProbabilityTheory.Kernel.rnDeriv_eq_top_iff'
code: lemma rnDeriv_eq_top_iff' (κ η : Kernel α γ) (a : α) (x : γ) :
    rnDeriv κ η a x = ∞ ↔ x ∈ mutuallySingularSetSlice κ η a 
goal: κ.rnDeriv η a x = ⊤ ↔ x ∈ κ.mutuallySingularSetSlice η a

full_name: ProbabilityTheory.Kernel.wrapped._@.Mathlib.Probability.Kernel.RadonNikodym._hyg.3223
code: /-- Singular part of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def singularPart (κ η : Kernel α γ) [IsSFiniteKernel κ] [IsSFiniteKernel η] :
    Kernel α γ 
goal: Subtype (Eq @ProbabilityTheory.Kernel.definition✝)

full_name: ProbabilityTheory.Kernel.singularPart
code: /-- Singular part of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def singularPart (κ η : Kernel α γ) [IsSFiniteKernel κ] [IsSFiniteKernel η] :
    Kernel α γ 
goal: ProbabilityTheory.Kernel α γ

full_name: ProbabilityTheory.Kernel.definition._@.Mathlib.Probability.Kernel.RadonNikodym._hyg.3223
code: /-- Singular part of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def singularPart (κ η : Kernel α γ) [IsSFiniteKernel κ] [IsSFiniteKernel η] :
    Kernel α γ 
goal: ProbabilityTheory.Kernel α γ

full_name: ProbabilityTheory.Kernel.singularPart_def
code: /-- Singular part of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def singularPart (κ η : Kernel α γ) [IsSFiniteKernel κ] [IsSFiniteKernel η] :
    Kernel α γ 
goal: κ.singularPart η =
  (κ + η).withDensity fun a x =>
    ↑(κ.rnDerivAux (κ + η) a x).toNNReal - ↑(1 - κ.rnDerivAux (κ + η) a x).toNNReal * κ.rnDeriv η a x

full_name: ProbabilityTheory.Kernel.measurable_singularPart_fun
code: lemma measurable_singularPart_fun (κ η : Kernel α γ) :
    Measurable (fun p : α × γ ↦ Real.toNNReal (rnDerivAux κ (κ + η) p.1 p.2)
      - Real.toNNReal (1 - rnDerivAux κ (κ + η) p.1 p.2) * rnDeriv κ η p.1 p.2) 
goal: Measurable fun p =>
  ↑(κ.rnDerivAux (κ + η) p.1 p.2).toNNReal - ↑(1 - κ.rnDerivAux (κ + η) p.1 p.2).toNNReal * κ.rnDeriv η p.1 p.2

full_name: ProbabilityTheory.Kernel.measurable_singularPart_fun_right
code: lemma measurable_singularPart_fun_right (κ η : Kernel α γ) (a : α) :
    Measurable (fun x : γ ↦ Real.toNNReal (rnDerivAux κ (κ + η) a x)
      - Real.toNNReal (1 - rnDerivAux κ (κ + η) a x) * rnDeriv κ η a x) 
goal: Measurable fun x => ↑(κ.rnDerivAux (κ + η) a x).toNNReal - ↑(1 - κ.rnDerivAux (κ + η) a x).toNNReal * κ.rnDeriv η a x

full_name: ProbabilityTheory.Kernel.singularPart_compl_mutuallySingularSetSlice
code: lemma singularPart_compl_mutuallySingularSetSlice (κ η : Kernel α γ) [IsSFiniteKernel κ]
    [IsSFiniteKernel η] (a : α) :
    singularPart κ η a (mutuallySingularSetSlice κ η a)ᶜ = 0 
goal: ((κ.singularPart η) a) (κ.mutuallySingularSetSlice η a)ᶜ = 0

full_name: ProbabilityTheory.Kernel.singularPart_of_subset_compl_mutuallySingularSetSlice
code: lemma singularPart_of_subset_compl_mutuallySingularSetSlice [IsFiniteKernel κ]
    [IsFiniteKernel η] {a : α} {s : Set γ} (hs : s ⊆ (mutuallySingularSetSlice κ η a)ᶜ) :
    singularPart κ η a s = 0 
goal: ((κ.singularPart η) a) s = 0

full_name: ProbabilityTheory.Kernel.singularPart_of_subset_mutuallySingularSetSlice
code: lemma singularPart_of_subset_mutuallySingularSetSlice [IsFiniteKernel κ]
    [IsFiniteKernel η] {a : α} {s : Set γ} (hsm : MeasurableSet s)
    (hs : s ⊆ mutuallySingularSetSlice κ η a) :
    singularPart κ η a s = κ a s 
goal: ((κ.singularPart η) a) s = (κ a) s

full_name: ProbabilityTheory.Kernel.withDensity_rnDeriv_mutuallySingularSetSlice
code: lemma withDensity_rnDeriv_mutuallySingularSetSlice (κ η : Kernel α γ) [IsFiniteKernel κ]
    [IsFiniteKernel η] (a : α) :
    withDensity η (rnDeriv κ η) a (mutuallySingularSetSlice κ η a) = 0 
goal: ((η.withDensity (κ.rnDeriv η)) a) (κ.mutuallySingularSetSlice η a) = 0

full_name: ProbabilityTheory.Kernel.withDensity_rnDeriv_of_subset_mutuallySingularSetSlice
code: lemma withDensity_rnDeriv_of_subset_mutuallySingularSetSlice [IsFiniteKernel κ]
    [IsFiniteKernel η] {a : α} {s : Set γ}
    (hs : s ⊆ mutuallySingularSetSlice κ η a) :
    withDensity η (rnDeriv κ η) a s = 0 
goal: ((η.withDensity (κ.rnDeriv η)) a) s = 0

full_name: ProbabilityTheory.Kernel.withDensity_rnDeriv_of_subset_compl_mutuallySingularSetSlice
code: lemma withDensity_rnDeriv_of_subset_compl_mutuallySingularSetSlice
    [IsFiniteKernel κ] [IsFiniteKernel η] {a : α} {s : Set γ} (hsm : MeasurableSet s)
    (hs : s ⊆ (mutuallySingularSetSlice κ η a)ᶜ) :
    withDensity η (rnDeriv κ η) a s = κ a s 
goal: ((η.withDensity (κ.rnDeriv η)) a) s = (κ a) s

full_name: ProbabilityTheory.Kernel.mutuallySingular_singularPart
code: /-- The singular part of `κ` with respect to `η` is mutually singular with `η`. -/
lemma mutuallySingular_singularPart (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η]
    (a : α) :
    singularPart κ η a ⟂ₘ η a 
goal: (κ.singularPart η) a ⟂ₘ η a

full_name: ProbabilityTheory.Kernel.rnDeriv_add_singularPart
code: /-- Lebesgue decomposition of a finite kernel `κ` with respect to another one `η`.
`κ` is the sum of an abolutely continuous part `withDensity η (rnDeriv κ η)` and a singular part
`singularPart κ η`. -/
lemma rnDeriv_add_singularPart (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    withDensity η (rnDeriv κ η) + singularPart κ η = κ 
goal: η.withDensity (κ.rnDeriv η) + κ.singularPart η = κ

full_name: ProbabilityTheory.Kernel.singularPart_eq_zero_iff_apply_eq_zero
code: lemma singularPart_eq_zero_iff_apply_eq_zero (κ η : Kernel α γ) [IsFiniteKernel κ]
    [IsFiniteKernel η] (a : α) :
    singularPart κ η a = 0 ↔ singularPart κ η a (mutuallySingularSetSlice κ η a) = 0 
goal: (κ.singularPart η) a = 0 ↔ ((κ.singularPart η) a) (κ.mutuallySingularSetSlice η a) = 0

full_name: ProbabilityTheory.Kernel.withDensity_rnDeriv_eq_zero_iff_apply_eq_zero
code: lemma withDensity_rnDeriv_eq_zero_iff_apply_eq_zero (κ η : Kernel α γ) [IsFiniteKernel κ]
    [IsFiniteKernel η] (a : α) :
    withDensity η (rnDeriv κ η) a = 0
      ↔ withDensity η (rnDeriv κ η) a (mutuallySingularSetSlice κ η a)ᶜ = 0 
goal: (η.withDensity (κ.rnDeriv η)) a = 0 ↔ ((η.withDensity (κ.rnDeriv η)) a) (κ.mutuallySingularSetSlice η a)ᶜ = 0

full_name: ProbabilityTheory.Kernel.singularPart_eq_zero_iff_absolutelyContinuous
code: lemma singularPart_eq_zero_iff_absolutelyContinuous (κ η : Kernel α γ)
    [IsFiniteKernel κ] [IsFiniteKernel η] (a : α) :
    singularPart κ η a = 0 ↔ κ a ≪ η a 
goal: (κ.singularPart η) a = 0 ↔ κ a ≪ η a

full_name: ProbabilityTheory.Kernel.withDensity_rnDeriv_eq_zero_iff_mutuallySingular
code: lemma withDensity_rnDeriv_eq_zero_iff_mutuallySingular (κ η : Kernel α γ)
    [IsFiniteKernel κ] [IsFiniteKernel η] (a : α) :
    withDensity η (rnDeriv κ η) a = 0 ↔ κ a ⟂ₘ η a 
goal: (η.withDensity (κ.rnDeriv η)) a = 0 ↔ κ a ⟂ₘ η a

full_name: ProbabilityTheory.Kernel.singularPart_eq_zero_iff_measure_eq_zero
code: lemma singularPart_eq_zero_iff_measure_eq_zero (κ η : Kernel α γ)
    [IsFiniteKernel κ] [IsFiniteKernel η] (a : α) :
    singularPart κ η a = 0 ↔ κ a (mutuallySingularSetSlice κ η a) = 0 
goal: (κ.singularPart η) a = 0 ↔ (κ a) (κ.mutuallySingularSetSlice η a) = 0

full_name: ProbabilityTheory.Kernel.withDensity_rnDeriv_eq_zero_iff_measure_eq_zero
code: lemma withDensity_rnDeriv_eq_zero_iff_measure_eq_zero (κ η : Kernel α γ)
    [IsFiniteKernel κ] [IsFiniteKernel η] (a : α) :
    withDensity η (rnDeriv κ η) a = 0 ↔ κ a (mutuallySingularSetSlice κ η a)ᶜ = 0 
goal: (η.withDensity (κ.rnDeriv η)) a = 0 ↔ (κ a) (κ.mutuallySingularSetSlice η a)ᶜ = 0

full_name: ProbabilityTheory.Kernel.measurableSet_absolutelyContinuous
code: /-- The set of points `a : α` such that `κ a ≪ η a` is measurable. -/
@[measurability]
lemma measurableSet_absolutelyContinuous (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    MeasurableSet {a | κ a ≪ η a} 
goal: MeasurableSet {a | κ a ≪ η a}

full_name: ProbabilityTheory.Kernel.measurableSet_mutuallySingular
code: /-- The set of points `a : α` such that `κ a ⟂ₘ η a` is measurable. -/
@[measurability]
lemma measurableSet_mutuallySingular (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η] :
    MeasurableSet {a | κ a ⟂ₘ η a} 
goal: MeasurableSet {a | κ a ⟂ₘ η a}