Semantic correctness of the distinguished-point algorithm #
This module proves the semantic correctness of the six-step distinguished-point procedure for
evaluating a fixed iterate f^[T] x using walk length K:
- Scan (
scan,scan_spec): walkKsteps fromx, recording the first distinguished pointc = f^[d] xwithd ≤ Kif one occurs, and ending atu = f^[K] x. - Lookup: read the pre-shifted payload
z c = f^[T - K] c. - Correction (
correctionStep,correction_run): applyfforK - dsteps fromz cto obtainf^[K - d] (f^[T - K] (f^[d] x)) = f^[T] x(shifted_payload). - Period walk (
periodWalk,periodWalk_spec): in a separate register, walk up toKsteps fromu = f^[K] xto find its minimal return period1 ≤ λ ≤ Kwhen the prefix repeats. - Residue and cycle walk (
walkStep,walk_run): walkR λ = (T - K) % λsteps fromu. - Output (
distinguishedPower,distinguishedPower_correct): return the corrected checkpoint value when the scan hitH, and the cycle-walk value otherwise.
The set H of distinguished points is abstract: the proof assumes only that every trajectory
prefix x, f x, …, f^[K] x of K + 1 pairwise distinct states meets H.
Main definitions #
Cslib.FunctionalGraph.runStages: sequential execution ofkindexed stages.Cslib.FunctionalGraph.ScanState,Cslib.FunctionalGraph.scanStep,Cslib.FunctionalGraph.scan: theK-step distinguished-point prefix scan.Cslib.FunctionalGraph.correctionStep: the forward-correction stage.Cslib.FunctionalGraph.PeriodState,Cslib.FunctionalGraph.periodStep,Cslib.FunctionalGraph.periodWalk: the short-cycle period walk in a separate register.Cslib.FunctionalGraph.walkStep: the bounded cycle-walk stage.Cslib.FunctionalGraph.distinguishedPower: the six-step distinguished-point procedure.
Main results #
Cslib.FunctionalGraph.shifted_payload: forward correction of a backward-shifted checkpoint payload recoversf^[T] x.Cslib.FunctionalGraph.scan_spec: invariant and specification of the prefix scan.Cslib.FunctionalGraph.correction_run: exact step count of the forward correction.Cslib.FunctionalGraph.periodWalk_spec: exact first return time of the period walk.Cslib.FunctionalGraph.walk_run: exact step count of the cycle walk.Cslib.FunctionalGraph.distinguishedPower_correct: semantic correctness of the distinguished-point procedure.
References #
- Adapted from lean/Proofs/{Reconstruction,DistinguishedPoints}.lean at revision
c4cfa198of [S. Schlesinger, Square-root circuit bounds for iterated functions] [Sch26f].
Apply indexed stages 0, …, k - 1 in order.
Instances For
Step 1: Prefix scan #
Scan stage i: record the first distinguished point, then advance u unless i = K.
Instances For
Run stages i = 0, 1, …, K of the scan starting from (x, false, 0, x).
Instances For
The scan ends at f^[K] x and records the first distinguished point among
x, f x, …, f^[K] x whenever one exists.
Step 3: Forward correction #
Correction stage i: apply f exactly when d ≤ i.
Instances For
Step 4: Period walk in a separate register #
Period stage i (step j = i + 1): advance w and record i + 1 on the first return to
y.
Instances For
Run K stages of the period walk from y.
Instances For
If y returns to itself within K positive steps, periodWalk f K y records the least
positive return time 1 ≤ λ ≤ K.
Step 5: Cycle walk #
Cycle-walk stage i: apply f exactly when i < r.
Instances For
The complete distinguished-point procedure #
The six-step distinguished-point procedure for f^[T] with walk length K, payload table z,
and residue table R. For T < K it unrolls T steps; otherwise it scans K steps, corrects the
payload z σ.c forward, walks the period of σ.u = f^[K] x in a separate register, advances σ.u
by R w.period steps, and selects the checkpoint branch iff the scan hit H.
Instances For
Semantic correctness of the distinguished-point algorithm. If every prefix of K + 1
pairwise distinct states meets H, the payloads satisfy z h = f^[T - K] h on H, and the
residues satisfy R l = (T - K) % l for 1 ≤ l ≤ K, then distinguishedPower f H K T z R x = f^[T] x for every input x.