Mathlib.Probability.Kernel.ThreeBernoulli.SelectedLawKL
This module collects density, likelihood, conditional-KL, and quadratic comparison results for two selected three-Bernoulli laws with a common base measure and treatment propensity.
Bernoulli 3 core · 0 supporting This module records a real Bernoulli KL formula and quadratic bounds used by selected three-Bernoulli laws. ★ bernoulliKL_le_inv_margin_sq★ bernoulliKL_symmetric_le_four
Scalar Bernoulli divergence bounds
This module records a real Bernoulli KL formula and quadratic bounds used by selected three-Bernoulli laws. The general coefficient depends on an interior margin; the symmetric small-perturbation bound reuses the quarter-band result.
The real Bernoulli KL expression compares a success mean with a reference success mean through its success and failure cells: p · log(p/q) + (1 - p) · log((1 - p)/(1 - q)), with the real logarithm.
Bernoulli KL is at most the squared difference divided by the squared interior margin when the margin is positive and both means lie in the margin band.
Formal statement
Proof (Lean source)
A symmetric Bernoulli perturbation has KL at most four times its squared mean difference when its displacement is at most 1/32.
Formal statement
Proof (Lean source)
Density 3 core · 0 supporting The existing selectedLaw_cell theorem supplies the four conditional cells. ★ selectedLaw_eq_withDensity★ selectedLaw_ac
Density comparison of selected three-Bernoulli laws
The existing selectedLaw_cell theorem supplies the four conditional cells.
Here a positive cellwise ratio gives a density of one selected law with respect
to another when the base and treatment propensity are common.
The cellwise likelihood ratio at a selected observation compares two outcome-mean pairs under the same treatment propensity: the observation's selected cell mass under the first pair divided by its selected cell mass under the second pair, at the observation's covariate value, read as an extended nonnegative number. A zero denominator gives ratio zero by the real-division convention, so the ratio is a genuine likelihood ratio only where the second cell mass is positive.
Definition (Lean source)
The first selected law is the second selected law weighted by its cellwise likelihood ratio for a probability base law, measurable propensity and outcome means, and uniform interior bounds on the propensity and the reference outcome means.
Formal statement
Proof (Lean source)
Of two selected laws with a shared base and propensity, the one with the first pair of outcome means is absolutely continuous with respect to the one with the second pair for measurable interior parameters over a probability base law.
Formal statement
Proof (Lean source)
Bound 2 core · 0 supporting The conditional KL identity and scalar Bernoulli bounds give an integrated quadratic control of changes in the two outcome means. ★ selectedLaw_klDiv_toReal_le_integral_sq★ selectedLaw_klDiv_toReal_le_symmetric
Quadratic KL control for selected Bernoulli laws
The conditional KL identity and scalar Bernoulli bounds give an integrated quadratic control of changes in the two outcome means.
The real-valued KL divergence between two selected laws is at most the covariate integral of the propensity-weighted squared changes in the two outcome means, each divided by the squared interior margin (untreated change weighted by one minus the propensity, treated change by the propensity) for a probability covariate law, measurable parameters, and uniform interior bounds.
Formal statement
Proof (Lean source)
When only the treated outcome mean changes symmetrically, selected-law KL is at most four times the propensity-weighted squared mean difference for a probability covariate law, measurable propensity, common untreated mean, and displacement, uniform interior bounds, and small displacement.
Formal statement
Proof (Lean source)
Cell 1 core · 0 supporting For a common treatment propensity, the propensity factor cancels from each cell likelihood ratio, leaving the two weighted Bernoulli divergences. ★ sum_cellMass_mul_log_ratio_eq_weighted_bernoulliKL
Algebra of four selected Bernoulli cells
For a common treatment propensity, the propensity factor cancels from each cell likelihood ratio, leaving the two weighted Bernoulli divergences.
The sum of four selected-cell KL contributions equals the two weighted Bernoulli divergences for a strictly interior propensity.
Formal statement
Proof (Lean source)
ChainRule 1 core · 0 supporting When two selected laws have the same covariate law and treatment propensity, their KL divergence is the covariate expectation of the two propensity-weighted Bernoulli divergences. ★ selectedLaw_klDiv_toReal_eq_integral
Conditional KL identity for selected Bernoulli laws
When two selected laws have the same covariate law and treatment propensity, their KL divergence is the covariate expectation of the two propensity-weighted Bernoulli divergences.
The real-valued KL divergence between two selected laws with the same covariate law and propensity equals the covariate integral of the conditional Bernoulli KL: one minus the propensity times the untreated-mean Bernoulli KL plus the propensity times the treated-mean Bernoulli KL for a probability covariate law, measurable propensity and means, and uniform interior bounds.
Formal statement
Proof (Lean source)
Integral 1 core · 0 supporting The log density ratio of two selected laws can be integrated by first summing over the four treatment and outcome cells at each covariate value. ★ selectedLaw_integral_cell_log_eq_sum
Cellwise integration for selected Bernoulli laws
The log density ratio of two selected laws can be integrated by first summing over the four treatment and outcome cells at each covariate value.
The expected cellwise log likelihood ratio is the covariate integral of the four cell contributions for a probability covariate law, measurable propensity and outcome means, and uniform interior bounds.
Formal statement
Proof (Lean source)
Likelihood 2 core · 1 supporting Uniformly interior cell probabilities make the selected-law log likelihood ratio a bounded measurable function and therefore integrable. ★ selectedCellRatio_log_integrable★ selectedLaw_llr_integrable
Selected-law log likelihood
Uniformly interior cell probabilities make the selected-law log likelihood ratio a bounded measurable function and therefore integrable.
The logarithm of the positive cellwise density ratio is integrable under the first selected law when all five parameter functions are measurable and uniformly interior.
Formal statement
Proof (Lean source)
The selected-law log likelihood ratio is integrable under the first selected law for a probability base, measurable parameters, and uniform interior bounds.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
selectedLaw_llr_ae_eq_cell_logtheorem — The selected-law log likelihood equals the logarithm of the cellwise ratio almost everywhere under the first law for a probability base, measurable parameters, and uniform interior bounds on the propensity and target law.hypothesesX :Type uμ :e q₀ q₁ q₀' q₁' :X → ℝhe :hq₀ :Measurable q₀hq₁ :Measurable q₁hq₀' :Measurable q₀'hq₁' :Measurable q₁'η :ℝhη0 :0 < ηheη :∀ x, e x ∈ Icc η (1 - η)hq₀'η :∀ x, q₀' x ∈ Icc η (1 - η)hq₁'η :∀ x, q₁' x ∈ Icc η (1 - η)conclusionProof (Lean source)
theorem selectedLaw_llr_ae_eq_cell_log {X : Type u} [MeasurableSpace X] (μ : Measure X) [IsProbabilityMeasure μ] (e q₀ q₁ q₀' q₁' : X → ℝ) (he : Measurable e) (hq₀ : Measurable q₀) (hq₁ : Measurable q₁) (hq₀' : Measurable q₀') (hq₁' : Measurable q₁') {η : ℝ} (hη0 : 0 < η) (heη : ∀ x, e x ∈ Icc η (1 - η)) (hq₀'η : ∀ x, q₀' x ∈ Icc η (1 - η)) (hq₁'η : ∀ x, q₁' x ∈ Icc η (1 - η)) : llr (selectedLaw μ e q₀ q₁) (selectedLaw μ e q₀' q₁') =ᵐ[selectedLaw μ e q₀ q₁] fun z => log (selectedCellRatio e q₀ q₁ q₀' q₁' z).toReal := by have he01 (x : X) : e x ∈ Icc (0 : ℝ) 1 := by rcases heη x with ⟨hl, hu⟩ constructor <;> linarith have hq₀'01 (x : X) : q₀' x ∈ Icc (0 : ℝ) 1 := by rcases hq₀'η x with ⟨hl, hu⟩ constructor <;> linarith have hq₁'01 (x : X) : q₁' x ∈ Icc (0 : ℝ) 1 := by rcases hq₁'η x with ⟨hl, hu⟩ constructor <;> linarith letI : IsProbabilityMeasure (selectedLaw μ e q₀' q₁') := selectedLaw_probability μ e q₀' q₁' he hq₀' hq₁' he01 hq₀'01 hq₁'01 have hderiv : (selectedLaw μ e q₀ q₁).rnDeriv (selectedLaw μ e q₀' q₁') =ᵐ[selectedLaw μ e q₀' q₁'] selectedCellRatio e q₀ q₁ q₀' q₁' := by conv_lhs => rw [selectedLaw_eq_withDensity μ e q₀ q₁ q₀' q₁' he hq₀ hq₁ hq₀' hq₁' hη0 heη hq₀'η hq₁'η] exact Measure.rnDeriv_withDensity _ (measurable_selectedCellRatio he hq₀ hq₁ hq₀' hq₁') have hac := selectedLaw_ac μ e q₀ q₁ q₀' q₁' he hq₀ hq₁ hq₀' hq₁' hη0 heη hq₀'η hq₁'η filter_upwards [hac.ae_le hderiv] with z hz exact congrArg (fun (t : ENNReal) => log t.toReal) hz