Repository navigation
fix: mathlib4 breakage from nightly-2026-10-16 - #174
Merged
Merged
Conversation
`Ordering.dthen` and the `@[simp]` lemma `Ordering.dthen_eq_then` moved into core in lean4#15317 (`feat: add `Bool.dand` and `Ordering.dthen` along with more lemmas`), which landed in `nightly-2026-10-16`. Core's `Ordering.dthen` has the same signature and the same two equations as mathlib's, and core's `dthen_eq_then` is the same statement, also `@[simp]` — so both mathlib copies are now plain duplicates and the build fails with `'Ordering.dthen' has already been declared`. Delete both. No other declaration added by lean4#15317 (`Bool.dand`, `Bool.Reflects.of_imp`, `forall_forall_prop_decidable`, the `then`/`dand` lemma batch) has a mathlib counterpart. Co-Authored-By: Claude Opus 5 <[email protected]>
Contributor
Author
Build report for fix: mathlib4 breakage from nightly-2026-10-16Turned green:
Stayed green
|
Garmelon
pushed a commit
that referenced
this pull request
Oct 16, 2026
`master` is red again on `nightly-2026-10-16` ([run 38962929561](https://github.com/leanprover/downstream-lean4/actions/runs/38962929561)) with the very error [#174](#174) fixed and merged this morning: ``` error: Mathlib/Data/Ordering/Basic.lean:37:20: `Ordering.dthen` has already been declared ``` `cslib` (skipped behind it) and `repl` (its test phase compiles Mathlib) fall over with it; every other repo is green. ## Why it came back `chore: switch mathlib to new nightly model` (53b5956) repointed the `mathlib4` entry in `repos.toml` from `leanprover-community/mathlib4-nightly-testing`@`nightly-testing` to `leanprover-community/mathlib4`@`master`, and the `downstream: reset repo mathlib4` (d700dff) that followed reset the subrepo onto mathlib `master` — 196 files, including a plain revert of #174's deletion. Mathlib `master` builds on a *release* toolchain and so still carries both declarations. This is not a one-off: under the new model every nightly adaptation that `nightly-testing` used to carry now has to live here and reach mathlib through the `bump/v4.37.0` export, so each such reset will need its adaptations re-landed in the monorepo. ## mathlib4 lean4#15317 (*feat: add `Bool.dand` and `Ordering.dthen` along with more lemmas*, Robin Arnez) moved `Ordering.dthen` into core. Core's `Ordering.dthen` has mathlib's signature and mathlib's two equations, and core also ships `@[simp] theorem Ordering.dthen_eq_then` — the same statement, the same attribute, as mathlib's lemma in `Mathlib/Data/Ordering/Lemmas.lean`. Both mathlib copies are therefore plain duplicates (and keeping the lemma while dropping the definition would just move the collision onto the lemma's name), so this deletes both — the same two hunks as #174, which applied unchanged. Nothing else from lean4#15317 collides: `Bool.dand`, `Bool.Reflects.of_imp`, the root-namespace instance `forall_forall_prop_decidable` and the `then`/`dand` lemma batch have no mathlib counterparts, and mathlib has no other user of `Ordering.dthen`. ## Verified locally on `d04c02ce` | repo | build | test | lint | | --- | --- | --- | --- | | mathlib4 | `Mathlib Archive Counterexamples Wanted cache --wfail`, 18446 jobs recompiled, 0 errors, 0 warnings | `lake test --iofail`, 18972 jobs | `Linting passed for Mathlib.` | | cslib | `--wfail --iofail`, 6694 jobs, 0 warnings | `--wfail --iofail`, 18735 jobs | `Linting passed for Cslib.` | | repl | `lake build` | `lake test` — 71 cases PASSED, 0 failed, including the `test/Mathlib` batch | (no driver) | `cslib` and `repl` are green **unpatched** on this master; they only needed `mathlib4` to build. Nothing was left unfinished. <!-- 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.
masterwent red with the bump tonightly-2026-10-16(run 38888679712):mathlib4fails to build, andcslib(skipped behind it) andrepl(its test phase compiles Mathlib) fall over with it. One repo needed a change.mathlib4
lean4#15317 (feat: add
Bool.dandandOrdering.dthenalong with more lemmas, Robin Arnez) movedOrdering.dtheninto core, soMathlib/Data/Ordering/Basic.lean:37fails withCore's
Ordering.dthenhas mathlib's signature and mathlib's two equations, and core also ships@[simp] theorem Ordering.dthen_eq_then— the same statement, the same attribute, as mathlib's lemma inMathlib/Data/Ordering/Lemmas.lean. Both mathlib copies are therefore plain duplicates (and keeping the lemma while dropping the definition would just move the collision onto the lemma's name), so this deletes both.Nothing else from lean4#15317 collides:
Bool.dand,Bool.Reflects.of_imp, the root-namespace instanceforall_forall_prop_decidableand thethen/dandlemma batch have no mathlib counterparts, and mathlib has no other user ofOrdering.dthen.Upstream
mathlib4-nightly-testingis still onnightly-2026-10-15and still carries both declarations, so it will need the same deletion when it bumps.Verified locally on
16428f35Mathlib Archive Counterexamples Wanted cache --wfail, 18440 jobs, 0 errors, 0 warningslake test --iofail, 18962 jobsLinting passed for Mathlib.--wfail --iofail, 6690 jobs, 0 warnings--wfail --iofail, 18727 jobsLinting passed for Cslib.lake buildlake test— all cases PASSED, including thetest/Mathlibbatchcslibandreplare green unpatched on this master; they only neededmathlib4to build. In particularcslib's own breakage from theSet-as-structure change is gone frommaster: upstream cslib#1134 merged on 2026-10-14 and the bot brought it in, which is whycslibwas fully green in run 38840386618. #166 is superseded and is being closed.Nothing was left unfinished.