chore(Algebra/DirectSum): workaround for backward.inferInstanceAs#38990
Open
Vierkantor wants to merge 2 commits intoleanprover-community:masterfrom
Open
chore(Algebra/DirectSum): workaround for backward.inferInstanceAs#38990Vierkantor wants to merge 2 commits intoleanprover-community:masterfrom
backward.inferInstanceAs#38990Vierkantor wants to merge 2 commits intoleanprover-community:masterfrom
Conversation
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.
PR summary 26fdeaa70aImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
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.
This PR works around a
backward.inferInstanceAscompatibility flag introduced by identifyingDirectSumwithDFinsuppin our definitions. We introduce a new dsimp lemmafunLike_eqthat transfers theFunLikeinstances, and now we can useDirectSum'sFunLikeinstance, instead of the customCoeFuninstance. I unsqueezed a fewsimps, 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
DirectSumandDFinsupp, which would mean a substantial rewrite of this corner of Mathlib. We can't makeDirectSuman@[implicit_reducible], because we need different multiplication on it thanDFinsupphas.