Skip to content

chore(Algebra/DirectSum): workaround for backward.inferInstanceAs#38990

Open
Vierkantor wants to merge 2 commits intoleanprover-community:masterfrom
Vierkantor:backward-inferInstance-directSum
Open

chore(Algebra/DirectSum): workaround for backward.inferInstanceAs#38990
Vierkantor wants to merge 2 commits intoleanprover-community:masterfrom
Vierkantor:backward-inferInstance-directSum

Conversation

@Vierkantor
Copy link
Copy Markdown
Contributor

This PR works around a backward.inferInstanceAs compatibility flag introduced by identifying DirectSum with DFinsupp in our definitions. We introduce a new dsimp lemma funLike_eq that transfers the FunLike instances, and now we can use DirectSum's FunLike instance, instead of the custom CoeFun instance. I unsqueezed a few simps, which all ran pretty much instant on my machine so it shouldn't cause much slowdown. Also we fix two porting notes.

This is not a great approach, but it seems the least painful for the short term. The alternative would be to strictly enforce the defeq barrier between DirectSum and DFinsupp, which would mean a substantial rewrite of this corner of Mathlib. We can't make DirectSum an @[implicit_reducible], because we need different multiplication on it than DFinsupp has.


Open in Gitpod

This PR fixes a `backward.inferInstanceAs` compatibility flag introduced by identifying `DirectSum` with `DFinsupp` in our definitions. We introduce a new dsimp lemma `funLike_eq` that transfers the `FunLike` instances, and now we can use `DirectSum`'s `FunLike` instance, instead of the custom `CoeFun` instance. I unsqueezed a few `simp`s, which all ran pretty much instant on my machine so it shouldn't cause much slowdown. Also we fix two porting notes.
@Vierkantor Vierkantor added t-algebra Algebra (groups, rings, fields, etc) tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip labels May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

PR summary 26fdeaa70a

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff

+ funLike_eq

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.


No changes to strong technical debt.
No changes to weak technical debt.

@github-actions github-actions Bot added the t-ring-theory Ring theory label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-algebra Algebra (groups, rings, fields, etc) t-ring-theory Ring theory tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant