Skip to content

Sync upstream mathlib4 (2026-07-27, +5 commits) - #86

Merged
winstonyin-ax merged 6 commits into
masterfrom
sync/upstream
Jul 27, 2026
Merged

winstonyin-ax merged 6 commits into
masterfrom
sync/upstream

Conversation

@winstonyin-ax

@winstonyin-ax winstonyin-ax commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Automated daily sync from leanprover-community/mathlib4@master.

Auto-merges to master once CI (self-hosted) passes. Regenerated
daily until merged or until a conflict appears.


Note

Low Risk
Mostly attribute, documentation, and new API alongside tests; no auth or runtime infrastructure changes. The monomial withBotDegree block is large but additive library surface.

Overview
Upstream mathlib4 sync (5 commits) adapting to Lean 4.31 definitional-equality behavior: many category-theory defs and key equivalences now carry @[implicit_reducible] so @[simps] lemmas stay on @[defeq] for dsimp, with related backward.* set_options removed where no longer needed. Adds MathlibTest/CategoryTheory/CheckDsimp.lean to guard important simp/defeq tags.

Monomial orders: MonomialOrder.toWithBotSyn and scoped ≼'[m] / ≺'[m] on WithBot (σ →₀ ℕ); MonomialOrder.withBotDegree on MvPolynomial (degree for zero, parallel to natDegree vs degree).

Smaller fixes: CommShift₂ precomposition uses CommShift.comp instead of inferInstanceAs; Yoneda/shrinkYoneda/coyoneda lemma tweaks (dsimp%, proof fixes); to_additive docstrings via docComment only (drops deprecated str syntax); doc typo on projective preservation vs epimorphisms.

Reviewed by Cursor Bugbot for commit c51e170. Bugbot is set up for automated code reviews on this repo. Configure here.

felixpernegger and others added 6 commits July 26, 2026 16:16
…42084)

Apparently giving the proof explicitly allows us to remove the backward.inferInstanceAs.wrap`. Note that avoiding the defeq abuse by first doing `dsimp` still does not work (and interesting replacing the `:=` with `:= by exact` does not work as well).

This removes the [last]([#mathlib4 > Technical Debt Counters @ 💬](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Technical.20Debt.20Counters/near/611588552)) `backward.inferInstanceAs.wrap` exception from the technical debt counter.

The solution was found with GPT 5.6 Sol high (fairly quickly)

Co-authored-by: Batixx <s59fpern@uni-bonn.de>
A test file is added to ensure that certain "dsimplifying" equalites in category theory are tagged with `@[defeq]` instead of `@[backward_defeq]`, so that `dsimp` can use them without `set_option backward.defeqAttrib.useBackward true`.

To turn a `@[backward_defeq]` into a `@[defeq]`, definitions need to be made `implicit_reducible`. Now that `instance_reducible` is split off `implicit_reducible`, it is much safer to tag many declarations. There is still a ton of declarations that should be tagged, and I did not remove all `set_options` after this tagging (this should be an automated process), but we can already clear some.
…ing"]` syntax (#41886)

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
…egree of `0` (#34759)

`withBotDegree` is to distinguish the degree of zero polynomial from the degree of non-zero constant polynomial. `MonomialOrder.degree` of both are 0, while `withBotDegree` is `⊥` for zero polynomial and 0 for non-zero constant polynomial.

Some lemmas, such as $\mathrm{degree} (p * q) = \mathrm{degree}(p) + \mathrm{degree}(q)$, hold on edge cases where $p=0$ or $q=0$ under `MonomialOrder.withBotDegree` but not `MonomialOrder.degree`.

`MonomialOrder.withBotDegree` is to `MonomialOrder.degree` as `Polynomial.degree` is to `Polynomial.natDegree`.

It's upstreamized from https://github.com/WuProver/groebner_proj.
…isms (#42065)

Correct docstring about preservation of epimorphisms.
@winstonyin-ax
winstonyin-ax merged commit 9a57711 into master Jul 27, 2026
4 checks passed
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.

6 participants