Repository navigation
Add four corner cases: inductive redexes, nested imax, maybe-Prop large elimination - #320
Merged
Merged
Conversation
…ge elimination nested-redex-aux and vanishing-occurrence come from the closed leanprover#319 (the latter as either: it complements positivity-whnf); imax-nested-absorption and large-elim-maybe-prop are new.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Four
corner-casestests, alloutcome: either. This replaces #319:nested-redex-auxis unchanged from there, andvanishing-occurrenceis now a corner case. My comment there was wrong: it is not a duplicate ofpositivity-whnfbut its counterpart. There the vanishing occurrence sits under an arrow inside the field and the official kernel rejects; here it is at the head of the field, where whnf removes it, and the official kernel accepts.nested-redex-aux: two nested occurrences that differ only by a beta-redex give the official kernel two auxiliary types. sokonanoda rejects, by design (Valid nested inductive rejected when two nested occurrences differ only by a redex intgrah/sokonanoda#12).vanishing-occurrence: the type being declared occurs only inside a redex at the head of a field. In Add corner-cases/nested-redex-aux and other/vanishing-occurrence #319's CI, kefir, kefir-wasm and metalean-fast rejected it (metalean-fast reports a positivity failure), and eink0rn because the export saysisRec = truewhile it derivesfalse: the official kernel computesisRecwithout reducing, but checks positivity after reducing. The other 27 checkers accepted.imax-nested-absorption:imax u v = imax (imax u v) vandimax u v = imax v (imax u v)hold for every assignment, but the official kernel's normalization does not establish them. Locally the nanoda family, con-leche, con-ron, sokonanoda and nano-lean accept; official, lean4lean, Pestka, tenet and kefir reject. Unlikeimax-right-successor, no right operand is a successor.large-elim-maybe-prop: a large recursor forMaybePropBox.{u} (α : Sort u) : Sort u | mk : α → MaybePropBox α, used byget. The official kernel only gives this type a recursor intoProp; the export uses the kernel's recursor for levelu + 1, rewritten tou. It is sound because the field is a proof whenever the type is a proposition, the same argument as inproj-maybe-prop. con-leche and con-ron accept it; their rule isblockLargeElimAllowedinConLeche/Kernel/Inductives/BlockRec.lean; everything else I ran rejects (nanoda master and nanoclo panic).The
.leanfiles compile with the arena toolchain (4.34.1); the.ndjsonis a Lean 4.35.0 export of theu + 1version with the recursor's level edited by hand.