FrankenRobotics

Lemma: proofs, certificates, the offline auditor

6,313 words8 subsections11 tables4 listingsPlan version 1.1

On this page8
12.1 What the two proof tools can do today12.2 Proof classes, family certificates and the claim product12.3 Theorem cards12.4 Mechanics12.5 What Lemma does not claim12.6 Gates12.7 Refusals, invariants and known answers12.8 Open questions

Lemma owns four things: the evidence classes and the type that combines them; the theorem cards; the certificate bundle .frobcert with its independent auditor frob-verify; and the routes by which a statement becomes Certified or Proved. Producers live in frob-lemma, derive/frob-derive and lean/. The format, the checkers and the frob-verify binary live in frob-cert, which depends on the standard library and nothing else. Verbs: prove.kernel, prove.verify, prove.list, prove.bundle and prove.reflect.

Decision Content Reason
ADR-LEMMA-01 The algebraic route first: what is certified is formulated as a polynomial or rational identity, an exact rational inequality or an interval enclosure. Analytic statements wait. It is what both proof tools can check today (§12.1).
ADR-LEMMA-02 Lean is a second opinion. Theorems are written in stock Lean with Mathlib and FrankenLean re-checks the compiled result. FrankenLean does not elaborate tactic proofs today.
ADR-LEMMA-03 One portable bundle format and one auditor built from the standard library only. A positive or negative answer must be readable on a machine that has neither the agent, a GPU nor the simulator.
ADR-LEMMA-04 The registry of proof kinds is closed and versioned; an unknown kind is rejected. D-11: consistent hashes do not make an unknown argument valid.
ADR-LEMMA-05 Reflection promotes selected instance certificates and is never the default. Instances are checked by kernel evaluation, never by a compiled evaluator. It keeps the trusted base at the kernel and the soundness theorems.
ADR-LEMMA-06 Statistical receipts travel in bundles and are never proofs. An auditor can recompute arithmetic; it cannot attest that episodes ran.

12.1 What the two proof tools can do today

FACT, from the audit of franken_lean (at 4426f8ea7) and frankensympy (at 29f847c1):

Capability FrankenSymPy FrankenLean
Exact polynomial identity checking with an offline verifier Yes (fsym-proof-kernel, fsym-capsule-consumer) Not natively
Interval certificates: roots in a box, enclosures, sign over a box Yes, up to 16 coordinates and 1,024 parameter cells No
Exact rational linear algebra with certificates (LU, QR, LDLᵀ) Yes No
Gröbner bases, ideal membership Yes: Buchberger over ℚ and 𝔽ₚ, cap of 1,024 basis polynomials No
Real solutions of polynomial systems real_rur: at most 8 variables, 64 equations, degree 256, 4,096-bit coefficients; zero-dimensional ideals only; no homotopy solver No
Lie algebras, quaternions, noncommutative symbols, group theory None in Rust —
Translating a symbolic certificate into a Lean statement fsym-formal: two univariate integer factor-product profiles (64-bit, degree at most 64) —
Elaborating Lean source with Mathlib tactics — No: MetaM/TacticM are not wired; no Mathlib tactic has run
Tactic automation of its own — fln-anvil implements a decision-tree procedure and omega (integer linear arithmetic) in 1,423 lines; other tactic names are type stubs
Re-checking compiled .olean files with an independent kernel — Yes: Lean stdlib 2,433 of 2,433 modules; Mathlib 9,131 of 11,083 accepted, 0 failed
Mathlib modules a robotics proof would want — Accepted: Algebra.Lie.Basic, Algebra.Lie.OfAssociative, Algebra.Quaternion, special linear and unitary groups, permutation groups, Order.FixedPoints. Blocked: Geometry.Manifold.Algebra.LieGroup, Analysis.Normed.Algebra.MatrixExponential, Analysis.Quaternion, all representation theory
Sealed offline proof bundles Proof capsules fln seal-capsule / verify-capsule --require-semantic
Bit-vector decisions with checked proofs — Yes (Engine::decide_bv)

FrankenSim adds fs-ivl (outward-rounded intervals, affine forms, Taylor models, interval Newton and Krawczyk), fs-sos and fs-checker, which checks packages outside the stepping process (FACT, at 483d09c682f2).

Three consequences shape this chapter. First, the algebraic route: formulate what we want certified as polynomial or rational identities (Cayley maps, quaternion norms, adjoint matrices), exact inequalities and enclosures, because that is what the tools can check now; analytic statements about exp, log and manifolds wait. Second, Lean is a second opinion, not a prover we drive: proofs are written in stock Lean with Mathlib as a development-time tool, and FrankenLean re-checks the compiled result with its independent kernel when the proof's dependency closure avoids the blocked modules. Third, reflection is the one route from an instance to a proof: a checker function with a soundness theorem lets the kernel itself evaluate an instance, which needs no tactic at checking time. It is Frontier, and §12.4 says what must be measured before it is relied on.

12.2 Proof classes, family certificates and the claim product

Class What it means Produced by
Proved A general statement accepted by a Lean kernel, and re-checked by FrankenLean when its closure permits. Also an instance evaluated by the kernel through a reflected checker whose soundness theorem is Proved. lean/ plus fln verify-capsule
Certified An instance-level statement (this kernel, this model, this box, this cell of a design family) accepted by a checker with an offline-verifiable certificate. FrankenSymPy proof kernel, interval certificates, exact rational certificates, the KIR dimension checker, frob-verify
Tested A property held on a stated set of cases. Gauntlet tiers G0–G5
Estimated A number from a model or a statistical procedure, with its uncertainty. Everything else

A report never prints Proved or Certified without the certificate's content hash and the checker's identity. "Verified" is not a class and the word is not used for results.

Family certificates. A mission answer (C-17) is certified cell by cell. A family certificate is Certified evidence about a set of designs, either a cell of the inner set or a cell removed from the outer set. Beyond what a kernel certificate carries, it has a quantifier prefix, a domain with its chart and units, an assumption set with polarity (C-18), a proof kind from the closed registry, and a witness. It is about the declared model, world set and policy class, and its class is capped by its inputs: an exact argument over an Estimated material card is Estimated.

The claim product. The seven claims of §8 are kinds of evidence, and a result that rests on two of them is their product. The weakest input wins by construction, and nothing converts a product into a proof:

// DESIGN: fixes intent, not signatures.
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
pub enum Class { Estimated, Tested, Certified, Proved }          // ordered, weakest first

pub struct Evidence<K> {              // K: a zero-sized marker for one of the seven claims of §8
    class: Class,                     // private; set only by the checker that produced the evidence
    scope: Scope,                     // model, tier, domain, quantifier prefix
    assumptions: AssumptionSet,       // each with its polarity (C-18)
    receipts: Vec<ReceiptId>,         // certificate hashes, checker identities, study receipts
    flags: NoAuthorization,           // a constant; see below
    kind: core::marker::PhantomData<K>,
}

pub struct ClaimProduct<A, B>(Evidence<A>, Evidence<B>);

impl<A, B> ClaimProduct<A, B> {
    pub fn class(&self) -> Class { self.0.class.min(self.1.class) }   // the weakest input wins
}
// No From or Into leads from ClaimProduct<A, B> to Evidence<A> or Evidence<B>. No constructor of
// Evidence<Proof> exists outside frob-lemma. Compile-fail tests assert both (GATE-LEMMA-06).

No-authorization flags. Every exported artifact (a report, a bundle, a skill, a build packet, a tool response) carries three machine-readable fields, and no code path sets any of them to true:

{ "execution_authorized": false, "hardware_safety_signoff": false, "sim_to_real_certified": false }

frob-verify rejects an artifact in which a flag is missing or true (FROB-REF-833). The flags say what no result of this project is: permission to run on hardware, a safety sign-off, or a statement about a physical robot. The last is a Reality claim, made only through the calibration lane of §30. A build packet carries a fourth field of the same kind, fabrication_released, also always false (§31.12).

12.3 Theorem cards

Each card is a statement the project wants, its route, and its tier. Status for every card today is HYPOTHESIS: none has been checked. A card is admitted only if a checker can decide it; the table after the cards lists the obligations that fail that test and what they are instead.

