Repository navigation
fix: cslib breakage from the mathlib4 merge making Set a one-field structure - #166
Closed
downstream-lean4[bot] wants to merge 1 commit into
Closed
downstream-lean4[bot] wants to merge 1 commit into
downstream-lean4[bot] wants to merge 1 commit into
Conversation
…structure
`downstream: update repo mathlib4` brought in mathlib4#41506, which replaces
`def Set (α : Type u) := α → Prop` by a one-field structure. Ten cslib modules relied
on the lost definitional equality:
- `Languages.Language`: `Set.mem_of_mem_inter_left` / `mem_preimage.mp` no longer unify
against `_ ∈ l - 1`; use `mem_sub_one` directly.
- `Combinatorics.InfiniteGraphRamsey`: `biInter_subset_of_mem` can no longer infer
`s` from `m < n`; pass `s := {m | m < n}`.
- `MachineLearning.PACLearning.Defs`: `Nat.sInf_mem` can no longer infer the set from
`∃ m, …`; pass it.
- `Data.OmegaSequence.Topology`: `convert` now descends into the `Set` structure, so it
hands back an `Iff` the following `ext` cannot use; stop it with `using 1`.
- `StatefulProcesses.DiffieHellman.Basic`: `fun μs => …` is not a `Set`; use set-builder.
- `LinearLogic.CLL.PhaseSemantics.Basic`: `imp G H p` is no longer an application;
write `p ∈ imp (G : Set P) (H : Set P)`.
- `Modal.Denotation`: `grind` no longer gets from `theory m w₁ = theory m w₂` to
pointwise membership; `rw [TheoryEq.ext_iff]` first.
- `Modal.Lean.Basic`: `ofSets f = ofPredicates f` no longer typechecks — the two models
have different atom types. Restated at valuation level as
`ofSets_v_eq_ofPredicates_v`, with an `#adaptation_note`.
- `Automata.NA.BuchiEquiv`: the `frequently_principal` golf relied on `nba.Run xs` being
usable as a `Set`; give the witness directly.
- `Automata.NA.Concat`: the `if [] ∈ language na1` in `concat`'s `start` is now genuinely
compiled, so `concat` and `finConcat` become `noncomputable`.
Verified locally on nightly-2026-10-13: cslib `lake build --wfail --iofail`,
`lake test --wfail --iofail` and `lake lint` all pass (with downstream-lean4#161 and
downstream-lean4#158 applied, which this PR does not include).
Co-Authored-By: Claude Opus 5 <[email protected]>
Contributor
Author
Build report for fix: cslib breakage from the mathlib4 merge making
|
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| aesop | ✅ | 🛑 by batteries | ⏭️ | ⏭️ |
| batteries | ✅ | 🟥 in 0s | ⏭️ | ⏭️ |
| mathlib4 | ✅ | 🛑 by batteries | ⏭️ | ⏭️ |
| cslib | 🛑 by batteries | ⏭️ | ⏭️ | |
| repl | ✅ in 0s | 🟥 in 14m 53s | ⏭️ |
Stayed green
| Repo | Critical | Build | Test | Lint |
|---|---|---|---|---|
| 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 43s | ⏭️ | ⏭️ |
| BibtexQuery | ✅ in 3s | ⏭️ | ⏭️ | |
| comparator | ✅ in 2s | ⏭️ | ⏭️ | |
| doc-gen4 | ✅ in 7s | ⏭️ | ⏭️ | |
| illuminate | ✅ in 1s | ✅ in 9s | ⏭️ | |
| lean4-unicode-basic | ✅ in 0s | ⏭️ | ⏭️ | |
| lean4export | ✅ in 0s | ✅ in 6s | ⏭️ | |
| LeanSearchClient | ✅ in 0s | ✅ in 0s | ⏭️ | |
| leansqlite | ✅ in 7s | ✅ in 16s | ⏭️ | |
| nerodia | ✅ in 1s | ✅ in 21s | ⏭️ | |
| verso | ✅ in 1m 18s | ✅ in 3m 13s | ⏭️ | |
| verso-slides | ✅ in 15s | ✅ in 8s | ⏭️ | |
| verso-web-components | ✅ in 6s | ⏭️ | ⏭️ |
Kha
pushed a commit
that referenced
this pull request
Oct 14, 2026
`master` bumped to `nightly-2026-10-14` in ac06c20, and the `Build subrepos` runs for that commit and for the `#15581` merge on top of it were both cancelled before any step ran — so no CI run has ever looked at the new nightly. Built locally instead, and `reference-manual` (critical) is the one repo the bump breaks. ## reference-manual lean4#15630 added `--add-downstream` and `--add-public-downstream` to `lake shake`. `Manual/BuildTools/Lake/CLI.lean` checks the `lake shake --help` output verbatim, so `Manual.BuildTools.Lake.CLI` now fails with ``Mismatched `lake --help` output``. The two options are inserted into the `lakeHelp shake` block, copied from the nightly's own `lake shake --help`, and added to the prose option list below it, which enumerates every option of the subcommand. **Verified:** `lake build` passes (1583 jobs). reference-manual defines neither a test nor a lint driver, so that is its full matrix. ## State of the rest of `master` on `nightly-2026-10-14` Everything else in `repos.toml` was built locally at 81b76e9 — all 22 repos, every phase its lakefile defines: * **Green:** aesop, batteries, BibtexQuery, doc-gen4, illuminate, import-graph, lean4-cli, lean4-unicode-basic, lean4export, LeanSearchClient, leansqlite, mathlib4 (all five build targets with `--wfail`, `test --iofail`, `lint`), plausible, ProofWidgets4, quote4, repl, verso, verso-slides, verso-web-components. * **cslib** is still red for the reason given in #166 (mathlib4#41506 making `Set` a one-field structure); that PR applies cleanly to 81b76e9 and was re-verified on this nightly — `build --wfail --iofail`, `test --wfail --iofail` and `lint` all pass with it. Not duplicated here. * **nerodia** fails only on this machine: its `pyconfig` step wants Python 3.14+ and the box has 3.13.15. Green in CI. Two earlier unattended PRs are obsolete as of this nightly and have been closed: * #161 (batteries `extract_lets`) — lean4#15655 reverted the realization-export change that caused it. batteries now builds green without the patch, and *with* it the added `dsimp -zeta only` fails as "`dsimp` made no progress", so merging it would re-break the repo. * #158 (ProofWidgets4 `Jsx` deprecation) — the `downstream: update repo mathlib4` merge in 68af6a9 migrated mathlib4 to `jsx%{…}` literals, leaving the deprecated syntax with no users in the tree. mathlib4 and ProofWidgets4 both build green with the `deprecated_syntax` line in place. <!-- downstream-watch: unattended --> Co-authored-by: downstream-lean4[bot] <downstream-lean4[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <[email protected]>
Contributor
Author
|
Superseded: upstream cslib#1134 — the same adaptation to Mathlib's |
Kha
pushed a commit
that referenced
this pull request
Oct 16, 2026
`master` went red with the bump to `nightly-2026-10-16` ([run 38888679712](https://github.com/leanprover/downstream-lean4/actions/runs/38888679712)): `mathlib4` fails to build, and `cslib` (skipped behind it) and `repl` (its test phase compiles Mathlib) fall over with it. One repo needed a change. ## mathlib4 lean4#15317 (*feat: add `Bool.dand` and `Ordering.dthen` along with more lemmas*, Robin Arnez) moved `Ordering.dthen` into core, so `Mathlib/Data/Ordering/Basic.lean:37` fails with ``` error: Mathlib/Data/Ordering/Basic.lean:37:20: `Ordering.dthen` has already been declared ``` 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. 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`. Upstream `mathlib4-nightly-testing` is still on `nightly-2026-10-15` and still carries both declarations, so it will need the same deletion when it bumps. ## Verified locally on `16428f35` | repo | build | test | lint | | --- | --- | --- | --- | | mathlib4 | `Mathlib Archive Counterexamples Wanted cache --wfail`, 18440 jobs, 0 errors, 0 warnings | `lake test --iofail`, 18962 jobs | `Linting passed for Mathlib.` | | cslib | `--wfail --iofail`, 6690 jobs, 0 warnings | `--wfail --iofail`, 18727 jobs | `Linting passed for Cslib.` | | repl | `lake build` | `lake test` — all cases PASSED, including the `test/Mathlib` batch | (no driver) | `cslib` and `repl` are green **unpatched** on this master; they only needed `mathlib4` to build. In particular `cslib`'s own breakage from the `Set`-as-structure change is gone from `master`: upstream [cslib#1134](leanprover/cslib#1134) merged on 2026-10-14 and the bot brought it in, which is why `cslib` was fully green in [run 38840386618](https://github.com/leanprover/downstream-lean4/actions/runs/38840386618). #166 is superseded and is being closed. Nothing was left unfinished. <!-- downstream-watch: unattended --> Co-authored-by: downstream-lean4[bot] <downstream-lean4[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <[email protected]>
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.
masterhas been red since run38385302531 on
batteries, andcslibis skipped behind it — so thedownstream: update repo mathlib4merge in
cddb5d55landed withoutcslibever being built. It brings inmathlib4#41506, which
replaces
def Set (α : Type u) := α → Propby a one-field structure. Tencslibmodulesrelied on the lost definitional equality.
cslib
Computability.Languages.LanguageSet.mem_of_mem_inter_leftandmem_preimage.mpno longer unify against_ ∈ l - 1mem_sub_oneFoundations.Combinatorics.InfiniteGraphRamseybiInter_subset_of_memcan no longer readsoffm < ns := {m | m < n}MachineLearning.PACLearning.DefsNat.sInf_memcan no longer read the set off∃ m, …Foundations.Data.OmegaSequence.Topologyconvertnow descends into theSetstructure and hands back anIff, which the followingextcannot useusing 1Algorithms.StatefulProcesses.DiffieHellman.Basicfun μs => …is no longer aSetLogics.LinearLogic.CLL.PhaseSemantics.Basicimp G H pis no longer a function applicationp ∈ imp (G : Set P) (H : Set P)Logics.Modal.Denotationgrindno longer gets fromtheory m w₁ = theory m w₂to pointwise membershiprw [TheoryEq.ext_iff]firstLogics.Modal.Lean.BasicofSets f = ofPredicates fno longer typechecks:Model α τ (Set α)andModel α τ (α → Prop)are now different typesofSets_v_eq_ofPredicates_v, with an#adaptation_noteComputability.Automata.NA.BuchiEquivfrequently_principalgolf relied onnba.Run xsbeing usable as aSetComputability.Automata.NA.Concatconcat'sstartcontainsif [] ∈ language na1, which is now genuinely compiled and needsClassical.propDecidableconcatandfinConcatbecomenoncomputableThe only API change is
ofSets_eq_ofPredicates→ofSets_v_eq_ofPredicates_v: the oldstatement cannot be restated, because the set model and the predicate model no longer
even have the same type.
Verification
On
nightly-2026-10-13, with#161 (batteries) and
#158 (ProofWidgets4) applied —
without them
batteriesdoes not build at all, and this PR deliberately does notduplicate them:
cslib:lake build --wfail --iofail,lake test --wfail --iofail,lake lint— all pass.masterthat the rest of the red set is covered by those twoPRs:
batteriesbuild/test/lint,aesopbuild/test,ProofWidgets4build/test,mathlib4build (--wfail, all five targets) / test (--iofail) / lint, andreplbuild/test all pass. The
mathlib4merge was built from source, not replayed.So
masterneeds #161, #158 and this PR to go green; none of the three subsumes another.