Provedalphabaguettealgorithm-ideaa3
A causal model gives identical outputs on identical relocated prefixes
For all , , and , if 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) - x : TVariables
- s, s' range over ℕ → ℕ: the statement must hold for every choice. (
(s s' : ℕ → ℕ)) - x ∈ TVariables
- a, a', r range over natural numbers: the statement must hold for every choice. (
(a a' r : ℕ)) - 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 ↦ f(x)Function (λ-abstraction)
- The function sending i to s(a + i). Lean writes fun x => …; papers write x ↦ …. (
fun i => s (a + i)) - ∀For all
- The statement after the comma holds for every i. (
∀ i ≤ t, s i = s' i) - +Addition
- a plus i. (
a + i) - f(x)Function application
- s applied to i. Lean writes f x; papers write f(x). (
s i) - =Equality
- s(i) and s'(i) are the same. (
s i = s' i)
theorem dedup-causal-relocated-prefix {α : Type} (F : (ℕ → ℕ) → ℕ → α) (hF : ∀ s s' t, (∀ i ≤ t, s i = s' i) → F s t = F s' t) (s s' : ℕ → ℕ) (a a' r : ℕ) (h : ∀ i ≤ r, s (a + i) = s' (a' + i)) :
F (fun i => s (a + i)) r = F (fun i => s' (a' + i)) rIdea A3 (prefix-dedup training). If a model's output at position t depends only on positions ≤ t (causality, with positions counted from the sample start), then two samples starting at a and a' whose first r+1 tokens agree produce the same output at relative position r. Their activations can be computed once.
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
- None
- Proof
- 12 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.