Trusted Base
Reference for what Lema v0.2 proves in the Lean kernel (Checked), what it validates by testing and static analysis (Tested), and what it assumes (Assumed).
Every claim in Lema belongs to one of three explicit evidence tiers: Checked, Tested, or Assumed. This page enumerates the exact boundary between machine-checked kernel proofs, tested compiler and runtime components, and the underlying trusted computing base (TCB) in Lema v0.2.
| Tier | Badge | Meaning |
|---|---|---|
| Checked | Proof checked | Replayed from source-free lema.core/v4 objects by the pinned Lean 4.34.1 kernel within the store’s axiom policy. |
| Tested | Tested, not proved | Enforced by Rust static analysers, differential oracle tests, conformance vector suites, and store governance gates, without a formal Lean proof of the Rust implementation. |
| Assumed | Assumed | Part of the trusted computing base (kernel, hardware, OS primitives) or an explicit mathematical/hardware premise on a theorem. |
Checked: proved in the Lean 4.34.1 kernel
The following components are written in restricted Lean (audit/inputs/), stored as lema.core/v4 objects, and verified by the Lean 4.34.1 kernel:
- Program core and concurrency (
Core): Soundness ofProg,Contract,Impl,Safe,Implements,Simulates,sound,replacement,safe_bind,safe_interp,safe_mono,Handles,Tickets,Parallel,Actor,ActorBridge,Replies,Durable,Channels, andSessions. - Layer 1 wire protocol and contracts (
Frames,Capability): Exact round-trip decoding (decodeRequest_encodeRequest,decodeReply_encodeReply) for allLC\x02frames and the operational state-machine contracts fortcp,udp,block,random,clock, andsecret. - Crash-safe storage (
BlockStore,BlockCrash,BlockStoreLaws,Record,ActorJournal,ActorCrash): All-or-nothing atomic file persistence (recover_sound,commit_all_or_nothing,writeAtomic_all_or_nothing_frame,writeAtomic_ok_frame) and linearizable actor crash recovery (crash_recovery,restart_keeps_replied,journaled_linearizable) under the explicitCrashIntegrityblock-device premise. - Cryptography (
ChaCha20Poly1305,Sha256,Sha512,Hmac,SigV4,Field25519,X25519,Ed25519,P256Verify,RsaVerify,ConstantTime): Functional equivalence to RFC 8439, FIPS 180-4, FIPS 198-1, AWS SigV4,GF(2^255 - 19)arithmetic, RFC 7748 Montgomery ladder, RFC 8032 Ed25519 signing/verification, FIPS 186-5 P-256 verification, and RFC 8017 RSA-PSS/PKCS#1 verification. - Network protocols and applications (
X509,Tls13KeySchedule,Tls13,Noise,Http1,S3,SecretPolicy,SecretExchange,ServeVerified,Collector,Escrow): Bounded X.509 chain validation, RFC 8446 TLS 1.3 handshake and record layer, Noise XX handshake/transport, bounded HTTP/1.1 framing and CRLF rejection, role-admitted secret usage, and application invariants.
Tested: verified by static analysers, differential oracles, and test suites
The following components are implemented in Rust and validated by automated test suites and static analysis passes rather than formal proofs of the Rust code:
- Store-native
LemaIRcompiler (crates/lema-ir): Lowerslema.core/v4declarations tolema.ir/v1and runs optimization passes. Tested against the kernel-checkedLema.Ir.Semanticsoperational semantics across theIrOracleCore,IrOraclePrims, andIrOracleCorpussuites. - Register VM (
crates/lema-vm): Executeslema.ir/v1bytecode with deterministic instruction, allocation, bigint-bit, and call-depth counters. Differential-tested againstLema.Ir.evalEntryand RFC/FIPS cryptographic test vectors. - Static VM guarantee analysers (
crates/lema-vm-runner/src/guarantee/mod.rs): Rust static passes verifyingNoCopySliceCall,NoBigIntPrimitives,NoBoxOrCtorInCycles,FlatMessage,ExclusiveActorLoop,ConstantTime(LEMA-355), andSecretFlow.*(LEMA-384,LEMA-421) over compiledLemaIR. - Capability host and Layer 0 substrate (
crates/lema-cap,crates/lema-vm-runner): EnforcesDomain,SharedBudget,Lease,Region/Slicebusy locks,Ring,HandleIdgeneration counters,LC\x02wire dispatch, and OS socket/file/clock/CSPRNG operations. - Store and governance engine (
crates/lema-core,crates/lema-store,crates/lema-http): Canonical JSON validation (R1-R21,S1-S4,D1-D3), zero-Lean contract re-derivation (view::rederive),Store::check_witness, semantic merges, and release policy gates. - Linux sandbox runtime (
crates/lema-native-runtime): Bubblewrap (bwrap),systemd-run --user --scope, SHA-256 binary pinning,ledger.jsonl, and fail-closedHALTEDlatches.
Assumed: the trusted computing base and explicit theorem premises
Trusted software and hardware components
| Component | Role in the trusted computing base |
|---|---|
Pinned Lean 4.34.1 kernel & Init (5045d005...) | Type-checks lema.core/v4 objects during replay (crates/lema-lean-check). |
crates/lema-core & crates/lema-lean-check | Translates lema.core/v4 JSON into kernel environment calls and checks axiom footprints. |
crates/lema-ir, crates/lema-vm, crates/lema-vm-runner, crates/lema-cap | Compiles lema.core/v4 declarations to LemaIR, executes bytecode, and mediates Layer 0 / Layer 1 host I/O. |
Linux kernel, glibc, bwrap, systemd, CPU & RAM | Enforces process isolation, cgroup limits, file locks, TCP/UDP sockets, fsync durability, /dev/urandom, and instruction execution. |
Explicit mathematical and environmental hypotheses
Where a proof depends on a mathematical fact not yet mechanized in audit/inputs/ or on a physical property of storage hardware, Lema states that assumption as an explicit theorem parameter (hypothesis) rather than hiding it in an axiom. The store’s axiom policy remains restricted to propext, Quot.sound, and Classical.choice:
| Hypothesis name | Module | What it states |
|---|---|---|
DhCommutes / X25519Comm | Lema.Std.X25519, Lema.Cap.Tls13, Lema.Cap.Noise | Commutativity of Montgomery scalar multiplication on Curve25519 (dh a (publicKey b) = dh b (publicKey a)). |
Fermat | Lema.Std.P256Verify | Fermat’s little theorem for the NIST P-256 prime p_256 = 2^256 - 2^224 + 2^192 + 2^96 - 1 (a^(p - 2) * a ≡ 1 (mod p) for 0 < a < p). |
CrashIntegrity | Lema.Cap.BlockCrash, Lema.Cap.BlockStoreLaws | Backing block storage writes individual 4096-byte sectors atomically with respect to power loss and preserves all sectors written prior to a completed block.flush (0x03). |
What Lema v0.2 does not claim
- Computational hardness: Lema proves that its cryptographic implementations equal their mathematical RFC/FIPS specifications (for example, that
ChaCha20Poly1305.sealcomputes RFC 8439 ChaCha20-Poly1305 and thatSha256.digestcomputes FIPS 180-4 SHA-256). It does not prove that SHA-256 is collision-resistant or that discrete logarithms on Curve25519 are intractable. - Microarchitectural timing immunity: The
ConstantTimeVM guarantee proves thatLemaIRbytecode contains no secret-dependent branches, memory indices, or variable-time division instructions. It does not model CPU microarchitectural side channels below the ISA/VM level (such as speculative execution or variable-latency hardware multiplier silicon). - Specification completeness: Kernel replay guarantees that an implementation satisfies the contract you selected. Auditing that the
.lemacontract itself captures your real-world business requirements remains a human responsibility, supported by zero-Leanrederiveandlema.review-display/v1.
Lema v0.3.2 · Updated 29 October 2026 · Version and compatibility