proofs
Provedrandomized-conversionconversion-theoremattention-compute-lawmedian-of-means

Good/bad split of an expectation: X ≤ G on a good event and X ≤ W off it gives E[X] ≤ G + δ W when P(bad) ≤ δ

For all Ω∈Type⁡\htmlData{mx=1}{\Omega \in \htmlData{mx=0}{\operatorname{Type}}}, w,X:Ω→R\htmlData{mx=3}{w, X : \htmlData{mx=0}{\Omega} \mathrel{\htmlData{mx=2}{\to}} \htmlData{mx=1}{\mathbb{R}}}, good:Ω→Prop⁡\htmlData{mx=3}{\mathit{good} : \htmlData{mx=0}{\Omega} \mathrel{\htmlData{mx=2}{\to}} \htmlData{mx=1}{\operatorname{Prop}}} and G,W,δ∈R\htmlData{mx=1}{G, W, \delta \in \htmlData{mx=0}{\mathbb{R}}}, if ∀ω, 0≤w(ω)\htmlData{mx=4}{\forall \omega,\ 0 \mathrel{\htmlData{mx=3}{\leq}} \htmlData{mx=2}{\htmlData{mx=0}{w}(\htmlData{mx=1}{\omega})}}, ∑ωw(ω)=1\htmlData{mx=3}{\sum_{\omega} \htmlData{mx=2}{\htmlData{mx=0}{w}(\htmlData{mx=1}{\omega})}} \mathrel{\htmlData{mx=4}{=}} 1, 0≤G0 \mathrel{\htmlData{mx=1}{\leq}} \htmlData{mx=0}{G}, ∀ω, good(ω)  ⟹  X(ω)≤G\htmlData{mx=9}{\forall \omega,\ \htmlData{mx=2}{\htmlData{mx=0}{\mathit{good}}(\htmlData{mx=1}{\omega})} \mathrel{\htmlData{mx=8}{\implies}} \htmlData{mx=5}{\htmlData{mx=3}{X}(\htmlData{mx=4}{\omega})} \mathrel{\htmlData{mx=7}{\leq}} \htmlData{mx=6}{G}}, ∀ω, ¬good(ω)  ⟹  X(ω)≤W\htmlData{mx=10}{\forall \omega,\ \htmlData{mx=3}{\lnot \htmlData{mx=2}{\htmlData{mx=0}{\mathit{good}}(\htmlData{mx=1}{\omega})}} \mathrel{\htmlData{mx=9}{\implies}} \htmlData{mx=6}{\htmlData{mx=4}{X}(\htmlData{mx=5}{\omega})} \mathrel{\htmlData{mx=8}{\leq}} \htmlData{mx=7}{W}}, ∑ω∈filter⁡(ω↦¬good(ω))w(ω)≤δ\htmlData{mx=10}{\sum_{\omega \in \htmlData{mx=6}{\htmlData{mx=0}{\operatorname{filter}}(\htmlData{mx=5}{\omega \mapsto \htmlData{mx=4}{\lnot \htmlData{mx=3}{\htmlData{mx=1}{\mathit{good}}(\htmlData{mx=2}{\omega})}}})}} \htmlData{mx=9}{\htmlData{mx=7}{w}(\htmlData{mx=8}{\omega})}} \mathrel{\htmlData{mx=12}{\leq}} \htmlData{mx=11}{\delta} and 0≤W0 \mathrel{\htmlData{mx=1}{\leq}} \htmlData{mx=0}{W} (given Fintype⁡ Ω\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{Fintype}}\,\htmlData{mx=1}{\Omega}} and DecidablePred⁡ good\htmlData{mx=2}{\htmlData{mx=0}{\operatorname{DecidablePred}}\,\htmlData{mx=1}{\mathit{good}}}), then

∑ωw(ω)⋅X(ω)≤G+δ⋅W\htmlData{mx=7}{\sum_{\omega} \htmlData{mx=6}{\htmlData{mx=2}{\htmlData{mx=0}{w}(\htmlData{mx=1}{\omega})} \cdot \htmlData{mx=5}{\htmlData{mx=3}{X}(\htmlData{mx=4}{\omega})}}} \mathrel{\htmlData{mx=13}{\leq}} \htmlData{mx=12}{\htmlData{mx=8}{G} + \htmlData{mx=11}{\htmlData{mx=9}{\delta} \cdot \htmlData{mx=10}{W}}}
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 Ω. Lean writes f x; papers write f(x). (Fintype Ω)
⟹Implies
If Ω, then ℝ. (Between types, A → B is the type of functions from A to B.) (Ω → ℝ)
x : TVariables
w, X range over Ω → ℝ: the statement must hold for every choice. ((w X : Ω → ℝ))
DecidablePred
DecidablePred: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (DecidablePred)
x ∈ TVariables
G, W, δ range over real numbers: the statement must hold for every choice. ((G W δ : ℝ))
∀For all
The statement after the comma holds for every ω. (∀ ω, 0 ≤ w ω)
∑Summation
Add up w(ω) for every ω. (∑ ω, w ω)
=Equality
∑ ω, w(ω) and 1 are the same. (∑ ω, w ω = 1)
RReal numbers
The real numbers: every point on the number line. (ℝ)
Prop
Prop: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (Prop)
≤At most
0 is less than or equal to w(ω). (0 ≤ w ω)
¬Not
It is not the case that good(ω). (¬ good ω)
·Multiplication
w(ω) times X(ω). (w ω * X ω)
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)
+Addition
G plus δ · W. (G + δ * W)
x ↦ f(x)Function (λ-abstraction)
The function sending ω to ¬good(ω). Lean writes fun x => …; papers write x ↦ …. (fun ω => ¬ good ω)

The elementary split that converts a high-probability bound on a randomized oracle into an expected-cost bound. Part of the Randomized Conversion Theorem: the Conversion Theorem (counting ⇒ sampling descent) extended to every randomized bounded-variance attention algorithm via median-of-means boosting, a union bound over the 2n descent nodes, and ε-smoothing of each node; closes the residual scalability crux of 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
20 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.

More proved statements