docs: the Lean laws, and their paths, are bookspec's

The laws are proved once in bookspec (D-69), so the documents that said
"put the new theorem in `verify/lean`" or cited
`verify/lean/Wanderbooks/<File>.lean` now say otherwise:

- AGENTS.md's formal-methods bar: a new law is written in bookspec's
  `lean/Bookspec/`; wanderbooks requires it and moves its pin (the lakefile,
  the manifest, and the crates' Cargo.toml together; the pin test fails if
  they drift). `Audit.lean` lists every theorem.
- docs/verification.md: the model and every cited Lean file are
  `bookspec/lean/Bookspec/<File>.lean`; "Running it" says the dependency is
  fetched and that all 151 theorems are audited.
- docs/testing.md and docs/spec/rules.md: the same paths, and the apportion
  row records where its law moved.
- README's repo map and the two test comments that named the Lean peer.

No accounting behavior changes; only where the proofs and their names live.

Co-Authored-By: DeepSeek V4.1 Flash <noreply@opencode.ai>
This commit is contained in:
swaitsandDeepSeek V4.1 Flash committed 2026-11-08 11:36:00 -07:00
1 parent e431791bbc
commit 4d9c73deef
7 files changed
+34 -22

No files matched your search

+16 -11
View File
@@ -31,16 +31,18 @@ smallest unit; the four proration charge harnesses at `i32`) and
explores every input in the bounds. (Grouping by
account is proved through `movements_into`, the allocation-free core
that `movements` wraps: symbolic heap growth is beyond what the model
checker explores in reasonable time.) The Lean model in
`verify/lean` restates each function over `Int` (proration over `Nat`,
checker explores in reasonable time.) The Lean model (bookspec's, which
`verify/lean` requires) restates each function over `Int` (proration over `Nat`,
both of `prorated_through`'s branches) and proves the laws with no bounds
at all.
at all. That model lives once, in bookspec's Lean (`bookspec/lean/`,
namespace `Bookspec`); `verify/lean` requires it at the same pinned rev as
the Rust checker (D-69) and holds no copy of its files.
## The laws
Each law, and what proves it. Kani harnesses are in
`crates/ledger-core/src/proofs.rs`; Lean theorems are in
`verify/lean/Wanderbooks/`.
`bookspec/lean/Bookspec/` (the laws live once, in bookspec: D-69).
### Entries
@@ -504,7 +506,7 @@ it. Rule: `docs/spec/rules.md` B-38.
`crates/ledger-store/tests/arap_props.rs` (`subledger_equals_control`
after every operation, at every date; `status_is_a_function_of_journal
_and_date`; `reversal_twice_restores_state`).
- Lean, `verify/lean/Wanderbooks/Documents.lean`: `control_agrees` and
- Lean, `bookspec/lean/Bookspec/Documents.lean`: `control_agrees` and
`control_agrees_through` (the identity, for every account and through
every day), `Step.document_unattached` (an untagged legacy line only
grows `unattached`, never a document), `Step.reverse_moves` and
@@ -834,8 +836,8 @@ panic, the import roots' lockdown (a property over generated paths, and a
component walk that refuses a folder swapped for a link; removed with the
import roots in P2 slice 5), files with full
TINs kept out of the books (B-26), and the agent text lint. Out of scope
for proof today: the format gate and the walk are I/O, and the model in
`verify/lean` stops at the ledger.
for proof today: the format gate and the walk are I/O, and bookspec's Lean
model stops at the ledger.
### P3: the odd cent (2026-10-20)
@@ -873,10 +875,13 @@ just prove-all # both
```
`just prove` runs every Kani harness but the justfile's `kani_slow`, in
parallel (`-j $(nproc)`), the whole run under a 30-minute timeout; builds
the Lean proofs (seconds); and fails if any headline theorem depends on
anything beyond Lean's standard axioms (`propext`, `Quot.sound`,
`Classical.choice`). In particular, `sorryAx` fails it. `just prove-slow`
parallel (`-j $(nproc)`), the whole run under a 30-minute timeout; fetches
and builds bookspec's Lean proofs (seconds; the git dependency is pinned in
`verify/lean/lakefile.toml` and its manifest); and fails if any theorem
depends on anything beyond Lean's standard axioms (`propext`,
`Quot.sound`, `Classical.choice`). It audits all 151 theorems: the 118
headline laws and the 33 named laws in `Laws.lean` that cite them. In
particular, `sorryAx` fails it. `just prove-slow`
runs the slow harnesses, `$(nproc)` at a time, each under its own
30-minute timeout. Both fail if a harness they ask for isn't verified (the
count is checked), if any cover is unsatisfiable (a vacuous proof), or if