Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ the error registry does not sanction (R5, `ERRORS.md`).
| `SM-35` | `build` | A language-1.2 theorem may be proved by `term_cases`, a split on the value of a document term: the proof names a term and a nonempty, strictly sorted, duplicate-free list of prior document definitions, the term's type is an inductive type of the document, and the backend lowers the proof to a split of the goal on every constructor of that type with the hypothesis that equates the term to the constructor, then `simp only` over the named definitions, that hypothesis, the reduction of a conditional on a decided condition, the refutation of an equation between two different constructors, the injectivity equation of every constructor with a field of `Option`, `Result`, `List`, and each inductive type the module declares, and the fixed rules that close an implication from `False` or of a proposition by itself and drop `True` from a conjunction, with closed propositions decided, which uses exactly the axioms the theorem's policy states, so a theorem whose cases need constructor disjointness or injectivity verifies and a false one is rejected by Lean; the schema, the linker, the notation, the Lean backend, the canonical LaTeX, and the formatter accept it, and a use in language 1.1, a term whose type is not an inductive type of the document, an empty list, an unsorted or repeated name, a name that is not a prior definition, and a theorem parameter that takes the hypothesis's name are each refused. |
| `SM-36` | `build` | A language-1.2 `cases` proof may split a local of type `Bool` into its two constructors: the proof names the local and gives a branch for `false` and one for `true`, each with no binders, the backend lowers it to `cases` on the local with those two alternatives, the theorem verifies with exactly the axioms its policy states, and the schema, the linker, the notation, the formatter, and the canonical LaTeX accept it; a use in language 1.1, a missing branch, a repeated branch, a branch with a binder, and an `induction` on a Boolean are each refused. |
| `SM-38` | `build` | A language-1.2 definition may apply bit_and, bit_or and bit_xor to two Nat operands and shift_left and shift_right to a Nat operand and a Nat amount, each with result Nat and no Option, and the backend lowers them to Nat.land, Nat.lor, Nat.xor, Nat.shiftLeft and Nat.shiftRight, so that reflexivity evaluates them inside a verified module; the registered laws nat_bit_and, nat_bit_or, nat_bit_xor, nat_bit_shift_left, nat_bit_shift_right, nat_or_xor_and, nat_witt_step and nat_bit_ext state the bit read of each under an exact axiom policy, and a theorem that applies one verifies while a false bit equation is rejected; a use in language 1.1, bit_not of a Nat, a Nat operand mixed with an integer of another type, and a production root over a Nat form are each refused. |
| `SM-39` | `build` | Language 1.2 simplify proofs may name exactly LexLeanRuntime.utf8Encode and String.toUTF8_eq_toByteArray as UTF-8 bridges; these names resolve to fixed global declarations and select simp only followed by reflexivity on remaining goals, preserving historical simplify lowering, while literal UTF-8 equalities verify with exact axioms and false equalities, language 1.1 uses, foreign helpers, and malformed name lists are refused. |

## stdlib

Expand Down Expand Up @@ -684,6 +685,7 @@ the error registry does not sanction (R5, `ERRORS.md`).
| `VR-21` | `build` | A multi-module project whose imports form nontrivial frontiers verifies at width 1 and at a larger width to byte-identical verified directories and the same attestation identity, observed axiom sets, and policy rows, and no completion order orders a record or changes which failure is reported. |
| `VR-22` | `build` | Performance telemetry is written only to the CI evidence directory the environment names, a verification with telemetry on publishes byte-identical artifacts to one without, and telemetry planted in a verified artifact fails the gate. |
| `VR-23` | `build` | A project verified as the parts of one run, each shard running the processes its plan names with the oleans of the shards it needs and the join reading every shard's records, publishes a verified directory byte-identical to the whole verification's with the same attestation identity, and a shard whose plan leaves a module without its imports, a join missing a record, or a join reading a record of an executable other than its own, is refused. |
| `VR-28` | `build` | Kernel type inspection runs an owned bounded adapter against the pinned local Lean environment, preserves structural names, universe levels and binder visibility, rejects unresolved terms and exhausted traversal budgets, and returns inspection data without a verification attestation or proof-acceptance claim. |

