Finite-sample self-certificate: from N proposal draws, mean(w²)/mean(w)² lies within [(1−δ)C/(1+δ)², (1+δ)C/(1−δ)²] of the cost factor C except w.p. ≤ (K+K³)/(Nδ²)
For all , , and , if , , , , , , and (given and ), then
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) - NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - ⟹Implies
- If J, then ℝ. (Between types, A → B is the type of functions from A to B.) (
J → ℝ) - x : TVariables
- s, r range over J → ℝ: the statement must hold for every choice. (
(s r : J → ℝ)) - x ∈ TVariables
- Z, C, K, δ range over real numbers: the statement must hold for every choice. (
(Z C K δ : ℝ)) - ∀For all
- The statement after the comma holds for every j. (
∀ j, 0 < r j) - ∑Summation
- Add up r(j) for every j. (
∑ j, r j) - =Equality
- ∑ j, r(j) and 1 are the same. (
∑ j, r j = 1) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - <Less than
- 0 is strictly smaller than r(j). (
0 < r j) - ≤At most
- exp(s(j))/Z is less than or equal to K · r(j). (
Real.exp (s j) / Z ≤ K * r j) - eˣExponential function
- e raised to the power s(j), where e ≈ 2.718. (
Real.exp (s j)) - aᵇPower
- exp(s(j))/Z raised to the power 2. (
(Real.exp (s j) / Z) ^ 2) - a/bDivision
- exp(s(j)) divided by Z. In Lean, dividing by 0 gives 0. (
Real.exp (s j) / Z) - filter
- Finset.univ.filter: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Finset.univ.filter) - ·Multiplication
- K times r(j). (
K * r j) - x ↦ f(x)Function (λ-abstraction)
- The function sending f to ¬((1 − δ) · C/(1 + δ)^2 < (∑ i, (exp(s(f(i)))/r(f(i)))^2)/…. Lean writes fun x => …; papers write x ↦ …. (
fun f : Fin N → J => ¬ ((1 - δ) * C / (…) - Fin
- Fin: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fin) - ¬Not
- It is not the case that (1 − δ) · C/(1 + δ)^2 < (∑ i, (exp(s(f(i)))/r(f(i)))^2)/N/…. (
¬ ((1 - δ) * C / (1 + δ) ^ 2 < ((∑ i, (…) - ∧And
- Both hold: (1 − δ) · C/(1 + δ)^2 < (∑ i, (exp(s(f(i)))/r(f(i)))^2)/N/…, and (∑ i, (exp(s(f(i)))/r(f(i)))^2)/N/((∑ i, exp(s(f(i)))/r(f(…. (
(1 - δ) * C / (1 + δ) ^ 2 < ((∑ i, (Rea…) - -Subtraction
- 1 minus δ. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
1 - δ) - +Addition
- 1 plus δ. (
1 + δ) - ∏Product
- Multiply together r(f(i)) for every i. (
∏ i, r (f i))
theorem sc-finite-sample-certificate {J : Type} [Fintype J] [Nonempty J] {N : ℕ} (s r : J → ℝ) (Z C K δ : ℝ) (hr : ∀ j, 0 < r j) (hrs : ∑ j, r j = 1) (hZ : Z = ∑ j, Real.exp (s j)) (hC : C = ∑ j, (Real.exp (s j) / Z) ^ 2 / r j) (hK : ∀ j, Real.exp (s j) / Z ≤ K * r j) (hN : 0 < N) (hδ : 0 < δ) (hδ1 : δ < 1) :
1 ≤ C ∧ C ≤ K ∧ ∑ f ∈ Finset.univ.filter (fun f : Fin N → J => ¬ ((1 - δ) * C / (1 + δ) ^ 2 < ((∑ i, (Real.exp (s (f i)) / r (f i)) ^ 2) / N) / ((∑ i, Real.exp (s (f i)) / r (f i)) / N) ^ 2 ∧ ((∑ i, (Real.exp (s (f i)) / r (f i)) ^ 2) / N) / ((∑ i, Real.exp (s (f i)) / r (f i)) / N) ^ 2 < (1 + δ) * C / (1 - δ) ^ 2)), ∏ i, r (f i) ≤ (K + K ^ 3) / (N * δ ^ 2)Answers the external-review objection (codex, 2026-10-05) that self-certification had only been proved as a population identity. For an attention row π = e^s/Z and a proposal r with bounded ratio π ≤ K·r, draw N keys i.i.d. from r and form the normaliser-free importance weights w = e^s/r. The empirical certificate Ĉ = mean(w²)/mean(w)² satisfies (1−δ)C/(1+δ)² < Ĉ < (1+δ)C/(1−δ)² except on an event of probability at most (K + K³)/(Nδ²), where C = Σπ²/r = 1 + χ²(π‖r); in addition 1 ≤ C ≤ K. Proof on the exact product space: first and second moments of w (E w = Z, E w² = Z²C), the variance bounds Var w ≤ Z²K and Var w² ≤ E w⁴ = Z⁴Σπ⁴/r³ ≤ Z⁴K³, Chebyshev for each average (rc-average-chebyshev, embedded), a union bound, and a ratio sandwich. Ratio-boundedness is the condition Sampleability loop 3 already identified (mix in the descent proposal, or clip with exact handling of the clipped mass).
How it was proved
- Proved
- 5 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
- 222 lines of Lean