Card Statement Route Tier
T-01 For skew-symmetric Ω, cay(Ω)ᵀ·cay(Ω) = I and det cay(Ω) = 1. Polynomial identity in the entries of Ω (Certified); general statement in Lean (Proved) S / F
T-02 The SE(3) Cayley update maps the group to itself. Polynomial identity S
T-03 The quaternion update preserves the norm: ‖q·c‖² = ‖q‖²·‖c‖². Polynomial identity; Lean through Mathlib.Algebra.Quaternion S / F
T-04 Ad(gh) = Ad(g)·Ad(h), and the group coadjoint is the inverse transpose. Polynomial identity in group coordinates S
T-05 The power pairing is invariant under a change of frame. Polynomial identity S
T-06 The Cayley discrete Euler–Poincaré step for a free rigid body conserves spatial momentum. Identity modulo the update equations (ideal membership) F; budget is a HYPOTHESIS
T-07 The friction-cone projection P satisfies P(x) ∈ 𝒦, P(x) − x ∈ 𝒦*, and ⟨P(x), P(x) − x⟩ = 0, for the three- and four-dimensional cones. Per-case polynomial identities and inequalities F
T-08 The fast-tier contact objective has a positive-semidefinite Hessian. Structural: a sum of positive-semidefinite terms; Lean F
T-09 Every kernel is dimensionally homogeneous, and every square root is taken on an even exponent vector. Decided exactly by the KIR type checker S
T-10 A model's derived step kernels are equivariant under each generator of its mechanical symmetry group, with gravity and terrain transformed by the same isometry. Polynomial identity per generator for the branch-free rational kernels, with each square root replaced by a witness t and the side relation t² = radicand, and one identity per select branch under its guard; exact-rational randomized identity testing with a Schwartz–Zippel bound only on those polynomial pieces, with a recorded degree bound and sample set. A kernel with data-dependent selects (contact, limits) is Tested by the round-off-level residual test F
T-11 A joint's screw basis is, or is not, closed under the bracket, and its Hervé class is as reported. Exact rational linear algebra S
T-12 Monotone co-design on finite chains has a least fixed point and Kleene iteration reaches it. Lean (order theory; Order.FixedPoints re-checks) F
T-13 Discrete Noether for left-invariant discrete Lagrangians on a matrix Lie group. Lean, general M
T-14 An exported fixed-point controller has no overflow on its stated input range. FrankenLean decide_bv M
T-15 The rational gear law: from f₂ = r·f₁ and e₁ = −r·e₂ it follows that e₁·f₁ + e₂·f₂ = 0, and a composition of power-preserving port maps preserves power. Polynomial identity after substitution; Lean (ring arithmetic) S / F
T-16 The convention card: ⟨ad_ξᵀ μ, η⟩ = ⟨μ, [ξ, η]⟩; the parity map T(P) = diag(det(P)·P, P) of an improper isometry preserves the bracket and the pairing. Polynomial identities, with P written as a fixed reflection times cay(Ω) S
T-17 A derived saltation kernel equals D_xR + (f⁺ − D_xR·f⁻ − D_tR)·D_xg/(D_tg + D_xg·f⁻) for its flow, guard and reset, after clearing the denominator. Polynomial identity per event class F
T-18 The symmetry–event identity ρ(h)·Ξ_e = Ξ_{h·e}·ρ(h) holds for each generator h of Γ_obs and each event class of a model. Polynomial identity per pair, or exact-rational randomized identity testing F
T-19 Every body's pseudo-inertia is positive definite, and its declared envelope satisfies the mass-support bound. Exact rational LDLᵀ with positive pivots; one rational inequality S
T-20 Curvature sign: for a polynomial connection the second-order coefficient of the holonomy of a coordinate rectangle is −(∂ᵢ𝔸ⱼ − ∂ⱼ𝔸ᵢ − [𝔸ᵢ, 𝔸ⱼ]). Truncated-series identity in exact rationals F
T-21 Farkas soundness: if Mᵀy ≥ 0 and rᵀy < 0 then no x ≥ 0 satisfies M·x = r. Instance: a given rational (M, r, y) satisfies the hypotheses. Lean (general, over an ordered field); exact rational arithmetic (instance) F / S
T-22 The stance-family specimen of C-32: b = 3/14 m is feasible at all four load vertices with the stated forces, feasibility is convex in the load for an allocation chosen after the load is observed (the bilinear interpolant of the four witnesses is such a law; no single affine law attains this b, and the affine class needs b = 1/2 m), and every smaller b is infeasible by the dual witness. Witness replay and Farkas check in exact rationals S
T-23 The docking family of C-19: for U ∈ [½, 1] a robust causal policy exists if and only if the packet is on time and ε < (U + ½)/4. Exact rational case analysis on a grid of instances; general statement in Lean (linear arithmetic over ℚ) S / F
T-24 The number of canonical representatives generated for a campaign equals |Γ|⁻¹·Σ_g k^c(g). Exhaustive enumeration for small cases; the counting lemma is cited from Mathlib only if its closure re-checks, and otherwise the count is Tested S / F
T-25 Gait enumeration is complete: the listed (H, K) pairs are exactly the pairs of subgroups of the ambient group with K normal in H and H/K cyclic. Exhaustive enumeration of the subgroup lattice, re-derived by the checker F
T-26 For a declared fixed-n rule and sample size, the set of verdicts reachable over all outcome counts is as stated; and for every n, Σ_{i ≤ n} α/[i·(i + 1)] = α·n/(n + 1) < α. Exhaustive enumeration in exact rationals; Lean (induction on n; the infinite sum is an analytic statement and is not needed) S / F
T-27 A class-E rewrite trace maps the source program to the target program using only rules of the closed table. Trace replay by an independent checker F
T-28 An energy budget satisfies its inequality with outward-rounded error bounds, and it has a term for every source on the declared load path. Exact rational or interval arithmetic; structural check against the port graph S
T-29 Wiring conserves power: the port powers of a composed design sum to zero identically, and the wiring graph has no algebraic loop. Linear identity; graph check S
T-30 An indistinguishability witness is valid: two admitted worlds produce identical packet histories under the stated command prefix and have disjoint successful continuations. Exact replay of both worlds in an integer or rational kernel class; Tested if the worlds run in floating point F
T-31 A clearance verdict follows from the stored complexes: the claimed path lies in the inner complex, or start and goal lie in different components of the outer complex. Path replay; union–find recomputed by the checker S
T-32 Dominance on a product model with rational piecewise-affine outcome maps, the fixture of C-40 included: the pair (success, failure) is unreachable. Exact case analysis; interval enclosure for cells that are not affine F
T-33 Coriolis skewness as an identity: Ṁ − 2C + (Ṁ − 2C)ᵀ = 0 for a model's derived factorization. Polynomial identity modulo cᵢ² + sᵢ² = 1, per limb F; budget is a HYPOTHESIS
T-34 An α-certified root: for the given rational point, the computed bound on α(f, z) is below (13 − 3√17)/4. Exact rational arithmetic; Smale's theorem is a named assumption of the bundle, not a re-proved result M
T-35 Reflection soundness: each reflected checker returns true only on inputs that satisfy its specification (§12.4). Lean, written in stock Lean with Mathlib, re-checked by FrankenLean F

Obligations that no checker decides. Each of these was a candidate card. None is a statement about a finite algebraic object, so each is a test, a monitored assumption or a separate claim, and no bundle may present it as Proved or Certified.

Candidate obligation Why it is not decidable here What it is instead
Equal mission projections give identical trajectories (C-22). A statement about the execution of the whole simulator. A structural rule with a bit-identical replay test.
A fixed-point firmware lowering is equivalent to its kernel. Needs a verified compiler and a model of the target. An overflow bound per function (T-14); otherwise parity tests.
∃u ∀(w, e): a barrier condition holds for a full-order robot (C-31). Quantified nonlinear real arithmetic at thirty or more states. A KKT check at every step, assumption monitors and a Tested rate.
The articulated variational step is symplectic. True of a step derived from a discrete Lagrangian and false of the kick–drift splitting of C-36 once the mass matrix depends on configuration; either way an analytic property of a map, which no checker here decides. Not claimed; energy behaviour is measured.
A kernel's floating-point output satisfies its identity. Certificates are over ℚ with square roots; rounding is not modeled. Residual tests with dimensioned tolerances; the power-of-two test of C-21.
Results are bit-equal across CPU, CUDA and Metal. A property of three compilers and two drivers. GATE-SPARK-01, a measured hypothesis.
A world's trajectory does not depend on its batch. A property of scheduling and reductions. A replay test outside the batch (§35).
An e-process or a conformal margin delivers its error rate. Needs the sampling assumptions to hold in the running system. Null calibration over 10⁴ simulated studies; an exchangeability alarm.
The simulator is equivariant in floating point. Round-off breaks exact equivariance. T-10 over ℚ, with a round-off-level residual test.
A minimal counterexample world is the minimum. Only 1-minimality is computed. Reported as 1-minimal (C-28).
The four-state reduction behind a tube table represents the robot. An assumption about model order. A monitored assumption (C-31).
A simulated result holds on a physical robot. Not a mathematical statement. A Reality claim through §30, with the flags of §12.2.

12.4 Mechanics

  • Instance certificates are produced at build time by derive/frob-derive and checked by FrankenSymPy. Each is stored beside the kernel as K-<name>.cert with the kernel's content hash inside. frob prove verify re-checks certificates offline.
  • Lean theorems live in a Lake project under lean/, pinned to the Lean version and Mathlib commit of FrankenLean's own pin (FACT: Lean v4.32.0). Stock Lean compiles them; FrankenLean's check-olean and seal-capsule re-check and seal. Neither tool is in the production dependency graph, and build outputs are not committed. A sealed capsule contains no sorry, no axiom outside a pinned whitelist and no proof of a weakened statement: the theorem's constants are mapped to the exact symbolic IR of the artifact it is about, and the hashes of translation, environment, kernel binary, definitions and proof are kept.
  • Constraints that are facts today. FrankenLean's suite lock certifies only x86_64-unknown-linux-gnu, and this Mac has no Lean 4.32.0 toolchain installed, so Lean work runs on a Linux host. A full Mathlib re-check peaked at 92.8 GiB; a single theorem's closure is far smaller, and its measured size is recorded before any claim (OPEN-LEMMA-1).

The certificate bundle .frobcert (schema frob.cert/1, canonical JSON). A bundle is everything needed to re-check one claim on a machine that has neither the agent, a GPU nor the simulator. An answer that makes several claims (a mission answer with several cells or several proofs) is a set of bundles, one per claim, under one Merkle root, and the hash such an answer cites is that root.

{
  "schema": "frob.cert/1",
  "claim": { "kind": "family-inclusion", "class": "Certified",
             "quantifiers": ["exists_causal_policy_per_design", "forall_admitted_worlds",
                             "forall_admitted_executions"], "horizon": "static" },
  "query": { "blake3": "…", "bytes": "…" },
  "definitions": { "units": "SI", "frame": "footprint centre, +z up", "clocks": [],
                   "ports_ordered": ["++", "+-", "-+", "--"] },
  "assumptions": [ { "id": "authority", "value": "independent normal forces", "survives": "grow" },
                   { "id": "world-set", "blake3": "…", "survives": "shrink" } ],
  "plant": { "model": "…", "policy_class": "…" },
  "domain": { "chart": "half-width b in metres", "cell": { "lo": ["3", "14"], "hi": ["1", "2"] } },
  "proof": { "kind": "lp-primal",
             "primitive_equations": ["sum f = W", "sum x·f = P_x", "sum y·f = P_y", "0 <= f <= c"],
             "payload": { "vertices": 4, "forces_newton": [["160","1"], ["130","1"], ["110","1"], ["0","1"]] } },
  "checker": { "name": "frob-verify", "build": "…" },
  "expected_verdict": "accept",
  "lineage": { "merkle_root": "…", "alpha_spend": [] },
  "authorization": { "execution_authorized": false, "hardware_safety_signoff": false, "sim_to_real_certified": false }
}

Rules of the format: every field that enters the argument is typed with its frame, origin, sign convention and units; the primitive equations travel in the bundle, because a proof about the wrong translation of a contact law is still a physical error; a minimum is claimed only with the incumbent value and a checked matching lower bound, and an infimum that is not attained is returned as an open threshold with a feasible candidate and its gap; the probability mass of an unresolved set is reported only under a supplied weighting. There is one registry of proof kinds, frob.cert.kinds/1, and it is closed. §25.5.2 lists the rows that mission answers use, with their payloads:

Kind What the auditor recomputes
poly-identity Normal-form equality of two polynomial expressions over ℚ
rational-ldlt Exact LDLᵀ with positive pivots
interval-box, interval-root Outward-rounded enclosure of a constraint over a box; existence and uniqueness of a root in a box
taylor-box The same enclosure of a constraint over a box by a Taylor model: the remainder bound and the range F
sos-gram Nonnegativity of a polynomial on a box: the polynomial identity of a rational Gram matrix and its multipliers, exactly, and positive semidefiniteness by LDLᵀ over ℚ F
lp-farkas, conic-farkas Mᵀy in the dual cone and rᵀy < 0, in exact rationals
lp-primal (static witnesses), finite-game (policy tables), trace-witness (a replayed execution; class at most Tested) An explicit witness (forces, a command sequence, a path) against the primitive equations, at every vertex, with the convexity or monotonicity argument named
partition That the listed cells cover the claimed region and that each carries its own certificate
monotone-transport A recorded monotonicity or polarity implication between two cells or two assumption sets
symmetry-transport The exact images of a verdict under a signed permutation, with the invariance of the mission, the world set and the observation map under it F
composition Each end-set ⊆ entry-set inclusion of a chain of stage contracts, and that no clock or resource is spent twice F
monomial-product The monomial screen of §25.31 in exponent coordinates, with a cell's box bounds entered as constraints F
complex-connectivity A path inside the inner complex, or component labels of the outer complex
tube-inclusion The inclusion of §22.12.5 (C-31, tier 2) for every cell and enabled guard of a table
rewrite-trace Replay of a class-E rule trace from source to target
orbit-count, group-enumeration Orbit representatives and counts; the subgroup lattice of a small group
energy-budget The inequality of C-31 with its error bounds and its list of sources
alias-pair Two exact replays with identical packet histories and disjoint success sets
product-unreachable Exact case analysis or enclosure of a product model's outcome pairs
alpha-root The α bound of a rational point, with Smale's theorem as a named assumption
lean-capsule The hash of a sealed FrankenLean capsule and the statement it proves; the capsule itself is checked by fln
sample-coverage The arithmetic of a recorded study (counts, e-values, spent α). Never a proof: class at most Tested

The auditor frob-verify. A single binary built from the Rust standard library and nothing else: no FrankenSim, no GPU and no network, with unsafe forbidden. It contains a canonical-JSON reader, its own BLAKE3 (checked against the published vectors and against fs-blake3), big-integer and rational arithmetic, outward-rounded intervals built on integers, and one small checker per proof kind. It returns accept, reject or unsupported, with the first failing rule named. It rejects a missing side condition, an unknown proof kind, a quantifier prefix or domain that differs from the query even when every hash is consistent, a field passed with the wrong type (a first moment where a torque is expected), and a flag that is missing or true. It does not run physics and cannot attest that an episode happened. Its size is capped (TARGET: at most 12,000 lines) so that a person can read it, and its trusted base is stated in every report: the binary, the Rust standard library and compiler, and for lean-capsule kinds the FrankenLean kernel. A producer never calls the auditor's decision code to construct a witness, so the two share a format and nothing else. Mutations of the stance specimen that must each cause rejection: a swapped foot order with unchanged forces; an unreported positive force floor; a passive-authority tag; (60, 30) passed as the torque.

Kernel reflection F. A reflected checker is a function check : Input → Bool defined in Lean together with a soundness theorem check x = true → Spec x. The theorem is proved once, in stock Lean with Mathlib tactics, and re-checked by FrankenLean like any other theorem (T-35). An instance is then proved by the kernel evaluating check x to true, which uses no tactic at checking time and no compiled evaluator. Four reflectors are planned, in this order:

-- DESIGN: statements fix intent. Proofs are written and compiled in stock Lean with Mathlib; FrankenLean
-- re-checks the compiled declarations. No `sorry`, no added axiom, no `native_decide`.

/-- Farkas witness check over ℚ. The conclusion is stated for x over every linearly ordered field K that
    contains ℚ (ℝ in particular), with M and r cast into K, as T-21 promises; forces are real, not rational. -/
def farkas {m n : ℕ} (M : Matrix (Fin m) (Fin n) ℚ) (r y : Fin m → ℚ) : Bool := …
theorem farkas_sound {m n : ℕ} (M : Matrix (Fin m) (Fin n) ℚ) (r y : Fin m → ℚ)
    (K : Type) [LinearOrderedField K] :
    farkas M r y = true →
      ¬ ∃ x : Fin n → K, (∀ j, 0 ≤ x j) ∧ (M.map (Rat.cast : ℚ → K)).mulVec x = fun i => (r i : K) := …

/-- Exact LDLᵀ over ℚ with positive pivots. The specification is stated without `Matrix.PosDef`,
    to keep the dependency closure inside algebra, and for x over every linearly ordered field K that
    contains ℚ, with A cast into K. -/
def ldltPos {n : ℕ} (A : Matrix (Fin n) (Fin n) ℚ) : Bool := …
theorem ldltPos_sound {n : ℕ} (A : Matrix (Fin n) (Fin n) ℚ) (hA : A.IsSymm)
    (K : Type) [LinearOrderedField K] :
    ldltPos A = true →
      ∀ x : Fin n → K, x ≠ 0 → 0 < x ⬝ᵥ (A.map (Rat.cast : ℚ → K)).mulVec x := …

/-- Normal-form equality of polynomial expressions with rational coefficients. -/
def polyEq (p q : PolyExpr) : Bool := …
theorem polyEq_sound (p q : PolyExpr) :
    polyEq p q = true → ∀ (R : Type) [CommRing R] [Algebra ℚ R] (ρ : ℕ → R), p.eval ρ = q.eval ρ := …

/-- Replay of a class-E rewrite trace on straight-line programs. Equality is over ℝ; bit-exactness of
    class E in floating point is a test, not this theorem. -/
def replay (src : Slp) (t : Trace) : Option Slp := …
theorem replay_sound (src tgt : Slp) (t : Trace) :
    replay src t = some tgt → ∀ ρ : ℕ → ℝ, src.denote ρ = tgt.denote ρ := …

-- An instance is a closed term that the kernel evaluates:
example : farkas M₀ r₀ y₀ = true := by decide

Pilot (before the work package is funded): the Farkas reflector end to end on the stance specimen and the rational LDLᵀ reflector on one 4×4 pseudo-inertia with 64-bit numerators; record the module closure, the peak memory of the re-check and the kernel evaluation time. Falsifier: a closure that cannot avoid a blocked module, or a specimen that the kernel does not evaluate within 60 s (TARGET). Ceiling: reflection relabels a few instance certificates from Certified to Proved; by itself it changes no design decision and no speed. Every cost of kernel evaluation on large rationals is a HYPOTHESIS until the pilot has run. Kill: KILL-REFLECT.

12.5 What Lemma does not claim

  • It does not claim the simulator is verified. It claims that named kernels satisfy named identities, and that named cells of a design family satisfy named inequalities under a declared model.
  • It does not claim floating-point results satisfy the identities exactly. A certificate is about the SLP over the rationals with square roots; the floating-point gap is measured by tests, not proved.
  • It does not claim any Mathlib result about Lie groups, matrix exponentials or representation theory has been re-checked by FrankenLean, because those modules are blocked today.
  • It does not claim anything about a physical robot. A family certificate is about the declared model, world set and policy class, and every bundle carries the three flags of §12.2.
  • It does not claim that a statistical receipt is a proof. The auditor recomputes the arithmetic of a study; it cannot attest that the episodes ran.
  • It does not claim that certificates change a design decision. Whether they do is an open question with a measurement attached (OPEN-LEMMA-5).

12.6 Gates

Gate Threshold (TARGET) Milestone
GATE-LEMMA-00 T-01, T-03 and T-04 certified by FrankenSymPy for the M0 kernels; certificates replay offline. M0
GATE-LEMMA-01 At least 80% of derived kernels carry a replayable instance certificate for each identity their manifest declares (BET-11). M5
GATE-LEMMA-02 At least three Lean theorem cards compiled by stock Lean, re-checked by fln, and sealed; the capsule verifies from an empty environment. M5
GATE-LEMMA-03 Every proof kind in use has one specimen that frob-verify accepts and at least three mutations that it rejects; the four stance mutations of §12.4, an unknown kind with consistent hashes and a changed quantifier are all rejected (100%); the binary lists no dependency outside the standard library and runs in an empty environment. M1
GATE-LEMMA-04 The first mission slice of §25 ships its inner cells and its exclusions as bundles; a re-check on a second machine accepts every one; the seeded-defect suite yields zero accepted false certificates. One accepted false certificate fails the gate. M1, repeated at M4
GATE-LEMMA-05 The Farkas and rational LDLᵀ reflectors have soundness theorems compiled by stock Lean and re-checked by fln, and each proves its specimen by kernel evaluation within 60 s. M5
GATE-LEMMA-06 Compile-fail tests show no conversion from a claim product to a factor and no constructor of Proved evidence outside frob-lemma; every artifact exported by the conformance suite carries the three flags, all false. M0
✖ KILL-LEMMA Trigger: GATE-LEMMA-01 below 50% after one repair cycle. Fallback: certificates become exact-rational randomized identity tests recorded as Tested, and the word "certificate" is removed from kernel manifests. M5
✖ KILL-REFLECT Trigger: GATE-LEMMA-05 fails after one repair cycle, or no reflector's closure avoids the blocked modules. Fallback: instance certificates stay Certified, and reflection is parked in Appendix C. M5
✖ KILL-FAMILYCERT Trigger: at the partial ten-fold gate no family certificate has decided a cell that the generic comparator of D-17 leaves undecided at equal cost. Fallback: mission answers are produced by the generic solvers alone and still ship in the bundle format; the specialized projections are removed. M3

