fix: cslib +typeChanged on two instance-based deprecations - #54
Merged
Conversation
The `downstream: update repo cslib` merge (ffe4553) added `@[deprecated _root_.refl]` on `MJoin.refl` and moved the existing `@[deprecated Relation.ReflGen.stdSymm]` on `ReflGen.symmGen_symm` from `Confluence.lean` into `Foundations/Relation/Basic.lean`. Both replacements are `Std.Refl`/`Std.Symm` instances rather than the lemmas they replace, so since lean4#14600 the deprecation linter reports `The updated constant has a different type`. `cslib` builds with `--wfail`, so those warnings fail the build. The type difference is intended in both cases — callers are meant to go through `_root_.refl` / `Std.Symm.symm` — so mark both with `+typeChanged` (syntax from lean4#14570).
Contributor
Build report for fix: cslib
|
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| reference-manual | ✅ | 🟥 in 83s | ⏭️ | ⏭️ |
| cslib | 🟥 in 5s | ⏭️ | ⏭️ |
Stayed green
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| aesop | ✅ | ✅ in 7s | ✅ in 4s | ⏭️ |
| batteries | ✅ | ✅ in 4s | ✅ in 4s | ✅ in 2s |
| import-graph | ✅ | ✅ in 2s | ✅ in 3s | ⏭️ |
| lean4-cli | ✅ | ✅ in 1s | ✅ in 0s | ⏭️ |
| mathlib4 | ✅ | ✅ in 186s | ✅ in 42s | ✅ in 91s |
| plausible | ✅ | ✅ in 1s | ✅ in 2s | ⏭️ |
| ProofWidgets4 | ✅ | ✅ in 3s | ✅ in 1s | ⏭️ |
| quote4 | ✅ | ✅ in 2s | ✅ in 1s | ⏭️ |
| BibtexQuery | ✅ in 3s | ⏭️ | ⏭️ | |
| comparator | ✅ in 2s | ⏭️ | ⏭️ | |
| doc-gen4 | ✅ in 9s | ⏭️ | ⏭️ | |
| illuminate | ✅ in 3s | ✅ in 10s | ⏭️ | |
| lean4-unicode-basic | ✅ in 2s | ⏭️ | ⏭️ | |
| lean4export | ✅ in 0s | ✅ in 7s | ⏭️ | |
| LeanSearchClient | ✅ in 1s | ✅ in 0s | ⏭️ | |
| leansqlite | ✅ in 7s | ✅ in 19s | ⏭️ | |
| nerodia | ✅ in 2s | ✅ in 21s | ⏭️ | |
| repl | ✅ in 1s | ✅ in 58s | ⏭️ | |
| verso | ✅ in 90s | ✅ in 84s | ⏭️ | |
| verso-slides | ✅ in 61s | ✅ in 6s | ⏭️ | |
| verso-web-components | ✅ in 35s | ⏭️ | ⏭️ |
Kha
added a commit
that referenced
this pull request
Sep 8, 2026
Fixes the red `master` of [run 34180042869](https://github.com/leanprover/downstream-lean4/actions/runs/34180042869) (`leanprover/lean4:nightly-2026-09-06`), whose only genuinely new failure is `mathlib4`. The repo builds with `--wfail`, so both of the following are warnings that fail the build. ## `mathlib4` ### Ten dropped `+typeChanged` markers `downstream: update repo mathlib4` (4b1d310) resolves conflicts in favour of upstream, and upstream touched the very lines that carry the `+typeChanged` markers this repo has been adding since lean4#14600 — so the merge silently removed all ten of them: | file | declaration | | --- | --- | | `Mathlib/Data/ENat/Monoid.lean` | `ENat.add_one_pos` → `add_pos_of_right` | | `Mathlib/Algebra/Ring/Subsemiring/Basic.lean` | `closureCommSemiringOfComm` → `isMulCommutative_closure` | | `Mathlib/Algebra/Ring/Subring/Basic.lean` | `closureCommRingOfComm` → `isMulCommutative_closure` | | `Mathlib/Algebra/Algebra/NonUnitalSubalgebra.lean` | `adjoinNonUnitalCommSemiringOfComm` → `isMulCommutative_adjoin` | | `Mathlib/Algebra/Star/NonUnitalSubalgebra.lean` | `adjoinNonUnitalCommSemiringOfComm` → `isMulCommutative_adjoin` | | `Mathlib/Algebra/Algebra/Subalgebra/Lattice.lean` | `adjoinCommSemiringOfComm`, `adjoinCommRingOfComm` → `isMulCommutative_adjoin` | | `Mathlib/Algebra/Star/Subalgebra.lean` | `adjoinCommSemiringOfComm`, `adjoinCommRingOfComm` → `isMulCommutative_adjoin` | | `Mathlib/RingTheory/PowerSeries/Derivative.lean` | `derivativeFun` → `derivative` | All ten are the intended kind of type change (an `abbrev` producing a `CommSemiring`/`CommRing` instance deprecated towards the `IsMulCommutative` lemma; a plain function deprecated towards a `Derivation`), so the markers are re-added verbatim. `NonUnitalSubalgebra.lean` shows 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_*` to `Ideal.IsIntegral.under_*` (mathlib, `since := "2026-09-03"`). The older `Ideal.IsIntegralClosure.*` and `Ideal.IntegralClosure.*` aliases in `Mathlib/RingTheory/Ideal/GoingUp.lean` still pointed at the `comap_*` names, which are now themselves deprecated — the case `linter.deprecated.deprecatedTarget` reports: ``` warning: Mathlib/RingTheory/Ideal/GoingUp.lean:245:2: `Ideal.IsIntegral.comap_lt_comap` is itself deprecated in favor of `Ideal.IsIntegral.under_lt_under`; consider deprecating `Ideal.IsIntegralClosure.comap_le_comap` in favor of `Ideal.IsIntegral.under_lt_under` instead ``` Retargeted all eight at the final names, which is the linter's own suggestion. An `alias` has the type of its target and these are aliases of aliases, so no statement changes and no `+typeChanged` becomes necessary. ## Verified `mathlib4` locally, with the run's artifact cache restored: * `lake build Mathlib Archive Counterexamples Wanted --wfail` — 9043 jobs, no warnings * `lake test --iofail` * `lake lint` (`batteries/runLinter Mathlib`) ## Not in this PR `cslib` is the run's other red repo, and it was only skipped behind `mathlib4`. Its own failure — two instance-based deprecations in `Cslib/Foundations/Relation/Basic.lean` — is already fixed by #54, which still applies; both have to land for the run to go green. <!-- downstream-watch: unattended -->
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.
Adapts
cslibto two deprecations that thedownstream: update repo cslibmerge(ffe4553, the head of run 34142798876)
brought in. Supersedes #53, which carried one of these two hunks and has been made
CONFLICTINGby that same merge.cslib (noncritical,
--wfail --iofail)The merge added
in
Cslib/Foundations/Relation/Basic.lean, and moved the existing@[deprecated Relation.ReflGen.stdSymm]onReflGen.symmGen_symmout ofConfluence.leaninto that same file. In both cases the replacement is aStd.Refl/Std.Symminstance rather than the lemma it replaces, so sincelean4#14600 the deprecation linter reports a type mismatch:
cslibbuilds with--wfail, so both warnings are build failures. The typedifference is intended — callers are meant to go through
_root_.reflandStd.Symm.symm, which is also how the two lemmas are proved — so this marks bothwith
+typeChanged(syntax from lean4#14570).Because #53 fixed the
ReflGen.symmGen_symmsite at its old location inConfluence.lean, it no longer applies and this PR replaces it. TheMJoin.reflsite is new in this run.
Verified on
nightly-2026-09-06:lake build --wfail --iofail(3212 jobs),lake test --wfail --iofail(9094 jobs) andlake lintall pass forcslib. Thebuild/test/lint runs also had #50's one-line
rwahunk applied in the working copy,because without it the build stops at
Cslib.Computability.Languages.MyhillNerodebefore the later phases can run; the two changes are in different files and
independent. With this commit alone,
Cslib.Foundations.Relation.Basicbuilds cleanand
MyhillNerodeis the only remaining logged failure.Not fixed here — already covered by open PRs
cslib's other failure,Cslib.Computability.Languages.MyhillNerodeundermathlib's
rwaSuggestionlinter, is #50, stillMERGEABLEand still applying tothe current sources. Both it and this PR are needed for
cslibto build.reference-manual, the one critical repo in the red set, is #51, stillMERGEABLE. Its only logged failure in this run isManual.BuildTools.Lake.Configat exactly the six
Mismatched elaborated configuration outputsites that #51 fillsin for
lean4#15015's newprecompileImports/precompileLibraryfields. Nothingadded here.