Mechanically extracted Lean model of the Rust argus-kernel, refined against the pure-Lean
TzimtzumV4 Kav specification. The end-to-end theorem is:
ArgusLean.Refinement.implementation_soundFor every reachable state of the extracted kernel, modulo the explicit assumptions below, the
theorem produces a related TzimtzumV4 state satisfying Tzimtzum.allInv: all 32 invariants over
the complete 12-action V4 system.
The Rust kernel is translated by Charon and Aeneas. The pinned extraction script
../scripts/charon-aeneas-extract.sh produces
ArgusLean/Generated/ArgusKernel.lean; generated Lean is never hand-edited.
lake build # complete extracted model + V4 refinement + implementation_sound
lake build ArgusChecks # opt-in Plausible collection-model checksLean 4.32.1 is pinned by lean-toolchain. After a toolchain change, run
lake exe cache get first.
| Component | Pin |
|---|---|
| Lean / mathlib | v4.32.1 |
| lean-auto / Duper | v4.32.0 |
| REPL | v4.32.0 |
| Aeneas | 3a8586facab25b31bdb1e1f5f45acd60d1cc5ff0 |
| Charon | 527ea8e3b5dcb52edd6aef0f7bc34cc09c11dd59 |
| Charon Rust | nightly-2026-06-01 |
The compatibility review, patches, and clean-build evidence are in
UPGRADE-4.32.md. Recreate the intentionally ignored extractor checkout from the
repository root with:
git clone https://github.com/AeneasVerif/aeneas tools/aeneas
git -C tools/aeneas checkout 3a8586facab25b31bdb1e1f5f45acd60d1cc5ff0
git -C tools/aeneas apply --unidiff-zero ../../argus/formal-lean/patches/aeneas-lean-v4.32.1.patch
(cd tools/aeneas && env -u RUSTUP_TOOLCHAIN gmake setup-charon)
(cd tools/aeneas && eval "$(opam env --switch=aeneas --set-switch)" && gmake build-bin-dir)The extraction script rejects source/pin/patch mismatches and clean-rebuilds the ignored extractor binaries before use.
KernelCmd, kernelStep, AbsStep, and step_refines cover exactly these twelve transitions:
register_toolunregister_tooldelegategrant_capabilitygrant_crossingrevokecascade_revokeingestbegin_invocationauthorize_inspectedsettle_invocationcross_output
Each successful extracted transition maps to the corresponding single abstract action. Transparent internal action parameters select disposition/verdict, live challenge scope, settlement fields, or crossing branch; they do not widen a command to another action.
ArgusLean.lean
ArgusLean/
Generated/ArgusKernel.lean Charon/Aeneas output; DO NOT EDIT
Refinement/
Bridging/
Collections.lean VecMap/VecSet and extracted opaque-operation specs
StateRelation.lean V4 record/enum/state correspondences
FlowBridging.lean V4 flow/integrity gate bridges
FlowOracle.lean extracted read/loop specifications
PlausibleChecks.lean opt-in finite collection-model checks
Unified/
Relation.lean canonical V4 relation `R`; `AuAgree`/`EgressAgree`
ViewCoincidence.lean canonical-view lemmas
NodupPreservation.lean seven VecMap key-uniqueness fences
Bridges.lean shared `R` projection helpers
Preservation/ 12 action proofs plus shared `ClearAgent`
InitRefinement.lean V4 initial-state refinement
Bundle.lean 12-command dispatch and `step_refines`
Soundness.lean forward simulation and `implementation_sound`
Layering is strict: Generated → Bridging → Unified.
For any governed background bg, fixed snapshot interpretation snapRel, fixed egress
interpretation egRel, fixed authorizer interpretation auRel, and reachable extracted state c:
∃ a, R c bg a ∧ Tzimtzum.allInv aThe proof composes:
init_refinesfor the extracted initial state;step_refinesfor all twelve successful transitions;- abstract reachability in
Tzimtzum.system; and Tzimtzum.kav_soundPfor the 32-invariant V4 bundle.
It verifies the extracted semantic model, not the hand-written Rust text directly. Charon/Aeneas are trusted to translate that text faithfully. It also does not verify the external SPIFFE/STS mesh, adapter, persistence, authenticated input construction, attestation truth, or event-store behavior.
implementation_sound has exactly two caller-supplied assumption bundles.
CapacityOK states:
- concrete
AgentId.rootequals the governedBackgroundTheory.root_agentat initialization; - the exact collection-capacity premises for the branch that successfully fires;
- the fixed per-invocation abstract snapshot predicts the concrete frozen snapshot at
begin_invocation; and grant_crossing nsatisfies the explicit abstract-Nat/Rust-u32boundaryn < 2^32.
The crossing premises remain branch-specific: crossing-id capacity is unconditional; endorsed label,
evidence, and grant capacities require endorsedOK; unendorsed copy capacities require the
release-unendorsed branch. Settlement likewise separates ambiguous pending reinsertion,
non-ambiguous label absorption, and optional resolution-evidence consumption.
These are premises only for successful commands from reachable related states. They are not hidden in the definition of concrete reachability.
OracleFidelity contains only the two begin-time values lifted to the unverified driver:
- the authorizer verdict agrees with
auRel inv; and - the attested egress
VecSetagrees extensionally withegRel inv.
Inspection, quarantine resolution, and crossing conformance are explicit scoped one-use attestation data. The kernel checks their scope and consumption; there are no V3 content-gate, conformance, or return-conformance oracle assumptions.
#print axioms ArgusLean.Refinement.implementation_sound reports:
- standard Lean axioms:
propext,Classical.choice,Quot.sound; - documented bridge specifications:
string_eq_spec,string_clone_spec; - documented extracted opaque operations:
Str.Insts.AllocBorrowToOwnedString.to_owned,alloc.string.String.Insts.CoreCloneClone.clone, andalloc.string.String.Insts.CoreCmpPartialEqString.eq; and types.AgentId.root._native.decide.ax_1, the generated/native root-name residual.
The theorem closure contains no sorryAx, and the handwritten refinement contains no sorry,
admit, or undeclared project-local authority beyond the two named String bridge specifications.
Always state the trusted extractor and the CapacityOK/OracleFidelity hypotheses when citing the
end-to-end result.