Chio/Docs

PlatformInventory & Assumptions

Theorem Inventory

Lean 4 theorems reachable from the formal root, with their Lean names, files, claim classes, and property IDs.

Reading the claim class

bounded_model means the theorem is over a finite Lean model, not the running Rust binary. aeneas_equivalence means the theorem links the handwritten Lean model to a model extracted from Rust by Aeneas. symbolic_crypto means the theorem is over a symbolic Merkle/sign/verify model rather than a cryptographic implementation. The declared axiom has claim class symbolic_crypto and is listed in allowed_axioms.

Axioms

The inventory contains one explicit axiom. It assumes receipt content-addressing: distinct canonical receipt-ID inputs do not collide.

IDLean nameFileClass
theorem.receipt.id_input_set_pinnedChio.Proofs.receipt_id_collision_resistantformal/lean4/Chio/Chio/Proofs/Receipt.leansymbolic_crypto (axiom)

It is a Lean axiom because the bounded receipt model treats the receipt ID as an opaque string with no modeled canonicalizer or hash; mechanizing injectivity would require a Lean model of the JCS serializer, a model of the hash, and a collision-resistance assumption on that hash (ASSUME-SHA256). The proof manifest's allowed_axioms list contains this entry, and any new axiom must be added there in the same PR or the gate fails.


Capability Algebra Theorems

P1 (capability monotonicity) proves, over the bounded capability algebra model, that a child capability is a subset of its parent.

IDLean nameFileMaps to
core.scope.empty_isSubsetOfChio.Core.ChioScope.empty_isSubsetOfCore/Scope.leanP1
core.tool_grant.isSubsetOf_reflChio.Core.ToolGrant.isSubsetOf_reflCore/Scope.leanP1
spec.capability_monotonicityChio.Spec.capability_monotonicitySpec/Properties.leanP1
spec.empty_scope_monotonicityChio.Spec.empty_scope_monotonicitySpec/Properties.leanP1
spec.scope_budgets_nonnegativeChio.Spec.scope_budgets_nonnegativeSpec/Properties.leanP1
proof.list_isSubsetOf_transChio.Proofs.list_isSubsetOf_transProofs/Monotonicity.leanP1
proof.scope_subset_of_grants_subsetChio.Proofs.scope_subset_of_grants_subsetProofs/Monotonicity.leanP1
proof.wildcard_subsumesChio.Proofs.wildcard_subsumesProofs/Monotonicity.leanP1
proof.reduced_budget_is_subsetChio.Proofs.reduced_budget_is_subsetProofs/Monotonicity.leanP1
proof.added_constraint_is_subsetChio.Proofs.added_constraint_is_subsetProofs/Monotonicity.leanP1
theorem.attenuation.witness_soundnessChio.Proofs.AttenuationWitness.witness_soundnessProofs/AttenuationWitness.leanP1
theorem.budget.sibling_sum_soundnessChio.Proofs.SiblingSumBudget.sibling_sum_soundnessProofs/SiblingSumBudget.leanP1
proof.delegation_chain_integrityChio.Proofs.delegation_chain_integrityProofs/Monotonicity.leanP5

The headline theorem statement is short. Verbatim from Spec/Properties.lean:

formal/lean4/Chio/Chio/Spec/Properties.lean
/-- P1: Capability monotonicity -- if a child scope is a subset of a parent
    scope, then every grant in the child is covered by some grant in the
    parent.

    This is the core Chio safety property: delegation can only attenuate,
    never amplify. -/
theorem capability_monotonicity (parent child : ChioScope)
    (h : child.isSubsetOf parent = true) :
    forall g, g in child.grants ->
      exists pg, pg in parent.grants /\ g.isSubsetOf pg = true := by
  intro g h_mem
  unfold ChioScope.isSubsetOf at h
  exact List.any_eq_true.mp (List.all_eq_true.mp h g h_mem)

P1: capability_monotonicity in this catalog

P1 says a child capability's bounds are tighter than its parent's; delegation attenuates and never amplifies. This catalog records P1 in thirteen rows spread across six files. The headline row is spec.capability_monotonicity; every other P1 row either supports it (subset transitivity, wildcard subsumption, budget tightening, added constraints, the attenuation witness, the sibling-sum budget law) or pins a corner case (empty scope, reflexivity, non-negative budgets). Verbatim from formal/theorem-inventory.json:

formal/theorem-inventory.json
{
  "id": "spec.capability_monotonicity",
  "leanName": "Chio.Spec.capability_monotonicity",
  "file": "formal/lean4/Chio/Chio/Spec/Properties.lean",
  "kind": "theorem",
  "rootImported": true,
  "claimClass": "bounded_model",
  "mapsTo": ["P1"],
  "notes": "Primary attenuation theorem over ChioScope grants only; no Rust refinement proof yet."
}

