Repository navigation
Conversation
…ion (#278, R3: row, scenario, named test, first negative fixture) R3: the register row, the SPEC.md section 31 row, the scenario, the failing named test conformance_sm_37, and the negative fixture induction-nested-type, which records that `induction` on a type that holds a list of itself is refused as LLT4001 with a message that names `nested_induction`. No implementation: the fixture fails until the message changes. The count moves 446 to 447. Stacked on the DF-19 branch. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4DJnZorC2Jd4MJfN9DbZk
… through its recursor (SM-37, #278) A language-1.2 theorem about a value of a nested inductive type (one that holds itself under List, Option, Result or a product, in no mutual group) may be proved by nested_induction: the proof names a parameter of the theorem, states one proposition for each auxiliary member of the type's recursive family (the family DF-19 computes) and gives a branch for every constructor of the type and of each member. The linker checks the members, the branch sets and the binder counts level by level before any backend; the backend lowers the step to `induction x using T.rec (motive_n := fun b => P)` and one positional `next binders =>` per minor premise, in the recursor's order whatever order the branches are written in. `induction` keeps refusing a nested type, and its message now names nested_induction. The theorem's scrutinee must be a theorem parameter so the backend knows its type to name T.rec; Environment.proof_parameters carries them. Both schemas gain the step. language/semantics-1.2.toml: semantic_ir 15 -> 16, proof_lowering 3 -> 4, which moves the 21.2 identity; the locks, records, goldens, fixtures and packages the digest binds are not regenerated here. examples/nested-induction proves leaves_le_size over Json by nested_induction, verified under Lean 4.32.1 with exactly the axioms propext and Quot.sound, which the SM-37 row now records. conformance_sm_37 refuses 49 plants as LLT4001 (reordered members, wrong binder counts and a missing branch on each level, a member of another instantiation, ...). A Rose (Rose Nat) case pins that the family counts a group only at its own type arguments. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4DJnZorC2Jd4MJfN9DbZk
3d96929 to
1ee15ef
Compare
|
Maintainer review of The lowering is the agreed design (#278, comment 6346669084): Should fix
Nits: the SM-37 row, §31 and scenario say "the proof names the local" while the implementation and §17.10 require a theorem parameter and refuse a non-parameter local; say "names a parameter of the theorem" and regenerate CONFORMANCE.md. In Landing: SM-37 moves Generated by Claude Code |
…, Option and Result members (SM-37, #278) - examples/nested-induction carries no lexlean.lock: every lock is regenerated at landing on the identity current then. conformance_sm_37 locks its own copy of the example. - backend/semantic.rs: a nested_induction scrutinee with no named parameter is an LLI9001 diagnostic (proof and proof_branch return Result), not a guessed `<local>.rec`. - conformance_sm_37: Lean-backed positive cases with one member under Option and one under Result, with the goals asserted in the recursor's order, so the none,some and error,ok rows of family_constructors are exercised; the language-1.1 use and the four scrutinee misuses go through refuse_project (LLT4001, the message, no backend output). - The SM-37 row, SPEC section 31 and the scenario say the proof names a parameter of the theorem; CONFORMANCE.md regenerated. - VERIFICATION.md: the lib-test count is 213. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4DJnZorC2Jd4MJfN9DbZk
|
Thanks. Everything is done and pushed to Should fix
Nits
Re-run on 🤖 Generated with Claude Code https://claude.ai/code/session_01F4DJnZorC2Jd4MJfN9DbZk Generated by Claude Code |
…ter laws (#27) Part of #18, part of #21. LexLean pin moves to UOR-Foundation/LexLean#292 at 0b0c95d96 (SM-37 on DF-19, release/v0.4), a branch commit until the LexLean release. Every export request pins its source ID, semantic ID and lock digest (LLC0204 on a stale request); cargo xtask export regenerates them. The writer half of the round trip is proved for every Json value by nested_induction. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01F4DJnZorC2Jd4MJfN9DbZk
|
Maintainer: the round at SM-37 lands as its own identity wave after the #91 heap half, stacked on DF-19 (#284); I retarget, regenerate and recount then. Generated by Claude Code |
SM-37:
nested_induction, induction over a nested inductive type through its recursor (#278). Draft; stacked on DF-19 (#284, branchclaude/issue-278-df19-family, head9d0896b18, with the maintainer's review fix), so the diff here is SM-37 alone. Review DF-19 first. Waits for the maintainer's acceptance of the design at #278 (comment) (accepted at #278 (comment), with the two conditions below). Based onrelease/v0.4through #284;release/v0.4is not merged into this branch.History is the R3 order: commit 1 (
904c1afc0) is the row, the SPEC §31 row, the scenario, the failing named testconformance_sm_37and theinduction-nested-typenegative fixture with the new message; commit 2 (1ee15eff6) is the implementation; commit 3 (0b0c95d96) is the maintainer's review round.What
A language-1.2 theorem about a value of a nested inductive type (one that holds itself under
List,Option,Resultor a product, in no mutual group) may be proved bynested_induction: the proof names a parameter of the theorem, states one proposition for each auxiliary member of the type's recursive family (DF-19'sfamily_members) in the order of Lean 4.32.1's recursor, and gives a branch for every constructor of the type and of each member, binding the fields then one hypothesis per field that is a family member.ir/semantic.rs):check_nested_inductionrefuses, asLLT4001before any backend, a use in language 1.1, a scrutinee that is not a theorem parameter of a nested document inductive in no mutual group, members missing / repeated / outside the family / out of order, a binder shared by two members, a proposition that is not aProp, and on every level a missing or repeated branch, a branch for no constructor, and a wrong binder count.backend/semantic.rs): lowers toinduction x using T.rec (motive_2 := fun b => P) …and one positionalnext binders =>per minor premise, in the recursor's order whatever order the branches are written in (widen.rssorts them). Goals are positional becausenil/consof two members share names, whichinduction … withrefuses. The scrutinee must be a theorem parameter so the backend knows its type to nameT.rec(Environment.proof_parameters).inductionkeeps refusing a nested type; its message now namesnested_induction. DF-13's case still asserts the refusal.examples/nested-induction:leaves_le_sizeoverJson(four motives, nine goals) proved bynested_induction, with mutualsize/leavesgroups over the family (DF-19).Inherits the DF-19 review fix
The family is DF-19's
family_members, so the fix tomentions_family_group(a group counts only at its own type arguments, #284) reaches SM-37's motive count.conformance_sm_37now has aRose (Rose Nat)case:rose = roseproved bynested_inductionwith the one memberList (Rose (Rose Nat)), lowered toinduction rose using Rose.rec (motive_2 := ...)with nomotive_3, verified under the pinned Lean, plus a plant namingList (Rose Nat)as a member (refused). With the arguments ignored again the case fails (nested_induction is missing the member Rose (Nat) of the recursive family of Rose (Rose (Nat)), VERIFICATION.md). The plants are 49 now. The fallback of the same function infamily_constructorsis dropped, as in DF-19.Maintainer's conditions
conformance_sm_37does: members swapped (3 pairs), a binder too many and too few and a missing branch for every branch of each of the four levels (Json,List Json,List (String * Json),String * Json), and every level written in reverse lowers to the same Lean. 49 plants, allLLT4001, no backend output written.verifyof the example with an empty policy failed withLLV7005 … observed [Quot.sound, propext]; the example's policy and the SM-37 row now statepropextandQuot.sound(ids.toml, SPEC §31, the scenario,CONFORMANCE.mdregenerated andvalidate-modelcurrent). Not the prototype's set by assumption: it is the observed one, and they happen to agree.Bumps (declared)
language/semantics-1.2.toml:semantic_ir15 → 16,proof_lowering3 → 4. Both schemas (semantic-module-v2,semantic-snapshot-v2) change. This moves the §21.2 identity, so SM-37 takes the identity slot (after #255, #259, #262, #264, #265; before #92 bootstrap landings). Nothing else the digest binds is regenerated here.Measured (this host: 2 cores, debug build, Lean 4.32.1, rustc 1.97.0, under the shared heavy-job lock)
lexlean fmt(canonical),lock --check(current),check,build,verify:verified 1 module; attestation c7af737dad4c8d13d8835083917ceeaadf066a1b5a1fb623e544c374ec2ac573, 19.3 s. The generated Lean isinduction value using Json.recwithmotive_2/3/4and ninenextgoals (next =>,next content =>,next items itemsHypothesis =>,next entries entriesHypothesis =>,next =>,next head tail headHypothesis tailHypothesis =>, ×2,next key content contentHypothesis =>).conformance_sm_37: passed, 41.0 s (verifies the example and a parameterisedRoseunder the pinned Lean, then the 49 plants, the language-1.1 use, and four scrutinee misuses).conformance_df_13,conformance_df_19: passed (with the stale locks ofexamples/recursive-dataandtests/nested-familyregenerated locally, not committed).cargo test -p lexlean --lib: 213 passed, 21.0 s.cargo fmt --all --check,cargo clippy --workspace --all-targets --all-features -- -D warnings(1 m 00 s),cargo xtask validate-model(447 ids),validate-spec-links(447 rows),check-test-inventory(779 tests: 287 + 492): clean.conformance_ex_07on a tree with every fixture lock regenerated locally (not committed): 1170 s; the newinduction-nested-typemessage matches; it fails only oncertificate-{b,e,heartbeat,}-rejected,certificate-resource-exhaustedandproduction-expectation-stale(theirexpected/command.jsonbind the identity) and on the twolock-schema-language-mismatch*fixtures, whose deliberately wrong locks my local blanket relock overwrote.conformance_sm_37fail (check fails, the swapped-members plant is accepted).just vv, the full workspace test, the host matrix (CI runs them; this draft runs only therestleg).Review round (head
0b0c95d96)Maintainer's review at #292 (comment), answered point by point on this PR.
examples/nested-induction/lexlean.lockis dropped;conformance_sm_37locks its own copy of the example.backend/semantic.rs:proofandproof_branchreturnResult, and anested_inductionscrutinee with no named parameter is anLLI9001diagnostic, not a guessed<local>.rec.conformance_sm_37: Lean-backed positive cases with a member underOption(none, some) and underResult(error, ok), goals asserted in the recursor's order; with theOptionrows swapped the case fails (VERIFICATION.md). The language-1.1 use and the four scrutinee misuses go throughrefuse_project(LLT4001, the message, no backend output).CONFORMANCE.mdregenerated (validate-modelcurrent).VERIFICATION.mdand here.0b0c95d96, under the lock:conformance_sm_37passed (77.1 s),cargo test -p lexlean --lib213 passed,conformance_df_13/df_19passed (fixture locks regenerated locally, not committed),fmtand workspaceclippy -D warningsclean,validate-model,validate-spec-links,check-test-inventorypass.Landing list (the maintainer's regeneration at landing)
README.md:150, the SPEC §31 total,crates/conformance/src/cases/repository.rs:763,xtask/src/spec_links.rs:64-65, and the "The register is 447 IDs." sentence of theCHANGELOG.mdentry (it auto-merges and goes stale silently).tests/**fixture locks,examples/*,compiler,stdlib, packages and bootstrap. They are stale on this branch (LLC0102 … the compiler semantics changed since locking), so every test that opens one fails here until then. Nothing is regenerated here:examples/nested-inductioncarries no lock (the case locks its own copy), so EX-08 stays red for it until landing. Theinduction-nested-typefixture lock records the base ID.tests/negative/certificate-*-rejected/expected/command.json(5),production-expectation-stale/expected/command.json,bootstrap/expected, the production packages and stack bounds, the normalized verification records; andexamples/nested-induction/expected/{build,verify}(new example, not generated here:cargo xtask verify-examples --writehas no single-example mode and would rewrite every other example's records).examples/nested-inductionretitle follows Seven examples carry the literal example's\title{Natural number addition}#251 (README notes it).https://claude.ai/code/session_01F4DJnZorC2Jd4MJfN9DbZk
Generated by Claude Code