proofs
Provedalphabaguettealgorithm-ideac9

Adding any prefix-only feature to a causal model keeps it causal (no target leakage)

For all α,β,γ∈Type⁡\htmlData{mx=1}{\alpha, \beta, \gamma \in \htmlData{mx=0}{\operatorname{Type}}}, φ:(N→α)→N→β\htmlData{mx=7}{\varphi : (\htmlData{mx=0}{\mathbb{N}} \mathrel{\htmlData{mx=2}{\to}} \htmlData{mx=1}{\alpha}) \mathrel{\htmlData{mx=6}{\to}} \htmlData{mx=3}{\mathbb{N}} \mathrel{\htmlData{mx=5}{\to}} \htmlData{mx=4}{\beta}} and M:(N→α×β)→N→γ\htmlData{mx=9}{M : (\htmlData{mx=0}{\mathbb{N}} \mathrel{\htmlData{mx=4}{\to}} \htmlData{mx=3}{\htmlData{mx=1}{\alpha} \times \htmlData{mx=2}{\beta}}) \mathrel{\htmlData{mx=8}{\to}} \htmlData{mx=5}{\mathbb{N}} \mathrel{\htmlData{mx=7}{\to}} \htmlData{mx=6}{\gamma}}, if ∀s,s′,t, (∀i≤t, s(i)=s′(i))  ⟹  φ(s,t)=φ(s′,t)\htmlData{mx=19}{\forall s, s', t,\ (\htmlData{mx=8}{\forall i \leq \htmlData{mx=7}{t},\ \htmlData{mx=2}{\htmlData{mx=0}{s}(\htmlData{mx=1}{i})} \mathrel{\htmlData{mx=6}{=}} \htmlData{mx=5}{\htmlData{mx=3}{s'}(\htmlData{mx=4}{i})}}) \mathrel{\htmlData{mx=18}{\implies}} \htmlData{mx=12}{\htmlData{mx=9}{\varphi}(\htmlData{mx=10}{s}, \htmlData{mx=11}{t})} \mathrel{\htmlData{mx=17}{=}} \htmlData{mx=16}{\htmlData{mx=13}{\varphi}(\htmlData{mx=14}{s'}, \htmlData{mx=15}{t})}} and ∀u,u′,t, (∀i≤t, u(i)=u′(i))  ⟹  M(u,t)=M(u′,t)\htmlData{mx=19}{\forall u, u', t,\ (\htmlData{mx=8}{\forall i \leq \htmlData{mx=7}{t},\ \htmlData{mx=2}{\htmlData{mx=0}{u}(\htmlData{mx=1}{i})} \mathrel{\htmlData{mx=6}{=}} \htmlData{mx=5}{\htmlData{mx=3}{u'}(\htmlData{mx=4}{i})}}) \mathrel{\htmlData{mx=18}{\implies}} \htmlData{mx=12}{\htmlData{mx=9}{M}(\htmlData{mx=10}{u}, \htmlData{mx=11}{t})} \mathrel{\htmlData{mx=17}{=}} \htmlData{mx=16}{\htmlData{mx=13}{M}(\htmlData{mx=14}{u'}, \htmlData{mx=15}{t})}}, then

∀s,s′,t,(∀i≤t, s(i)=s′(i))  ⟹  M(i↦(s(i),φ(s,i)),t)=M(i↦(s′(i),φ(s′,i)),t)\begin{aligned} & \htmlData{mx=0}{\forall} s, s', t, \\ & \quad (\htmlData{mx=10}{\forall i \leq \htmlData{mx=9}{t},\ \htmlData{mx=4}{\htmlData{mx=2}{s}(\htmlData{mx=3}{i})} \mathrel{\htmlData{mx=8}{=}} \htmlData{mx=7}{\htmlData{mx=5}{s'}(\htmlData{mx=6}{i})}}) \\ & \quad \htmlData{mx=1}{\implies} \htmlData{mx=22}{\htmlData{mx=11}{M}(\htmlData{mx=20}{i \mapsto \htmlData{mx=19}{\left( \htmlData{mx=14}{\htmlData{mx=12}{s}(\htmlData{mx=13}{i})}, \htmlData{mx=18}{\htmlData{mx=15}{\varphi}(\htmlData{mx=16}{s}, \htmlData{mx=17}{i})} \right)}}, \htmlData{mx=21}{t})} \mathrel{\htmlData{mx=35}{=}} \htmlData{mx=34}{\htmlData{mx=23}{M}(\htmlData{mx=32}{i \mapsto \htmlData{mx=31}{\left( \htmlData{mx=26}{\htmlData{mx=24}{s'}(\htmlData{mx=25}{i})}, \htmlData{mx=30}{\htmlData{mx=27}{\varphi}(\htmlData{mx=28}{s'}, \htmlData{mx=29}{i})} \right)}}, \htmlData{mx=33}{t})} \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)
x ∈ TVariables
α, β, γ range over Type: the statement must hold for every choice. ((α β γ : Type))
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.) (ℕ → α)
×Product
Pairs of an element of α and an element of β. (α × β)
∀For all
The statement after the comma holds for every i. (∀ i ≤ t, s i = s' 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)
x ↦ f(x)Function (λ-abstraction)
The function sending i to (s(i), φ(s, i)). Lean writes fun x => …; papers write x ↦ …. (fun i => (s i, φ s i))
(a, b)Tuple
The ordered pair (or tuple) of s(i), φ(s, i). ((s i, φ s i))

Idea C9 (suffix-automaton copy channel). The copy feature φ at position t (e.g. the token after the longest earlier match of the current suffix) depends only on tokens ≤ t. Feeding the pair (token, feature) into a causal model M yields a model that is still causal, so training with the channel cannot leak targets.

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
18 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.

More proved statements