Repository navigation
feat: feature flags for inductive declarations - #16595
Open
arthur-adjedj wants to merge 28 commits into
Open
arthur-adjedj wants to merge 28 commits into
arthur-adjedj wants to merge 28 commits into
Conversation
arthur-adjedj
force-pushed
the
indData
branch
2 times, most recently
from
November 19, 2026 14:05
18fd39e to
0899b42
Compare
Contributor
Author
|
downstream |
arthur-adjedj
force-pushed
the
indData
branch
from
November 20, 2026 21:29
550311a to
5c41ac0
Compare
7 of 12 tasks
Contributor
Author
|
!bench |
|
Benchmark results for 01161fb against 8009d0a are in. There are significant results. @arthur-adjedj
Large changes (1✅, 4🟥)
Medium changes (5🟥)
Small changes (21✅, 50🟥)
|
Contributor
Author
|
downstream |
Contributor
Author
|
!bench |
|
Benchmark results for b35dde6 against 8009d0a are in. There are significant results. @arthur-adjedj
Large changes (30✅, 5🟥)
Medium changes (20✅, 6🟥)
Small changes (37✅, 48🟥)
|
arthur-adjedj
marked this pull request as ready for review
November 22, 2026 01:45
arthur-adjedj
requested review from
TwoFX,
datokrat,
digama0,
hargoniX,
kim-em and
leodemoura
as code owners
November 22, 2026 01:45
Contributor
Author
|
changelog-language |
Contributor
Author
|
ci-release |
Conflict resolutions: * Init/WF.lean, Init/WFComputable.lean: take nightly's `Acc.ndrec` (Prop motive) / `Acc.ndrec'` naming, dropping this branch's rename. * Lean/Meta/WHNF.lean: `isMajorProof` keeps the `isImpredicative` shortcut and uses nightly's universe check against the first type of the mutual block. * kernel/inductive.cpp: keep the flag-based `check_large_elim` (it already rules out large elimination of recursive Prop types); run the flag checks before nightly's reordered `check_constructors`/`declare_inductive_types`. * tests/elab/16648.lean, tests/elab/16649.lean: add the new `InductiveType` flags; tests/elab/accRecPrime.lean: take nightly's version. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reads the inductive feature flags in the export format. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nating recursors Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reads the inductive feature flags in the export format. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This builds on Windows again. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Inductive types now carry the feature flags and no longer `isReflexive`, and recursors of types without large elimination have no rules. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
con-leche and con-ron accept exports without `isReflexive`; nanoda and lean4lean additionally accept `Quot` in `Sort (max 1 u)`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
Conflict resolutions: * Lean/Meta/WHNF.lean: `reduceRec` is public (master) and keeps the early exits for recursors without rules or large elimination. * kernel/type_checker.cpp, Lean/Meta/ExprDefEq.lean: the recursor eta-expansion of leanprover#15374 tests structure eta with `has_eta`/`hasEta`, as the rest of the branch does. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
With the inductive flags, a `Prop` inductive large-eliminates only if it is structure-like or K-like, and reducing such a recursor does not unfold the major premise. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
Conflict resolutions: * Lean/Replay.lean: keep leanprover#16717's validated `InductiveVal`s and pass their feature flags to the kernel. * tests/elab/issue16698.lean: the forged `InductiveVal`s carry the feature flags instead of `isReflexive`. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WD3k8hwfVBznY9FEMvR4xw
downstream-green is green again on nightly-2026-11-25 (downstream-lean4 run 45801655564). Conflict resolutions: * kernel/inductive.cpp: keep leanprover#16742's order (check the nested applications before adding the constructors) and pass the inductive feature flags to `inductive_val`. * tests/elab/16736.lean: the inductive type carries the feature flags. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The adaptation PR for this PR is leanprover/downstream-lean4#287. |
This branch has not been deployed
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.
This PR adds various flags to inductive declarations, as defined in #14977.
The PR also changes the following:
Exists.{0}andNonEmpty.{0}) are elaborated away into recursor calls to avoid downstream errors (i.e. merges feat: elaborate prop-based projections using recursors instead #16676)Quot.{u}now lives inSort (max 1 u)rather thanSort u(i.e. merges feat: makeQuotlive inSort (max 1 u)rather thanSort u#15023)