Mathlib.Probability.Poisson.Finite­Partition.Unequal­Mass­KL

This module collects the count, conditional-sample, and finite-measure components of the exact KL identity for finite marked Poisson laws with arbitrary total intensity masses.

Count 2 core · 3 supporting This module gives the exact extended-real divergence of Poisson count laws at arbitrary nonnegative rates, including zero rates. ★ klDiv_poissonMeasure

Unequal-rate Poisson count divergence

This module gives the exact extended-real divergence of Poisson count laws at arbitrary nonnegative rates, including zero rates.

def poissonRateKL reviewed
Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL

Two nonnegative Poisson rates determine the extended-real rate divergence, given by three cases: the second rate when the first rate is zero; infinity when the first rate is positive and the second is zero; and otherwise the first rate times the logarithm of the ratio of first to second rate, plus the second rate, minus the first.

Definition (Lean source)
r s :
ℝ≥0
poissonRateKL r s :
ℝ≥0∞
if r
= 0 then (s : ℝ≥0∞) else if s = 0 then ∞ else ofReal ((r : ℝ) * log ((r : ℝ) / (s : ℝ)) + (s : ℝ) - (r : ℝ))
Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL.poissonRateKL · Causalean/Mathlib/Probability/Poisson/FinitePartition/UnequalMassKL/Count.lean:118
theorem klDiv_poissonMeasure reviewed
Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL

Two nonnegative Poisson rates imply that the exact extended-real count-law divergence equals their rate divergence, including the zero-rate cases.

Formal statement
r s :
ℝ≥0
Proof (Lean source)
theorem klDiv_poissonMeasure (r s : ℝ≥0) : klDiv (poissonMeasure r) (poissonMeasure s) = poissonRateKL r s := by by_cases hr : r = 0 · subst r simpa [poissonRateKL] using klDiv_poissonMeasure_zero_left s by_cases hs : s = 0 · subst s simpa [poissonRateKL, hr] using klDiv_poissonMeasure_zero_right r hr simpa [poissonRateKL, hr, hs] using klDiv_poissonMeasure_pos r s hr hs
Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL.klDiv_poissonMeasure · Causalean/Mathlib/Probability/Poisson/FinitePartition/UnequalMassKL/Count.lean:288 · uses poissonRateKL
3 supporting declarations (lemmas, instances)
  • poissonMeasure_zero_eq_dirac theorem — The Poisson count law at zero rate is the point mass at count zero.
    poissonMeasure 0 = Measure.dirac 0
    Proof (Lean source)
    theorem poissonMeasure_zero_eq_dirac : poissonMeasure 0 = Measure.dirac 0 := by ext s hs rw [poissonMeasure, Measure.sum_apply _ hs] refine (tsum_eq_single 0 ?_).trans ?_ · intro n hn rw [Measure.smul_apply, smul_eq_mul] simp [zero_pow hn] · simp
    Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL.poissonMeasure_zero_eq_dirac · Causalean/Mathlib/Probability/Poisson/FinitePartition/UnequalMassKL/Count.lean:19
  • poisson_lintegral_count theorem — A nonnegative Poisson rate determines an extended-real first count moment equal to that rate.
    r :
    ℝ≥0
    ∫⁻ n : ℕ, (n : ℝ≥0∞) ∂poissonMeasure r = (r : ℝ≥0∞)
    Proof (Lean source)
    theorem poisson_lintegral_count (r : ℝ≥0) : ∫⁻ n : ℕ, (n : ℝ≥0∞) ∂poissonMeasure r = (r : ℝ≥0∞) := by rw [lintegral_countable'] simp_rw [poissonMeasure_singleton_eq_poissonPMF] rw [tsum_eq_zero_add' ENNReal.summable] simp only [Nat.cast_zero, zero_mul, zero_add] simp_rw [poissonPMF_succ_mul] rw [ENNReal.tsum_mul_left, PMF.tsum_coe, mul_one]
    Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL.poisson_lintegral_count · Causalean/Mathlib/Probability/Poisson/FinitePartition/UnequalMassKL/Count.lean:106
  • poissonRateKL_mul_left theorem — A common intensity multiplier and two Poisson rates imply that their rate divergence scales by that multiplier, including zero rates.
    lam r s :
    ℝ≥0
    poissonRateKL (lam * r) (lam * s) = (lam : ℝ≥0∞) * poissonRateKL r s
    Proof (Lean source)
    theorem poissonRateKL_mul_left (lam r s : ℝ≥0) : poissonRateKL (lam * r) (lam * s) = (lam : ℝ≥0∞) * poissonRateKL r s := by by_cases hl : lam = 0 · subst lam simp [poissonRateKL] by_cases hr : r = 0 · subst r simp [poissonRateKL] by_cases hs : s = 0 · subst s simp [poissonRateKL, hl, hr] have hlr : lam * r ≠ 0 := mul_ne_zero hl hr have hls : lam * s ≠ 0 := mul_ne_zero hl hs simp only [poissonRateKL, if_neg hlr, if_neg hls, if_neg hr, if_neg hs] have hla : (lam : ℝ) ≠ 0 := by exact_mod_cast hl have hsa : (s : ℝ) ≠ 0 := by exact_mod_cast hs have hratio : ((lam * r : ℝ≥0) : ℝ) / ((lam * s : ℝ≥0) : ℝ) = (r : ℝ) / (s : ℝ) := by push_cast field_simp rw [hratio] have hfactor : ((lam * r : ℝ≥0) : ℝ) * log ((r : ℝ) / (s : ℝ)) + ((lam * s : ℝ≥0) : ℝ) - ((lam * r : ℝ≥0) : ℝ) = (lam : ℝ) * ((r : ℝ) * log ((r : ℝ) / (s : ℝ)) + (s : ℝ) - (r : ℝ)) := by push_cast ring rw [hfactor] rw [ENNReal.ofReal_mul (by exact_mod_cast (show 0 ≤ lam from lam.property))] simp
    Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL.poissonRateKL_mul_left · Causalean/Mathlib/Probability/Poisson/FinitePartition/UnequalMassKL/Count.lean:303
