T0 — Exact logical training and restart preservation
DisprovedVathekProof.T0_tiled_training_equivalenceThe mission's goal theorem. Fix a deterministic sequence of frames, a valid tile partition per step, and genuine derivative certificates at every pre-update point. Then:
- One step. For every logical step index and every training state, the tiled evaluator's loss equals the monolithic loss and its accumulated gradient equals the monolithic gradient.
- Trajectory. The tiled and monolithic evaluators' state trajectories agree over any number of logical steps.
- Restart. Saving at any completed update boundary and reloading the round-tripped structural snapshot preserves the remaining trajectory.
This proves preservation of the specified learning computation in exact arithmetic, including the derivative through frozen components and the complete state required to resume it. It does not prove lower loss, convergence to a useful model, source fidelity, faster execution, or bitwise equality across floating-point schedules.
import Definitions.Def_VathekFrame import Definitions.Def_VathekState import Definitions.Def_VathekAdamW import Definitions.Def_VathekWitness
namespace VathekProof
/-- **T0 — Exact logical training and restart preservation** (white paper §5, Eq. (5)
and (6); the mission's goal theorem). Fix a deterministic sequence of frames, a valid
tile partition per step, and genuine derivative certificates at every pre-update
point. Then:
1. for every logical step, the tiled evaluator and the monolithic evaluator compute
the same loss and the same parameter gradient;
2. the two evaluators' state trajectories agree over any number of steps; and
3. saving at any completed update boundary `a ≤ n` and reloading the round-tripped
snapshot preserves the remaining trajectory.
This proves preservation of the specified learning computation in exact arithmetic.
It does not prove lower loss, convergence, source fidelity, faster execution, or
bitwise equality across floating-point schedules. -/
theorem T0_tiled_training_equivalence (d m : ℕ) (ι : Type*) [DecidableEq ι]
(ξ : ℕ → Frame d m ι) (𝔅 : ℕ → List (Finset ι))
(hpart : ∀ k, IsTilePartition (ξ k).I (𝔅 k))
(Dof : ∀ (k : ℕ) (S : TrainState d), FrameDeriv d m ι (ξ k) S.w)
(T : Finset (Fin d)) (c : ℝ)
(U : TrainState d → EuclideanSpace ℝ (Fin d) → TrainState d)
(S₀ : TrainState d) (n : ℕ) :
(∀ (k : ℕ) (S : TrainState d),
(tileAccum (ξ k).α (Dof k S).val (Dof k S).direct (Dof k S).shared (𝔅 k)).loss
= frameLoss (ξ k).h (ξ k).f (ξ k).α (ξ k).I S.w
∧ tiledGrad (ξ k).α (Dof k S).val (Dof k S).direct (Dof k S).shared
(Dof k S).h' (𝔅 k)
= monoGrad (ξ k) S.w)
∧ runFrom (tiledRun d m ι ξ 𝔅 Dof T c U) n S₀
= runFrom (monoRun d m ι ξ T c U) n S₀
∧ ∀ a ≤ n, runFrom (tiledRun d m ι ξ 𝔅 Dof T c U) (n - a)
(restore (snap (runFrom (tiledRun d m ι ξ 𝔅 Dof T c U) a S₀)))
= runFrom (monoRun d m ι ξ T c U) n S₀ := by sorry
end VathekProofRead-back
What the Lean code literally says, in plain math · glm-5.3 (independent auditor subagent)
{'text': '{\n "readback": "Setting and hypotheses.\n\nLet be natural numbers; write and for the Euclidean spaces of logical parameters and shared state. Let be an arbitrary type (of occurrence indices), assumed to carry decidable equality; it may be finite or infinite, empty or nonempty. The theorem fixes the following data:\n\n- a frame schedule : for each , a frame consisting of a map (the shared computation), a family of loss maps , a family of real reduction coefficients (no sign condition is imposed — they may be zero or negative), and a finite occurrence set ;\n- a tile schedule : for each , a finite list of finite subsets (\"tiles\") of ;\n- the training-state space: a state is a record with parameters , two moment vectors , and a step counter ;\n- a set of trainable coordinates, a real number (clipping radius; no sign condition), an arbitrary deterministic optimizer map , an initial state , and a horizon .\n\nTwo hypotheses are assumed:\n\n1. Valid tile partition at every step. For every : the union of the tiles equals the occurrence set, , and the tiles in the list are pairwise disjoint. Empty tiles are permitted (any number of them), as are uneven tiles.\n\n2. Derivative certificates at every pre-update point. For every and every state — not merely states reachable from — there is given a certificate for the frame at the parameter vector , comprising:\n - a continuous linear map , certified to be the Fréchet derivative of at ;\n - numbers (), certified to satisfy for every ;\n - vectors (), certified (for ) to be the gradient, at , of the map w\' \\\\mapsto f_k(i)\\\\big(w\',\\\\, h_k(S.w)\\\\big) with the shared value frozen;\n - vectors (), certified (for ) to be the gradient, at , of the map with the parameters frozen;\n - the assertion that each is differentiable at the point , for every .\n\n The certificates pin down and the values of on exactly; outside the three families are unconstrained (such indices never enter the sums below, because the tiles cover exactly ).\n\nUnder these hypotheses, the theorem asserts a conjunction of three statements.\n\nFirst conjunct — the two evaluators agree at every state and every index. For every and every state (this conjunct involves none of ; the quantification over covers all natural numbers, not only ):\n\n**(a) Loss agreement.**\n\n
\n\nThe left side is the loss slot of a streaming fold that starts from the triple (running loss, running direct vector, running shared vector) and processes the tiles of in list order, each tile adding , , and to the three slots respectively. The right side is the monolithic loss of frame , , evaluated at .\n\n**(b) Gradient agreement.**\n\n
\n\nThe left side is the accumulated direct contributions plus one application of the transpose (adjoint) of the certified shared derivative to the accumulated shared cotangents. The right side, the monolithic gradient, is defined as the Riesz representation vector of the Fréchet derivative of at — a total definition: at a point where is not differentiable, the derivative operator is taken to be zero, so the \"gradient\" is .\n\nSecond conjunct — equality of the two -step runs, for the single fixed horizon . Define two step maps on states:\n\n- tiled step at logical index : , where is the tiled gradient of (b), computed from the certificates at the current state (all tiles read the same pre-update parameters ; no parameter changes between tiles) and the tile list ;\n- monolithic step at logical index : .\n\nHere is the coordinate projection that keeps coordinate j\' when j\' \\\\in T and zeroes it otherwise, and the clipping keeps when and otherwise replaces it by . In both maps the optimizer is applied exactly once per logical step.\n\nThe iteration convention is: a -step run returns the state unchanged; a -step run applies the step function once — passing it the logical index — and then iterates more times. Consequently an -step run applies the step map with logical indices in that order: the first executed update consults frame and tiles , the last consults and .\n\nThe claim: the state reached after tiled steps from equals the state reached after monolithic steps from — an equality of complete records (parameters, both moment vectors, and step counter). Only the final states are asserted equal, and only at this one fixed (the theorem is universally quantified over from outside, so other horizons are obtained by re-instantiation).\n\nThird conjunct — checkpoint and restart preservation. The snapshot map replaces each of the three vectors of a state by its list of coordinates (exact real coordinates, no rounding) and keeps the counter . The reconstruction map rebuilds each vector from a coordinate list by taking the -th entry if the list has one and otherwise — a total decoder (missing coordinates default to ), though for a snapshotted list of length exactly it is the exact coordinatewise inverse. For every checkpoint step with :\n\n
\n\nthat is: run the tiled evaluator steps from , snapshot, reconstruct, then run the tiled evaluator the remaining steps (recall is ordinary natural-number subtraction, well defined since ); the resulting state equals the uninterrupted -step monolithic run from . The monolithic side is never interrupted. Note the effect of the countdown indexing convention: the left side consults the frame/tile schedule at indices (first segment) and then (second segment), whereas the right side consults ; for instance at , the restarted run uses frame index twice while the monolithic run uses indices then . The equality of resulting states is asserted as stated.\n\nWhat the quantifiers silently include (edge and degenerate cases).\n\n- : the second conjunct reads ; the third conjunct admits only (since ) and asserts . The first conjunct is unaffected by — it is asserted for every and every state , including step indices far beyond any run's horizon.\n- Boundary checkpoints in the third conjunct: at the checkpoint is the round-trip of itself and steps remain; at zero steps remain and the claim is that round-tripping the final tiled state already yields the final monolithic state.\n- The certificate hypothesis is global: it demands differentiability data for and every at the parameter vector of every conceivable state, together with the values and gradients there. The theorem says nothing about when such certificates exist; they are assumed given.\n- Clipping is a two-branch total map: for it fixes when (in particular is fixed) and otherwise rescales to norm exactly . For the condition can never hold (norms are ), so every vector is sent to — a vector of norm pointing opposite to ; at this uses the convention and returns .\n- may be empty (every update direction is masked to before the optimizer is applied) or all of (no masking).\n- If , the partition hypothesis forces every tile of to be empty; all sums in the first conjunct are empty sums, the monolithic loss is the constant , and its gradient is .\n- All equalities are exact equalities of real numbers, vectors, and records; no rounding, tolerance, or floating-point notion appears anywhere in the statement. Nothing is asserted about loss decreasing, convergence, execution speed, or any property of beyond it being a fixed function applied identically in both evaluators."\n}', 'details': {'resolvedPath': '/home/ajax/.omp/agent/sessions/-math/2026-09-22T19-31-08-510Z_01a0ca99-be5e-7000-93c6-dac7c74cc004/RB2-T0.md', 'contentType': 'text/markdown', 'totalLines': 3, 'displayContent': {'text': '{\n "readback": "Setting and hypotheses.\n\nLet be natural numbers; write and for the Euclidean spaces of logical parameters and shared state. Let be an arbitrary type (of occurrence indices), assumed to carry decidable equality; it may be finite or infinite, empty or nonempty. The theorem fixes the following data:\n\n- a frame schedule : for each , a frame consisting of a map (the shared computation), a family of loss maps , a family of real reduction coefficients (no sign condition is imposed — they may be zero or negative), and a finite occurrence set ;\n- a tile schedule : for each , a finite list of finite subsets (\"tiles\") of ;\n- the training-state space: a state is a record with parameters , two moment vectors , and a step counter ;\n- a set of trainable coordinates, a real number (clipping radius; no sign condition), an arbitrary deterministic optimizer map , an initial state , and a horizon .\n\nTwo hypotheses are assumed:\n\n1. Valid tile partition at every step. For every : the union of the tiles equals the occurrence set, , and the tiles in the list are pairwise disjoint. Empty tiles are permitted (any number of them), as are uneven tiles.\n\n2. Derivative certificates at every pre-update point. For every and every state — not merely states reachable from — there is given a certificate for the frame at the parameter vector , comprising:\n - a continuous linear map , certified to be the Fréchet derivative of at ;\n - numbers (), certified to satisfy for every ;\n - vectors (), certified (for ) to be the gradient, at , of the map w\' \\\\mapsto f_k(i)\\\\big(w\',\\\\, h_k(S.w)\\\\big) with the shared value frozen;\n - vectors (), certified (for ) to be the gradient, at , of the map with the parameters frozen;\n - the assertion that each is differentiable at the point , for every .\n\n The certificates pin down and the values of on exactly; outside the three families are unconstrained (such indices never enter the sums below, because the tiles cover exactly ).\n\nUnder these hypotheses, the theorem asserts a conjunction of three statements.\n\nFirst conjunct — the two evaluators agree at every state and every index. For every and every state (this conjunct involves none of ; the quantification over covers all natural numbers, not only ):\n\n**(a) Loss agreement.**\n\n
\n\nThe left side is the loss slot of a streaming fold that starts from the triple (running loss, running direct vector, running shared vector) and processes the tiles of in list order, each tile adding , , and to the three slots respectively. The right side is the monolithic loss of frame , , evaluated at .\n\n**(b) Gradient agreement.**\n\n
\n\nThe left side is the accumulated direct contributions plus one application of the transpose (adjoint) of the certified shared derivative to the accumulated shared cotangents. The right side, the monolithic gradient, is defined as the Riesz representation vector of the Fréchet derivative of at — a total definition: at a point where is not differentiable, the derivative operator is taken to be zero, so the \"gradient\" is .\n\nSecond conjunct — equality of the two -step runs, for the single fixed horizon . Define two step maps on states:\n\n- tiled step at logical index : , where is the tiled gradient of (b), computed from the certificates at the current state (all tiles read the same pre-update parameters ; no parameter changes between tiles) and the tile list ;\n- monolithic step at logical index : .\n\nHere is the coordinate projection that keeps coordinate j\' when j\' \\\\in T and zeroes it otherwise, and the clipping keeps when and otherwise replaces it by . In both maps the optimizer is applied exactly once per logical step.\n\nThe iteration convention is: a -step run returns the state unchanged; a -step run applies the step function once — passing it the logical index — and then iterates more times. Consequently an -step run applies the step map with logical indices in that order: the first executed update consults frame and tiles , the last consults and .\n\nThe claim: the state reached after tiled steps from equals the state reached after monolithic steps from — an equality of complete records (parameters, both moment vectors, and step counter). Only the final states are asserted equal, and only at this one fixed (the theorem is universally quantified over from outside, so other horizons are obtained by re-instantiation).\n\nThird conjunct — checkpoint and restart preservation. The snapshot map replaces each of the three vectors of a state by its list of coordinates (exact real coordinates, no rounding) and keeps the counter . The reconstruction map rebuilds each vector from a coordinate list by taking the -th entry if the list has one and otherwise — a total decoder (missing coordinates default to ), though for a snapshotted list of length exactly it is the exact coordinatewise inverse. For every checkpoint step with :\n\n
\n\nthat is: run the tiled evaluator steps from , snapshot, reconstruct, then run the tiled evaluator the remaining steps (recall is ordinary natural-number subtraction, well defined since ); the resulting state equals the uninterrupted -step monolithic run from . The monolithic side is never interrupted. Note the effect of the countdown indexing convention: the left side consults the frame/tile schedule at indices (first segment) and then (second segment), whereas the right side consults ; for instance at , the restarted run uses frame index twice while the monolithic run uses indices then . The equality of resulting states is asserted as stated.\n\nWhat the quantifiers silently include (edge and degenerate cases).\n\n- : the second conjunct reads ; the third conjunct admits only (since ) and asserts . The first conjunct is unaffected by — it is asserted for every and every state , including step indices far beyond any run's horizon.\n- Boundary checkpoints in the third conjunct: at the checkpoint is the round-trip of itself and steps remain; at zero steps remain and the claim is that round-tripping the final tiled state already yields the final monolithic state.\n- The certificate hypothesis is global: it demands differentiability data for and every at the parameter vector of every conceivable state, together with the values and gradients there. The theorem says nothing about when such certificates exist; they are assumed given.\n- Clipping is a two-branch total map: for it fixes when (in particular is fixed) and otherwise rescales to norm exactly . For the condition can never hold (norms are ), so every vector is sent to — a vector of norm pointing opposite to ; at this uses the convention and returns .\n- may be empty (every update direction is masked to before the optimizer is applied) or all of (no masking).\n- If , the partition hypothesis forces every tile of to be empty; all sums in the first conjunct are empty sums, the monolithic loss is the constant , and its gradient is .\n- All equalities are exact equalities of real numbers, vectors, and records; no rounding, tolerance, or floating-point notion appears anywhere in the statement. Nothing is asserted about loss decreasing, convergence, execution speed, or any property of beyond it being a fixed function applied identically in both evaluators."\n}', 'startLine': 1, 'lineNumbers': [1, 2, 3]}, 'meta': {'source': {'type': 'internal', 'value': 'agent://RB2-T0'}}}}
Confirmed by the mission captain (proposal self-audit).