fix: mathlib4 deprecation-linter breakage from the mathlib merge - #55
Merged
Conversation
The `downstream: update repo mathlib4` merge (resolved in favour of upstream) dropped the ten `+typeChanged` markers this repo carries on deprecations whose replacement intentionally has a different type (lean4#14600): `Subsemiring.closureCommSemiringOfComm` and friends towards the `isMulCommutative_*` lemmas, `ENat.add_one_pos` towards `add_pos_of_right`, `PowerSeries.derivativeFun` towards the `derivative` derivation. Re-added them. Upstream's own rename of `Ideal.IsIntegral.comap_*` to `Ideal.IsIntegral.under_*` additionally left eight `@[deprecated] alias`es in `RingTheory/Ideal/GoingUp.lean` pointing at aliases that are now themselves deprecated, which `linter.deprecated.deprecatedTarget` reports. Retargeted them at the final names, as the linter suggests; the alias types are unchanged. mathlib4 builds (`--wfail`), tests (`--iofail`) and lints clean.
Contributor
Build report for fix: mathlib4 deprecation-linter breakage from the mathlib mergeTurned green:
Stayed red
Stayed green
|
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.
Fixes the red
masterof run 34180042869 (leanprover/lean4:nightly-2026-09-06), whose only genuinely new failure ismathlib4. The repo builds with--wfail, so both of the following are warnings that fail the build.mathlib4Ten dropped
+typeChangedmarkersdownstream: update repo mathlib4(4b1d310) resolves conflicts in favour of upstream, and upstream touched the very lines that carry the+typeChangedmarkers this repo has been adding since lean4#14600 — so the merge silently removed all ten of them:Mathlib/Data/ENat/Monoid.leanENat.add_one_pos→add_pos_of_rightMathlib/Algebra/Ring/Subsemiring/Basic.leanclosureCommSemiringOfComm→isMulCommutative_closureMathlib/Algebra/Ring/Subring/Basic.leanclosureCommRingOfComm→isMulCommutative_closureMathlib/Algebra/Algebra/NonUnitalSubalgebra.leanadjoinNonUnitalCommSemiringOfComm→isMulCommutative_adjoinMathlib/Algebra/Star/NonUnitalSubalgebra.leanadjoinNonUnitalCommSemiringOfComm→isMulCommutative_adjoinMathlib/Algebra/Algebra/Subalgebra/Lattice.leanadjoinCommSemiringOfComm,adjoinCommRingOfComm→isMulCommutative_adjoinMathlib/Algebra/Star/Subalgebra.leanadjoinCommSemiringOfComm,adjoinCommRingOfComm→isMulCommutative_adjoinMathlib/RingTheory/PowerSeries/Derivative.leanderivativeFun→derivativeAll ten are the intended kind of type change (an
abbrevproducing aCommSemiring/CommRinginstance deprecated towards theIsMulCommutativelemma; a plain function deprecated towards aDerivation), so the markers are re-added verbatim.NonUnitalSubalgebra.leanshows the situation nicely: the sibling deprecation twelve lines further down kept its marker because upstream did not touch that line.This will keep recurring: mathlib master builds on a release toolchain, so upstream never sees the warning that makes the marker necessary and has no reason to preserve it across a rewrite.
Eight deprecated aliases pointing at deprecated aliases
Independently, the merge brought in upstream's rename of
Ideal.IsIntegral.comap_*toIdeal.IsIntegral.under_*(mathlib,since := "2026-09-03"). The olderIdeal.IsIntegralClosure.*andIdeal.IntegralClosure.*aliases inMathlib/RingTheory/Ideal/GoingUp.leanstill pointed at thecomap_*names, which are now themselves deprecated — the caselinter.deprecated.deprecatedTargetreports:Retargeted all eight at the final names, which is the linter's own suggestion. An
aliashas the type of its target and these are aliases of aliases, so no statement changes and no+typeChangedbecomes necessary.Verified
mathlib4locally, with the run's artifact cache restored:lake build Mathlib Archive Counterexamples Wanted --wfail— 9043 jobs, no warningslake test --iofaillake lint(batteries/runLinter Mathlib)Not in this PR
cslibis the run's other red repo, and it was only skipped behindmathlib4. Its own failure — two instance-based deprecations inCslib/Foundations/Relation/Basic.lean— is already fixed by #54, which still applies; both have to land for the run to go green.