Skip to content

fix: mathlib4 +typeChanged marker for the renamed central binomial bound - #76

Merged
Kha merged 1 commit into
masterfrom
push-wmowzxptkltk
Sep 15, 2026
Merged

Kha merged 1 commit into
masterfrom
push-wmowzxptkltk

Conversation

@Kha

@Kha Kha commented Sep 15, 2026

Copy link
Copy Markdown
Member

Fixes the red run 34921296164 on master (nightly-2026-09-14, commit d7f4adb downstream: update repo mathlib4).

mathlib4

Root cause. The merge with mathlib master brought in mathlib4#42606, which renames Nat.four_pow_le_two_mul_add_one_mul_central_binom to Nat.four_pow_le_two_mul_add_one_mul_centralBinom and restates it as

4 ^ n ≤ (2 * n + 1) * n.centralBinom

while the deprecated alias it leaves behind still says

4 ^ n ≤ (2 * n + 1) * (2 * n).choose n

The two are defeq but not syntactically equal, so lean4#14600's inexact-deprecation check warns at Mathlib/Data/Nat/Choose/Central.lean:131. mathlib4 builds with --wfail, so the warning is the failure; Mathlib.Data.Nat.Choose.Central was the only logged target.

mathlib's own CI builds on a release toolchain, which does not have this check, so markers like this one only ever exist downstream and every mathlib merge can add another.

Fix. Added +typeChanged to the @[deprecated] attribute, as the warning's own hint suggests. The marker is not recorded in the environment, so no dependent .olean changes and everything downstream of the module replays from cache.

Verified locally on nightly-2026-09-14:

  • mathlib4: lake build --wfail Mathlib Archive Counterexamples Wanted, lake test --iofail, lake lint — all pass. Only Mathlib.Data.Nat.Choose.Central rebuilt; the rest replayed.
  • cslib: lake build --wfail --iofail, lake test --wfail --iofail, lake lint — all pass with no changes. It was red in the run only because it was skipped behind mathlib4.

Nothing was left unfinished: those two were the entire red set.

…bound

The merge with mathlib master (mathlib4#42606) renamed
`Nat.four_pow_le_two_mul_add_one_mul_central_binom` to
`...centralBinom` and restated the new lemma in terms of
`Nat.centralBinom n` rather than `(2 * n).choose n`, so the compatibility
alias deprecates in favour of a declaration whose type differs
syntactically. lean4#14600's inexact-deprecation check fires on it, and
`mathlib4` builds with `--wfail`.

Added `+typeChanged` to the `@[deprecated]` attribute.
@downstream-lean4

Copy link
Copy Markdown
Contributor

Build report for fix: mathlib4 +typeChanged marker for the renamed central binomial bound

Turned green:

Repo Critical Build Test Lint
mathlib4 ✅ ✅ in 220s ✅ in 48s ✅ in 96s
cslib ✅ in 35s ✅ in 9s ✅ in 3s
Stayed green
Repo Critical Build Test Lint
aesop ✅ ✅ in 7s ✅ in 5s ⏭️
batteries ✅ ✅ in 5s ✅ in 4s ✅ in 2s
import-graph ✅ ✅ in 2s ✅ in 3s ⏭️
lean4-cli ✅ ✅ in 1s ✅ in 0s ⏭️
plausible ✅ ✅ in 1s ✅ in 2s ⏭️
ProofWidgets4 ✅ ✅ in 3s ✅ in 1s ⏭️
quote4 ✅ ✅ in 2s ✅ in 1s ⏭️
reference-manual ✅ ✅ in 16s ⏭️ ⏭️
BibtexQuery ✅ in 1s ⏭️ ⏭️
comparator ✅ in 2s ⏭️ ⏭️
doc-gen4 ✅ in 3s ⏭️ ⏭️
illuminate ✅ in 3s ✅ in 10s ⏭️
lean4-unicode-basic ✅ in 2s ⏭️ ⏭️
lean4export ✅ in 0s ✅ in 7s ⏭️
LeanSearchClient ✅ in 1s ✅ in 0s ⏭️
leansqlite ✅ in 4s ✅ in 15s ⏭️
nerodia ✅ in 2s ✅ in 21s ⏭️
repl ✅ in 1s ✅ in 57s ⏭️
verso ✅ in 36s ✅ in 165s ⏭️
verso-slides ✅ in 5s ✅ in 6s ⏭️
verso-web-components ✅ in 2s ⏭️ ⏭️

View run

@Kha
Kha merged commit 93b7e44 into master Sep 15, 2026
24 checks passed
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