proofs
Provedsampleability-lawself-certifying-proposalimportance-samplingattention-compute-law

Proposal objective is convex: θ ↦ log Σ a_j e^{θ f_j} is midpoint-convex (Cauchy–Schwarz), for positive weights a

For all J∈Type⁡\htmlData{mx=1}{J \in \htmlData{mx=0}{\operatorname{Type}}}, a,f:J→R\htmlData{mx=3}{a, f : \htmlData{mx=0}{J} \mathrel{\htmlData{mx=2}{\to}} \htmlData{mx=1}{\mathbb{R}}} and θ,φ∈R\htmlData{mx=1}{\theta, \varphi \in \htmlData{mx=0}{\mathbb{R}}}, if ∀j, 0<a(j)\htmlData{mx=4}{\forall j,\ 0 \mathrel{\htmlData{mx=3}{<}} \htmlData{mx=2}{\htmlData{mx=0}{a}(\htmlData{mx=1}{j})}} (given Fintype⁡ J\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fintype}}\,\htmlData{mx=1}{J}} and Nonempty⁡ J\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Nonempty}}\,\htmlData{mx=1}{J}}), then

log⁡(∑ja(j)⋅eθ+φ2⋅f(j))≤log⁡(∑ja(j)⋅eθ⋅f(j))+log⁡(∑ja(j)⋅eφ⋅f(j))2\begin{aligned} & \htmlData{mx=15}{\log \left(\htmlData{mx=14}{\sum_{j} \htmlData{mx=13}{\htmlData{mx=3}{\htmlData{mx=1}{a}(\htmlData{mx=2}{j})} \cdot \htmlData{mx=12}{e^{\htmlData{mx=11}{\htmlData{mx=7}{\frac{\htmlData{mx=6}{\htmlData{mx=4}{\theta} + \htmlData{mx=5}{\varphi}}}{2}} \cdot \htmlData{mx=10}{\htmlData{mx=8}{f}(\htmlData{mx=9}{j})}}}}}}\right)} \\ & \quad \htmlData{mx=0}{\leq} \htmlData{mx=41}{\frac{\htmlData{mx=40}{\htmlData{mx=27}{\log \left(\htmlData{mx=26}{\sum_{j} \htmlData{mx=25}{\htmlData{mx=18}{\htmlData{mx=16}{a}(\htmlData{mx=17}{j})} \cdot \htmlData{mx=24}{e^{\htmlData{mx=23}{\htmlData{mx=19}{\theta} \cdot \htmlData{mx=22}{\htmlData{mx=20}{f}(\htmlData{mx=21}{j})}}}}}}\right)} + \htmlData{mx=39}{\log \left(\htmlData{mx=38}{\sum_{j} \htmlData{mx=37}{\htmlData{mx=30}{\htmlData{mx=28}{a}(\htmlData{mx=29}{j})} \cdot \htmlData{mx=36}{e^{\htmlData{mx=35}{\htmlData{mx=31}{\varphi} \cdot \htmlData{mx=34}{\htmlData{mx=32}{f}(\htmlData{mx=33}{j})}}}}}}\right)}}}{2}} \end{aligned}
What the notation means · or point at any symbol
Type
Type: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Type)
Fintype
Fintype: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Fintype)
f(x)Function application
Fintype applied to J. Lean writes f x; papers write f(x). (Fintype J)
Nonempty
Nonempty: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Nonempty)
⟹Implies
If J, then ℝ. (Between types, A → B is the type of functions from A to B.) (J → ℝ)
x : TVariables
a, f range over J → ℝ: the statement must hold for every choice. ((a f : J → ℝ))
x ∈ TVariables
θ, φ range over real numbers: the statement must hold for every choice. ((θ φ : ℝ))
∀For all
The statement after the comma holds for every j. (∀ j, 0 < a j)
logNatural logarithm
The logarithm of ∑ j, a(j) · exp((θ + φ)/2 · f(j)) to base e: the power e must be raised to to give ∑ j, a(j) · exp((θ + φ)/2 · f(j)). (Real.log (∑ j, a j * Real.exp ((θ + φ) …)
≤At most
log(∑ j, a(j) · exp((θ + φ)/2 · f(j))) is less than or equal to (log(∑ j, a(j) · exp(θ · f(j))) + log(∑ j, a(j) · exp(φ · …. (Real.log (∑ j, a j * Real.exp ((θ + φ) …)
RReal numbers
The real numbers: every point on the number line. (ℝ)
<Less than
0 is strictly smaller than a(j). (0 < a j)
∑Summation
Add up a(j) · exp((θ + φ)/2 · f(j)) for every j. (∑ j, a j * Real.exp ((θ + φ) / 2 * f j))
eˣExponential function
e raised to the power (θ + φ)/2 · f(j), where e ≈ 2.718. (Real.exp ((θ + φ) / 2 * f j))
a/bDivision
θ + φ divided by 2. In Lean, dividing by 0 gives 0. ((θ + φ) / 2)
·Multiplication
(θ + φ)/2 times f(j). ((θ + φ) / 2 * f j)
+Addition
θ plus φ. (θ + φ)

Makes the convexity in sc-log-cost-exponential-family formal: each log-sum-exp term of the log cost of a score-shaped proposal is midpoint-convex, hence (with continuity) convex, so gradient training of the proposal has no spurious local minima. Part of 'The Sampleability Law: a transformer can be trained to make its own attention cheap to sample, and the samples certify the saving' (self-certifying learned proposals inside the Attention Compute Law).

How it was proved

Proved
4 October 2026
By
Ajax, with the agent “Baguette math & proofs (Claude Code, 2026-10-03)”
Checked by
Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
Axioms
Classical.choice, Quot.sound, propext
Proof
30 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.

More proved statements