Repository navigation
feat: Legendre functions, their constrained minimizers and Bregman projections [LS, §26.4–26.6] - #289
Open
RemyDegenne wants to merge 1 commit into
Conversation
…ojections [LS, §26.4–26.6] Define IsLegendre and prove [LS, Proposition 26.7, Corollary 26.8, Proposition 26.14, Theorem 26.15, Exercises 26.10 and 26.13]: the directional derivative blows up at the boundary, constrained minimizers are interior and characterized by the first-order condition, and in finite dimension minimizers and Bregman projections onto closed convex sets meeting the interior exist and are unique. Move bregDiv_le_sub_of_isMinOn(_self) from FTRL/Basic to the new Bregman/Projection file, where they give the generalized Pythagorean inequality. Co-Authored-By: Claude Code <noreply@github.com>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR defines Legendre functions and proves the results of [LS, §26.4–26.6] about them that do not involve the Fenchel conjugate. It covers the Bandits roadmap's Layer 6.1, "Legendre functions" (the definition, [LS, Proposition 26.14], and [LS, Corollary 26.8] through [LS, Proposition 26.7]), and finishes Layer 6.2, "Bregman divergence and projections", with the Bregman projection theorem [LS, Theorem 26.15] and the generalized Pythagorean inequality [LS, Exercise 26.13]. The rest of Layer 6.2 was already on
main: [LS, Theorem 26.3] is LML'sHasFDerivWithinAt.hasSubgradientWithinAt(nonnegativity),bregDiv_selfandConvexOn.bregDiv, and the Hessian forms [LS, Theorems 26.12–26.13] are inAnalysis/Convex/Bregman/Taylor.lean. These items are also the prerequisites that the OnlineLearning roadmap cites for its Layer 12.2 ("Constraints through Bregman projections [Ora, Theorem 12.11]: … the Bregman projection of Bandits 6.2"). Its Layer 6.1/6.2 relation lists "Legendre functions (6.1) and Bregman projections (6.2)" as provided here. The ReinforcementLearning roadmap's Bregman proximal steps also need them ("$F$ a Legendre mirror map (Bandits roadmap, Layer 6)").Roadmap: Bandits
After this PR, Layer 6.1 still needs [LS, Theorem 26.6]: the gradient is a bijection between the interiors of the domains with inverse $\nabla F^$, $D_F(x,y)=D_{F^}(\nabla F(y),\nabla F(x))$, and$F^*$ is Legendre. It also needs the conversions of this representation to Tau Ceti's
fenchelConjugate.The representation follows the roadmap's first option:
F : E → ℝtogether with its convex domainD, on a real normed spaceE.IsLegendre F Dasks for the following:Fis convex onD;Dis nonempty;Fis differentiable and strictly convex on the interior;‖fderiv ℝ F y‖ → ∞along𝓝[interior D] xfor everyx ∈ frontier (interior D). This is LS's sequence condition (c), stated with a filter.The finite-dimensional hypothesis appears only where compactness is used. LS's Theorem 26.15 takes
A ∩ dom fnonempty. HereAmust meet the interior ofD, becauseFis not assumed lower semicontinuous at the boundary, and on a boundary face ofDthe constrained minimum can then fail to exist.LMLExplore/Analysis/Convex/Legendre.lean(new, 515 lines):IsLegendre, withconvex,hasFDerivAt,hasSubgradientWithinAt,add_fderiv_apply_sub_leandmem_frontier_interior.IsLegendre.tendsto_fderiv_apply_sub[LS, Proposition 26.7]:∇F(x + α (y - x)) (y - x) → ∞asα → 1⁻, forxinterior andyin the boundary of the interior. If the directional derivative stayed bounded, the tangent inequalities atxand along the segment would bound‖∇F‖there, contradicting steepness.IsLegendre.mem_interior_of_isMinOn_interandmem_interior_of_isMinOn[LS, Corollary 26.8]: minimizers overA ∩ Dare interior, for every convexAmeeting the interior.fderiv_eq_zero_of_isMinOnfollows.IsLegendre.isMinOn_inter_iff[LS, Proposition 26.14].IsLegendre.add_linearandadd_const[LS, Exercise 26.10].IsLegendre.isBounded_sublevel, in finite dimension: a Legendre function with a minimizer has bounded sublevel sets. It grows linearly beyond a sphere around the minimizer.IsLegendre.existsUnique_isMinOn_inter[LS, Theorem 26.15 (a)]. Take a minimizing sequence and a subsequence that converges to someb. Ifbis interior, continuity makes it a minimizer. Ifbis on the boundary, Proposition 26.7 gives a point ofA ∩ Dwith a smaller value.IsLegendre.isMinOn_bregDiv_iff[LS, Theorem 26.15 (b)].isLegendre_bregDiv,existsUnique_isMinOn_bregDiv(projections of interior points ontoA ∩ Dexist and are unique),mem_interior_of_isMinOn_bregDiv, and the Legendre form of the Pythagorean inequalitybregDiv_add_bregDiv_le.isLegendre_mul_log:x ↦ x log xon[0, ∞)is a non-degenerate witness with a nonempty boundary [LS, Example 26.11].LMLExplore/Analysis/Convex/Bregman/Projection.lean(new, 93 lines):OnlineLearning/FTRL/Basic.lean. Being general convex-analysis facts, they now sit before both FTRL and the Legendre file.bregDiv_add_bregDiv_le_of_isMinOn[LS, Exercise 26.13 (a)] derives the generalized Pythagorean inequality from them.Fneed not be convex, andJneed not be a derivative aty.LMLExplore/Analysis/Convex/Extrema.lean(new, 46 lines):ConvexOn.isMinOn_iff_forall_apply_sub_nonneg[LS, (26.2)], first-order optimality for convex functions with a derivative within the set. It is named after Mathlib'sMathlib/Analysis/Convex/Extrema.lean. No Mathlib, Tau Ceti or LML declaration states it;IsLocalMinOn.hasFDerivWithinAt_nonneggives only one direction and does not use convexity.Moved and renamed declarations (namespace change only, statements unchanged; every use now resolves through the parent namespace):
LMLExplore.OnlineLearning.bregDiv_le_sub_of_isMinOn→LMLExplore.bregDiv_le_sub_of_isMinOnLMLExplore.OnlineLearning.bregDiv_le_sub_of_isMinOn_self→LMLExplore.bregDiv_le_sub_of_isMinOn_selfOnlineLearning/FTRL/Basic.leannow importsLMLExplore.Analysis.Convex.Bregman.Projectioninstead ofMathlib.Analysis.Calculus.LocalExtr.Basic.Sources: [LS] T. Lattimore and Cs. Szepesvári, Bandit Algorithms, Sections 26.4–26.6, and R. T. Rockafellar, Convex Analysis, Section 26. Both are cited in the files. No Mathlib infrastructure was vendored.
🤖 Prepared with Claude Code