feat(LinearAlgebra/Matrix/Reindex): AddEquiv and RingEquiv#39106
feat(LinearAlgebra/Matrix/Reindex): AddEquiv and RingEquiv#39106SnirBroshi wants to merge 1 commit intoleanprover-community:masterfrom
AddEquiv and RingEquiv#39106Conversation
PR summary 043e9e0413Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| variable [Add R] | ||
|
|
||
| /-- `Matrix.reindex` as an `AddEquiv` between `R`-matrices. -/ | ||
| @[simps!] |
There was a problem hiding this comment.
For the other reindex equivs we seem to write this manually; does it produce a matching lemma?
There was a problem hiding this comment.
The generated *_apply lemmas match modulo simpNF (the RHS of reindexLinearEquiv_apply/reindexAlgEquiv_apply isn't simpNF because of reindex_apply, not sure why the linter allows them).
simps also generates *_symm_apply lemmas which look good, but it doesn't generate unapplied *_symm lemmas like the other equivs have, nor Equiv.refl/Equiv.trans lemmas which look nice.
Although everyone is missing a DFunLike.coe lemma (including reindex itself), which might fix everything.
wdyt?
There was a problem hiding this comment.
The RHS doesn't need to be in simpNF form. If foo_apply simplifies to _ = reindex, then it'll end also end up simplifying further using the reindex API.
I like the *_symm lemmas being a simp more than *_symm_apply. You can have both though, if you want?
Please also add *_symm lemmas, and Equiv.refl, and the rest.
|
|
||
| /-- `Matrix.reindex` as an `AddEquiv` between `R`-matrices. -/ | ||
| @[simps!] | ||
| def reindexAddEquiv (eₘ : m ≃ m') (eₙ : n ≃ n') : Matrix m n R ≃+ Matrix m' n' R where |
There was a problem hiding this comment.
there's also toEquiv_reindexAddEquiv that's missing. And same with the rest, (i.e., toAddEquiv_reindexRingEquiv, etc)
We had
Matrix.reindexbundled as aLinearEquivand anAlgEquiv,and this bundles it as an
AddEquivand aRingEquiv.