Skip to content

Forward-port to Lean/mathlib v4.31.0#830

Merged
SnO2WMaN merged 1 commit into
FormalizedFormalLogic:masterfrom
gotrevor:upstream-v4.31
Jul 2, 2026
Merged

Forward-port to Lean/mathlib v4.31.0#830
SnO2WMaN merged 1 commit into
FormalizedFormalLogic:masterfrom
gotrevor:upstream-v4.31

Conversation

@gotrevor

@gotrevor gotrevor commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Forward-ports the library from Lean/mathlib v4.29.0 → v4.31.0, on top of current master (c089e7ab, which already includes the #794 FirstOrder redesign and #829 ProvabilityLogic removal).

Authorship: this port was written by Claude (Anthropic's Claude Code), driven by @gotrevor. It is AI-generated work — please review accordingly.

What changed

  • Config bump: lean-toolchain, lakefile.toml (mathlib + doc-gen4 → v4.31.0), lake-manifest.json regenerated.
  • Foundation.lean: regenerated via lake exe mk_all --module (v4.31 module-system header).
  • Source changes to build green on v4.31.0 (recurring patterns below).

Verification

  • Whole library builds green: 1730/1730 targets.
  • Audit vs the base commit: no files added/removed/renamed, no declaration dropped, no new axiom/sorry/admit. The only additions are 5 small proved helpers/compat-shims; several instances became def/lemma (same names) under v4.31's stricter instance checker.

Recurring change patterns

  • simpa … using esimpa … using! e — v4.31 tightened simpa's final match to reducible transparency; using! opts back into semireducible, so goals that hold only up to unfolding a semireducible def still close.
  • coe_injective'coe_injective (mathlib FunLike/SetLike field rename).
  • zero_le aArithmetic.zero_le a (mathlib's zero_le now shadows the protected lemma).
  • instancelemma/def where v4.31's instance checker rejects a non-typeclass return type or an uninferable hypothesis.
  • Function.comp_def added to simp sets; Nat.testBit / Nat.bitIndices API update in Proof/Coding.

Related work

  • Port to Lean 4.31 #828 by @lividgreen is a parallel v4.31 port (also AI-assisted), cut against an earlier master. For the operator-eval lemmas it unfolds via explicit simp lemmas (e.g. Semiterm.Operator.val) rather than using!.

🤖 Generated with Claude Code

Forward-ports the library from Lean/mathlib v4.29.0 to v4.31.0 on top of
current master (which already includes the FormalizedFormalLogic#794 FirstOrder redesign and the
FormalizedFormalLogic#829 ProvabilityLogic removal).

- Config bump: lean-toolchain, lakefile.toml (mathlib + doc-gen4 pinned to
  v4.31.0), lake-manifest.json regenerated.
- Source changes to build green on v4.31.0.

Whole library builds green (1730/1730 targets). No new proof holes: the
sorry/admit count is unchanged versus the base commit.

Recurring change patterns:
- `simpa … using X` -> `simpa … using! X` (v4.31 needs the defeq-close hatch
  where the elaborated term is defeq but not syntactically equal to the goal).
- `coe_injective'` -> `coe_injective` on mathlib FunLike/SetLike instance
  bodies (field renamed upstream).
- Bare `zero_le a` -> `Arithmetic.zero_le a` across the arithmetic tree
  (mathlib's `zero_le` now shadows the protected Foundation lemma).
- `instance` -> `lemma`/`def` where v4.31's stricter instance checker rejects
  a non-typeclass return type (`.Nonempty`, `.Countable`) or a hypothesis it
  cannot infer.
- `Function.comp_def` added to simp sets for `f ∘ v` vs pointwise mismatches.
- `Nat.testBit` / `Nat.bitIndices` API update in Proof/Coding.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gotrevor gotrevor mentioned this pull request Jul 2, 2026
@SnO2WMaN SnO2WMaN enabled auto-merge (squash) July 2, 2026 22:11
@SnO2WMaN SnO2WMaN merged commit 387f915 into FormalizedFormalLogic:master Jul 2, 2026
4 checks passed
SnO2WMaN added a commit that referenced this pull request Jul 2, 2026
Resolve modify/delete conflicts (from #830 v4.31.0 forward-port and later
master commits) in favor of removing InterpretabilityLogic: keep the whole
Foundation/InterpretabilityLogic tree deleted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QDE3PcJrxn8nz7V5hJTbjH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants