Repository navigation
feat: two mixture nulls separating one observation, the bipolar rate and the relative entropy - #435
RemyDegenne wants to merge 5 commits into
Conversation
…and the relative entropy On the circle with Lebesgue measure, for the null of the mixtures (1 - ε) U + ε volume with U uniform on a coset x₀ + (1/N)ℤ: one observation carries no evidence (maxLogGrowth 1 = 0), and the bipolar rate and the smallest relative entropy to the null are both log (1/ε). For any probability measure Q and the null of the mixtures (1 - ε) F + ε Q with F finitely supported: maxLogGrowth n = 0 for every n, so the bipolar rate is 0, while the smallest relative entropy is log (1/ε) when Q has no atoms. With the prerequisites: products of mixtures of measures, the relative entropy to a mixture with a singular law, the maximal expected logarithm on the effective null, and Lebesgue measure on the circle has no atoms. EValues roadmap, Layer 6, item 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0196ftMVbgjSJzPQEwdek3kM
There was a problem hiding this comment.
🟡 proof-quality — request_changes claude/claude-opus-5-5
Several steps in Circle.lean and FiniteSupport.lean are long named-lemma rw chains that a single simp call would make robust to Mathlib renames. The argument that the infimum of a constant klDiv over the null equals that constant is written out twice instead of being factored into one lemma.
LMLExplore/EValues/BipolarRate/Circle.lean:300— Brittle eight-lemmarwa [measure_univ, uniformOn_coset_one, lintegral_add_measure, lintegral_smul_measure, lintegral_smul_measure, lintegral_dirac, smul_eq_mul, smul_eq_mul] at h. The same pattern recurs at line 305 (rw [lintegral_add_right _ measurable_const, lintegral_const_mul _ hX.measurable, lintegral_const, measure_univ, mul_one, add_mul]), at line 351 (rw [add_apply, smul_apply, (uniformOn_eq_zero_iff ..).2 .., smul_zero, zero_add, smul_apply, smul_eq_mul]) and in the cast chains oflog_inv_le_bipolarRate(lines ~220-233). Fix: Replace each chain with onesimpa [uniformOn_coset_one, lintegral_add_measure] using h/simp [lintegral_add_right, lintegral_const_mul, add_mul]/simp [(uniformOn_eq_zero_iff (finite_coset x₀ N)).2 (Set.inter_compl_self _)]-style call, keeping only the non-simp lemmas explicit.LMLExplore/EValues/BipolarRate/FiniteSupport.lean:205— Brittle six-lemma chainrw [ENNReal.ofReal_div_of_pos .., ENNReal.ofReal_natCast, ENNReal.ofReal_pow .., ENNReal.ofReal_natCast, div_eq_mul_inv, ENNReal.inv_pow]used to move the descFactorial limit from ℝ to ℝ≥0∞. Fix: Close the cast step withsimp [ENNReal.ofReal_div_of_pos, ENNReal.ofReal_pow, div_eq_mul_inv, ENNReal.inv_pow]orpush_cast, or state the limit directly in ℝ≥0∞ throughENNReal.tendsto_toReal_iff-style transfer.LMLExplore/EValues/BipolarRate/Circle.lean:328— The proof that the infimum of klDiv over the null equals a constant (rw [← hkl ..]; congr 1; refine (biInf_congr ?_).trans (biInf_const ⟨..⟩); ... EReal.coe_ennreal_injective (...)) is written out twice. The second copy is iniInf_klDiv_finitelySupported_mixturesat FiniteSupport.lean:241. Fix: Factor a lemma, e.g.(∀ P ∈ S, ((f P : ℝ≥0∞) : EReal) = c) → S.Nonempty → ((⨅ P ∈ S, f P : ℝ≥0∞) : EReal) = c, next toklDiv_mixture_of_mutuallySingularin Mixture.lean, and use it in both theorems.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5-5 · 43s · 135.1k in (90.5k cache read, 44.6k cache write) / 4.3k out tokens · reviewing this diff · rubric ·
AI review — changes requestedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
…proof steps Credit EValuesResearch/Results/RateVersusKL.lean (commit dd4072f) of RemyDegenne/evalues_research and [EVR26, Note 19] in the ported files. Factor the expected utility of a constant times an indicator into ProbabilityTheory.Utility.eintegral_comp_indicator_const, use biInf_congr and biInf_const for the constant relative entropies, move the logarithm identity to the reals, drop a rewrite back and name the coset null once in its proof. Co-Authored-By: Claude Code <noreply@github.com>
Main (LeanMachineLearning#413) moved LMLExplore/EValues/BipolarRate.lean to LMLExplore/EValues/BipolarRate/Basic.lean; point the Circle and FiniteSupport imports at the new module. Co-Authored-By: Claude Code <noreply@github.com>
Co-Authored-By: Claude Code <noreply@github.com>
This pull request proves the two instances of the bipolar rate of Layer 6, item 1, of the EValues roadmap: on the circle with Lebesgue measure, a null against which one observation carries no evidence while the bipolar rate equals the smallest relative entropy
log (1/ε), and a null whose bipolar rate is0while the smallest relative entropy islog (1/ε). It adds four new files,LMLExplore/EValues/BipolarRate/Circle.lean(355 lines),LMLExplore/EValues/BipolarRate/FiniteSupport.lean(241 lines),LMLExplore/InformationTheory/KullbackLeibler/Mixture.lean(79 lines)LMLExplore/MeasureTheory/Integral/IntervalIntegral/Periodic.lean(34 lines) andLMLExplore/EValues/Utility/Basic.lean(43 lines), and adds lemmas to two existing files,LMLExplore/MeasureTheory/Constructions/Pi.lean(+58 lines) andLMLExplore/EValues/EffectiveSet.lean(+12 lines). It removes and renames nothing.Main declarations
maxLogGrowth_one_coset_mixtures_eq_zero,bipolarRate_coset_mixtures,iInf_klDiv_coset_mixtures: forε ≤ 1and the nullS = {(1 - ε) • uniformOn {x | x - x₀ ∈ AddSubgroup.zmultiples (((N : ℝ)⁻¹ : ℝ) : UnitAddCircle)} + ε • volume | (x₀ : UnitAddCircle) (N : ℕ)}onUnitAddCircle:maxLogGrowth volume S 1 = 0,bipolarRate volume S = ENNReal.log ε⁻¹, and((⨅ P ∈ S, klDiv volume P : ℝ≥0∞) : EReal) = ENNReal.log ε⁻¹.maxLogGrowth_finitelySupported_mixtures_eq_zero,bipolarRate_finitelySupported_mixtures_eq_zero,iInf_klDiv_finitelySupported_mixtures: for any measurable space with measurable singletons, any probability measureQ,ε ≤ 1and the nullS = {(1 - ε) • F + ε • Q | (F : Measure 𝓧) (_ : IsProbabilityMeasure F) (_ : ∃ s : Set 𝓧, s.Finite ∧ F sᶜ = 0)}:maxLogGrowth Q S n = 0for everyn,bipolarRate Q S = 0, and, whenQhas no atoms ([NullSingletonClass Q]),((⨅ P ∈ S, klDiv Q P : ℝ≥0∞) : EReal) = ENNReal.log ε⁻¹.InformationTheory.klDiv_mixture_of_mutuallySingular: for probability measuresμ,νwithν ⟂ₘ μandε ≤ 1,((klDiv μ ((1 - ε) • ν + ε • μ) : ℝ≥0∞) : EReal) = ENNReal.log ε⁻¹.ProbabilityTheory.maxUtility_eq_zero_of_mem_effectiveSet(inEffectiveSet.lean): for a probability measureP ∈ effectiveSet S,maxUtility P S logUtility = 0.Pi.lean:MeasureTheory.Measure.pi_sum_smul(the product of finite mixtures∑ k, w i k • μ i kis∑ σ, (∏ i, w i (σ i)) • Measure.pi fun i ↦ μ i (σ i)),MeasureTheory.Measure.measurable_pi_comp(x ↦ Measure.pi fun i ↦ G i (x i)is measurable for measurable mapsG ito finite measures) andMeasureTheory.Measure.pi_bind_pi((Measure.pi μ).bind (fun x ↦ Measure.pi fun i ↦ G i (x i)) = Measure.pi fun i ↦ (μ i).bind (G i)).ProbabilityTheory.Utility.eintegral_comp_indicator_const(inEValues/Utility/Basic.lean, mirroring Statlib'sEValues/Utility/Basic.lean): under a probability measureμwithμ Aᶜ = 0,∫ᵉ x, (U ∘ A.indicator fun _ ↦ c) x ∂μ = U cfor every utilityU. It is the shared last step ofklDiv_mixture_of_mutuallySingularand of the lower bound on the coset bipolar rate.NullSingletonClass (volume : Measure (AddCircle T)), inMeasureTheory/Integral/IntervalIntegral/Periodic.lean, next to Mathlib's file of the same path whereAddCircle.volume_closedBalllives. Mathlib does not infer it: its Haar-measure instanceIsAddHaarMeasure.nullSingletonClassneeds(𝓝[≠] 0).NeBot, which is not an instance onAddCircle.Roadmap coverage (EValues, Layer 6, item 1)
Covered: the bullet "The inequality
d ≤ KL_inf(Q₁, S₁)can be strict [RR26, Proposition 5.4], and one observation may carry no evidence whend = KL_inf(Q₁, S₁) > 0. Instances on the circle …": both instances. For the coset null,a 1 = 0andd = KL_inf(Q₁, S₁) = log (1/ε). For the finitely supported null,d = 0andKL_inf(Q₁, S₁) = log (1/ε), stated for anyQ₁and derived on the circle withQ₁ = volume(see below).Left: [RR26, Proposition 5.4] itself and the other bullets of item 1. The two instances have no published source: the roadmap cites them
[EVR26, Note 19]. The proofs here are their Lean proofs from the paper project, restated as described below.Notes for reviewers
mem_*_iffAPI. The cost is that each set appears in its three statements. The proofs use private lemmas about one member, or about any null whose members have the properties the proof uses.x₀ + (1/N) ℤis written{x | x - x₀ ∈ AddSubgroup.zmultiples (((N : ℝ)⁻¹ : ℝ) : UnitAddCircle)}, andUis Mathlib'suniformOn. Since0⁻¹ = 0,N = 0gives the pointx₀, asN = 1does, soNneeds no constraint.ε ≤ 1instead ofε ∈ (0, 1]: forε = 0the bipolar rate and the smallest relative entropy of the coset null are both⊤. For the finitely supported null,d = 0andKL_inf = ⊤. The proofs cover this case.Qon a measurable space with measurable singletons, since the proof uses nothing about the circle. The boundd = 0holds for every suchQ, and is proved in the stronger formmaxLogGrowth Q S n = 0for everyn. The valuelog (1/ε)of the smallest relative entropy needsQwithout atoms. The roadmap's instance isQ = volumeonUnitAddCircle, with theNullSingletonClassinstance of this pull request.⨅ P ∈ S, klDiv Q Pinℝ≥0∞, coerced toERealto compare it withENNReal.log ε⁻¹, as inbipolarRate_le_iInf_klDivand the open feat: n observations are worth n times one when one observation attains the smallest relative entropy #421.a 1 = 0for the coset null: Lebesgue measure is the average overxof the members(1 - ε) δ_x + ε volume(N = 1), so it lies in the effective null, andmaxUtility_eq_zero_of_mem_effectiveSet(Jensen's inequality) applies.klDiv_mixture_of_mutuallySingular, whose proof is Statlib's variational formmaxUtility_singleton_eq_klDiv: an e-variable for the mixture has mean at most1/εunderμ, andε⁻¹times the indicator of a set charged byμalone is an e-variable.1undervolume ^ nand at mostn ε ^ (n - 1)under then-fold product of a member. So their indicator divided byn ε ^ (n - 1)is ann-sample e-variable, with expected logarithm(n - 1) log (1/ε) - log n. The upper bound isbipolarRate_le_iInf_klDiv.d = 0for the finitely supported null: withG z = (1 - ε) δ_z + ε Q, the uniform mixture of theG (y k)overy : Fin m → 𝓧is a member of the null. Itsn-fold product expands along the mapsσ : Fin n → Fin m(pi_sum_smul). For an injectiveσ, the average overyofQ ^ mof the products of theG (y (σ i))isQ ^ n, by Statlib'sMeasure.pi_map_comp_of_injectiveandpi_bind_pi. Hence everyn-sample e-variable has mean at mostm ^ n / (m (m - 1) ⋯ (m - n + 1))underQ ^ nfor everym, so at most1.Pi.leanis the canonical home of the three product lemmas. It gains the importsMathlib.MeasureTheory.Measure.GiryMonad(public) andTauCeti.MeasureTheory.Integral.Pi(private, forTauCeti.lintegral_fintype_prod_eq_prod).EffectiveSet.leangains one theorem at its end and one bullet in its docstring.Pi.lean: it addsFin 2integrals afterend MeasureTheory.Measureand the sameTauCeti.MeasureTheory.Integral.Piimport. Whichever lands second will have small textual conflicts in the imports, the docstring list and the end of the file, with no mathematical overlap.EffectiveSet.leanin other places.maxLogGrowth Q S n = 0fromQ ^ n ∈ effectiveSetinline through the duality;maxUtility_eq_zero_of_mem_effectiveSetgives that step without hypotheses onS.LMLExplore/EValues/BipolarRate.leantoLMLExplore/EValues/BipolarRate/Basic.lean. If it lands first, the imports ofCircle.leanandFiniteSupport.leanmust follow, as forSemicontinuity.leanand feat: n observations are worth n times one when one observation attains the smallest relative entropy #421'sSingleLetter.lean.SingleLetter.lean) is not needed.Circle.leannotes that, forε < 1, the smallest relative entropy is not lower semicontinuous atvolumefor the topology of integrals of bounded measurable functions, so thatbipolarRate_eq_iInf_klDiv_of_forall_exists_forall_ledoes not apply. That fact is stated as not proved here.EValuesResearch/Results/RateVersusKL.lean, commitdd4072f, credited in the module docstrings ofCircle.lean,FiniteSupport.lean,Mixture.lean,Pi.leanand in the docstring ofmaxUtility_eq_zero_of_mem_effectiveSet):cosetLaw,cosetNullandfiniteSupportNull, and states each null's results as a conjunction. Here the sets are inline and each result is its own theorem.uniformOnof the coset written withzmultiples, instead of an average of Dirac masses overFinset.range Nwith0 < N.Fcarried by aFinset. Here it is on any space, withFcarried by a finiteSet.⟂ₘ, and the maximal expected logarithm through the effective null. The source's reindexing lemma is replaced by Statlib'sMeasure.pi_map_comp_of_injective, its count of injective maps byFintype.card_embedding_eq, and its probability instance for the circle by Tau Ceti's.Roadmap: EValues
Paper: RemyDegenne/evalues_research
Item: R35
🤖 Generated with Claude Code
https://claude.ai/code/session_0196ftMVbgjSJzPQEwdek3kM