Repository navigation
[Merged by Bors] - feat: MulActionHom in the semilinear style - #6057
Closed
AntoineChambert-Loir wants to merge 260 commits into
Closed
AntoineChambert-Loir wants to merge 260 commits into
AntoineChambert-Loir wants to merge 260 commits into
Conversation
AntoineChambert-Loir
marked this pull request as draft
July 22, 2023 21:23
AntoineChambert-Loir
marked this pull request as ready for review
July 22, 2023 21:23
Collaborator
Author
|
I need some advice here :
|
AntoineChambert-Loir
requested review from
Vierkantor
and removed request for
Vierkantor
July 29, 2023 14:16
Vierkantor
reviewed
Jul 31, 2023
added 20 commits
August 15, 2023 08:51
jcommelin
reviewed
Apr 2, 2024
| map_smulₛₗ _ _ _ | ||
| #align non_unital_alg_hom.map_smul NonUnitalAlgHom.map_smul | ||
|
|
||
| -- @[simp] -- Porting note (#10618): simp can prove this |
Member
There was a problem hiding this comment.
Can you please restore all the (#10618)'s in these comments?
Collaborator
Author
There was a problem hiding this comment.
Done (I don't even remember having deleted it…)
jcommelin
reviewed
Apr 2, 2024
|
|
||
| variable {φ' : S →* R} {ψ : S →* T} {χ : R →* T} | ||
|
|
||
| set_option linter.unusedVariables false in |
Collaborator
Author
There was a problem hiding this comment.
Because of kappa, I believe, which is used implicitly in comp.
Member
|
!bench |
|
Here are the benchmark results for commit 41c8327. Benchmark Metric Change
==========================================================================
- ~Mathlib.Algebra.Algebra.NonUnitalHom instructions 60.4%
- ~Mathlib.Analysis.NormedSpace.HahnBanach.Extension instructions 20.6%
- ~Mathlib.GroupTheory.GroupAction.Hom instructions 43.8% |
mathlib-bors Bot
pushed a commit
that referenced
this pull request
Apr 3, 2024
…ilinearMap (#10758) This PR adds a coercion from any instance of `SemilinearMapClass` to `SemilinearMap`. This is the standard practice for other parts of the library, such as ring homs (see also the recent change #10368). I also expect this change will help with some rough edges in #6057. Previously, a coercion from `f : AlgHom` to `LinearMap` would look like `f.toNonUnitalAlgHom.toDistribMulActionHom.toLinearMap`, now it should look like `SemilinearMapClass.semilinearMap f`. The new coercion instances are `CoeHead` since the left hand side is a free variable `F`. I redefined the existing `DistribMulActionHom → LinearMap` coercion in terms of the `SemilinearMapClass` coercion to ensure we don't get any diamonds.
Collaborator
Author
|
!bench |
|
Here are the benchmark results for commit 8644410. Benchmark Metric Change
=======================================================================================
- ~Mathlib.Algebra.Algebra.NonUnitalHom instructions 60.4%
- ~Mathlib.Algebra.Module.PID instructions 6.3%
- ~Mathlib.Analysis.NormedSpace.HahnBanach.Extension instructions 22.9%
+ ~Mathlib.Analysis.NormedSpace.PiTensorProduct.InjectiveSeminorm instructions -6.2%
- ~Mathlib.GroupTheory.GroupAction.Hom instructions 43.8%
+ ~Mathlib.RepresentationTheory.GroupCohomology.Resolution instructions -3.9% |
Contributor
|
Thanks again for all your work on this @AntoineChambert-Loir ! bors merge |
mathlib-bors Bot
pushed a commit
that referenced
this pull request
Apr 5, 2024
Generalize `MulActionHom` so that it allows two different monoids acting, related by a morphism. This is inspired by the treatment of (semi)linear maps in mathlib, and allows to refactor them. Let `M`, `N`, `X`, `Y` be types, with `SMul M X` and `SMul N Y`, and let `φ : M → N` be a map. * `MulActionHom φ X Y`, the type of equivariant functions from `X` to `Y`, consists of functions `f : X → Y` such that `f (m • x) = (φ m) • (f x)` for all `m : M` and `x : X`. Assume that we have `Monoid M`, `Monoid N` and that `φ : M →* N`. For `A`, `B` by types with `AddMonoid A` and `AddMonoid B`, endowed with `DistribMulAction M A` and `DistribMulAction M B`: * `DistribMulActionHom φ A B` is the type of equivariant additive monoid homomorphisms from `A` to `B`. Similarly, when `R` and `S` are types with `Semiring R`, `Semiring S`, `MulSemiringAction M R` and `MulSemiringAction N S` * `SMulSemiringHom φ R S` is the type of equivariant ring homomorphisms from `R` to `S`. The above types have corresponding classes: * `MulActionHomClass F φ X Y` states that `F` is a type of bundled `X → Y` homs which are `φ`-equivariant * `DistribMulActionHomClass F φ A B` states that `F` is a type of bundled `A → B` homs preserving the additive monoid structure and `φ`-equivariant * `SMulSemiringHomClass F φ R S` states that `F` is a type of bundled `R → S` homs preserving the ring structure and `φ`-equivariant ## Notation We introduce the following notation to code equivariant maps (the subscript index `ₑ` is for *equivariant*) : * `X →ₑ[φ] Y` is `MulActionHom φ X Y`. * `A →ₑ+[φ] B` is `DistribMulActionHom φ A B`. * `R →ₑ+*[φ] S` is `MulSemiringActionHom φ R S`. When `M = N` and `φ = MonoidHom.id M`, we provide the backward compatible notation : * `X →[M] Y` is `MulActionHom (@id M) X Y` * `A →+[M] B` is `DistribMulActionHom (MonoidHom.id M) A B` * `R →+*[M] S` is `MulSemiringActionHom (MonoidHom.id M) R S` This more general definition is propagated all over mathlib, in particular to `LinearMap`. The treatment of composition of equivariant maps is inspired by that of semilinear maps. We provide classes `CompTriple` and `MonoidHom.CompTriple` of “composable triples`, and various instances for them.
Contributor
|
Pull request successfully merged into master. Build succeeded: |
xgenereux
pushed a commit
that referenced
this pull request
Apr 15, 2024
…ilinearMap (#10758) This PR adds a coercion from any instance of `SemilinearMapClass` to `SemilinearMap`. This is the standard practice for other parts of the library, such as ring homs (see also the recent change #10368). I also expect this change will help with some rough edges in #6057. Previously, a coercion from `f : AlgHom` to `LinearMap` would look like `f.toNonUnitalAlgHom.toDistribMulActionHom.toLinearMap`, now it should look like `SemilinearMapClass.semilinearMap f`. The new coercion instances are `CoeHead` since the left hand side is a free variable `F`. I redefined the existing `DistribMulActionHom → LinearMap` coercion in terms of the `SemilinearMapClass` coercion to ensure we don't get any diamonds.
xgenereux
pushed a commit
that referenced
this pull request
Apr 15, 2024
Generalize `MulActionHom` so that it allows two different monoids acting, related by a morphism. This is inspired by the treatment of (semi)linear maps in mathlib, and allows to refactor them. Let `M`, `N`, `X`, `Y` be types, with `SMul M X` and `SMul N Y`, and let `φ : M → N` be a map. * `MulActionHom φ X Y`, the type of equivariant functions from `X` to `Y`, consists of functions `f : X → Y` such that `f (m • x) = (φ m) • (f x)` for all `m : M` and `x : X`. Assume that we have `Monoid M`, `Monoid N` and that `φ : M →* N`. For `A`, `B` by types with `AddMonoid A` and `AddMonoid B`, endowed with `DistribMulAction M A` and `DistribMulAction M B`: * `DistribMulActionHom φ A B` is the type of equivariant additive monoid homomorphisms from `A` to `B`. Similarly, when `R` and `S` are types with `Semiring R`, `Semiring S`, `MulSemiringAction M R` and `MulSemiringAction N S` * `SMulSemiringHom φ R S` is the type of equivariant ring homomorphisms from `R` to `S`. The above types have corresponding classes: * `MulActionHomClass F φ X Y` states that `F` is a type of bundled `X → Y` homs which are `φ`-equivariant * `DistribMulActionHomClass F φ A B` states that `F` is a type of bundled `A → B` homs preserving the additive monoid structure and `φ`-equivariant * `SMulSemiringHomClass F φ R S` states that `F` is a type of bundled `R → S` homs preserving the ring structure and `φ`-equivariant ## Notation We introduce the following notation to code equivariant maps (the subscript index `ₑ` is for *equivariant*) : * `X →ₑ[φ] Y` is `MulActionHom φ X Y`. * `A →ₑ+[φ] B` is `DistribMulActionHom φ A B`. * `R →ₑ+*[φ] S` is `MulSemiringActionHom φ R S`. When `M = N` and `φ = MonoidHom.id M`, we provide the backward compatible notation : * `X →[M] Y` is `MulActionHom (@id M) X Y` * `A →+[M] B` is `DistribMulActionHom (MonoidHom.id M) A B` * `R →+*[M] S` is `MulSemiringActionHom (MonoidHom.id M) R S` This more general definition is propagated all over mathlib, in particular to `LinearMap`. The treatment of composition of equivariant maps is inspired by that of semilinear maps. We provide classes `CompTriple` and `MonoidHom.CompTriple` of “composable triples`, and various instances for them.
atarnoam
pushed a commit
that referenced
this pull request
Apr 16, 2024
…ilinearMap (#10758) This PR adds a coercion from any instance of `SemilinearMapClass` to `SemilinearMap`. This is the standard practice for other parts of the library, such as ring homs (see also the recent change #10368). I also expect this change will help with some rough edges in #6057. Previously, a coercion from `f : AlgHom` to `LinearMap` would look like `f.toNonUnitalAlgHom.toDistribMulActionHom.toLinearMap`, now it should look like `SemilinearMapClass.semilinearMap f`. The new coercion instances are `CoeHead` since the left hand side is a free variable `F`. I redefined the existing `DistribMulActionHom → LinearMap` coercion in terms of the `SemilinearMapClass` coercion to ensure we don't get any diamonds.
atarnoam
pushed a commit
that referenced
this pull request
Apr 16, 2024
Generalize `MulActionHom` so that it allows two different monoids acting, related by a morphism. This is inspired by the treatment of (semi)linear maps in mathlib, and allows to refactor them. Let `M`, `N`, `X`, `Y` be types, with `SMul M X` and `SMul N Y`, and let `φ : M → N` be a map. * `MulActionHom φ X Y`, the type of equivariant functions from `X` to `Y`, consists of functions `f : X → Y` such that `f (m • x) = (φ m) • (f x)` for all `m : M` and `x : X`. Assume that we have `Monoid M`, `Monoid N` and that `φ : M →* N`. For `A`, `B` by types with `AddMonoid A` and `AddMonoid B`, endowed with `DistribMulAction M A` and `DistribMulAction M B`: * `DistribMulActionHom φ A B` is the type of equivariant additive monoid homomorphisms from `A` to `B`. Similarly, when `R` and `S` are types with `Semiring R`, `Semiring S`, `MulSemiringAction M R` and `MulSemiringAction N S` * `SMulSemiringHom φ R S` is the type of equivariant ring homomorphisms from `R` to `S`. The above types have corresponding classes: * `MulActionHomClass F φ X Y` states that `F` is a type of bundled `X → Y` homs which are `φ`-equivariant * `DistribMulActionHomClass F φ A B` states that `F` is a type of bundled `A → B` homs preserving the additive monoid structure and `φ`-equivariant * `SMulSemiringHomClass F φ R S` states that `F` is a type of bundled `R → S` homs preserving the ring structure and `φ`-equivariant ## Notation We introduce the following notation to code equivariant maps (the subscript index `ₑ` is for *equivariant*) : * `X →ₑ[φ] Y` is `MulActionHom φ X Y`. * `A →ₑ+[φ] B` is `DistribMulActionHom φ A B`. * `R →ₑ+*[φ] S` is `MulSemiringActionHom φ R S`. When `M = N` and `φ = MonoidHom.id M`, we provide the backward compatible notation : * `X →[M] Y` is `MulActionHom (@id M) X Y` * `A →+[M] B` is `DistribMulActionHom (MonoidHom.id M) A B` * `R →+*[M] S` is `MulSemiringActionHom (MonoidHom.id M) R S` This more general definition is propagated all over mathlib, in particular to `LinearMap`. The treatment of composition of equivariant maps is inspired by that of semilinear maps. We provide classes `CompTriple` and `MonoidHom.CompTriple` of “composable triples`, and various instances for them.
uniwuni
pushed a commit
that referenced
this pull request
Apr 19, 2024
…ilinearMap (#10758) This PR adds a coercion from any instance of `SemilinearMapClass` to `SemilinearMap`. This is the standard practice for other parts of the library, such as ring homs (see also the recent change #10368). I also expect this change will help with some rough edges in #6057. Previously, a coercion from `f : AlgHom` to `LinearMap` would look like `f.toNonUnitalAlgHom.toDistribMulActionHom.toLinearMap`, now it should look like `SemilinearMapClass.semilinearMap f`. The new coercion instances are `CoeHead` since the left hand side is a free variable `F`. I redefined the existing `DistribMulActionHom → LinearMap` coercion in terms of the `SemilinearMapClass` coercion to ensure we don't get any diamonds.
uniwuni
pushed a commit
that referenced
this pull request
Apr 19, 2024
Generalize `MulActionHom` so that it allows two different monoids acting, related by a morphism. This is inspired by the treatment of (semi)linear maps in mathlib, and allows to refactor them. Let `M`, `N`, `X`, `Y` be types, with `SMul M X` and `SMul N Y`, and let `φ : M → N` be a map. * `MulActionHom φ X Y`, the type of equivariant functions from `X` to `Y`, consists of functions `f : X → Y` such that `f (m • x) = (φ m) • (f x)` for all `m : M` and `x : X`. Assume that we have `Monoid M`, `Monoid N` and that `φ : M →* N`. For `A`, `B` by types with `AddMonoid A` and `AddMonoid B`, endowed with `DistribMulAction M A` and `DistribMulAction M B`: * `DistribMulActionHom φ A B` is the type of equivariant additive monoid homomorphisms from `A` to `B`. Similarly, when `R` and `S` are types with `Semiring R`, `Semiring S`, `MulSemiringAction M R` and `MulSemiringAction N S` * `SMulSemiringHom φ R S` is the type of equivariant ring homomorphisms from `R` to `S`. The above types have corresponding classes: * `MulActionHomClass F φ X Y` states that `F` is a type of bundled `X → Y` homs which are `φ`-equivariant * `DistribMulActionHomClass F φ A B` states that `F` is a type of bundled `A → B` homs preserving the additive monoid structure and `φ`-equivariant * `SMulSemiringHomClass F φ R S` states that `F` is a type of bundled `R → S` homs preserving the ring structure and `φ`-equivariant ## Notation We introduce the following notation to code equivariant maps (the subscript index `ₑ` is for *equivariant*) : * `X →ₑ[φ] Y` is `MulActionHom φ X Y`. * `A →ₑ+[φ] B` is `DistribMulActionHom φ A B`. * `R →ₑ+*[φ] S` is `MulSemiringActionHom φ R S`. When `M = N` and `φ = MonoidHom.id M`, we provide the backward compatible notation : * `X →[M] Y` is `MulActionHom (@id M) X Y` * `A →+[M] B` is `DistribMulActionHom (MonoidHom.id M) A B` * `R →+*[M] S` is `MulSemiringActionHom (MonoidHom.id M) R S` This more general definition is propagated all over mathlib, in particular to `LinearMap`. The treatment of composition of equivariant maps is inspired by that of semilinear maps. We provide classes `CompTriple` and `MonoidHom.CompTriple` of “composable triples`, and various instances for them.
callesonne
pushed a commit
that referenced
this pull request
Apr 22, 2024
…ilinearMap (#10758) This PR adds a coercion from any instance of `SemilinearMapClass` to `SemilinearMap`. This is the standard practice for other parts of the library, such as ring homs (see also the recent change #10368). I also expect this change will help with some rough edges in #6057. Previously, a coercion from `f : AlgHom` to `LinearMap` would look like `f.toNonUnitalAlgHom.toDistribMulActionHom.toLinearMap`, now it should look like `SemilinearMapClass.semilinearMap f`. The new coercion instances are `CoeHead` since the left hand side is a free variable `F`. I redefined the existing `DistribMulActionHom → LinearMap` coercion in terms of the `SemilinearMapClass` coercion to ensure we don't get any diamonds.
callesonne
pushed a commit
that referenced
this pull request
Apr 22, 2024
Generalize `MulActionHom` so that it allows two different monoids acting, related by a morphism. This is inspired by the treatment of (semi)linear maps in mathlib, and allows to refactor them. Let `M`, `N`, `X`, `Y` be types, with `SMul M X` and `SMul N Y`, and let `φ : M → N` be a map. * `MulActionHom φ X Y`, the type of equivariant functions from `X` to `Y`, consists of functions `f : X → Y` such that `f (m • x) = (φ m) • (f x)` for all `m : M` and `x : X`. Assume that we have `Monoid M`, `Monoid N` and that `φ : M →* N`. For `A`, `B` by types with `AddMonoid A` and `AddMonoid B`, endowed with `DistribMulAction M A` and `DistribMulAction M B`: * `DistribMulActionHom φ A B` is the type of equivariant additive monoid homomorphisms from `A` to `B`. Similarly, when `R` and `S` are types with `Semiring R`, `Semiring S`, `MulSemiringAction M R` and `MulSemiringAction N S` * `SMulSemiringHom φ R S` is the type of equivariant ring homomorphisms from `R` to `S`. The above types have corresponding classes: * `MulActionHomClass F φ X Y` states that `F` is a type of bundled `X → Y` homs which are `φ`-equivariant * `DistribMulActionHomClass F φ A B` states that `F` is a type of bundled `A → B` homs preserving the additive monoid structure and `φ`-equivariant * `SMulSemiringHomClass F φ R S` states that `F` is a type of bundled `R → S` homs preserving the ring structure and `φ`-equivariant ## Notation We introduce the following notation to code equivariant maps (the subscript index `ₑ` is for *equivariant*) : * `X →ₑ[φ] Y` is `MulActionHom φ X Y`. * `A →ₑ+[φ] B` is `DistribMulActionHom φ A B`. * `R →ₑ+*[φ] S` is `MulSemiringActionHom φ R S`. When `M = N` and `φ = MonoidHom.id M`, we provide the backward compatible notation : * `X →[M] Y` is `MulActionHom (@id M) X Y` * `A →+[M] B` is `DistribMulActionHom (MonoidHom.id M) A B` * `R →+*[M] S` is `MulSemiringActionHom (MonoidHom.id M) R S` This more general definition is propagated all over mathlib, in particular to `LinearMap`. The treatment of composition of equivariant maps is inspired by that of semilinear maps. We provide classes `CompTriple` and `MonoidHom.CompTriple` of “composable triples`, and various instances for them.
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.
Generalize
MulActionHomso that it allows two different monoids acting, related by a morphism. This is inspired by the treatment of (semi)linear maps in mathlib, and allows to refactor them.Let
M,N,X,Ybe types, withSMul M XandSMul N Y, and letφ : M → Nbe a map.MulActionHom φ X Y, the type of equivariant functions fromXtoY, consists of functionsf : X → Ysuch thatf (m • x) = (φ m) • (f x)for allm : Mandx : X.Assume that we have
Monoid M,Monoid Nand thatφ : M →* N. ForA,Bby types withAddMonoid AandAddMonoid B, endowed withDistribMulAction M AandDistribMulAction M B:DistribMulActionHom φ A Bis the type of equivariant additive monoid homomorphisms fromAtoB.Similarly, when
RandSare types withSemiring R,Semiring S,MulSemiringAction M RandMulSemiringAction N SSMulSemiringHom φ R Sis the type of equivariant ring homomorphismsfrom
RtoS.The above types have corresponding classes:
MulActionHomClass F φ X Ystates thatFis a type of bundledX → Yhoms which areφ-equivariantDistribMulActionHomClass F φ A Bstates thatFis a type of bundledA → Bhoms preserving the additive monoid structure andφ-equivariantSMulSemiringHomClass F φ R Sstates thatFis a type of bundledR → Shoms preserving the ring structure andφ-equivariantNotation
We introduce the following notation to code equivariant maps
(the subscript index
ₑis for equivariant) :X →ₑ[φ] YisMulActionHom φ X Y.A →ₑ+[φ] BisDistribMulActionHom φ A B.R →ₑ+*[φ] SisMulSemiringActionHom φ R S.When
M = Nandφ = MonoidHom.id M, we provide the backward compatible notation :X →[M] YisMulActionHom (@id M) X YA →+[M] BisDistribMulActionHom (MonoidHom.id M) A BR →+*[M] SisMulSemiringActionHom (MonoidHom.id M) R SThis more general definition is propagated all over mathlib, in particular to
LinearMap.The treatment of composition of equivariant maps is inspired by that of semilinear maps. We provide classes
CompTripleandMonoidHom.CompTripleof “composable triples`, and various instances for them.TODO (?) :
CompTriplemechanism may have to be unified