Skip to content

chore(Algebra/Polynomial/Module): workaround for backward.inferInstanceAs#39011

Open
Vierkantor wants to merge 1 commit intoleanprover-community:masterfrom
Vierkantor:backward.inferInstanceAs-PolynomialModule
Open

chore(Algebra/Polynomial/Module): workaround for backward.inferInstanceAs#39011
Vierkantor wants to merge 1 commit intoleanprover-community:masterfrom
Vierkantor:backward.inferInstanceAs-PolynomialModule

Conversation

@Vierkantor
Copy link
Copy Markdown
Contributor

This PR, like #38990, works around a backward.inferInstanceAs compatibility flag introduced by identifying PolynomialModule with Finsupp in our definitions. We introduce a new dsimp lemma funLike_eq that transfers the FunLike instances, and now we can use PolynomialModule's FunLike instance, instead of the custom CoeFun instance.

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 PolynomialModule and Finsupp, which would mean a substantial rewrite of this corner of Mathlib. We can't make PolynomialModule an @[implicit_reducible], because we need different multiplication on it than Finsupp has.


Open in Gitpod

…ceAs

This PR, like leanprover-community#38990, works around a `backward.inferInstanceAs` compatibility flag introduced by identifying `PolynomialModule` with `Finsupp` in our definitions. We introduce a new dsimp lemma `funLike_eq` that transfers the `FunLike` instances, and now we can use `PolynomialModule`'s `FunLike` instance, instead of the custom `CoeFun` instance.

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 `PolynomialModule` and `Finsupp`, which would mean a substantial rewrite of this corner of Mathlib. We can't make `PolynomialModule` an `@[implicit_reducible]`, because we need different multiplication on it than `Finsupp` has.
@Vierkantor Vierkantor added the tech debt Tracking cross-cutting technical debt, see e.g. the "Technical debt counters" stream on zulip label May 6, 2026
@github-actions github-actions Bot added the t-algebra Algebra (groups, rings, fields, etc) label May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

PR summary 8885ca9642

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.

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) 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