Repository navigation
[#13851] feat: no large elim of recursive Prop inductives in the kernel - #163
Merged
Merged
Conversation
`Acc.rec` no longer eliminates into `Sort v`, so the three definitions that recurse on an accessibility proof to produce data go through `Acc.recOn'` / `Acc.rec'` instead, and their unfolding equations, previously closed by `rfl`, go through `Acc.rec'_eq`. Ported from mathlib4-nightly-testing's `lean-pr-testing-13851` (f88713414c). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Adapts `Acc.rank` and `SSet.Subcomplex.Pairing.rank'` to leanprover/lean4#13851, which restricts `Acc.rec` to `Prop`; their unfolding lemmas now use `Acc.rec'_eq`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
Build report for mathlib4: use
|
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| aesop | ✅ | ✅ in 0s | ✅ in 4s | ⏭️ |
| batteries | ✅ | ✅ in 0s | ✅ in 3s | ✅ in 1s |
| import-graph | ✅ | ✅ in 2s | ✅ in 4s | ⏭️ |
| lean4-cli | ✅ | ✅ in 0s | ✅ in 0s | ⏭️ |
| mathlib4 | ✅ | ✅ in 11s | ✅ in 32s | ✅ in 45s |
| plausible | ✅ | ✅ in 0s | ✅ in 2s | ⏭️ |
| ProofWidgets4 | ✅ | ✅ in 0s | ✅ in 0s | ⏭️ |
| quote4 | ✅ | ✅ in 0s | ✅ in 1s | ⏭️ |
| reference-manual | ✅ | ✅ in 1s | ⏭️ | ⏭️ |
| BibtexQuery | ✅ in 1s | ⏭️ | ⏭️ | |
| cslib | ✅ in 29s | ✅ in 9s | ✅ in 2s | |
| doc-gen4 | ✅ in 1s | ⏭️ | ⏭️ | |
| illuminate | ✅ in 0s | ✅ in 9s | ⏭️ | |
| lean4-unicode-basic | ✅ in 0s | ⏭️ | ⏭️ | |
| lean4export | ✅ in 0s | ✅ in 5s | ⏭️ | |
| LeanSearchClient | ✅ in 0s | ✅ in 0s | ⏭️ | |
| leansqlite | ✅ in 2s | ✅ in 15s | ⏭️ | |
| nerodia | ✅ in 0s | ✅ in 22s | ⏭️ | |
| repl | ✅ in 0s | ✅ in 1m 49s | ⏭️ | |
| verso | ✅ in 17s | ✅ in 3m 35s | ⏭️ | |
| verso-slides | ✅ in 4s | ✅ in 9s | ⏭️ | |
| verso-web-components | ✅ in 0s | ⏭️ | ⏭️ |
skip-checks: true
Contributor
Author
|
The upstream PR has landed. This adaptation PR is being merged. |
Kha
pushed a commit
that referenced
this pull request
Nov 26, 2026
Sole fix for [run 45176665928](https://github.com/leanprover/downstream-lean4/actions/runs/45176665928) — everything else that run reports red is already carried by open PRs: `mathlib4` also needs #273 (lean4#16668) and the bot's #163 (`adaptation-13851`), and `reference-manual` needs #268 and #275. On its own this PR's CI therefore stays red on `mathlib4` (at `Mathlib.Data.Int.Init`, four thousand modules before the one fixed here) and on `reference-manual`; that is expected, and it was verified with all four applied. `repl` fails on the same `mathlib4` modules rebuilt through `test/Mathlib`, and `cslib` was only ever skipped behind `mathlib4`. ### `mathlib4` — lean4#16680 (`leodemoura`) lean4#16680 makes `grind`'s *local* E-matching theorems — the ones built from `∀`-hypotheses in the context — take their instances and anchors from the **preprocessed** type of the hypothesis rather than from whatever `mkOfEqTrueCore` handed back. In `Pentagonal.tprod_one_sub_pow` (`Mathlib/Combinatorics/Enumerative/Pentagonal/Ring.lean`) the line before the failure is exactly such a hypothesis: ```lean have h1 (k : ℕ) : pentagonal (k + 1) = ((k + 1) * (3 * k + 2) / 2) := by grind [pentagonal_def] have h2 (k : ℕ) : pentagonal (-k) = (k * (3 * k + 1) / 2) := by grind [pentagonal_neg] ``` and with `h1` in the context the second `grind` now exhausts `(instances := 1000)`, `(ematch := 5)` and `(ringSteps := 100000)`. The declaration's heartbeats are gone with it, so the `rw` two lines further down fails as `(deterministic) timeout` — two errors, one cause. The module takes **315s** to fail, where the whole file used to elaborate in well under a second. `h1` is the whole trigger, not the theorem's five hypotheses and not `h` above it: * `clear h1` alone, before the `grind`, fixes it — the module is back to **0.9s** for the entire file; * `h1`'s own `grind` is fine with the full context, as long as `h2` has not run yet; * the same `h2` goal in a file with no context at all proves in 0.6s on this nightly. `h1` is only used by the `simp_rw` after both `have`s, so clearing it inside `h2`'s proof costs nothing. An `#adaptation_note` records why, because the interesting question is upstream: whether `grind` should be 300× slower because an unrelated equation about the same function sits in the context is for lean4#16680's author to decide, and that is a better outcome than `clear`ing hypotheses at every future site. Nothing else in `mathlib4` moved on this nightly. ### Verification On `master@origin` (`c2ff11e2`, `nightly-2026-11-23`) with #273 and #163's three `mathlib4` hunks applied locally: * `lake build Mathlib Archive Counterexamples Wanted cache --wfail` — green, 18655 jobs (the previous build stopped at 18647/18655 on this module, which also hid `Pentagonal.PowerSeries`, `Pentagonal.EulerFunction` and `Mathlib` itself); * `lake test --iofail` — green, 19219 jobs; * `lake lint` — green. `reference-manual` was verified in the same tree with #268 and #275 applied: full `lake build` green, 1668 jobs, with elan 4.4.0 first on `PATH` so the pinned `elan --help` blocks match CI. It defines no test or lint driver. `repl`'s test phase was not rebuilt here — its failures are these same `mathlib4` modules compiled through `test/Mathlib`. One thing that is *not* fixed by anything, because it needs no fix: `Tutorial.Grind.IndexMap` failed in this run with `permission denied (error code: 13)` on `.lake/build/lib/lean/IndexMapGrind.ilean`. #274 changed `IndexMapGrind.lean`, so for one run no cached artifact existed, and the parent `lake build` and the nested `lake build +IndexMapGrind:highlighted` that `Tutorial/Grind/IndexMap.lean` spawns both had to build the module — the parent won and replaced the output with a read-only hardlink into the artifact cache. The artifact is in the cache now, both sides replay it, and the module builds green locally. It will recur for one run on every future change to that file. <!-- downstream-watch: unattended --> Co-authored-by: downstream-lean4[bot] <downstream-lean4[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <[email protected]>
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 is the adaptation PR for leanprover/lean4#13851.