Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(LinearAlgebra/{ExteriorAlgebra,CliffordAlgebra}): Functoriality of the exterior algebra and some lemmas about generation #9718

Closed
wants to merge 53 commits into from

Conversation

smorel394
Copy link
Collaborator

@smorel394 smorel394 commented Jan 13, 2024

This does a few things:

  • Define the algebra morphism TrivSqZeroExt.map f between trivial square-zero extensions induced by a linear mapf, and establish some of its basic properties (functoriality, composition with the basic maps to/from TrivSqZeroExt). Note that we only consider the case of a commutative base ring, because the case of a general base ring requires morphisms of bimodules, which we do not have.

  • Define the algebra morphism ExteriorAlgebra.map f between exterior algebras induced by a linear map f. This is a straightforward application of the similar construction for Clifford algebras, but I think it is still useful to have. Basic properties of this construction are proved: functoriality, composition with ExteriorAlgebra.ι, ExteriorAlgebra.ιInv (this part uses the first point) and ExteriorAlgebra.ιMulti. Then exactness properties of the construction is studied:

    • If the linear map is surjective, then the map on exterior algebras is also surjective. This actually holds for Clifford algebras, so I added a lemma called CliffordAlgebra.map_surjective in LinearAlgebra/CliffordAlgebra/Basic.lean. For exterior algebras, the converse holds and is also proved.
    • If the linear map has a retraction, then the map on exterior algebras is injective. So if the base ring is a field, the map on exterior algebras is injective if the linear map is injective.
  • Establish some properties of ExteriorAlgebra.ιMulti:

    • ExteriorAlgebra.ιMulti_range: The range of ιMulti R n is contained in the nth exterior power (define here as LinearMap.range (ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n).
    • ExteriorAlgebra.ιMulti_span_fixedDegree: This range spans the nth exterior power.
    • ExteriorAlgebra.ιMulti_span: The union over all n of the range of ιMulti R n spans the whole exterior algebra (this is in LinearAlgebra/ExteriorAlgebra/Grading.lean because the proof uses the graded module structure, but it might be possible to do something simpler).
  • Construct ExteriorAlgebra.ιMulti_family: This takes a natural number n and a family of vectors v indexed by a linearly ordered type I, and it returns the family of n-fold products of the v i in the exterior algebra, indexed by the set of finsets of I of cardinality n. (The point, to be proved in another PR, is that when v is a basis, then ExteriorAlgebra.ιMulti_family R n v is a basis of the nth exterior power.)


Open in Gitpod

@smorel394 smorel394 added awaiting-review The author would like community review of the PR t-algebra Algebra (groups, rings, fields etc) labels Jan 13, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Jan 20, 2024
@eric-wieser
Copy link
Member

Sorry, I think I missed this one. Can you resolve the merge conflicts? Are all the changes in the conflicting file already merged?

@eric-wieser eric-wieser self-assigned this Feb 9, 2024
@smorel394
Copy link
Collaborator Author

Sorry, missed your comment (busy week). I'm thinking of just doing a fresh branch and fresh PR at this point, so the conflicts will be easier to solve.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label Feb 15, 2024
Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking pretty good now! I suspect this is similar to what I was thinking of when I added MultilinearMap.range, but I don't think that definition is of any use for this PR.

Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/ExteriorAlgebra/Grading.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/ExteriorAlgebra/Grading.lean Outdated Show resolved Hide resolved
Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean Outdated Show resolved Hide resolved
Its easy enough to prove these by simp, then the bunled versions are trivial.
The bundled version of one result can be promoted from a RingHom to an AlgHom.
Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maintainer merge

I pushed some more small cleanups, and fixed a porting note that was causing you to need erw. This now looks great! Can you check the commit message reflects what we've ended up at?

Comment on lines +944 to +951
/-- Functoriality of `TrivSqZeroExt` when the ring is commutative: a linear map
`f : M →ₗ[R'] N` induces a morphism of `R'`-algebras from `TrivSqZeroExt R' M` to
`TrivSqZeroExt R' N`.

Note that we cannot neatly state the non-commutative case, as we do not have morphisms of bimodules.
-/
def map (f : M →ₗ[R'] N) : TrivSqZeroExt R' M →ₐ[R'] TrivSqZeroExt R' N :=
liftEquivOfComm ⟨inrHom R' N ∘ₗ f, fun _ _ => inr_mul_inr _ _ _⟩
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please mention this in the commit message

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the commit message.

Copy link

🚀 Pull request has been placed on the maintainer queue by eric-wieser.

1 similar comment
Copy link

🚀 Pull request has been placed on the maintainer queue by eric-wieser.

@mattrobball
Copy link
Collaborator

!bench

@mattrobball
Copy link
Collaborator

Thanks! Functoriality is wonderful.

Assuming the profiling comes back ok, I will merge.

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 4fc8304.
There were significant changes against commit d43978d:

  Benchmark                                      Metric         Change
  ====================================================================
- ~Mathlib.Algebra.TrivSqZeroExt                 instructions    43.0%
- ~Mathlib.LinearAlgebra.ExteriorAlgebra.Basic   instructions    46.7%

@mattrobball
Copy link
Collaborator

+100 lines or so for +50% in instructions isn't great. These mainly all come from typeclass search. But the problems surfaced are not particular to this file and need to be fixed more generally.

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Feb 16, 2024
@mathlib-bors
Copy link

mathlib-bors bot commented Feb 16, 2024

Canceled.

@eric-wieser
Copy link
Member

eric-wieser commented Feb 16, 2024

@mattrobball, I tried making some simps unfold less, lets see if it helps.

@eric-wieser
Copy link
Member

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit beb41cd.
There were significant changes against commit d43978d:

  Benchmark                                      Metric         Change
  ====================================================================
- ~Mathlib.Algebra.TrivSqZeroExt                 instructions    42.6%
- ~Mathlib.LinearAlgebra.ExteriorAlgebra.Basic   instructions    46.7%

@eric-wieser
Copy link
Member

Well, I guess .4% is better than nothing!

bors merge

mathlib-bors bot pushed a commit that referenced this pull request Feb 16, 2024
…of the exterior algebra and some lemmas about generation (#9718)

This does a few things:
- Define the algebra morphism `TrivSqZeroExt.map f` between trivial square-zero extensions induced by a linear map`f`, and establish some of its basic properties (functoriality, composition with the basic maps to/from `TrivSqZeroExt`). Note that we only consider the case of a commutative base ring, because the case of a general base ring requires morphisms of bimodules, which we do not have.
- Define the algebra morphism `ExteriorAlgebra.map f` between exterior algebras induced by a linear map `f`. This is a straightforward application of the similar construction for Clifford algebras, but I think it is still useful to have. Basic properties of this construction are proved: functoriality, composition with `ExteriorAlgebra.ι`, `ExteriorAlgebra.ιInv` (this part uses the first point) and `ExteriorAlgebra.ιMulti`. Then exactness properties of the construction is studied:
  - If the linear map is surjective, then the map on exterior algebras is also surjective. This actually holds for Clifford algebras, so I added a lemma called `CliffordAlgebra.map_surjective` in `LinearAlgebra/CliffordAlgebra/Basic.lean`. For exterior algebras, the converse holds and is also proved.
  - If the linear map has a retraction, then the map on exterior algebras is injective. So if the base ring is a field, the map on exterior algebras is injective if the linear map is injective.

- Establish some properties of `ExteriorAlgebra.ιMulti`:
  - `ExteriorAlgebra.ιMulti_range`: The range of `ιMulti R n` is contained in the `n`th exterior power (define here as `LinearMap.range (ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`).
  - `ExteriorAlgebra.ιMulti_span_fixedDegree`: This range spans the `n`th exterior power.
  - `ExteriorAlgebra.ιMulti_span`: The union over all `n` of the range of `ιMulti R n` spans the whole exterior algebra (this is in `LinearAlgebra/ExteriorAlgebra/Grading.lean` because the proof uses the graded module structure, but it might be possible to do something simpler).

- Construct `ExteriorAlgebra.ιMulti_family`: This takes a natural number `n` and a family of vectors `v` indexed by a linearly ordered type `I`, and it returns the family of `n`-fold products of the `v i` in the exterior algebra, indexed by the set of finsets of `I` of cardinality `n`. (The point, to be proved in another PR, is that when `v` is a basis, then `ExteriorAlgebra.ιMulti_family R n v` is a basis of the `n`th exterior power.)



Co-authored-by: morel <smorel@math.princeton.edu>
Co-authored-by: smorel394 <67864981+smorel394@users.noreply.github.com>
@mattrobball
Copy link
Collaborator

Overall instructions were up by 4B though

@mathlib-bors
Copy link

mathlib-bors bot commented Feb 16, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(LinearAlgebra/{ExteriorAlgebra,CliffordAlgebra}): Functoriality of the exterior algebra and some lemmas about generation [Merged by Bors] - feat(LinearAlgebra/{ExteriorAlgebra,CliffordAlgebra}): Functoriality of the exterior algebra and some lemmas about generation Feb 16, 2024
@mathlib-bors mathlib-bors bot closed this Feb 16, 2024
@mathlib-bors mathlib-bors bot deleted the ExteriorAlgebra branch February 16, 2024 18:01
@smorel394
Copy link
Collaborator Author

Great, now I can PR the exterior power stuff (after I have checked that it still builds).

@smorel394
Copy link
Collaborator Author

Here it is: #10654

riccardobrasca pushed a commit that referenced this pull request Feb 18, 2024
…of the exterior algebra and some lemmas about generation (#9718)

This does a few things:
- Define the algebra morphism `TrivSqZeroExt.map f` between trivial square-zero extensions induced by a linear map`f`, and establish some of its basic properties (functoriality, composition with the basic maps to/from `TrivSqZeroExt`). Note that we only consider the case of a commutative base ring, because the case of a general base ring requires morphisms of bimodules, which we do not have.
- Define the algebra morphism `ExteriorAlgebra.map f` between exterior algebras induced by a linear map `f`. This is a straightforward application of the similar construction for Clifford algebras, but I think it is still useful to have. Basic properties of this construction are proved: functoriality, composition with `ExteriorAlgebra.ι`, `ExteriorAlgebra.ιInv` (this part uses the first point) and `ExteriorAlgebra.ιMulti`. Then exactness properties of the construction is studied:
  - If the linear map is surjective, then the map on exterior algebras is also surjective. This actually holds for Clifford algebras, so I added a lemma called `CliffordAlgebra.map_surjective` in `LinearAlgebra/CliffordAlgebra/Basic.lean`. For exterior algebras, the converse holds and is also proved.
  - If the linear map has a retraction, then the map on exterior algebras is injective. So if the base ring is a field, the map on exterior algebras is injective if the linear map is injective.

- Establish some properties of `ExteriorAlgebra.ιMulti`:
  - `ExteriorAlgebra.ιMulti_range`: The range of `ιMulti R n` is contained in the `n`th exterior power (define here as `LinearMap.range (ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`).
  - `ExteriorAlgebra.ιMulti_span_fixedDegree`: This range spans the `n`th exterior power.
  - `ExteriorAlgebra.ιMulti_span`: The union over all `n` of the range of `ιMulti R n` spans the whole exterior algebra (this is in `LinearAlgebra/ExteriorAlgebra/Grading.lean` because the proof uses the graded module structure, but it might be possible to do something simpler).

- Construct `ExteriorAlgebra.ιMulti_family`: This takes a natural number `n` and a family of vectors `v` indexed by a linearly ordered type `I`, and it returns the family of `n`-fold products of the `v i` in the exterior algebra, indexed by the set of finsets of `I` of cardinality `n`. (The point, to be proved in another PR, is that when `v` is a basis, then `ExteriorAlgebra.ιMulti_family R n v` is a basis of the `n`th exterior power.)



Co-authored-by: morel <smorel@math.princeton.edu>
Co-authored-by: smorel394 <67864981+smorel394@users.noreply.github.com>
dagurtomas pushed a commit that referenced this pull request Mar 22, 2024
…of the exterior algebra and some lemmas about generation (#9718)

This does a few things:
- Define the algebra morphism `TrivSqZeroExt.map f` between trivial square-zero extensions induced by a linear map`f`, and establish some of its basic properties (functoriality, composition with the basic maps to/from `TrivSqZeroExt`). Note that we only consider the case of a commutative base ring, because the case of a general base ring requires morphisms of bimodules, which we do not have.
- Define the algebra morphism `ExteriorAlgebra.map f` between exterior algebras induced by a linear map `f`. This is a straightforward application of the similar construction for Clifford algebras, but I think it is still useful to have. Basic properties of this construction are proved: functoriality, composition with `ExteriorAlgebra.ι`, `ExteriorAlgebra.ιInv` (this part uses the first point) and `ExteriorAlgebra.ιMulti`. Then exactness properties of the construction is studied:
  - If the linear map is surjective, then the map on exterior algebras is also surjective. This actually holds for Clifford algebras, so I added a lemma called `CliffordAlgebra.map_surjective` in `LinearAlgebra/CliffordAlgebra/Basic.lean`. For exterior algebras, the converse holds and is also proved.
  - If the linear map has a retraction, then the map on exterior algebras is injective. So if the base ring is a field, the map on exterior algebras is injective if the linear map is injective.

- Establish some properties of `ExteriorAlgebra.ιMulti`:
  - `ExteriorAlgebra.ιMulti_range`: The range of `ιMulti R n` is contained in the `n`th exterior power (define here as `LinearMap.range (ι R : M →ₗ[R] ExteriorAlgebra R M) ^ n`).
  - `ExteriorAlgebra.ιMulti_span_fixedDegree`: This range spans the `n`th exterior power.
  - `ExteriorAlgebra.ιMulti_span`: The union over all `n` of the range of `ιMulti R n` spans the whole exterior algebra (this is in `LinearAlgebra/ExteriorAlgebra/Grading.lean` because the proof uses the graded module structure, but it might be possible to do something simpler).

- Construct `ExteriorAlgebra.ιMulti_family`: This takes a natural number `n` and a family of vectors `v` indexed by a linearly ordered type `I`, and it returns the family of `n`-fold products of the `v i` in the exterior algebra, indexed by the set of finsets of `I` of cardinality `n`. (The point, to be proved in another PR, is that when `v` is a basis, then `ExteriorAlgebra.ιMulti_family R n v` is a basis of the `n`th exterior power.)



Co-authored-by: morel <smorel@math.princeton.edu>
Co-authored-by: smorel394 <67864981+smorel394@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-merge ready-to-merge This PR has been sent to bors. t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants