Research paper 📐 Charon/Aeneas Rust→Lean + 6-Kernel Sandboxed Replay (144 / 6,900+ Proofs)

Translating Real Rust Code Into Math Checked by Six Independent Judges

Closing the Specification-to-Binary Trust Gap: Zero-Axiom Rust-to-Lean Functional Extraction and Six-Kernel Proof Replay

Addressing the two residual failure modes of formal verification—human model-to-code transcription drift and single-checker kernel or axiom blind spots—through zero-axiom Charon/Aeneas Rust extraction, paired constructive boundary witnesses, and six-kernel independent Lean 4.36.0 proof replay.

David Charlot, Open Interface Engineering

Depth 1 · Plain Story (1 min) Full manuscript (~24 min) is at Depth 4 below
All 4 film lengths & 50 captioned languages in TV →

Translating Real Rust Code Into Math Checked by Six Independent Judges

Hand-writing a math model beside your code leaves room for copy-paste drift, and trusting one proof checker risks a tool bug—extracting the real Rust compiler tree into Lean and replaying every theorem across six independent checkers closes both gaps.

💡 Everyday Analogy

Think of scanning the actual steel bridge beams directly from the factory floor rather than trusting an early pencil sketch—and then having six rival engineering firms verify every load calculation inside sealed rooms.

01 · Setup

Machine-checked theorems in Lean 4 give strong assurance about security boundaries, numeric exactness, and microkernel isolation.

02 · Problem

Two subtle trust gaps remain in ordinary formal verification: a human-written Lean specification can drift away from the shipping Rust code, and a single proof kernel or shortcut tactic (like `CVE-2026-72844` / `ofReduceBool`) can harbor a soundness bug.

03 · Result

We extract production `#![no_std]` Rust crates directly through Inria `Charon` and `Aeneas` into pure Lean 4 functions, pair safety theorems with constructive `sat`/`unsat` boundary witnesses to forbid vacuous hypotheses, and replay all `144` hardware/Quad-Stack theorems (`6,900+` fleet theorem constants) across `6/6` independent sandboxed Lean `4.36.0` kernels with `0` `sorry`, `0` `Classical.choice`, and `0` custom axioms.

Headline Number in Plain Words

`144` hardware-invariance & Quad-Stack theorems (`41 + 103`) and `6,900+` fleet theorem constants mechanically checked across `6/6` independent `bubblewrap`-sandboxed Lean `4.36.0` kernels with `0` `sorry`, `0` `Classical.choice`, `0` `ofReduceBool`, and `0` custom axioms (`unmetered` formal verification).

▶ Watch or Listen in 15 Seconds (Plain-Words Summary)
Spoken audio:
🔊 English (15s)
Easy-Read · One Idea Per Sentence Mulberry + Tawasol (CC BY-SA 4.0)
less: energy to correct completion (J*)check: Source Sheet
  • Instead of hand-writing a separate math model that might drift from real code, Inria Charon and Aeneas translate actual no-std Rust compiler intermediate code into Lean 4 with zero opaque axioms.
  • All seven extracted Rust kernels are machine-checked for total panic-freedom, integer overflow safety, and exact mathematical refinement alongside constructive counterexamples where bounds break.
  • Every proof term is replayed from scratch across six independent verifiers—Lean paranoid, lean4lean, nanoda, con-leche, con-ron, and Lean default—across more than 58,600 declarations.
Depth 2 · Visual & Hands-On Interactive Simulator, How to Prove Us Wrong & Late-2026 Literature
Step Deeper ▾
🔬 Touch the Working Model

Adjust parameters live in your browser (zero cloud wait) or step through a guided 4-step Predict → Break → Repair → Verify lab.

🧪 How Someone Could Prove Us Wrong (Plain Falsifier)

Identify any theorem in `hardware-invariance` or `aios-quadstack-proofs` whose `#print axioms` output is non-empty (`!= ∅`), whose boundary hypotheses are unsatisfiable, or that is rejected by any of the 6 independent Lean 4.36.0 kernels.

📡 Fresh Late-2026 External Research Connection (arXiv:2611.18220v1) Read on arXiv ↗
From Pen-and-Paper to Machine-Checked Proofs: Lean for System Identification

Shows how machine-checked Lean formalization exposes unstated boundary assumptions that informal reasoning misses.

Depth 3 · Builder & Evidence Signed [G0–G12] Source Sheet, Hardware Telemetry, Code & Citation
Inspect Receipts ▾
📐 Charon/Aeneas Rust→Lean + 6-Kernel Sandboxed Replay (144 / 6,900+ Proofs) Signed Provenance · Self-Checked measured_j ⊥ reported_j ⊥ est_j ⊥ unmetered

Cite this

Genre: Research paper: formal verification, Rust-to-Lean functional extraction, constructive boundary witnesses, and multi-kernel proof replay

David Charlot, Open Interface Engineering. Closing the Specification-to-Binary Trust Gap: Zero-Axiom Rust-to-Lean Functional Extraction and Six-Kernel Proof Replay. Open Interface Engineering. Web: https://research.openie.dev/papers/rust-to-lean-six-kernel-extraction/. PDF: https://research.openie.dev/pdfs/rust-to-lean-six-kernel-extraction.pdf. Markdown: https://research.openie.dev/papers/rust-to-lean-six-kernel-extraction.md.

Research studies, not journal finals. Notation is defined in the paper. Energy classes stay strictly separate (measured_j ⊥ reported_j ⊥ est_j ⊥ unmetered). Interactive figures live under /living/. Shared terms: glossary.

Depth 4 · Full Technical Paper (Last Resort)

You already have the plain-words guide above. Expand the formal manuscript whenever you want every equation, table, and proof.

Closing the Specification-to-Binary Trust Gap: Zero-Axiom Rust-to-Lean Functional Extraction and Six-Kernel Proof Replay

Revision e1f71e37, 1 December 2026. Companion bridge: Software Automation Pipelines. Data and code: research.openie.dev/data/ · Replication Kits.

Abstract

Machine-checked formal proofs in interactive theorem provers (Lean 4, Rocq/Coq, Isabelle Higher-Order Logic (HOL), Agda) eliminate logical deduction errors relative to stated definitions, yet real-world high-assurance systems still suffer subtle semantic failures through two residual trust gaps: (i) model-to-implementation transcription drift, when engineers or autoformalizing language models write an idealized mathematical model in a proof assistant while shipping a separate Rust or C implementation whose fixed-width integer casts, modulo sign rules, or overflow branches diverge from the idealized spec; and (ii) single-checker and hidden-axiom blind spots, when a proof silently relies on unverified external axiom declarations, compiler-trusting reflection (native_decide / Lean.ofReduceBool), non-constructive classical choice (Classical.choice), vacuous preconditions (false -> P), or an implementation bug in a single proof-checking kernel.

This paper presents the verification architecture developed across waiOS (waiOS-H27 and waiOS-H28), lut-adapt, and the Reality Code Engine (RCE) to close both trust gaps simultaneously. First, #![no_std] #![forbid(unsafe_code)] production Rust functions are lowered directly from rustc Mid-Level Intermediate Representation (MIR) via Inria’s Charon into Low-Level Borrow Calculus (LLBC) and translated by Aeneas -backend lean into pure monadic Lean 4 definitions (WaiosRingsVerify_Aeneas.lean, Secure Hash Algorithm 256 (SHA-256) digest ee3c1d522d467b16ce8bd1666fafe411b2fb7f24d7075870010641038f7665c2) containing 0 external axiom declarations across all 7 extracted core functions. Second, every mathematical safety bound is enforced under a constructive choice-free discipline (0 sorry, 0 Classical.choice, 0 Quot.sound, 0 ofReduceBool) and paired with an explicit constructive failure/tightness witness one step beyond the hardware boundary (16,777,217 binary32 round-to-nearest-even rounding witness; ±1,890,071,541 redundant-residue Hamming-distance collapse ; and 9-tap -145,161 < -131,072 Xilinx digital-signal-processor slice (DSP48E2) dual-lane crosstalk overflow witness), making vacuous specifications impossible. Third, compiled proof environments (58,649 declarations in waiOS-H27, scaling to 144 waiOS theorems, 218 lut-adapt theorems, and 5,393 RCE theorem constants) are replayed independently inside isolated sandboxes across six distinct proof checkers (Lean v4.36.0 paranoid kernel, lean4lean, nanoda, con-leche --verified, con-ron --verified, and Lean v4.36.0 default kernel). Applied to JouleBit-LUT6 6-column zero-multiply slabs (Theorem 19) on real ornith-1.0-9B Layer-0 weight slices, extracted-and-proved kernels achieve 2.05×–2.47× speedups over bitsliced baselines and 3.55×–4.37× lower Linux Running Average Power Limit (RAPL) reported_j than dense Brain Floating Point 16 (BF16) at 0-bit cross-host drift (256-bit cryptographic hash (BLAKE3) digest 7af8ecc1...b4ce).

In plain words

  1. Even when a project boasts “mathematical proofs,” two things often go wrong in practice: humans prove theorems about a simplified math sketch that doesn’t match the real Rust or C code running in production (especially around integer overflow and negative remainders), or a proof quietly smuggles in unproven assumptions, vacuous “if-impossible-then-anything” rules, or a bug in a single proof checker.
  2. We eliminate hand-transcription drift by translating the real #![no_std] Rust compiler intermediate code (MIR) automatically into Lean 4 via Charon and Aeneas with zero unverified axioms, and we prevent vacuous theorems by pairing every positive hardware safety proof with a concrete counterexample showing the exact number (16,777,217, 1,890,071,541, or tap 9) where the hardware bound genuinely breaks.
  3. Finally, every compiled proof (58,649 declarations) is checked independently by six separate proof kernels written in different languages (Lean C++, Lean-in-Lean, Rust, and minimal verifiers) so no single checker bug can slip through—anchoring real 9B-parameter neural layers that cut Zen 5 RAPL chip energy by 3.55×–4.37× with 0-bit drift across Apple, Advanced Micro Devices (AMD), and NVIDIA (Blackwell) hosts.

Terms and evidence labels

  • MIR, LLBC, AST, IR, SSA, SMT, VC, FFI, CLI, CI, TCB, LoC: Mid-Level Intermediate Representation (`rustc`), Low-Level Borrow Calculus (`Charon`), abstract syntax tree, intermediate representation, static single assignment, satisfiability modulo theories, verification condition, foreign function interface, command-line interface, continuous integration, trusted computing base, and lines of code
  • HOL, RNE, ULP, CRT, RRNS, RNS, DSP, DSP48E2, SIMD, FWHT, FWHT8, KV, DC, MP, JpCT: higher-order logic (`Isabelle/HOL`), round-to-nearest-even, unit in the last place, Chinese Remainder Theorem, redundant residue number system, residue number system, digital signal processor, Xilinx UltraScale+ $27 \times 18 \to 45$-bit multiplier-accumulator slice (`DSP48E2`), single instruction multiple data, fast Walsh–Hadamard transform (`8`-point `FWHT8`), key-value attention cache, direct-current zero-frequency component (or direct current rail in shunt context), Marchenko–Pastur random-matrix rank floor, and Joules per Certified Transition (`JpCT`)
  • CPU, GPU, FPGA, ISA, BF16, FP32, INT8, BPW, LUT, LUT6, QKV, MLP, dB: central processing unit, graphics processing unit, field-programmable gate array, instruction set architecture, Brain Floating Point 16, 32-bit binary floating point, 8-bit signed integer, bits per weight, lookup table (`JouleBit-LUT6`), query-key-value attention projection, multi-layer perceptron, and decibel signal-to-distortion ratio
  • WAIOS, RCE, SHA, BLAKE3, XNU, AMU, RAPL, TI, INA238, LCF, SAT, CVC5, TLS, KEM, OS, SNR, WGSL, EXT: Hardware-Invariant Operating Substrate (`waiOS`), Reality Code Engine, Secure Hash Algorithm (`SHA-256`), `BLAKE3` 256-bit cryptographic hash, macOS hybrid kernel (`XNU`), Apple Activity Monitor Unit energy counters, Running Average Power Limit on-chip energy counters, Texas Instruments (`INA238` DC rail monitor), Logic for Computable Functions proof-kernel architecture, Boolean satisfiability, Cooperating Validity Checker 5 (`CVC5`), Transport Layer Security, key-encapsulation mechanism (`ML-KEM`), operating system, signal-to-noise ratio, WebGPU Shading Language, and Extraction & Six-Kernel study falsifier prefix (`EXT-F1` to `EXT-F5`)
  • AMD, NVIDIA, AGX, ARM64, RV64, KV260, HIL, LLM, HOL4, MIN, PASS, ICFP, POPL, ITP, CAV, CPP: Advanced Micro Devices, NVIDIA accelerated computing (`Jetson AGX`), 64-bit Arm (`ARM64`), 64-bit RISC-V (`RV64`), Xilinx `Kria KV260` FPGA kit, hardware-in-the-loop, large language model, Higher-Order Logic 4 theorem prover (`HOL4`), minimum signed integer constant (`I64::MIN`), passing kernel verdict, International Conference on Functional Programming, Principles of Programming Languages, Interactive Theorem Proving, Computer Aided Verification, and Certified Programs and Proofs

Every quantitative figure in this study carries an explicit source-epistemology label, and every energy reading strictly separates orthogonal telemetry classes (measured_j ⊥ reported_j ⊥ est_j ⊥ unmetered):

LabelEpistemic scope
ProjectionA forward-looking scaling estimate conditioned on stated codebase or proof-library assumptions
Company-reportedA third-party tool specification or vendor hardware rating stated without independent external audit
FiledA statutory or standards-body specification
Literature / ReportedA peer-reviewed formal-methods, compiler, or theorem-proving result reported by external authors (ICFP, POPL, ITP, CAV, CPP)
MeasuredA deterministic declaration count, cryptographic file digest, kernel replay wall time, or hardware power reading from reproducible Open Interface Engineering artifacts (proofs/WaiosRingsVerify_Aeneas.lean, proofs/WaiosProofs/, results/h27_lean4_six_kernel_and_aeneas_proof.json, results/h28_real_9b_jpct_and_compiled_agency_benchmark.json; Signed Provenance · Self-Checked), strictly separating measured_j (TI INA238 on NVIDIA Jetson AGX Thor), reported_j (Linux RAPL on AMD Zen 5 and XNU AMU on Apple M3 Ultra), est_j (analytical models), and unmetered (Lean 4.36.0 declaration/kernel verification counts with board_metered: false)

1. Anatomy of the Two Residual Formal-Verification Failure Modes

1.1 Failure Mode 1 — Model-to-Implementation Transcription Drift

In conventional formal-methods workflows, an engineer writes an executable system in Rust or C () and separately hand-authors a specification model in Lean 4 or Rocq (), proving . Whenever the human author (or an autoformalizing language model [1]) abstracts i32/i64/u8 machine words into unbounded mathematical integers or translates Euclidean modulo (Int.emod, always non-negative) in place of Rust’s truncating remainder (%, negative on negative dividends!), holds in Lean while silently panics, wraps, or corrupts lanes in silicon.

Consider DSP48E2 borrow-compensated dual-lane signed INT8 extraction (dsp48e2_pack_and_extract_dual_i8 in WaiosRingsVerify_Aeneas.lean): in Rust, shifted % 262144_i64 yields a negative remainder r0 < 0 whenever p48 + 131072 < 0, requiring an explicit branch if r0 < 0 { r0 + 262144 } else { r0 } before subtracting 131072. A hand-written Lean model using Nat or Euclidean Int.emod erases that branch entirely—leaving the exact bug-prone lines of Rust unverified.

1.2 Failure Mode 2 — Single-Kernel Bugs, Compiler-Trusting Reflection, and Vacuous Specs

Even when a Lean 4 file compiles with zero visible warnings, four soundness hazards can hollow out the assurance value of lake build:

  1. Unverified axiom or sorry smuggling. An imported helper module declaring axiom hardware_safe : ... or leaving an incomplete sorry produces sorryAx in the declaration environment.
  2. Compiler-trusting native_decide (Lean.ofReduceBool). Using by native_decide compiles Lean code to native C/machine code, executes it outside the logical kernel, and injects a trust axiom (Lean.ofReduceBool) asserting the unverified compiler/CPU execution returned true—expanding the proof TCB from a ~6k-line logical kernel to the entire Lean compiler, C toolchain, and host OS!
  3. Vacuous preconditions (Spec gaming). As quantified in Open Interface Engineering Kit #8 (/papers/software-automation-pipelines/), shared-context specification writing admits 199 / 200 (99.50%) broken mutants when preconditions are contradictory or assertions are tautological [1]. In arithmetic hardware proofs, an overly narrow or contradictory hypothesis makes trivially provable without testing the actual boundary.
  4. Single-checker implementation bugs. Interactive theorem provers are complex C++ or self-hosted software systems; historical soundness bugs in universe polymorphism, let-projection reduction, or quotient axioms motivate replaying exported declaration graphs across independent minimal proof checkers [2, 3].

1.3 Four Testable Hypotheses (H1 to H4)

We formulate and test four hypotheses in ascending order:

  • H1 (Zero-Axiom Charon + Aeneas Functional Extraction Hypothesis): Compiling #![no_std] #![forbid(unsafe_code)] Rust crates through rustc MIR Charon LLBC Aeneas -backend lean produces pure monadic Result functions in Lean 4 with 0 external axiom declarations, preserving exact Rust Std.I32/Std.I64/Std.U32/Std.U8 overflow checks and truncating-modulo branches.
  • H2 (Choice-Free Constructive Proof Discipline Hypothesis): All arithmetic, error-correcting, hardware-packing, attention-tiling, and lookup-table theorems in WaiosProofs can be proved constructively in Lean 4.36.0 with 0 sorry, 0 Classical.choice, 0 Quot.sound, and 0 ofReduceBool (native_decide).
  • H3 (Paired Tightness & Overflow Witness Non-Vacuity Hypothesis): Pairing every positive safety bound () with a constructive witness at () mathematically proves both non-vacuity of the specification and optimality (tightness) of the hardware parameter.
  • H4 (Six-Kernel Independent Replay & JouleBit-LUT6 Physical Payoff Hypothesis): Replaying the compiled 58,649-declaration environment across six independent proof checkers achieves 6 / 6 unanimous acceptance in < 4 minutes, while the extracted-and-proved JouleBit-LUT6 6-column zero-multiply slab cuts real ornith-1.0-9B Layer-0 RAPL reported_j by 3.55×–4.37× at 0-bit cross-host drift.
End-to-end verification pipeline diagram. Top lane: Production #![no_std] #![forbid(unsafe_code)] Rust source (7 core waios_rings_verify functions) compiled by rustc into MIR, lowered by Inria Charon into LLBC, and translated by Aeneas -backend lean into WaiosRingsVerify_Aeneas.lean (SHA-256 ee3c1d522d..., 0 external axioms, exact Std.I64/U32/U8 checked arithmetic). Middle lane: Five choice-free Lean 4.36.0 proof modules (20 theorems in H27 scaling to 144 waiOS, 218 lut-adapt, and 5,393 RCE declarations; 0 sorry, 0 Classical.choice, 0 Quot.sound, 0 ofReduceBool). Bottom lane: Independent replay of all 58,649 declarations inside isolated sandboxes across all 6 proof kernels (Lean 4.36.0 paranoid, lean4lean, nanoda, con-leche --verified, con-ron --verified, and Lean default) sealing h27_lean4_six_kernel_and_aeneas_proof.json.
Figure 1. Zero-axiom rustc MIR -> Charon LLBC -> Aeneas functional extraction pipeline paired with choice-free Lean 4.36.0 proofs and 6-kernel independent declaration replay (58,649 declarations, 0 sorry, 0 ofReduceBool). A PNG copy is provided. Open full size · PNG

2. Survey of Rust Formal-Verification Lineages and Zero-Axiom Charon/Aeneas Extraction

2.1 Comparing Rust Verification Approaches (Verus, Kani, Creusot, hacspec, Aeneas)

Over the past five years, five major toolchains have tackled formal verification of safe Rust (Literature / Reported):

Rust verification lineageCore mechanism & backend solver/proverStrengthBoundary for foundational 6-kernel arithmetic proofs
Bounded model checking — Kani (CBMC) [4]Translates MIR to bitvector SAT/SMT formulas with bounded loop unwindingZero-annotation bit-exact panic/overflow hunting on bounded inputsBounded unwinding; produces no foundational proof-assistant term replayable across 6 Lean kernels
SMT-backed deductive Rust — Verus [5], Prusti, Creusot (Why3) [6]Ghost annotations inside Rust lowered to Z3 / CVC5 SMT verification conditionsHigh developer velocity on systems invariants (Verus OS/storage proofs)Trusts SMT solver (~300k+ LoC C++) unless SMT proofs are reconstructed inside an LCF/type-theory kernel
Subset transpilers — hacspec / hax [7]Translates a restricted cryptographic Rust subset into F*, Rocq, ProVerif, or LeanBattle-tested on TLS / ML-KEM (libcrux) cryptographic primitivesGeneral borrow-returning mutable references require full borrow-calculus functionalization
Borrow-calculus functional extraction — Inria Charon + Aeneas (Ho & Protzenko [8])Charon extracts full rustc MIR into LLBC; Aeneas translates borrow lifetimes via symbolic backward functions into pure Lean 4 / HOL4 / F* functionsOperates on unmodified safe Rust (#![no_std]), preserving every fixed-width CheckedAdd/CheckedMul/Rem in pure monadic Lean 4Ideal fit: emitted Lean 4 definitions carry 0 SMT trust and replay directly inside 6 independent Lean kernels!

2.2 All Seven Zero-Axiom Extracted Rust Functions (WaiosRingsVerify_Aeneas.lean, H1)

Compiling crates/waios-rings-verify/src/lib.rs (#![no_std], #![forbid(unsafe_code)]) through Charon (MIR -> LLBC) and Aeneas -backend lean generated proofs/WaiosRingsVerify_Aeneas.lean (189 lines, SHA-256: ee3c1d522d467b16ce8bd1666fafe411b2fb7f24d7075870010641038f7665c2, 0 external axiom declarations, Measured):

Extracted Lean 4 definition in waios_rings_verifyExact Aeneas monadic signature (Std machine integers)Machine-level Rust behaviors preserved faithfully in Lean 4
1 · kulisch_safe_tile_bound_okStd.U32 → Result BoolChecked k * 16129#u32 (u32 overflow trap) and < 16777216#u32 (2^24 significand gate)
2 · dsp48e2_pack_and_extract_dual_i8Std.I32 → Std.I32 → Std.I32 → Result (Std.I32 × Std.I32)I32 -> I64 casts, * 262144#i64, + 131072#i64 borrow bias, truncating % 262144#i64 negative-remainder branch (if r0 < 0#i64), / 262144#i64, and I64 -> I32 narrowing casts
3 · rrns_encode_6Std.U32 → Result (Std.U8 × Std.U8 × Std.U8 × Std.U8 × Std.U8 × Std.U8)Six checked modulo reductions (% 251, 253, 255, 256, 241, 247) and U32 -> U8 narrowing UScalar.cast checks
4 · rrns_hamming_dist_6(6 × Std.U8) → (6 × Std.U8) → Result Std.U8Six byte-equality branches plus five sequential checked Std.U8 additions (d0 + d1 + ... + d5)
5 · fwht2_butterfly_pairStd.I32 → Std.I32 → Result (Std.I32 × Std.I32)Explicit [-1_000_000, +1_000_000] guard bounds preventing i32 signed addition/subtraction overflow on a + b and a - b
6 · antisym40_mirror_codeStd.U8 → Std.U8 → Std.U8 → Std.U8 → Result (Std.U8 × Std.U8)Base-3 trit validation (u_i < 3#u8), u0 + 3*u1 + 9*u2 + 27*u3 checked U8 evaluation, and antisymmetric mirror 80#u8 - c
7 · waios_authority_gate_sealStd.U64 → Std.U64 → Bool → Result BoolExact 64-bit digest equality (candidate_digest = ref_digest) gated conjunctive signature admission

2.3 Concrete MIR -> LLBC -> Lean 4 Inspection (WaiosRingsVerify_Aeneas.lean)

Inspecting the verbatim Aeneas-generated Lean 4 code (WaiosRingsVerify_Aeneas.lean, lines 35–68 and 153–176) illustrates why automated functional extraction catches implementation subtleties that hand-written mathematical models miss:

/-- [waios_rings_verify::dsp48e2_pack_and_extract_dual_i8]: Source: 'src/lib.rs', lines 15:0-28:1 -/
def dsp48e2_pack_and_extract_dual_i8
  (w0 : Std.I32) (w1 : Std.I32) (x : Std.I32) : Result (Std.I32 × Std.I32) := do
  if w0 >= (-127)#i32 then
    if w0 <= 127#i32 then
      if w1 >= (-127)#i32 then
        if w1 <= 127#i32 then
          if x >= (-127)#i32 then
            if x <= 127#i32 then
              let i ← lift (IScalar.cast .I64 w0)
              let i1 ← i * 262144#i64
              let i2 ← lift (IScalar.cast .I64 w1)
              let a_packed ← i1 + i2
              let i3 ← lift (IScalar.cast .I64 x)
              let p48 ← a_packed * i3
              let shifted ← p48 + 131072#i64
              let r0 ← shifted % 262144#i64
              let rem_shifted ← if r0 < 0#i64 then r0 + 262144#i64 else ok r0
              let lane1 ← rem_shifted - 131072#i64
              let i4 ← shifted - rem_shifted
              let lane0 ← i4 / 262144#i64
              let i5 ← lift (IScalar.cast .I32 lane0)
              let i6 ← lift (IScalar.cast .I32 lane1)
              ok (i5, i6)
            else ok (0#i32, 0#i32) ...

Every monadic bind (←) inside Result obligates the prover to establish absence of panic/overflow across 14 sequential machine operations:

  1. All six [-127, +127] Std.I32 input guard branches must dominate i * 262144#i64 so neither a_packed nor p48 + 131072#i64 can ever wrap Std.I64.
  2. shifted % 262144#i64 preserves Rust’s truncating signed remainder (r0 ∈ (-262144, +262144)), explicitly verifying that if r0 < 0#i64 then r0 + 262144#i64 else ok r0 lands inside [0, 262143] and that (shifted - rem_shifted) / 262144#i64 divides cleanly without division-by-zero or I64::MIN / -1 traps.
  3. Finally, IScalar.cast .I32 lane0 and IScalar.cast .I32 lane1 verify that narrowing back from 64-bit hardware DSP48E2 accumulators to 32-bit output registers never truncates high bits.

Similarly, in antisym40_mirror_code(u0, u1, u2, u3 : Std.U8) (lines 153–176), Aeneas verifies that whenever , the Std.U8 radix-3 polynomial never overflows 255#u8 and the antisymmetric mirror subtraction 80#u8 - c never underflows unsigned 0#u8—exploiting so 40 lookup entries cover all 81 4-trit states via sign negation!


3. Constructive Choice-Free Proofs and Paired Boundary Witnesses (H2 & H3)

Across the five foundational modules of WaiosProofs (20 core theorems in waiOS-H27, extended to 144 total waiOS theorems across 31 modules), every safety invariant is proved without Classical.choice, Quot.sound, sorry, or ofReduceBool, and paired with an explicit constructive boundary witness demonstrating that relaxing the hardware bound by +1 unit causes genuine mathematical failure:

Three-row paired constructive tightness diagram. Row 1 (KulischExactFloat.lean): Safe zone K_tile <= 512 keeps |sum w_k x_k| <= 8,258,048 < 2^24 = 16,777,216 (ulp = 1, 0 rounding error across sequential, systolic tree, and permuted workers) paired with tightness witness z = 16,777,217 = 2^24 + 1 rounding to 16,777,216 != 16,777,217 under RNE. Row 2 (RrnsFaultHealing.lean): Safe zone [-1,890,071,540, +1,890,071,540] across 6 moduli {241, 247, 251, 253, 255, 256} enforces minimum Hamming distance d_H >= 3 (100 percent 1-channel cosmic-ray healing) paired with horizon boundary witness x = +1,890,071,541 vs y = -1,890,071,540 collapsing to d_H = 2. Row 3 (Dsp48e2DualSimd.lean): Safe zone <= 8 INT8xINT8 taps packed into 27x18->45b DSP48E2 keeps |sub1| <= 129,032 < 131,072 = 2^17 (0 lane crosstalk via +2^17 bias) paired with 9-tap extremal witness (w1 = -127, x = 127) overflowing sub1 = -145,161 < -131,072 and corrupting upper lane0.
Figure 2. Paired constructive safety theorems and exact +1-step failure witnesses across KulischExactFloat.lean, RrnsFaultHealing.lean, and Dsp48e2DualSimd.lean, eliminating vacuous specifications while proving hardware parameter tightness. A PNG copy is provided. Open full size · PNG

3.1 Three Paired Hardware Safety & Failure-Boundary Derivations

  1. Module 1 · KulischExactFloat.lean (Theorems 1–4, Systolic FP32 Significand Ceiling):

    • Positive Safety Theorem: For all and tile depth , and , guaranteeing binary32RneGrid(acc) = acc (0 rounding error across sequential, systolic tree, and permuted worker orders).
    • Constructive Tightness Witness: At in octave where ulp = 2, binary32RneGrid 16777217 = 16777216 != 16777217.
  2. Module 2 · RrnsFaultHealing.lean (Theorems 5–8, Six-Channel Cosmic-Ray Fault Healing):

    • Positive Safety Theorem: Over moduli , all pairs carry explicit small Nat Bézout coprimality certificates with . Chaining constructive Gauss–Euclid divisibility (euclid_dvd_pos / euclid_dvd_neg) across the four smallest moduli proves that for all distinct in (), at most 3 residues can match—so code Hamming distance satisfies , guaranteeing disjoint radius-1 single-fault balls ().
    • Constructive Tightness Witness: Stepping +1 integer past the symmetric horizon to and yields , causing all four smallest channels to collide simultaneously and collapsing code distance to rrnsHamming6 x y = 2 (1-fault unique decoding lost!).
  3. Module 3 · Dsp48e2DualSimd.lean (Theorems 9–12, Dual-INT8 Packing on -Bit FPGA DSPs):

    • Positive Safety Theorem: Packing two signed weights into the 27-bit port and multiplying by shared activation on the 18-bit port exploits exact bilinearity:

For taps, , so borrow-compensated extraction and recovers both lanes with 0 crosstalk—lighting up all 1,248 DSP48E2 slices on Kria KV260 at 2× throughput.

  • Constructive Tightness Witness: At T = 9 taps with , , overflowing the signed 18-bit lower lane and corrupting extractLane0 by -1 (Theorem 12, proving 8 taps is the exact physical subtile maximum!).
  1. Modules 4 & 5 · FlashAttentionAndTraining.lean (Theorems 13–16) & LittleBit2AndCompiledAgency.lean (Theorems 17–20): Prove 256-bit online Base-2 FlashAttention tile-merge associativity, E8 256 : 36 = 64 / 9 = 7.111× KV-cache paging compression, error-feedback DC conservation, 4-worker AllReduce invariance, FWHT8 dot-product isometry (0 runtime multiply ops), copy-head collapse (8) vs. Hadamard orthogonality (0), JouleBit-LUT6 6-column zero-multiply slab exactness (0.119 BPW floor), and N >= 2 JpCT amortization dominance.

3.2 Constructive Gauss–Euclid Proof Structure Without Classical.choice (RrnsFaultHealing.lean)

Why do standard library number-theory proofs in Mathlib frequently pull Classical.choice and Quot.sound into their axiom footprint? General ring localization, quotient-group isomorphisms (), and non-constructive existence of greatest-common-divisor linear combinations routinely invoke quotient types or classical decidability by classical.

In WaiosProofs/RrnsFaultHealing.lean and Dsp48e2DualSimd.lean, we avoid every quotient and choice axiom by supplying explicit small positive Nat Bézout witnesses (u, v <= 127) and chaining constructive divisibility directly over Nat and Int:

/-- Constructive Gauss-Euclid lemma (`a * u = b * v + 1`, `a * x = b * y -> ∃ z, x = b * z`)
    proved with 0 Classical.choice, 0 Quot.sound, and 0 ofReduceBool. -/
theorem euclid_dvd_pos (a b x y u v : Nat)
    (h_bez : a * u = b * v + 1)
    (h_eq  : a * x = b * y) :
    ∃ z : Nat, x = b * z := by
  refine ⟨u * y - v * x, ?_⟩
  -- Explicit witness `z := u * y - v * x` computed directly from Bézout coefficients!
  ...

/-- Borrow-compensated DSP48E2 dual-lane extraction (`0` lane crosstalk on `[-131072, +131071]`). -/
def sext18 (r : Int) : Int :=
  if decide (r < 131072) then r else r - 262144

def extractLane0 (p48 : Int) : Int := (p48 + 131072) / 262144
def extractLane1 (p48 : Int) : Int := sext18 (p48 % 262144)

theorem dsp48e2_borrow_compensated_extractor_exact
    (sub0 sub1 : Int) (h_lo : -131072 ≤ sub1) (h_hi : sub1 < 131072) :
    let p48 := sub0 * 262144 + sub1
    extractLane0 p48 = sub0 ∧ extractLane1 p48 = sub1

Constructing the explicit witness z := u * y - v * x in euclid_dvd_pos has two direct payoffs: (i) the resulting proof term reduces via pure structural recursion in every independent external checker (con-leche --verified, con-ron --verified, nanoda, and lean4lean) without needing classical axiom schemas, and (ii) every existential proof doubles as a runnable syndrome-decoding algorithm for hardware fault recovery!

3.3 Summary Table of All 20 Foundational waiOS-H27 Theorems and Axiom Audits

Proof module (WaiosProofs/)Theorem IDsPositive safety invariant provedPaired +1-step tightness / boundary witnessChoice / ofReduceBool count
1 · KulischExactFloat.lean1–4INT8×INT8 ∈ [-16129, +16129]; $K \le 512 \implies\text{acc}\le 8{,}258{,}048 < 2^{24}$; seq = tree = perm
2 · RrnsFaultHealing.lean5–815 Bézout pairs (); Gauss–Euclid CRT; on 0 choice · 0 ofReduceBool
3 · Dsp48e2DualSimd.lean9–12 borrow extractor; b bilinearity; 8-tap $\text{sub}_1\le 129{,}032 < 2^{17}$
4 · FlashAttentionAndTraining.lean13–16256-bit Base-2 online FlashAttention merge associativity; E8 64/9 = 7.111× KV; DC; 4-worker AllReduceUnmerged naive block-max shift drift without 256-bit exact rescaling0 choice · 0 ofReduceBool
5 · LittleBit2AndCompiledAgency.lean17–20FWHT8 dot-product isometry; Hadamard 0 vs. copy-head 8; JouleBit-LUT6 6-col slab; JpCT winCopy-head rank collapse (8 coherent spike) without FWHT8 rotation0 choice · 0 ofReduceBool

4. Six-Kernel Independent Proof Replay and Real ornith-1.0-9B Hardware Payoff (H4)

4.1 Six-Kernel Verification Matrix (58,649 Declarations in 234.9 s)

Exporting the complete declaration environment of WaiosProofs + WaiosRingsVerify_Aeneas (58,649 total kernel declarations) and replaying every universe level, inductive rule, and definitional reduction inside isolated sandboxes (scripts/verify_waios_lean_and_aeneas.py, Measured [9]):

Independent proof checkerImplementation language & lineageVerification flags & soundness checks enforcedDeclarations verified (waiOS-H27)Verdict
1 · Lean v4.36.0 Paranoid KernelC++ reference kernellake check --paranoid (full environment re-typecheck)58,649PASS (0 sorry)
2 · lean4lean (Carneiro [2])Lean 4 self-formalized kernelIndependent type-theory spec checking exported .olean graph58,649PASS (0 sorry)
3 · nanoda [3]Independent Rust checkerStandalone Rust parser/reducer explicitly barring sorryAx & ofReduceBoolFull graphPASS (0 sorryAx)
4 · con-leche --verifiedMinimal verified external checkerStrict axiom whitelist ([] or [propext] only; Classical.choice flagged)58,647PASS (0 choice)
5 · con-ron --verifiedSecond independent minimal checkerDisjoint reduction/conversion engine checking every constant58,647PASS (0 choice)
6 · Lean v4.36.0 Default KernelC++ fresh clean buildClean-room rebuild + WaiosRingsVerify_Aeneas SHA-256 lock58,649PASS (234.9 s total)

This identical six-kernel discipline scales across the wider Open Interface Engineering proof estate: 144 waiOS theorems (including 103 Quad-Stack seL4 theorems in /papers/sel4-heterogeneous-hil-consensus/), 218 lut-adapt theorems (1,584 fleet declarations [10]), and 5,393 RCE theorem constants (1,264 source declarations inside Linux bubblewrap containers, powering Spec ⊥ Impl software factories at /automation-pipelines/ [1]).

4.2 Empirical Payoff of Theorem 19 (JouleBit-LUT6) on Real ornith-1.0-9B Slices (waiOS-H28)

To verify that zero-axiom extracted and 6-kernel-checked arithmetic translates into real silicon energy savings—and to report candidly where extreme sub-bit Walsh truncation hits random-matrix limits—we evaluated the JouleBit-LUT6 6-column zero-multiply slab (compiled_agency.rs) across one localized multi-head operator (kurtosis = 211.41) and four real ornith-1.0-9B Layer-0 weight projections (256 × 1024) across Apple M3 Ultra (XNU AMU), AMD Zen 5 (Linux RAPL), and NVIDIA Jetson Thor (TI INA238) (Measured, identical BLAKE3 = 7af8ecc1fc587af67db1a575519cc8869f1b760ad4f5d5d7f102f2d42f62b4ce):

Projection (256 × 1024)Weight kurtosisMultiRing (~2.2 BPW) SNRLittleBit-2 Walsh (0.476 BPW)Zen 5 bitsliced LUT6 latencyLUT6 speedup (M3U / Zen5 / Thor)Zen 5 RAPL reported_j (Dense BF16 LUT6)
canonical_localized_multihead211.4116.02 dB (4.251 BPW)49.34 dB (+9.12 dB Walsh)72.71 29.38 µs2.33× / 2.47× / 2.23×3,921 897 µJ/op (4.37× cut)
ornith_9b.in_proj_qkv3.4510.11 dB (2.197 BPW)1.48 dB (hits MP rank floor!)69.03 29.48 µs2.15× / 2.34× / 2.05×2,755 665 µJ/op (4.14× cut)
ornith_9b.out_proj5.2910.97 dB (2.517 BPW)1.28 dB (hits MP rank floor!)69.34 29.41 µs2.31× / 2.36× / 2.07×2,746 773 µJ/op (3.55× cut)
ornith_9b.mlp.gate_proj3.5610.21 dB (2.187 BPW)1.18 dB (hits MP rank floor!)69.49 29.44 µs2.26× / 2.36× / 2.07×2,720 760 µJ/op (3.58× cut)
ornith_9b.mlp.down_proj3.2010.21 dB (2.239 BPW)1.18 dB (hits MP rank floor!)68.87 29.42 µs2.24× / 2.34× / 2.05×2,803 662 µJ/op (4.23× cut)

Notice the candid empirical lesson in column 4: ultra-sparse 0.119–0.476 BPW LittleBit-2 Walsh spectral coding excels on high-kurtosis localized heads (49.34 dB at kurtosis = 211.41), yet collapses to 1.18–1.48 dB on dense low-kurtosis (3.20–5.29) pretrained 9B weights whose singular spectrum follows the Marchenko–Pastur (MP) bulk distribution—whereas ~2.2 BPW MultiRing + JouleBit-LUT6 preserves 10.11–10.97 dB while cutting Zen 5 RAPL reported_j by 3.55×–4.23× on real 9B slices.

4.3 Reproducible Single-Command Six-Kernel Verification Protocol

To ensure external auditors can replay both the Charon/Aeneas zero-axiom check and all six independent Lean 4.36.0 proof kernels without manual environment assembly, scripts/verify_waios_lean_and_aeneas.py executes four deterministic stages and emits a cryptographically hashed JSON ledger (results/h27_lean4_six_kernel_and_aeneas_proof.json):

# 1. Verify exact SHA-256 of Aeneas-extracted Lean module & assert 0 external `axiom` lines:
shasum -a 256 proofs/WaiosRingsVerify_Aeneas.lean
# -> ee3c1d522d467b16ce8bd1666fafe411b2fb7f24d7075870010641038f7665c2 (0 external axioms)

# 2. Clean-build all WaiosProofs modules under Lean v4.36.0 & audit `#print axioms`:
cd proofs && lake build WaiosProofs

# 3. Replay all 58,649+ declarations across all 6 independent paranoid proof kernels:
python3 scripts/verify_waios_lean_and_aeneas.py --out results/h27_lean4_six_kernel_and_aeneas_proof.json

# 4. Run 3-host JouleBit-LUT6 & real ornith-1.0-9B JpCT hardware benchmark:
cargo run --release -p waios-rings --example h28_real_9b_jpct_and_deterministic_null_bench

5. Role in Gate-First Spec ⊥ Impl Software Factories (/automation-pipelines/)

In Pipelines for Computer Automation of Software Development and Maintenance (/automation-pipelines/) [1], surveying “LLM-as-Formalizer” autoformalization pipelines revealed a subtle Achilles’ heel: while a proof assistant’s kernel blocks proof hallucinations (Impl soundness), an unconstrained neural model translating requirements into Lean 4 can still emit vacuous specifications (false -> P, dropped edge-case branches, or idealized Int models divorced from Rust machine types).

Combining the four mechanisms established in this paper closes that autoformalization loophole inside unattended software factories:

Verification failure mode in autonomous codingHow naive LLM + unit-test or LLM + single-prover stacks failHow Charon/Aeneas + Paired Witnesses + 6-Kernel Replay closes it
1 · Shared-context weak test gaming199 / 200 (99.50%) broken AST mutants pass naive self-written tests (Kit #8 Arm A [1])Context-isolated Spec ⊥ Impl 100% AST Mutant Kill Gate (0 / 200 & 0 / 800 escapes)
2 · Hand-written Lean model drifts from Rust codeLean model uses unbounded Nat/Int.emod; Rust panics or corrupts negative % remaindersCharon + Aeneas extracts actual #![no_std] Rust MIR (Std.I32/I64/U8 % & casts) with 0 axioms
3 · Autoformalized Lean theorem is vacuously trueContradictory hypotheses (h : x < 0 ∧ x > 5) prove anything (0 sorry)Mandatory paired positive safety proof + +1-step constructive failure witness (16,777,217; 1,890,071,541; 9 taps)
4 · native_decide or single-kernel bug bypassLean.ofReduceBool trusts C compiler; single checker has a reduction bug6 / 6 independent kernels (Lean paranoid, lean4lean, nanoda, con-leche, con-ron, Lean default) bar sorryAx & ofReduceBool

Across the Open Interface Engineering codebase, this multi-kernel discipline now governs 5,393 RCE theorem constants, 218 lut-adapt theorems, and 144 waiOS theorems—demonstrating that foundational, zero-choice, six-kernel verification is practical at multi-repository scale.


6. Falsification Criteria and Open Engineering Boundaries

Every formal-extraction and multi-kernel claim in this study is paired with an explicit refutation condition (EXT-F1 to EXT-F5) and honest statement of remaining trust boundaries:

Falsifier IDClaim under testConcrete refutation conditionCurrent empirical status & open boundary
EXT-F1 · Charon + Aeneas Translation FidelityWaiosRingsVerify_Aeneas.lean (0 external axioms) faithfully captures the semantics of crates/waios-rings-verify/src/lib.rsA bug in Charon’s MIR -> LLBC lowering or Aeneas’s Std integer model produces a Lean definition diverging from compiled rustc execution on any concrete inputCross-checked by differential property fuzzing between compiled native Rust and Lean evaluation on boundary inputs; Charon/Aeneas itself is not yet self-verified in Lean (an active upstream research goal [8])
EXT-F2 · MIR-to-Machine-Code Backend Gap (LLVM)Proving MIR-extracted Lean definitions eliminates source/model bugs, yet rustc’s LLVM backend still lowers MIR to machine instructionsAn LLVM optimization pass miscompiles safe #![no_std] Rust MIR into defective x86_64/ARM64/RV64 machine codeMitigated by 11-ISA differential BLAKE3 execution (/papers/isa-agnostic-computing/) and zero-LLVM direct RCE compilation (4 ISAs); full binary-level translation validation (seL4 AsmRefine style [11]) for rustc remains open
EXT-F3 · Scope of Aeneas Extraction Across Full Workspace7 core ring/packing/gate functions are automatically extracted via Aeneas, while larger seL4 / WGSL system state machines (144 theorems) use Lean relational models paired with Rust conformance testsClaiming 100% of lines across GPU WGSL shaders, C Microkit shims, and async networking are Aeneas-extracted todayExplicitly scoped: Aeneas covers pure #![no_std] safe Rust (waios_rings_verify); WGSL compute shaders (liquid_butterfly.wgsl) and C Microkit shims are verified via 4-vendor / HIL 0-bit BLAKE3 lockstep + Lean capsule predicates
EXT-F4 · Six-Kernel Shared Frontend SurfaceReplaying exported .olean / declaration graphs across 6 independent kernels eliminates single-kernel typechecker and reducer bugsA bug in .olean export serialization before the 6 checkers read the environment drops or alters a theorem statementMitigated by inspecting human-readable theorem signatures directly in WaiosProofs/*.lean alongside nanoda’s independent text/export parser and SHA-256 manifest locks
EXT-F5 · Marchenko–Pastur Sub-Bit Spectral CeilingJouleBit-LUT6 accelerates 6-column binary slabs 2.05×–2.47×, while 0.12–0.48 BPW Walsh coding only succeeds on structured/high-kurtosis operatorsApplying 0.119 BPW LittleBit-2 Walsh truncation directly to dense kurtosis ~ 3.2 pretrained MLP matrices without MultiRing / Block64-QAT training degrades SNR to < 1.5 dBCandidly documented in Table 4.2 (ornith-1.0-9B 1.18–1.48 dB vs. MultiRing 10.11–10.97 dB); sub-0.5 BPW deployment requires Block64-QAT training or crystallized R0 skill vaults [10]

References

  1. Open Interface Engineering, "Pipelines for Computer Automation of Software Development and Maintenance (`Kit #8` `Spec ⊥ Impl` Mutant Gate & 5,393 Six-Kernel Lean Constants)," 2026. /papers/software-automation-pipelines/
  2. M. Carneiro, "Lean4Lean: Towards a verified typechecker for Lean, in Lean," 2024. arXiv:2403.14064. https://arxiv.org/abs/2403.14064
  3. Nanoda Project and independent Lean 4 external kernel verifiers (`nanoda_lib`, `con-leche`, and `con-ron` standalone declaration-graph typecheckers barring `sorryAx` and compiler reflection), 2023–2026. https://github.com/ammkrn/nanoda_lib
  4. A. VanHattum, D. Schwartz-Narbonne, N. Chong, and A. Sampson, "Verifying dynamic trait objects in Rust (`Kani` Rust Verifier)," in 44th International Conference on Software Engineering: Software Engineering in Practice (ICSE-SEIP), pp. 321–330, 2022. https://model-checking.github.io/kani/
  5. A. Lattuada, T. Hance, C. Cho, M. Brun, I. Subasinghe, Y. Zhou, J. Howell, B. Parno, and C. Hawblitzel, "Verus: Verifying Rust programs using linear ghost types," Proceedings of the ACM on Programming Languages 7(OOPSLA1), Article 85, 2023. doi:10.1145/3586037
  6. X. Denis, J.-H. Jourdan, and C. Marché, "Creusot: A foundry for the deductive verification of Rust programs," in 24th International Conference on Formal Engineering Methods (ICFEM), pp. 90–105, 2022.
  7. D. Merigoux, N. Kulatova, and K. Bhargavan, "Hacspec / hax: Succinct, executable, verifiable specifications for high-assurance Rust cryptography," Inria & Cryspen technical reports, 2021–2025. https://hacspec.org
  8. S. Ho and J. Protzenko, "Aeneas: Rust verification by functional translation (with the Charon MIR-to-LLBC extractor)," Proceedings of the ACM on Programming Languages 6(ICFP), Article 116, pp. 711–741, 2022. doi:10.1145/3547647
  9. Open Interface Engineering, "Horizons waiOS-H27 & waiOS-H28: Six-Kernel Choice-Free Lean 4.36.0 Suite, Zero-Axiom Charon/Aeneas Extraction, and JouleBit-LUT6 Real ornith-1.0-9B Evaluation," commit 59e855a, 2026. /data/
  10. Open Interface Engineering, "Downward LUT6 Compilation in a Mixture of Limits Cascade (`218` Six-Kernel Lean 4.36.0 Theorems)," openIE-dev/lut-adapt-ai, 2026. /papers/lut-adapt/
  11. T. Sewell, M. Myreen, and G. Klein, "Translation validation for a verified OS kernel," in Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pp. 471–482, 2013. doi:10.1145/2491956.2462183