Repository navigation
#291 PF-25: simplify discharges a conditional lemma from a named hypothesis of the statement - #303
humuhumu33 wants to merge 9 commits into
Conversation
…f_25 (#291, R3 skeleton) The language-1.2 simplify proof form may name the leading premises of its goal, introduce them, and add them to its closed simp only set, so that a prior theorem whose rewrite holds under a condition rewrites where a named hypothesis discharges the condition. The case builds a module in the shape of UOR-Foundation/MCP#24's UTF-8 lead-byte classes (Table 3-7, E1..EC): a step lemma conditional on the lead byte's class, the zero test of the row's conditional, and the composed statement. It fails on this commit: the schema has no `hypotheses` member. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`simplify` gains `hypotheses`, names for the leading premises of the goal. It lowers to `intro h1 … hn` and then `simp only [h1, …, hn, d1, …]`, so a prior theorem whose rewrite holds under a condition rewrites where a named hypothesis discharges that condition. The rule set is still exactly what the source names. Linking (LLT4001) refuses hypotheses where the goal is not the theorem's statement (only the proof itself and branches of cases and induction carry it), more names than the goal's leading implications, a name already in scope or repeated (a hypothesis cannot also be named among the definitions), and the form under language 1.1. A theorem whose hypotheses do not discharge a rule's condition is rejected by Lean (LLV7002). The semantic-module and snapshot schemas gain the optional member, and semantic_ir moves 15 -> 16 and proof_lowering 3 -> 4: the language-1.2 compiler-semantics ID moves. The records are regenerated in the next commit. SPEC §17.12 gains the row of the form (through `cargo xtask spec`). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fy-hypotheses # Conflicts: # CHANGELOG.md
The lead-byte module verifies with its exact policy; the ED variant is rejected by Lean (LLV7002, `simp` made no progress); the forged policy is refused (LLV7005); the hypotheses dropped from the simp set, the ED variant made true, and the forged policy made the observed one each turn conformance_pf_25 red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…generated by the writers The semantic-module and snapshot schemas gain `simplify.hypotheses`, and semantic_ir and proof_lowering move to 16 and 4, so the language-1.2 ID moves from 5262e5b4... to 583ff8e2.... The ID was substituted, then check-golden, check-calculus, check-production-export, check-fixtures and verify-examples (without uor-atlas) rewrote their records; every example, compiler, stdlib and bootstrap verified under the new compiler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…otheses # Conflicts: # CHANGELOG.md # VERIFICATION.md
The merge of #288 kept its count of 445 in the generated total; the register has 446 rows. Regenerated by validate-model --write. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…otheses # Conflicts: # README.md # SPEC.md # VERIFICATION.md # spec/lexlean.lock
|
Maintainer review of What checked out. R3 order ( Identity. Keep both bumps ( Before it can land (blocking, as you anticipated):
Nits, in the same push: the stray blank line after the "Register 445." CHANGELOG entry; Order on the 0.5.0 line: #300 (one push owed, then merge), then this one, then #295. Say the head here when it is up. Generated by Claude Code |
|
Generated by Claude Code |
|
Generated by Claude Code |
Fixes #291 on the 0.5.0 line.
simplifycan now discharge a conditional lemma's condition from a hypothesis of the theorem's statement, so a theorem of the formP x → (f x = 0 ↔ Q x)is proved from a lemma that holds underP x. This is the statement UOR-Foundation/MCP#24 could not write.The form (SPEC §17.12,
PF-25)The row added to the §17.12 table of language-1.2 constructs:
The hypothesis is bound by the statement's
→, the waynested_inductionbinds its induction hypotheses in #278. No tactic, option or lemma comes from anywhere but the source, and no raw Lean enters.In the notation:
This lowers to:
Register (R3)
PF-25(proofs, §17.12) is the one new row. Its statement covers the form, the linking refusals, and Lean's rejection of a hypothesis that does not discharge the condition. That rejection uses the existingLLV7002, so no new diagnostic code is registered. If you want a separate row or code for that refusal, say so.PF-24belongs to draft #263 PF-24: runtime bounds a law proof cites (split_exact, UTF-8 decode, UInt32 checked_add) #296, so this takesPF-25. The head containsrelease/v0.5at 34cfc12 ([0.5.0] #113: release identity, §2.3 completion release 0.5.0 and §30 for languages 1.0-1.2 (RP-17, CL-18) #288 and #124: the general performance corpus (PC-01, PC-02, L4.6 of #106) #289), so the register count is 448.conformance_pf_25. On that commit the case fails withunknown field `hypotheses`. The implementation follows in 186f028.The case (
conformance_pf_25)The case builds a module in the shape of MCP#24's three-byte row for lead bytes E1..EC (Table 3-7):
lead_e1_ec_stepis conditional on the lead byte's class.three_byte_zero_iffholds for all bounds.three_byte_complete_zero_iffcomposes the two, as above.[Quot.sound, propext], the zero test and the composed statement[Classical.choice, Quot.sound, propext]leadED b1 = true), which does not imply the lemma's conditionLLV7002,`simp` made no progressClassical.choiceLLV7005constructorbranch, more names than premises, a parameter's name, a hypothesis also named among the definitions, the form under language 1.1LLT4001at linking, before any build outputThe case also checks the generated Lean:
intro lead, thensimp only [lead, …].Plants (VERIFICATION.md)
Each plant was one edit in a separate worktree, restored with
git checkout. Each turnsconformance_pf_25red.introkept.lexlean verifyreportsLLV7002,`simp` made no progress: no other rule discharges the condition.LLV7005comes.Identity
The language-1.2 compiler-semantics ID moves, from
5262e5b4…to583ff8e2…. The reasons:simplifyalternatives ofschemas/semantic-module-v2.schema.jsonandschemas/semantic-snapshot-v2.schema.jsongain the optionalhypotheses.semantic_irmoves from 15 to 16 andproof_loweringfrom 3 to 4, the convention [v0.4] Add language-model semantic components and compositional text-processing pipeline #30 and [0.5.0] Lemmas for universal equalities over list folds #117 followed.Commit f48de99 substitutes the ID and lets the writers regenerate their records:
check-golden,check-calculus,check-production-export,check-fixtures, thenverify-exampleswithoutuor-atlas. All 15 non-Atlas examples,compiler,stdlibandbootstrapverified under the new compiler, so every committed proof still verifies.State of the base. #296 landed on
release/v0.5at 80bf4ba after this head was pushed, and it moves the same ID (to9fdf4d30…). This PR therefore conflicts on every lock and expected record, and the ID it computes (583ff8e2…) is stale. #295 and #300 move the ID as well. The merge with #296 and one more run of the writers are needed once, on top of whichever identity PR lands last, so I have not repeated them for each landing. Say which order you want, or merge this one last.Run locally (WSL, Linux x86-64, Lean 4.32.1)
validate-model(446 ids),validate-spec-linksandcheck-test-inventorypass.lexleanandrepo-conformancewith-D warningspasses, and so do the 211 tests ofcargo test -p lexlean --lib.conformance_pf_25,_pf_09,_pf_21,_pf_23,_sm_16,_sm_17,_rp_07and_rp_11.verify-examples --write.release/v0.5at 34cfc12 ([0.5.0] #113: release identity, §2.3 completion release 0.5.0 and §30 for languages 1.0-1.2 (RP-17, CL-18) #288, #124: the general performance corpus (PC-01, PC-02, L4.6 of #106) #289; the merge of #124: the general performance corpus (PC-01, PC-02, L4.6 of #106) #289 also regenerated the newperformance-corpusexample under this PR's ID, the only records that changed). Earlier it merged 655d9ae ([0.5.0] #113: release identity, §2.3 completion release 0.5.0 and §30 for languages 1.0-1.2 (RP-17, CL-18) #288). The merge resolves two appends, in CHANGELOG and VERIFICATION, and moves the README count to 446. The merge left the generated total of SPEC.md §31 at 445, sovalidate-modelandvalidate-spec-linksfailed on b53aedb. The next commit regenerates it withvalidate-model --write, one line.validate-model(446 ids),validate-spec-links(446 rows bijective) andcheck-test-inventorypass, andconformance_rp_07,_rp_11and_pf_25pass. On b53aedb,_rp_17and_cl_18also passed.lexlean --versionoutput with the old 1.2 ID. It stays as recorded, because it is a past output.Not verified locally
uor-atlas. It was not verified here, because it is CI-only evidence. It is a language-1.0 project, whose ID does not move, and no file of it changed, so its records stand.just vv. That includes the fullbddsuite, which is CI's.🤖 Generated with Claude Code