## Cited authorities

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rustix = { version = "1", default-features = false, features = ["std", "process"
same-file = "1.0"
semver = "1.0"
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["unbounded_depth"] }
serde_json = { version = "1", features = ["unbounded_depth", "arbitrary_precision"] }
sha2 = "0.10"
signal-hook = { version = "0.3", default-features = false, features = ["iterator"] }
tempfile = "3"
Expand Down
16 changes: 14 additions & 2 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ or document-inductive local; their constructor set and pattern-binder arities
are checked exactly before rendering. Induction may carry a strictly sorted,
unique list of other in-scope theorem parameters to generalize; the scrutinee
cannot be generalized. Every simplification name resolves
to one of those closed choices. An axiom-free `boolean_reflection` proof is
to one of those closed choices. Language 1.2 additionally admits exactly the global names `LexLeanRuntime.utf8Encode` and `String.toUTF8_eq_toByteArray` in a simplify list. A proof naming either UTF-8 bridge lowers to `simp only` over the named definitions followed by `rfl` on every remaining goal; these helpers are emitted with the root namespace so document qualification cannot capture them. This fixed recipe lets the kernel reduce literal byte-array projections after the pinned String representation theorem rewrites the non-exposed UTF-8 operation. It adds no arbitrary helper, tactic payload, or proof sequence syntax. Language 1.1 rejects both names, and simplify proofs without them keep their existing lowering. An axiom-free `boolean_reflection` proof is
available only in two validated
generic shapes: structural `List Nat` recursion that reflects `Nat.beq` or
`Nat.blt` into an independently recursive proposition, and a finite structure
Expand Down Expand Up @@ -9502,6 +9502,16 @@ Wall time, resident-set and swap measurements, scheduling and completion order,

Telemetry is write-only: no stage reads it, no ID or verified artifact contains any of it, and a failure to write it changes no result. Every key it uses is in a closed vocabulary (`wall_ms`, `started_unix_ms`, `peak_rss_kib`, `peak_swap_kib`, `mem_total_kib`, `mem_available_kib`, `swap_total_kib`, `swap_used_kib`, `host_cpus`, `process_width`, `completion_seq`), and a JSON key of that vocabulary anywhere in a verified directory fails the gate: `cargo xtask verify-examples` checks every example's verified directory for one.

### 22.13 Kernel type inspection

`lexlean inspect` and the sibling `api::inspection` API inspect declarations in the pinned local Lean environment. Inspection is data retrieval, not verification: it runs no proof acceptance shortcut and publishes no verification attestation (`VR-28`). The caller supplies explicit import modules and declaration names; the compiler admits at most 64 declarations, a positive traversal budget no larger than 65536 nodes, a depth bound no larger than 128, and a report bound no larger than 8388608 bytes. Invalid requests fail before running the adapter.

The compiler renders its embedded LexLean tooling adapter through the typed tooling backend and checks the pinned toolchain and registered authority signatures before use. For each declaration present in the loaded environment, the adapter obtains its actual kernel type and universe parameters. An absent declaration retains its requested structural name and position with empty parameters and a null type; its native-core view reports that the declaration was not found and supplies no goal arena. An absent name consumes the shared name-traversal budget and does not prevent inspection of other requested declarations. The adapter preserves structural names, universes, binder visibility, lambdas, dependent functions, lets, literals and projections; metadata annotations may be omitted because they do not change the kernel type. It rejects free variables, expression metavariables and universe metavariables. A shared traversal budget covers repeated occurrences, names and universes before invoking serialization, so expanding a shared expression cannot bypass the bounds. Budget exhaustion refuses the whole inspection; it never substitutes a truncated type or an absence row for an unresolved or over-budget type.

The result binds the admitted import and declaration request, compiler identity and actual tool identities to the bounded process record and inspected data. Requested declaration count, structural names and order remain exact, including absent-declaration rows; a null type with nonempty parameters is malformed. Only a normal successful owned process with the exact output schema produces an inspection result. A malformed, noisy, timed-out or interrupted adapter fails without accepted inspection output. The caller remains responsible for owning and pinning the imported library build; inspection data alone establishes neither that ownership nor a theorem's proof acceptance.

Each present declaration also carries a native-core view when its names and expressions are representable by the native-core schema. That view preserves universe parameters, binder visibility, natural literals and scalar-valued string literals and uses only backward arena references. When a kernel projection has no reported elaborator projection label, or a structural name is outside the native-core name schema, the view explicitly reports why it is unrepresentable; the complete structural kernel type remains available. An absent declaration uses the same unrepresentable native status with an explicit missing-declaration reason, while its structural type is null. Neither form is a proof candidate or acceptance receipt.

---

## 23. Command-line interface
Expand Down Expand Up @@ -11047,6 +11057,7 @@ Every row below is normative, has honesty level `build`, and is projected byte-f
| `SM-35` | `semantic-ir` | A language-1.2 theorem may be proved by `term_cases`, a split on the value of a document term: the proof names a term and a nonempty, strictly sorted, duplicate-free list of prior document definitions, the term's type is an inductive type of the document, and the backend lowers the proof to a split of the goal on every constructor of that type with the hypothesis that equates the term to the constructor, then `simp only` over the named definitions, that hypothesis, the reduction of a conditional on a decided condition, the refutation of an equation between two different constructors, the injectivity equation of every constructor with a field of `Option`, `Result`, `List`, and each inductive type the module declares, and the fixed rules that close an implication from `False` or of a proposition by itself and drop `True` from a conjunction, with closed propositions decided, which uses exactly the axioms the theorem's policy states, so a theorem whose cases need constructor disjointness or injectivity verifies and a false one is rejected by Lean; the schema, the linker, the notation, the Lean backend, the canonical LaTeX, and the formatter accept it, and a use in language 1.1, a term whose type is not an inductive type of the document, an empty list, an unsorted or repeated name, a name that is not a prior definition, and a theorem parameter that takes the hypothesis's name are each refused. | §17.10 |
| `SM-36` | `semantic-ir` | A language-1.2 `cases` proof may split a local of type `Bool` into its two constructors: the proof names the local and gives a branch for `false` and one for `true`, each with no binders, the backend lowers it to `cases` on the local with those two alternatives, the theorem verifies with exactly the axioms its policy states, and the schema, the linker, the notation, the formatter, and the canonical LaTeX accept it; a use in language 1.1, a missing branch, a repeated branch, a branch with a binder, and an `induction` on a Boolean are each refused. | §17.10 |
| `SM-38` | `semantic-ir` | A language-1.2 definition may apply bit_and, bit_or and bit_xor to two Nat operands and shift_left and shift_right to a Nat operand and a Nat amount, each with result Nat and no Option, and the backend lowers them to Nat.land, Nat.lor, Nat.xor, Nat.shiftLeft and Nat.shiftRight, so that reflexivity evaluates them inside a verified module; the registered laws nat_bit_and, nat_bit_or, nat_bit_xor, nat_bit_shift_left, nat_bit_shift_right, nat_or_xor_and, nat_witt_step and nat_bit_ext state the bit read of each under an exact axiom policy, and a theorem that applies one verifies while a false bit equation is rejected; a use in language 1.1, bit_not of a Nat, a Nat operand mixed with an integer of another type, and a production root over a Nat form are each refused. | §17.11, §17.12 |
| `SM-39` | `semantic-ir` | Language 1.2 simplify proofs may name exactly LexLeanRuntime.utf8Encode and String.toUTF8_eq_toByteArray as UTF-8 bridges; these names resolve to fixed global declarations and select simp only followed by reflexivity on remaining goals, preserving historical simplify lowering, while literal UTF-8 equalities verify with exact axioms and false equalities, language 1.1 uses, foreign helpers, and malformed name lists are refused. | §17.10 |
| `DF-01` | `declarations` | A valid type-definition sentence emits one nonrecursive sort-valued Lean def linked to its document entry. | §15.7, §18.6 |
| `DF-02` | `declarations` | A valid term-definition sentence emits one nonrecursive explicitly typed Lean def. | §15.7, §18.6 |
| `DF-03` | `declarations` | A valid predicate-definition sentence emits one nonrecursive Prop-valued Lean def. | §15.7, §18.6 |
Expand Down Expand Up @@ -11150,6 +11161,7 @@ Every row below is normative, has honesty level `build`, and is projected byte-f
| `VR-21` | `verification` | A multi-module project whose imports form nontrivial frontiers verifies at width 1 and at a larger width to byte-identical verified directories and the same attestation identity, observed axiom sets, and policy rows, and no completion order orders a record or changes which failure is reported. | §22.3, §22.4, §22.11 |
| `VR-22` | `verification` | Performance telemetry is written only to the CI evidence directory the environment names, a verification with telemetry on publishes byte-identical artifacts to one without, and telemetry planted in a verified artifact fails the gate. | §22.12 |
| `VR-23` | `verification` | A project verified as the parts of one run, each shard running the processes its plan names with the oleans of the shards it needs and the join reading every shard's records, publishes a verified directory byte-identical to the whole verification's with the same attestation identity, and a shard whose plan leaves a module without its imports, a join missing a record, or a join reading a record of an executable other than its own, is refused. | §9.4, §22.11 |
| `VR-28` | `verification` | Kernel type inspection runs an owned bounded adapter against the pinned local Lean environment, preserves structural names, universe levels and binder visibility, rejects unresolved terms and exhausted traversal budgets, and returns inspection data without a verification attestation or proof-acceptance claim. | §22.13 |
| `CL-01` | `cli-api` | Global options and upward project discovery obey the exact CLI contract. | §23.1, §23.2 |
| `CL-02` | `cli-api` | Init creates the complete canonical skeleton only in an absent or empty destination and never overwrites. | §23.4 |
| `CL-03` | `cli-api` | Lock check, local update, and explicit network acquisition obey their exact mutually exclusive behavior. | §23.4 |
Expand Down Expand Up @@ -11413,7 +11425,7 @@ Every row below is normative, has honesty level `build`, and is projected byte-f
| `NS-06` | `normative-source` | The hand-edited normative inputs of the repository are the `.lex.tex` modules of the specification project: `model/` holds only the projected files and the copies an authority row vendors, every Markdown file at the root is a projection or is on the closed list of hand-written documents, the projections carry the notice that names their source, and no hand-written document restates a registered statement, a plant of each being refused naming R1. | §27.2, §27.5, §27.10 |
| `NS-07` | `normative-source` | `cargo xtask spec` changes the chapter modules of the specification project by item: it replaces a block, inserts one after a block, and ports the hunks of a merged SPEC.md that lie outside derived regions, each through the authoring SDK, and it writes nothing unless the regenerated SPEC.md equals the intended text outside derived regions, refusing a first line that matches no block or two and a hunk that spans two blocks. | §24.8, §27.5 |

**Total required capability IDs:** 486.
**Total required capability IDs:** 488.

No row may be downgraded to `some-true` or `open`. Upstream Lean facts are ledger/authority rows, not substitutions for these build behaviors.

Expand Down
Loading
Loading