12.7 Refusals, invariants and known answers

Code Refusal
FROB-REF-168 A solid body exceeds the mass plausibility bound of its part class and no fill is declared (§11.5).
FROB-REF-263 A derivative is requested near grazing, at an ambiguous event order, across a change of active set or at frictional degeneracy (C-16). The reply carries the offending state and directions.
FROB-REF-823 Unknown proof kind.
FROB-REF-826 The quantifier prefix, domain or assumption set of a certificate does not match the query it is offered for.
FROB-REF-829 A side condition of a proof rule is missing, or a field has the wrong frame, origin, sign or unit.
FROB-REF-833 A no-authorization flag is missing or true.
FROB-REF-834 A result is presented above the class of its weakest input, or as Proved or Certified without a certificate hash and a checker identity.
FROB-REF-835 A verdict is reused after a change without a recorded implication (D-11).
Invariant or obligation Statement How it is checked
INV-LEMMA-01 No artifact carries Proved or Certified without a certificate hash and a checker identity. Schema check on every export
INV-LEMMA-02 The class of a combined result is the minimum of its inputs' classes; no interface raises a class. Type design; compile-fail tests
INV-LEMMA-03 Every exported artifact carries the three flags, false. Schema check; frob-verify
INV-LEMMA-04 The proof-kind registry is closed, and a checker rejects a kind it does not implement. Mutation with a fabricated kind
INV-LEMMA-05 frob-cert depends on the standard library only, and producers do not call its decision code to build witnesses. Dependency listing in xtask; call-graph lint
INV-LEMMA-06 A sealed Lean capsule has no sorry, no axiom outside the whitelist and no native_decide. fln verify-capsule --require-semantic
PO-LEMMA-01 Re-serializing a bundle with frob-verify gives identical bytes. Round trip on every specimen
PO-LEMMA-02 The auditor's BLAKE3 equals fs-blake3. Published vectors and 10⁶ random inputs
PO-LEMMA-03 Each row of the polarity table of C-18 gives the stated survival on the docking and stance fixtures. Fresh evaluation of all twelve moves per fixture
PO-LEMMA-04 The rational and interval arithmetic of the auditor agrees with FrankenSymPy's on a shared corpus. Differential test at build time; FrankenSymPy is not linked into the auditor
Known answer Expected result
Stance bundle at b = 3/14 m accept; each of the four mutations of §12.4 gives reject
Dual witness at b = 1/5 m accept for the exclusion; a perturbed multiplier gives reject
Docking cell (U, ε) = (¾, ¼), packet on time accept for the inclusion; the same bundle with the quantifiers reordered gives reject
Docking, packet late accept for the exclusion at every U and ε
T-01 for the M0 Cayley kernel accept; one changed coefficient gives reject
Rewrite trace with a reassociation filed as class E reject
Energy budget of C-31 without its gravity term reject
Bundle with execution_authorized set to true reject
Bundle with an unknown proof kind and consistent hashes reject

12.8 Open questions

Id Question Fail-closed default Blocks
OPEN-LEMMA-1 Memory and time to re-check one theorem's closure with FrankenLean. Measure before any claim. INT-FLN-01
OPEN-LEMMA-2 Do the soundness theorems of the reflectors have closures that avoid the blocked Mathlib modules? Specifications are stated in elementary form, without analysis modules. GATE-LEMMA-05
OPEN-LEMMA-3 What does kernel evaluation cost on exact rationals at specimen size? Reflection is limited to specimens that fit the budget. GATE-LEMMA-05
OPEN-LEMMA-4 Is one auditor enough, or does a family certificate need a second independent checker (fs-checker, or FrankenSymPy's capsule consumer for polynomial kinds)? One auditor with the mutation suite of GATE-LEMMA-03. GATE-LEMMA-04 at M4
OPEN-LEMMA-5 Do certificates change any design decision? Counted in the phase ledger of the ten-fold test; if the count is zero, Lemma is evidence quality only and stays off the critical path. The M7 tournament
OPEN-LEMMA-6 Does the Mathlib module that holds the orbit-counting lemma of T-24 re-check in FrankenLean at the pinned commit? Cited only after a recorded re-check; until then the count is Tested. GATE-LEMMA-02

All six are owned by the Lemma lead.