Field by field:

  • id · stable inventory ID. The gate scripts/check-formal-proofs.sh fails if any ID is renamed without an accompanying entry change.
  • leanName · the fully qualified Lean identifier. The gate elaborates the root module and asserts this name resolves.
  • file · path relative to the repo root. P1 sits under Spec/ rather than Proofs/ because the theorem statement is the Chio spec, not a derived helper.
  • rootImported · true means the gate checks the import graph closure from Chio.lean reaches this file. A theorem that elaborates but is not root-imported fails the gate.
  • claimClass · bounded_model. The theorem reasons about the Lean ChioScope definition, not the Rust binary. The Aeneas equivalence theorem aeneas_optionalCapIsSubset_preserves_parent_cap (also tagged P1) is what ties the bounded model to the executable code.
  • mapsTo · the property IDs from the proof manifest this row helps discharge. P1 is the only one here.

Continue the tour at Lean 4 Proofs: P1 the canonical proof or jump back to the P1 Tour.


Revocation Theorems

Revocation surfaces in two places: the bounded revocation-store model, and the projected snapshot used by the evaluator.

IDFileMaps to
proof.revoke_marks_capability_revokedProofs/Revocation.leanP2
proof.revoke_preserves_existing_revocationProofs/Revocation.leanP2
proof.checkRevocation_revoked_token_errorsProofs/Revocation.leanP2
proof.checkRevocation_revoked_ancestor_never_okProofs/Revocation.leanP2
proof.checkRevocation_ok_implies_not_revokedProofs/Revocation.leanP2
proof.revocationSnapshot_revoked_token_deniesProofs/Protocol.leanP2, P3
proof.revocationSnapshot_revoked_ancestor_deniesProofs/Protocol.leanP2, P3

Evaluation Theorems

The bounded evaluator covers signature, time, scope, and revocation checks. P3 is the master fail-closed property.

IDFileMaps to
proof.evalToolCall_totalProofs/Evaluation.leanP3
proof.evalToolCall_invalid_signature_deniesProofs/Evaluation.leanP3
proof.evalToolCall_not_yet_valid_deniesProofs/Evaluation.leanP3
proof.evalToolCall_expired_deniesProofs/Evaluation.leanP3
proof.evalToolCall_revoked_token_never_allowsProofs/Evaluation.leanP2, P3
proof.evalToolCall_revoked_ancestor_never_allowsProofs/Evaluation.leanP2, P3
proof.evalToolCall_out_of_scope_deniesProofs/Evaluation.leanP3
proof.evalToolCall_all_checks_pass_allowProofs/Evaluation.leanP3

Receipt Theorems

Receipt theorems live across two files. The Merkle and signing theorems are in Proofs/Receipt.lean; the field-coupling theorem is in Proofs/Protocol.lean.

IDFileClassMaps to
proof.applyProof_appendProofs/Receipt.leansymbolic_cryptoP4
proof.membership_proof_soundProofs/Receipt.leansymbolic_cryptoP4
proof.membership_proof_verifiesProofs/Receipt.leansymbolic_cryptoP4
proof.checkpoint_consistencyProofs/Receipt.leansymbolic_cryptoP4
proof.receipt_sign_then_verifyProofs/Receipt.leansymbolic_cryptoP4
proof.receipt_immutabilityProofs/Receipt.leansymbolic_cryptoP4
proof.receiptFieldsCoupled_preserves_all_fieldsProofs/Protocol.leanbounded_modelP4

Protocol-Layer Theorems

Theorems in Proofs/Protocol.lean and Proofs/FormalClosure.lean cover guard-pipeline composition, DPoP nonce admission, budget commits, governed approvals, session continuity, lineage soundness, registry behavior, path-prefix safety, and report truthfulness.

