Repository navigation
feat: the dual formula for the smallest relative entropy to a null generated by finitely many constraints, with no constraint qualification #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
RemyDegenne
wants to merge
5
commits into
LeanMachineLearning:main
Choose a base branch
from
RemyDegenne:evr/constraint-null-klinf
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+758
−11
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
af10b45
feat: the dual formula for the smallest relative entropy to a null ge…
RemyDegenne 51948b1
refactor: factor the dual-formula proofs into lemmas and cite their s…
RemyDegenne 5fe0074
refactor: factor the general steps of the dual-formula proofs and cit…
RemyDegenne 47fb2c7
refactor: name the damped density and drop "strong duality" from the …
RemyDegenne 3f2b591
refactor: reuse integral_sum_smul_dirac and move abs_log_one_add_mul_…
RemyDegenne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
86 changes: 86 additions & 0 deletions
86
LMLExplore/Analysis/SpecialFunctions/Integrability/PosLog.lean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| /- | ||
| Copyright (c) 2026 LMLExplore contributors. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: LMLExplore contributors | ||
| -/ | ||
| module | ||
|
|
||
| public import Mathlib.Analysis.SpecialFunctions.Log.PosLog | ||
| public import Mathlib.MeasureTheory.Function.L1Space.Integrable | ||
| public import Mathlib.MeasureTheory.Integral.Bochner.Basic | ||
| import LMLExplore.Analysis.SpecialFunctions.Log.Basic | ||
| import Mathlib.MeasureTheory.Function.SpecialFunctions.Basic | ||
| import Mathlib.MeasureTheory.Integral.DominatedConvergence | ||
|
|
||
| /-! | ||
| # Integrability of `log (1 + ∑ i, |f i|)` | ||
|
|
||
| Finitely many real functions whose positive logarithms `log⁺ (f i)` are integrable under a finite | ||
| measure have an integrable `log (1 + ∑ i, |f i|)`, and damping the sum by a factor in `[0, 1]` | ||
| keeps the integrability. As the damping factor tends to `0`, so does the integral of the damped | ||
| logarithm, by dominated convergence. | ||
|
|
||
| ## Main statements | ||
|
|
||
| * `MeasureTheory.integrable_log_one_add_sum_abs`: if every `log⁺ (f i)` is integrable under a | ||
| finite measure, so is `log (1 + ∑ i, |f i|)`. | ||
| * `MeasureTheory.Integrable.log_one_add_const_mul`: if `log (1 + f)` is integrable for a | ||
| nonnegative `f`, so is `log (1 + δ f)` for `δ ∈ [0, 1]`. | ||
| * `MeasureTheory.Integrable.tendsto_integral_log_one_add_mul`: if `log (1 + f)` is integrable for | ||
| a nonnegative `f`, then `∫ log (1 + δ f)` tends to `0` as `δ ≥ 0` tends to `0`. | ||
| -/ | ||
|
|
||
| public section | ||
|
|
||
| open MeasureTheory Filter Topology | ||
|
|
||
| namespace MeasureTheory | ||
|
|
||
| variable {α ι : Type*} [MeasurableSpace α] {μ : Measure α} | ||
|
|
||
| /-- If every `log⁺ (f i)` is integrable under a finite measure, so is `log (1 + ∑ i, |f i|)`. -/ | ||
| theorem integrable_log_one_add_sum_abs [Fintype ι] [IsFiniteMeasure μ] {f : ι → α → ℝ} | ||
| (hf : ∀ i, AEMeasurable (f i) μ) (h : ∀ i, Integrable (fun x ↦ Real.posLog (f i x)) μ) : | ||
| Integrable (fun x ↦ Real.log (1 + ∑ i, |f i x|)) μ := by | ||
| have hint : Integrable | ||
| (fun x ↦ Real.log (Fintype.card ι) + ∑ i, Real.posLog (f i x) + Real.log 2) μ := | ||
| ((integrable_const _).add (integrable_finsetSum _ fun i _ ↦ h i)).add (integrable_const _) | ||
| have hm : AEMeasurable (fun x ↦ Real.log (1 + ∑ i, |f i x|)) μ := by fun_prop | ||
| refine hint.mono' hm.aestronglyMeasurable (ae_of_all _ fun x ↦ ?_) | ||
| have hsum : 0 ≤ ∑ i, |f i x| := Finset.sum_nonneg fun i _ ↦ abs_nonneg _ | ||
| rw [Real.norm_of_nonneg (Real.log_nonneg (by linarith))] | ||
| refine Real.log_one_add_le_posLog.trans ?_ | ||
| gcongr | ||
| simpa using Real.posLog_sum Finset.univ fun i ↦ |f i x| | ||
|
|
||
| /-- If `log (1 + f)` is integrable for a nonnegative `f`, so is `log (1 + δ f)` for | ||
| `δ ∈ [0, 1]`. -/ | ||
| theorem Integrable.log_one_add_const_mul {f : α → ℝ} | ||
| (h : Integrable (fun x ↦ Real.log (1 + f x)) μ) (hfm : AEMeasurable f μ) (hf : ∀ x, 0 ≤ f x) | ||
| {δ : ℝ} (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) : | ||
| Integrable (fun x ↦ Real.log (1 + δ * f x)) μ := by | ||
| have hm : AEMeasurable (fun x ↦ Real.log (1 + δ * f x)) μ := by fun_prop | ||
| refine h.mono' hm.aestronglyMeasurable (ae_of_all _ fun x ↦ ?_) | ||
| rw [Real.norm_eq_abs] | ||
| exact Real.abs_log_one_add_mul_le hδ hδ1 (hf x) | ||
|
|
||
| /-- If `log (1 + f)` is integrable for a nonnegative `f`, then `∫ log (1 + δ f)` tends to `0` as | ||
| the damping factor `δ ≥ 0` tends to `0`, by dominated convergence. -/ | ||
| theorem Integrable.tendsto_integral_log_one_add_mul {f : α → ℝ} | ||
| (h : Integrable (fun x ↦ Real.log (1 + f x)) μ) (hfm : AEMeasurable f μ) (hf : ∀ x, 0 ≤ f x) | ||
| {β : Type*} {l : Filter β} [l.IsCountablyGenerated] {δ : β → ℝ} (hδ : Tendsto δ l (𝓝 0)) | ||
| (hδ0 : ∀ᶠ n in l, 0 ≤ δ n) : | ||
| Tendsto (fun n ↦ ∫ x, Real.log (1 + δ n * f x) ∂μ) l (𝓝 0) := by | ||
| rw [← integral_zero α ℝ (μ := μ)] | ||
| refine tendsto_integral_filter_of_dominated_convergence _ | ||
| (.of_forall fun n ↦ (by fun_prop : AEMeasurable (fun x ↦ Real.log (1 + δ n * f x)) μ) | ||
| |>.aestronglyMeasurable) | ||
| ((hδ0.and (hδ.eventually (ge_mem_nhds one_pos))).mono fun n hn ↦ ae_of_all _ fun x ↦ ?_) h | ||
| (ae_of_all _ fun x ↦ ?_) | ||
| · rw [Real.norm_eq_abs] | ||
| exact Real.abs_log_one_add_mul_le hn.1 hn.2 (hf x) | ||
| · have : Tendsto (fun n ↦ 1 + δ n * f x) l (𝓝 1) := by | ||
| simpa using (hδ.mul_const (f x)).const_add 1 | ||
| simpa [Function.comp_def] using (Real.continuousAt_log one_ne_zero).tendsto.comp this | ||
|
|
||
| end MeasureTheory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 placement — request_changes
claude/claude-opus-5-5The two general completion results about the constraint null, which have nothing to do with relative entropy, sit in
KLInf.leaninstead ofCompleteClass.lean, the file that supplies everything they use. The other new declarations and files are placed correctly, and no import is evidently wrong.LMLExplore/EValues/ConstraintNull/KLInf.lean:86—noArbitrageOn_add_integral_div_of_lintegral_leandexists_add_sum_smul_dirac_mem_constraintNullare general facts aboutconstraintNullandNoArbitrageOn, an application of the complete class theorem. Neither involvesklDiv,maxUtilityor the numeraire, yet they live in the KL_inf file, so anyone who needs them also has to importStatlib.EValues.RIPr. Fix: Move the section "Completion into a member of the null" (both theorems) toLMLExplore/EValues/ConstraintNull/CompleteClass.lean, afterIsEVar.exists_mem_constraintBets_le_of_noArbitrageOn, and list them in that file's main statements.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· 41s · 218.3k in (210k cache read, 8.2k cache write) / 3.5k out tokens · reviewing this diff · rubric ·