Skip to content

fix: cslib +typeChanged on two instance-based deprecations - #54

Merged
Kha merged 1 commit into
masterfrom
push-xluttxsowntv
Sep 8, 2026
Merged

fix: cslib +typeChanged on two instance-based deprecations#54
Kha merged 1 commit into
masterfrom
push-xluttxsowntv

Conversation

@Kha

@Kha Kha commented Sep 7, 2026

Copy link
Copy Markdown
Member

Adapts cslib to two deprecations that the downstream: update repo cslib merge
(ffe4553, the head of run 34142798876)
brought in. Supersedes #53, which carried one of these two hunks and has been made
CONFLICTING by that same merge.

cslib (noncritical, --wfail --iofail)

The merge added

@[deprecated _root_.refl (since := "2026-09-07")]
theorem MJoin.refl (a : α) : MJoin r a a := _root_.refl a

in Cslib/Foundations/Relation/Basic.lean, and moved the existing
@[deprecated Relation.ReflGen.stdSymm] on ReflGen.symmGen_symm out of
Confluence.lean into that same file. In both cases the replacement is a
Std.Refl/Std.Symm instance rather than the lemma it replaces, so since
lean4#14600 the deprecation linter reports a type mismatch:

warning: Cslib/Foundations/Relation/Basic.lean:60:2: The updated constant has a different type:
  ∀ {α : Sort u_1} {r : α → α → Prop} [Std.Refl r] (a : α), r a a
instead of
  ∀ {α : Type u_1} {r : α → α → Prop} (a : α), MJoin r a a

cslib builds with --wfail, so both warnings are build failures. The type
difference is intended — callers are meant to go through _root_.refl and
Std.Symm.symm, which is also how the two lemmas are proved — so this marks both
with +typeChanged (syntax from lean4#14570).

Because #53 fixed the ReflGen.symmGen_symm site at its old location in
Confluence.lean, it no longer applies and this PR replaces it. The MJoin.refl
site is new in this run.

Verified on nightly-2026-09-06: lake build --wfail --iofail (3212 jobs),
lake test --wfail --iofail (9094 jobs) and lake lint all pass for cslib. The
build/test/lint runs also had #50's one-line rwa hunk applied in the working copy,
because without it the build stops at Cslib.Computability.Languages.MyhillNerode
before the later phases can run; the two changes are in different files and
independent. With this commit alone, Cslib.Foundations.Relation.Basic builds clean
and MyhillNerode is the only remaining logged failure.

Not fixed here — already covered by open PRs

cslib's other failure, Cslib.Computability.Languages.MyhillNerode under
mathlib's rwaSuggestion linter, is #50, still MERGEABLE and still applying to
the current sources. Both it and this PR are needed for cslib to build.

reference-manual, the one critical repo in the red set, is #51, still
MERGEABLE. Its only logged failure in this run is Manual.BuildTools.Lake.Config
at exactly the six Mismatched elaborated configuration output sites that #51 fills
in for lean4#15015's new precompileImports / precompileLibrary fields. Nothing
added here.

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).
@downstream-lean4

Copy link
Copy Markdown
Contributor

Build report for fix: cslib +typeChanged on two instance-based deprecations

Stayed red
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 ⏭️ ⏭️

View run

@Kha
Kha merged commit 5d3523a into master Sep 8, 2026
21 of 24 checks passed
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 -->
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