IDFileMaps to
proof.admitSession_invalid_dpop_rejectsProofs/Protocol.leanP3, P8
proof.admitSession_invalid_anchor_rejectsProofs/Protocol.leanP3, P8
proof.budgetPrecheck_commit_preserves_boundsProofs/Protocol.leanP3
proof.budgetCommit_none_when_precheck_failsProofs/Protocol.leanP3
proof.budgetTwoCommit_preserves_boundsProofs/Protocol.leanP3
proof.clusterOverrun_bound_is_explicitProofs/Protocol.leanP3
proof.governedApproval_required_without_token_failsProofs/Protocol.leanP3
proof.governedApproval_valid_token_passesProofs/Protocol.leanP3
proof.dpop_required_missing_proof_rejectsProofs/Protocol.leanP3, P8
proof.dpop_required_invalid_proof_rejectsProofs/Protocol.leanP3, P8
proof.dpop_reused_nonce_rejectsProofs/Protocol.leanP8
proof.guardPipeline_deny_dominatesProofs/Protocol.leanP3
proof.guardPipeline_error_dominatesProofs/Protocol.leanP3
proof.guardPipeline_allow_requires_core_authorizedProofs/Protocol.leanP3
proof.observed_parent_edge_soundProofs/Protocol.leanP6
proof.verified_receipt_lineage_soundProofs/Protocol.leanP7
proof.session_continuity_soundProofs/Protocol.leanP8
proof.capability_lineage_consistency_soundProofs/Protocol.leanP9
proof.report_truthfulness_asserted_not_verifiedProofs/Protocol.leanP10
proof.report_truthfulness_observed_not_verifiedProofs/Protocol.leanP10
proof.registry_publish_requires_valid_signatureProofs/Protocol.leanP10
proof.registry_resolve_published_valid_recordProofs/Protocol.leanP10
proof.registry_revoke_deactivates_published_recordProofs/Protocol.leanP10
proof.delegation_step_allow_requires_attenuationProofs/FormalClosure.leanP5
proof.delegation_step_allow_requires_subject_continuityProofs/FormalClosure.leanP5
proof.delegation_step_allow_requires_expiry_monotonicityProofs/FormalClosure.leanP5
proof.delegation_revoked_ancestor_deniesProofs/FormalClosure.leanP5
proof.delegation_max_depth_failure_deniesProofs/FormalClosure.leanP3, P5
proof.dpop_binding_allows_only_when_all_fields_matchProofs/FormalClosure.leanP8
proof.path_prefix_rejects_sibling_prefixProofs/FormalClosure.leanP3
proof.path_prefix_rejects_normalized_traversal_escapeProofs/FormalClosure.leanP3

Treaty and Bilateral Accept Theorems

The Treaty lane covers cross-organization governance: bilateral treaty admission, constitutional amendment refinement, syntactic predicate-chain preservation, and the bilateral DSSE accept set. These theorems live in Treaty/Intersection.lean, Treaty/PredicateLang.lean, and Treaty/BilateralAccept.lean, all imported from Chio.lean. The explanation of the systems modeled by these theorems is in Papers; this table is the catalog entry, copied verbatim from formal/theorem-inventory.json.

IDLean nameFileClassMaps to
proof.treaty_admission_iff_predicate_intersectionChio.Treaty.treaty_admission_iff_predicate_intersectionTreaty/Intersection.leanbounded_modelP7
proof.treaty_admission_stable_under_ladder_floorChio.Treaty.treaty_admission_stable_under_ladder_floorTreaty/Intersection.leanbounded_modelP7
proof.amendment_admissible_iff_backward_refinementChio.Treaty.amendment_admissible_iff_backward_refinementTreaty/Intersection.leanbounded_modelP3
proof.amendment_without_refinement_rejectedChio.Treaty.amendment_without_refinement_rejectedTreaty/Intersection.leanbounded_modelP3
proof.freestanding_accept_set_theoremChio.Treaty.BilateralAccept.freestanding_accept_set_theoremTreaty/BilateralAccept.leanbounded_modelP7
proof.essential_preserved_chainChio.Treaty.PredicateLang.essential_preserved_chainTreaty/PredicateLang.leanbounded_modelP3
proof.containsPredicate_preserved_chainChio.Treaty.PredicateLang.containsPredicate_preserved_chainTreaty/PredicateLang.leanbounded_modelP3
proof.anchor_admission_iff_lane_quorum_satisfiedChio.Treaty.PredicateLang.anchor_admission_iff_lane_quorum_satisfiedTreaty/PredicateLang.leanbounded_modelP7
proof.anchor_admission_rejects_undeclared_laneChio.Treaty.PredicateLang.anchor_admission_rejects_undeclared_laneTreaty/PredicateLang.leanbounded_modelP7

All nine rows are rootImported: true with status proved, claim class bounded_model: each holds over the bounded Lean treaty and predicate-language models described above, not yet over an Aeneas extraction or a Kani harness. No Treaty theorem currently has an Aeneas equivalence proof, a Kani harness, or a Creusot contract. Those implementation links are currently absent.


Aeneas Equivalence Theorems

These theorems live in Proofs/AeneasEquivalence.lean. Each one says: the Aeneas-extracted Lean mirror of a function in crates/kernel/chio-kernel-core/src/formal_aeneas.rs is equivalent to the handwritten model the rest of the proofs depend on. The class is aeneas_equivalence.

IDMaps to
proof.aeneas_timeWindowValid_equiv_modelP3
proof.aeneas_optionalCapIsSubset_preserves_parent_capP1
proof.aeneas_budgetCommit_equiv_modelP3
proof.aeneas_dpopAdmits_equiv_modelP8
proof.aeneas_revocationSnapshot_equiv_modelP2
proof.aeneas_guardStep_equiv_modelP3
proof.aeneas_receiptCoupling_equiv_modelP4

Proof-to-Rust Mapping

formal/MAPPING.md is the cross-reference from named TLA+ invariants and Kani harnesses to the Rust call sites they constrain. The script scripts/check-mapping.sh greps the source for each name and fails the build if any appear in source but not in the mapping.

TLA+ Invariants

InvariantRust path constrainedAssumption discharge
NoAllowAfterRevokechio-kernel-core/src/evaluate.rs::evaluate, chio-kernel/src/capability_lineage.rsASSUME-SQLITE-ATOMICITY (per-row)
MonotoneLogchio-kernel/src/receipt_store.rsASSUME-SQLITE-ATOMICITY; jointly discharges RETIRED-SQLITE-CROSS-ROW
AttenuationPreservingchio-core-types/src/capability.rs (ChioScope::is_subset_of), chio-kernel-core/src/normalized.rsn/a (structural; bounded by DEPTH_MAX)
RevocationFreshnesschio-revocation-oracle/src/freshness.rs, chio-kernel-core/src/revocation_view.rsASSUME-OS-CLOCK
RevocationEventuallySeenchio-kernel/src/capability_lineage.rs, chio-kernel/src/receipt_store.rsWeak fairness on PropagateAny (a spec-level fairness conjunct in RevocationPropagation.tla, not a registered assumption ID)

Two more Apalache specs sit alongside RevocationPropagation.tla. formal/tla/DelegationDepthBound.tla carries three named safety invariants ( DepthBoundedByRoot, AttenuatedAtEachStep, and RevokedSubtreeNotObservable ) and the kernel-state-subset lane under formal/apalache/ adds four more: MonotoneLogApalache, ReceiptBeforeAllow (the named evidence for RETIRED-SQLITE-CROSS-ROW), RevocationCutCompleteness, and KernelTransitionCancelSafe.

Public Kani Harnesses

Source: crates/kernel/chio-kernel-core/src/kani_public_harnesses.rs. The mapping script extracts function names following a #[kani::proof] attribute and checks that each appears in the table below.

HarnessRust path constrained
public_verify_capability_rejects_untrusted_issuer_before_signaturecapability_verify::verify_capability
public_normalized_scope_subset_rejects_widened_childNormalizedScope::is_subset_of
public_normalized_scope_subset_rejects_value_widened_childNormalizedScope::is_subset_of
public_normalized_scope_subset_rejects_identity_mismatchNormalizedScope::is_subset_of
public_resolve_matching_grants_rejects_out_of_scope_requestscope::resolve_matching_grants
public_resolve_matching_grants_preserves_wildcard_matchingscope::resolve_matching_grants
public_evaluate_rejects_untrusted_issuer_before_dispatchevaluate::evaluate
public_sign_receipt_rejects_kernel_key_mismatch_before_signingreceipts::sign_receipt
public_sign_receipt_accepts_matching_kernel_keyreceipts::sign_receipt
public_sign_receipt_refuses_content_hash_mismatchreceipts::sign_receipt (WYSIWYS content-hash recompute)
public_sign_receipt_accepts_matching_content_hashreceipts::sign_receipt (WYSIWYS content-hash recompute)
verify_scope_intersection_associativeformal_core::optional_u32_cap_is_subset
verify_revocation_predicate_idempotentformal_core::revocation_snapshot_denies
verify_delegation_chain_stepformal_core::* (one delegation step composition)
verify_receipt_roundtripreceipts::sign_receipt, ChioReceipt::verify_signature
verify_budget_checked_add_no_overflowchio_kernel::budget_store::BudgetUsageRecord (additive cap update)
verify_delegate_no_widenchio_core_types::capability::delegate
verify_delegation_receipt_canonicalchio_core_types::delegation_receipt::DelegationReceipt::canonical_bytes
verify_revocation_view_freshnesschio_kernel_core::revocation_view::RevocationView::install_if_newer
verify_oracle_inclusion_soundnesschio_revocation_oracle::api::InclusionProof::verify

Status

Each theorem in the inventory above is rootImported: true. That means it is reachable from the root module formal/lean4/Chio/Chio.lean and the Lean kernel has type-checked it without sorry placeholders. The gate scripts/check-formal-proofs.sh rejects any theorem that drops out of the root import graph or that introduces a sorry.

Bounded models, not Rust

Except for the Aeneas equivalence theorems, these theorems are over Lean models, not the running Rust binary. Aeneas equivalence theorems, Kani harnesses, and Creusot contracts cover separate links to executable code; each has its own model and boundary.

Next