Repository navigation
feat(proofs): program equalities over all inputs: integer order, linear_arithmetic over the runtime, fold laws, and the law form (PF-20..PF-23, #117) - #158
Conversation
R3, before any implementation: four `proofs` rows (SPEC.md §31 and model/ids.toml, 390 IDs), one scenario each in features/suites/proofs.feature, and `conformance_pf_20`..`conformance_pf_23`, with the corpus they quantify over, `examples/fold-laws` (integer kernels, fold equalities over lists, sets, and maps, and law applications). PF-19's case now pins the extended fixed script; RT-01 lists five runtime modules and requires the laws oracle absent. The cases fail: no order over Int, no laws module, no `law` form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
`LexLeanRuntime.Laws` (namespace `LexLeanLaws`) joins the runtime project: sums of a function over a list, the bridges from the runtime's comparison, division, and collection operations to propositions, the normal form of additive folds, linearity and permutation invariance of sums, fusion, the fold of a pair, and the fold of an append. Every row pins its exact axioms, none depends on Classical.choice. This commit is the export checkpoint: it carries the one-time oracle, tests/runtime-library/laws-oracle/ (the authored Lean and the migration's exporter narrowed to `Laws`), which the next commit removes. The record is tests/runtime-library/LAWS.md: the export printed in the notation is the committed source byte for byte, and the regenerated environment equals it in 118 of 119 rows, the last equal up to binder names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…e law form Language 1.2 types `le`/`lt` over Nat, Int, and every fixed-width type. `linear_arithmetic` lowers to the extended fixed script: the runtime bridges and the registered rewrite set of `LexLeanRuntime.Laws`, fixed-width order and equality on mathematical values with bit-level bounds, a split of every `if` and `match` left in the goal, then omega. The closed `law` proof applies a registered law (`language/runtime-1.2/laws.toml`) with linking checks; the runtime build refuses a registry naming what the module lacks. A module with either proof imports the laws module. The one-time laws oracle is removed. semantic_ir 11, lean_backend 18, proof_lowering 3: every language-1.2 lock, golden, calculus package, and production export is regenerated by the repository's writers (fixtures and verified records follow). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…-1.2 identity Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…-23 fragments that quote them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…ples Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…cal writer had set it aside The language-1.0 Atlas is untouched by this change; the tree equals main's byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…guage-1.2 projects Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…s' fragments A module or binder named like a namespace or lemma the extended linear_arithmetic script writes unqualified (BitVec, LexLeanLaws, beq_iff_eq, decide_eq_true_eq, decide_eq_false_iff_not, reduceIte) would capture it, so each is a backend bare name, and LexLeanLaws a shipped root (SP-09). RP-07 counts 390 rows; SM-16's downstream match covers the law form; the PF cases quote the rendered Lean exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…he PF-21 case Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
…cgz94p # Conflicts: # CHANGELOG.md # README.md # SPEC.md # crates/conformance/src/cases/repository.rs # xtask/src/spec_links.rs
|
This is the runner's connection to the artifact service, not this PR: the job never reached a test body, and this PR does not change the Atlas or the workflow. The other Atlas parts downloaded the same artifacts successfully. Re-running the failed jobs from this session is refused ( Generated by Claude Code |
|
Run 38941418389 on The failed job needs a re-run, and neither this session nor the one that wrote the PR can do it: If nobody has re-run it by 21:15Z, I will instead push a small, real change to this branch (RT-01 and RT-04 do not yet list Generated by Claude Code |
|
The Generated by Claude Code |
|
Maintainer review: approved at Checked against #117's acceptance and the repository rules, on the head that ran:
One gap found in review, not a blocker: RT-01 and RT-04 do not list Merging with a merge commit, pinned to this head. Generated by Claude Code |
…combined tree (certificate E as data, main with #158) The verification records of the four certificate corpora and the two certificate fixtures are regenerated by the repository's writers on the tree that merges #158; check-calculus, check-golden, check-production-export, validate-model and validate-spec-links pass on it.
The merge commit of #158 (378628e) has the tree of its head aa58c1d, which this branch already contains; the merge records main in the history and changes no file. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
CHANGELOG: both Unreleased entries kept. The four new IDs (PF-20..PF-23) run in the bdd remainder; check-test-inventory reports the 429 tests of bdd as the five parts. Register 391, CONFORMANCE.md current. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…to issue-30-language-model Hand-written conflicts: - language/semantics-1.2.toml: main (#158) and this branch each moved semantic_ir 10 -> 11 and lean_backend 17 -> 18 for different changes, so the combined tree takes fresh numbers past both: semantic_ir 12, lean_backend 19, latex_backend 12 (this branch), proof_lowering 3 (main). - crates/lexlean/src/ir/semantic.rs: BACKEND_BARE_NAMES is main's 43 names plus LexLeanText (44). - schemas/semantic-module-v2.schema.json: merged structurally; every change of either side is kept. - SPEC.md, CHANGELOG.md: both sides kept. - The register is 395 (main's 391 plus LM-01..LM-03 and LM-13); the 391 both sides wrote merged cleanly and is corrected in README.md, SPEC.md §31, repository.rs, spec_links.rs and the CHANGELOG entry. Generated records take main's side here and are regenerated for the combined tree in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…with #158 The merged tree's language-1.2 compiler-semantics ID is 7a7834c6... (from main's 7c6ad912...): locks (230 of 283 moved, a second relock moved none), goldens, calculus packages, CONFORMANCE.md and ERRORS.md, negative fixtures, the production export, and every example's verification records (uor-atlas is language 1.0 and unchanged). Also the register count 395 in README.md, repository.rs and spec_links.rs, which the merge commit left at the 391 both sides wrote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The register has 392 rows; SL-01 stays the last row. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #117 (plan item L3.4 of #106).
The probe (first step of the issue)
Re-run on
mainat32afe5dawith Lean 4.32.1 (recorded intests/runtime-library/LAWS.md):clampStepmonotonicity, written withless_than) underlinear_arithmetic{definitions: [clampStep]}fails withomega … No usable constraints found. The script unfolds none ofless_than,quotientornegate, and nothing splits the clamp'sifs. This confirms the three gaps from the earlier probe on the issue.doubledTotal xs = total xs + total xs):omegasees two unrelatedlistFoldatoms. The missing lemma is a normal form for additive folds: a fold whose step addsk xequalsinitial + Σ k, and Σ is linear ink. With both sides in that form, the equality is linear over one atom.What changes
Integer order (
PF-20). Under language 1.2,<=and<take two operands of one integer type (Nat,Int, or one fixed-width type) and lower to Lean's order on that type. Language 1.1 keepsNatonly and is byte-identical.linear_arithmeticreads the runtime (PF-21). The script is still one fixed script (SPEC.md §17.12). Its simplifier pass now covers:less_thanon every integer key type,equal,negate,quotientandremainder(a zero divisor becomes anif; truncating division by a positive or negative literal becomes Euclidean division with a sign case);A second pass reads every remaining fixed-width value as the bounded natural number of its bits, so
omegaknows its range. Thenall_goals (repeat' split)splits everyif/matchleft in the goal, andall_goals omegadecides each case.The fold laws as LexLean source (
PF-22).LexLeanRuntime.Laws(namespaceLexLeanLaws) is the fifth native runtime module, importingPortableandCollections. It contains:sumNat/sumInt;sumNat_perm,sumInt_perm), append and reverse, plus the cons- and snoc-folds;Every row pins its exact axioms, and none uses
Classical.choice. The registrylanguage/runtime-1.2/laws.tomlnames the rewrite set and the applicable laws; the runtime build refuses a registry that names anything the module lacks.The
lawproof form (PF-23).law{name, type_arguments, arguments, premises}applies a registered law (list_fold_fusion,list_fold_pair,list_fold_append). Linking checks the counts, the types and that each premise names a prior theorem; Lean checks the statement. It lowers toexact @L ….Corpus.
examples/fold-lawscovers integer kernels (clamped requantization monotone and in range for everyInt, truncating division by ±7,UInt8/Int8order and equality) and fold equalities over lists, sets and maps (doubling, counting, weighting, append both ways, reverse, debits against credits, a map's keys and values). It includes a one-pass statistics fold bylist_fold_pairand a fused parity fold bylist_fold_fusion;decideappears only on closed instances.Provenance of the laws module
Commit
b58f1952is an oracle checkpoint: the authoredLaws.leanplus the runtime migration's exporter narrowed toLaws. The next commit removes it, as #144's migration did, andRT-01now also requireslaws-oracleto be absent. Runningrun.shfrom the checkpoint gives:Laws.lex.tex, byte for byte;casesOn) is equal up to binder names.Identity
semantic_ir11,lean_backend18,proof_lowering3. Every language-1.2 lock, golden, fixture expectation, calculus package, production export and verified record was regenerated by the repository's writers. The existinglinear_arithmeticproofs ofmodels,recursion,reasoning,production(-coverage)andcompilerall verify under the extended script. Languages 1.0 and 1.1, Atlas included, are byte-identical tomain. New reserved names (BitVec,LexLeanLaws,beq_iff_eq,decide_eq_true_eq,decide_eq_false_iff_not,reduceIte) keep a module or binder from capturing what the script writes. The register has 391 IDs after mergingmain; there is no new diagnostic code.Evidence
cb02f8d3), then the checkpoint, then the implementation.validate-model,validate-spec-links, clippy,test,features,check-test-inventory,check-goldenandcheck-reproducibilitypassed;verify-examples --writeverified every example except Atlas;cargo test -p repo-conformance: 384 cases passed and 6 failed on the first run; all 6 now pass, and the runtime cases pass against the merge ofmain.Full
just vvruns in CI.🤖 Generated with Claude Code
https://claude.ai/code/session_018risLc2kcmeqW2hL5pcQNs
Generated by Claude Code