Provedalphabaguettealgorithm-ideaa2
A position-only causal softmax head is a causal convolution divided by a prefix normalizer
For all and :
What the notation means · or point at any symbol
- NNatural numbers
- The natural numbers 0, 1, 2, …. In Lean they start at 0. (
ℕ) - ⟹Implies
- If ℕ, then ℝ. (Between types, A → B is the type of functions from A to B.) (
ℕ → ℝ) - x : TVariables
- a, v range over ℕ → ℝ: the statement must hold for every choice. (
(a v : ℕ → ℝ)) - =Equality
- ∑ j, exp(a(i − j))/(∑ j', exp(a(i − j'))) · v(j) and (∑ d, exp(a(d)) · v(i − d))/(∑ d, exp(a(d))) are the same. (
∑ j ∈ Finset.range (i + 1), Real.exp (a…) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - +Addition
- i plus 1. (
i + 1) - eˣExponential function
- e raised to the power a(i − j), where e ≈ 2.718. (
Real.exp (a (i - j))) - a/bDivision
- exp(a(i − j)) divided by ∑ j', exp(a(i − j')). In Lean, dividing by 0 gives 0. (
Real.exp (a (i - j)) / (∑ j' ∈ Finset.r…) - ·Multiplication
- exp(a(i − j))/(∑ j', exp(a(i − j'))) times v(j). (
Real.exp (a (i - j)) / (∑ j' ∈ Finset.r…) - f(x)Function application
- a applied to i − j. Lean writes f x; papers write f(x). (
a (i - j)) - -Subtraction
- i minus j. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (
i - j) - ∑Summation
- Add up exp(a(i − j')) for j' = 0, 1, …, i + 1 − 1. (
∑ j' ∈ Finset.range (i + 1), Real.exp (…)
theorem pos-head-is-causal-convolution (a v : ℕ → ℝ) (i : ℕ) :
∑ j ∈ Finset.range (i + 1), Real.exp (a (i - j)) / (∑ j' ∈ Finset.range (i + 1), Real.exp (a (i - j'))) * v j = (∑ d ∈ Finset.range (i + 1), Real.exp (a d) * v (i - d)) / ∑ d ∈ Finset.range (i + 1), Real.exp (a d)Idea A2 (positional heads become convolutions). If a head's score for query i and key j depends only on i − j (score a(i−j)), its causal softmax output at position i equals (Σ_{d≤i} e^{a(d)} v_{i−d}) / (Σ_{d≤i} e^{a(d)}): an exact causal convolution of the values with kernel e^{a}, divided by a prefix sum of the kernel. One value channel is shown; channels are independent.
How it was proved
- Proved
- 3 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
- 27 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.