Skip to content

fix: mathlib4 breakage from nightly-2026-10-16 (reapply #174) - #176

Merged
Garmelon merged 1 commit into
masterfrom
push-yvxvoumrkxuy
Oct 16, 2026
Merged

Garmelon merged 1 commit into
masterfrom
push-yvxvoumrkxuy

Conversation

@downstream-lean4

Copy link
Copy Markdown
Contributor

master is red again on nightly-2026-10-16 (run 38962929561) with the very error #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: reset repo mathlib4` (d700dff) switched the `mathlib4`
subrepo from `mathlib4-nightly-testing` to `leanprover-community/mathlib4`
`master` (`chore: switch mathlib to new nightly model`, 53b5956), which
reverted the deletion merged as #174 and brought the collision back:

    error: Mathlib/Data/Ordering/Basic.lean:37:20: `Ordering.dthen` has already been declared

`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 mathlib's signature and its two equations, and core's
`dthen_eq_then` is the same statement, also `@[simp]` — so both mathlib
copies are plain duplicates. Delete both, as #174 did.

Under the new model mathlib master is a release-toolchain branch, so this
adaptation now has to live here and reach mathlib through the
`bump/v4.37.0` export rather than through `nightly-testing`.

Co-Authored-By: Claude Opus 5 <[email protected]>
@downstream-lean4

Copy link
Copy Markdown
Contributor Author

Build report for fix: mathlib4 breakage from nightly-2026-10-16

Turned green:

Repo Critical Build Test Lint
mathlib4 ✅ ✅ in 14m 49s ✅ in 39s ✅ in 1m 31s
cslib ✅ in 30s ✅ in 9s ✅ in 3s
repl ✅ in 0s ✅ in 2m 5s ⏭️
Stayed green
Repo Critical Build Test Lint
aesop ✅ ✅ in 0s ✅ in 4s ⏭️
batteries ✅ ✅ in 0s ✅ in 3s ✅ in 2s
import-graph ✅ ✅ in 2s ✅ in 4s ⏭️
lean4-cli ✅ ✅ in 0s ✅ in 0s ⏭️
plausible ✅ ✅ in 0s ✅ in 2s ⏭️
ProofWidgets4 ✅ ✅ in 1s ✅ in 1s ⏭️
quote4 ✅ ✅ in 0s ✅ in 1s ⏭️
reference-manual ✅ ✅ in 1m 11s ⏭️ ⏭️
BibtexQuery ✅ in 3s ⏭️ ⏭️
doc-gen4 ✅ in 7s ⏭️ ⏭️
illuminate ✅ in 1s ✅ in 10s ⏭️
lean4-unicode-basic ✅ in 0s ⏭️ ⏭️
lean4export ✅ in 0s ✅ in 7s ⏭️
LeanSearchClient ✅ in 0s ✅ in 0s ⏭️
leansqlite ✅ in 7s ✅ in 20s ⏭️
nerodia ✅ in 1s ✅ in 22s ⏭️
verso ✅ in 1m 17s ✅ in 3m 20s ⏭️
verso-slides ✅ in 16s ✅ in 9s ⏭️
verso-web-components ✅ in 6s ⏭️ ⏭️

View run

@Garmelon
Garmelon merged commit 727a8d0 into master Oct 16, 2026
23 checks passed
@Garmelon
Garmelon deleted the push-yvxvoumrkxuy branch October 17, 2026 01:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant