Forward-port to Lean/mathlib v4.31.0#1
Merged
Merged
Conversation
lean-toolchain v4.29.0 -> v4.31.0; mathlib and doc-gen4 requires bumped to v4.31.0, with the source migration across the Foundation library (133 files). sorry/admit baseline unchanged (27, all pre-existing upstream). doc-gen4 pinned to its v4.31.0 tag (upstream tracked `main`); flip back to `main` if preferred. Mechanical port produced with Claude Code; not yet human-reviewed. Porting cheat sheet: https://github.com/gotrevor/mathlib-bump-cookbook/blob/main/v4.29.1-to-v4.31.0.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
72f1e97 to
e6f6001
Compare
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.
Forward-ports Foundation to Lean/mathlib v4.31.0 (from v4.29.0).
What changed
lean-toolchain:v4.29.0→v4.31.0mathlibrequire →v4.31.0;doc-gen4require →v4.31.0tag (upstream trackedmain— flip back if preferred)Foundation/*.leanfiles for the v4.29 → v4.31 API changesinstancedeclarations demoted todef/lemma(e.g. theSound/Completeinstances,buildAxioms.instHasJ*,instRooted,isTree,set_nonempty,set_countable). These were non-synthesizable (explicit non-class hypotheses like(hV : C ⊧* Ax),(ha : a ≠ M.root)) or non-class heads (Set.Nonempty/Set.Countableare Props, not classes), which v4.31's stricter instance check now rejects. None were firing in typeclass resolution, so the demotion is behavior-preserving — flagged here soinstance→defin a mechanical port isn't surprising.Faithfulness
sorry/admitbaseline unchanged at 27, all pre-existing upstream (the heaviest files —ProvabilityLogic/Classification/Result.lean(9) andModal/Maximal/Makinson.lean(6) — match upstreammasterexactly). Zero new holes introduced by the port.Known follow-up — mathlib v4.31 deprecations
The build is green, but emits deprecation warnings (no
sorry, no errors — pure hygiene). The port leans on still-working-but-deprecated mathlib API in a few spots. These are deliberately left for a focused follow-up PR to keep this bump minimal and reviewable. Inventory: 122 warning lines → 22 distinct symbols.Reflexive/Irreflexive/Symmetric/AntiSymmetric→Std.Refl/Std.Irrefl/Std.Symm/Std.Antisymm;IsRefl/IsIrrefl/IsAsymm/IsAntisymm/IsTotal/IsTrichotomous→Std.*; plusSet.diff_subset→Set.sdiff_subset,Set.Infinite.diff→Set.Infinite.sdiff,Set.insert_diff_singleton→Set.insert_sdiff_singleton,List.max?_eq_some_iff'→List.max?_eq_some_iff,WellFounded.isIrrefl→WellFounded.irrefl,_root_.not_imp→Classical.not_imp, and 3 deprecated module-imports (Mathlib.Data.Finite.Card,Mathlib.Data.Nat.Lattice,Mathlib.Logic.IsEmpty).Transitive→IsTrans _(add the type placeholder),Nat.lt_succ→Nat.lt_succ_iff(confirm same statement),Std.Irrefl.swap→inferInstance(structural, not a rename).Provenance⚠️
This is a mechanical port produced with Claude Code, not yet human-reviewed. The tactic-level substitutions (
using!,grind→simp, etc.) are written up here: https://github.com/gotrevor/mathlib-bump-cookbook/blob/main/v4.29.1-to-v4.31.0.md — treat it as a starting point, not vetted work.This PR targets the fork's own
masterpurely so CI can verify the build; it carries only the Lean + lockfile changes (the migration handoff notes live separately on themathlib-v4.31branch).