Convex analysis in Lean 4

Design decisions

This file records the choices that shape every statement in the library, with the reason for each. Change a decision only on purpose, and record the change here.

1. Setting: real Hilbert spaces

Most results are stated for a real inner product space H ([NormedAddCommGroup H] [InnerProductSpace ℝ H]), with [CompleteSpace H] where it is needed, for example for proximal points and projections. Subgradients and dual variables are vectors of H, paired by the inner product, written ⟪x, y⟫_ℝ (open scoped InnerProductSpace), as in most of Mathlib.

Reason: this is the setting of the reference text (section 2), and it covers ℝⁿ as EuclideanSpace ℝ (Fin n). Optimization texts state their results for ℝⁿ or Hilbert spaces. A general dual pair (E, E*) would make every statement carry a pairing, for little gain in the applications we target. Results that need no inner product, such as convexity of the epigraph, are stated for real vector spaces.

Status: confirmed by the author on 2026-11-29, after the first slice (M0, M1) was written.

Linear programming (LinearProgramming.lean) is an exception: it is stated with matrices A : Matrix m n ℝ on m → ℝ with Mathlib's ⬝ᵥ, *ᵥ and ᵥ*, the form in which LP duality is usually read; the KKT theorem on ℝⁿ (exists_kkt_euclidean) uses EuclideanSpace and toEuclideanLin instead.

Linear maps are bounded linear maps A : H →L[ℝ] K between Hilbert spaces, and their adjoint is Mathlib's ContinuousLinearMap.adjoint, written A† (open scoped InnerProduct); it needs CompleteSpace on both spaces. Rules with a linear map follow [BC] in the roles of the functions: in f + g ∘ A, f lives on H, and g on K carries the continuity condition.

2. Reference text

H. H. Bauschke, P. L. Combettes, Convex Analysis and Monotone Operator Theory in Hilbert Spaces, 2nd ed., Springer 2017 (cited as [BC]). Docstrings cite results by number, [BC, Theorem 5.5][BC], and by chapter, [BC, Chapter n][BC], where no single result fits; the second bracket is the key in docs/references.bib, through which doc-gen4 links the citation (AGENTS.md, "Documentation"). A theorem number is added only after it has been checked against the source; on 2026-11-30 all citations of [BC], [R], Beck, Nesterov, Horst–Tuy, Neumaier, Moore–Kearfott–Cloud, Granas–Dugundji, Ortega–Rheinboldt and of the cited papers were checked against the texts (Clarke's 1983 book was not available, so Clarke is cited by chapter). Where the library's statement is more general than the cited one or a special case of it, the docstring says so. Numbers recalled from memory need this check: the optimality condition 0 ∈ ∂f x + N_C x is [R, Theorem 27.4], which was doubted because the ReasBook transcription of the book numbers it 27.5; Section 27 of the book has no Theorem 27.5. For finite-dimensional results (KKT, linear programming) we also cite Rockafellar, Convex Analysis (1970) [R], Rockafellar–Wets, Variational Analysis (1998) [RW], and Boyd–Vandenberghe, Convex Optimization (2004) [BV]. ε-subdifferentials are not treated in [BC] and are cited to [R, Section 23]. Every cited work has an entry in docs/references.bib.

The check of 2026-11-30 compared all 201 citations of [BC] in the library, this file and ROADMAP.md with the 2nd edition; the main results now cite theorem numbers. Chapter assignments it corrected: minimizing sequences (ConvexFun.isMinOn_of_tendsto_toWeakSpace) are [BC, Proposition 11.21] in Chapter 11, not Chapter 9; Fix prox = Argmin (fixedPoints_prox_const_mul) is [BC, Proposition 12.29], not Chapter 28; the averaged forward–backward step (norm_proxGradStep_sub_proxGradStep_sq_le and its gradient form) is [BC, Proposition 26.1], with the ingredients [BC, Propositions 4.39 and 4.44]; the supremum of affine minorants (ConvexFun.exists_affine_minorant_of_lt) is [BC, Corollary 13.42], not Chapter 9; the one-step inequality of averaged maps is [BC, Proposition 4.35] in Chapter 4, not Chapter 5. Only the Brøndsted–Rockafellar theorem ([BC, Theorem 16.58]) and the density of dom ∂f ([BC, Corollary 16.39]) are cited to [BC] among the ε-subdifferential results. The max rule is the Dubovitskii–Milyutin theorem [BC, Theorem 18.5], which assumes continuity at x where the library assumes upper semicontinuity; the max formula is [BC, Theorem 17.18]. Farkas' lemmas are [R, Theorem 22.3] (nonhomogeneous), [R, Corollary 22.3.1] and Gale's inequality form [R, Theorem 22.1].

3. Extended real values: EReal

Functions of convex analysis take values in EReal = [-∞, +∞] (Mathlib's EReal, which is WithBot (WithTop ℝ)).

Results that depend on the convention:

Real valued functions f : H → ℝ enter by composition with the coercion (↑) : ℝ → EReal. Bridge lemmas connect our notions with Mathlib's ConvexOn ℝ s f, so Mathlib's library for real valued convex functions stays usable: convexFun_coe_iff for s = univ, and convexFun_coe_add_convexIndicator_iff (f + ι_s is convex iff ConvexOn ℝ s f) for any s.

4. Convexity of extended valued functions: via the epigraph

ConvexAnalysis.ConvexFun f means that the epigraph {(x, t) : H × ℝ | f x ≤ t} is convex, as in [BC, Definition 8.1] and [R, Section 4]. Mathlib's ConvexOn 𝕜 s f needs SMul 𝕜 β on the codomain β, and there is no SMul ℝ EReal, so ConvexOn does not apply to EReal valued functions.

5. Names

6. Proof standards