Finite­Measure 1 core · 2 supporting This module identifies the relative entropy of finite marked Poisson laws with scalar intensity times the finite-measure divergence, retaining the total-mass correction. ★ klDiv_finiteMeasureMarkedPoissonLaw_unequal

Unequal-mass finite marked-Poisson divergence

This module identifies the relative entropy of finite marked Poisson laws with scalar intensity times the finite-measure divergence, retaining the total-mass correction.

theorem klDiv_finiteMeasureMarkedPoissonLaw_unequal reviewed
Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL

On a standard Borel observation space, two finite intensity measures, a shared fallback probability law, a shared real mark law, and a nonnegative scalar intensity imply that the extended-real KL divergence between the two finite-measure marked Poisson laws equals the scalar intensity times the KL divergence between the two intensity measures, where the divergence of finite measures includes the total-mass correction, so unequal total masses are covered.

Formal statement
ν₁ ν₀ :
lam :
ℝ≥0
= (lam : ℝ≥0∞) * klDiv ν₁ ν₀
Proof (Lean source)
theorem klDiv_finiteMeasureMarkedPoissonLaw_unequal {X : Type*} [MeasurableSpace X] [StandardBorelSpace X] (ν₁ ν₀ : Measure X) [IsFiniteMeasure ν₁] [IsFiniteMeasure ν₀] (P₀ : Measure X) [IsProbabilityMeasure P₀] (R : Measure ℝ) [IsProbabilityMeasure R] (lam : ℝ≥0) : klDiv (finiteMeasureMarkedPoissonLaw ν₁ P₀ R lam) (finiteMeasureMarkedPoissonLaw ν₀ P₀ R lam) = (lam : ℝ≥0∞) * klDiv ν₁ ν₀ := by /- Unfold each marked law; use `klDiv_finiteMarkedPoissonSampleLaw_unequal`. Rewrite count KL by `klDiv_poissonMeasure` and scale the rate expression with `poissonRateKL_mul_left`. The remaining sum is `lam *` the `klDiv_eq_poissonRateKL_add_normalized` identity; use distributivity. Do not split on absolute continuity or mass here: those cases are already covered by the two imported identities, including `0 * ∞`. -/ unfold finiteMeasureMarkedPoissonLaw rw [klDiv_finiteMarkedPoissonSampleLaw_unequal, klDiv_poissonMeasure, poissonRateKL_mul_left, klDiv_eq_poissonRateKL_add_normalized ν₁ ν₀ P₀] simp only [ENNReal.coe_mul, mul_add, mul_assoc]
Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL.klDiv_finiteMeasureMarkedPoissonLaw_unequal · Causalean/Mathlib/Probability/Poisson/FinitePartition/UnequalMassKL/FiniteMeasure.lean:163 · uses FiniteSample , finiteMeasureMarkedPoissonLaw
2 supporting declarations (lemmas, instances)
Marked 1 core · 0 supporting This module factors a finite marked Poisson law through its count and fixed-size conditional sample kernel, then applies the KL chain rule at unequal rates. ★ klDiv_finiteMarkedPoissonSampleLaw_unequal

Marked Poisson divergence at unequal rates

This module factors a finite marked Poisson law through its count and fixed-size conditional sample kernel, then applies the KL chain rule at unequal rates.

theorem klDiv_finiteMarkedPoissonSampleLaw_unequal reviewed
Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL

On a standard Borel point space, two point probability laws, a shared real mark law, and two nonnegative count rates imply that the extended-real KL divergence between the two finite marked Poisson sample laws equals the KL divergence between the two Poisson count laws plus the first (source) rate times the KL divergence between the point laws.

Formal statement
Proof (Lean source)
theorem klDiv_finiteMarkedPoissonSampleLaw_unequal {X : Type*} [MeasurableSpace X] [StandardBorelSpace X] (P Q : Measure X) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (R : Measure ℝ) [IsProbabilityMeasure R] (r s : ℝ≥0) : klDiv (finiteMarkedPoissonSampleLaw P R r) (finiteMarkedPoissonSampleLaw Q R s) = klDiv (poissonMeasure r) (poissonMeasure s) + (r : ℝ≥0∞) * klDiv P Q := by by_cases hPQ : P ≪ Q · exact klDiv_finiteMarkedPoissonSampleLaw_of_ac_unequal P Q R r s hPQ by_cases hr : r = 0 · subst r rw [klDiv_finiteMarkedPoissonSampleLaw_zero_left] simp rw [InformationTheory.klDiv_of_not_ac (finiteMarkedPoissonSampleLaw_not_ac_of_not_point_ac P Q R r s hr hPQ), InformationTheory.klDiv_of_not_ac hPQ] have hr' : (r : ℝ≥0∞) ≠ 0 := by simpa using hr simp [ENNReal.mul_top hr']
Causalean.Mathlib.Probability.Poisson.FinitePartition.UnequalMassKL.klDiv_finiteMarkedPoissonSampleLaw_unequal · Causalean/Mathlib/Probability/Poisson/FinitePartition/UnequalMassKL/Marked.lean:359 · uses FiniteSample , finiteMarkedPoissonSampleLaw