-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[Merged by Bors] - feat(LinearAlgebra/QuadraticForm/TensorProduct): base change of quadratic forms #6636
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
Closed
Closed
[Merged by Bors] - feat(LinearAlgebra/QuadraticForm/TensorProduct): base change of quadratic forms #6636
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7bcd49c
wip
eric-wieser b14cba2
wip
eric-wieser 4ad432b
update
eric-wieser 71a9111
cleanup
eric-wieser 301236d
add import
eric-wieser 1133939
fix
eric-wieser 4f85ca3
helper lemma
eric-wieser 0e1ef11
Update Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean
eric-wieser 26ec194
Update Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean
eric-wieser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| /- | ||
| Copyright (c) 2023 Eric Wieser. All rights reserved. | ||
| Released under Apache 2.0 license as described in the file LICENSE. | ||
| Authors: Eric Wieser | ||
| -/ | ||
| import Mathlib.LinearAlgebra.BilinearForm.TensorProduct | ||
| import Mathlib.LinearAlgebra.QuadraticForm.Basic | ||
|
|
||
| /-! | ||
| # The quadratic form on a tensor product | ||
|
|
||
| ## Main definitions | ||
|
|
||
| * `QuadraticForm.tensorDistrib (Q₁ ⊗ₜ Q₂)`: the quadratic form on `M₁ ⊗ M₂` constructed by applying | ||
| `Q₁` on `M₁` and `Q₂` on `M₂`. This construction is not available in characteristic two. | ||
|
|
||
| -/ | ||
|
|
||
| universe uR uA uM₁ uM₂ | ||
|
|
||
| variable {R : Type uR} {A : Type uA} {M₁ : Type uM₁} {M₂ : Type uM₂} | ||
|
|
||
| open TensorProduct | ||
|
|
||
| namespace QuadraticForm | ||
|
|
||
| section CommRing | ||
| variable [CommRing R] [CommRing A] | ||
| variable [AddCommGroup M₁] [AddCommGroup M₂] | ||
| variable [Algebra R A] [Module R M₁] [Module A M₁] | ||
| variable [SMulCommClass R A M₁] [SMulCommClass A R M₁] [IsScalarTower R A M₁] | ||
| variable [Module R M₂] [Invertible (2 : R)] | ||
|
|
||
|
|
||
| variable (R A) in | ||
| /-- The tensor product of two quadratic forms injects into quadratic forms on tensor products. | ||
|
|
||
| Note this is heterobasic; the quadratic form on the left can take values in a larger ring than | ||
| the one on the right. -/ | ||
| def tensorDistrib : QuadraticForm A M₁ ⊗[R] QuadraticForm R M₂ →ₗ[A] QuadraticForm A (M₁ ⊗[R] M₂) := | ||
| letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm | ||
| -- while `letI`s would produce a better term than `let`, they would make this already-slow | ||
| -- definition even slower. | ||
| let toQ := BilinForm.toQuadraticFormLinearMap A A (M₁ ⊗[R] M₂) | ||
| let tmulB := BilinForm.tensorDistrib R A (M₁ := M₁) (M₂ := M₂) | ||
| let toB := AlgebraTensorModule.map | ||
| (QuadraticForm.associated : QuadraticForm A M₁ →ₗ[A] BilinForm A M₁) | ||
| (QuadraticForm.associated : QuadraticForm R M₂ →ₗ[R] BilinForm R M₂) | ||
| toQ ∘ₗ tmulB ∘ₗ toB | ||
|
|
||
| -- TODO: make the RHS `MulOpposite.op (Q₂ m₂) • Q₁ m₁` so that this has a nicer defeq for | ||
| -- `R = A` of `Q₁ m₁ * Q₂ m₂`. | ||
| @[simp] | ||
| theorem tensorDistrib_tmul (Q₁ : QuadraticForm A M₁) (Q₂ : QuadraticForm R M₂) (m₁ : M₁) (m₂ : M₂) : | ||
| tensorDistrib R A (Q₁ ⊗ₜ Q₂) (m₁ ⊗ₜ m₂) = Q₂ m₂ • Q₁ m₁ := | ||
| letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm | ||
| (BilinForm.tensorDistrib_tmul _ _ _ _ _ _).trans <| congr_arg₂ _ | ||
| (associated_eq_self_apply _ _ _) (associated_eq_self_apply _ _ _) | ||
|
|
||
| /-- The tensor product of two quadratic forms, a shorthand for dot notation. -/ | ||
| protected abbrev tmul (Q₁ : QuadraticForm A M₁) (Q₂ : QuadraticForm R M₂) : | ||
| QuadraticForm A (M₁ ⊗[R] M₂) := | ||
| tensorDistrib R A (Q₁ ⊗ₜ[R] Q₂) | ||
|
|
||
| theorem associated_tmul [Invertible (2 : A)] (Q₁ : QuadraticForm A M₁) (Q₂ : QuadraticForm R M₂) : | ||
| associated (R₁ := A) (Q₁.tmul Q₂) | ||
| = (associated (R₁ := A) Q₁).tmul (associated (R₁ := R) Q₂) := by | ||
| rw [QuadraticForm.tmul, tensorDistrib, BilinForm.tmul] | ||
| dsimp | ||
| convert associated_left_inverse A ((associated_isSymm A Q₁).tmul (associated_isSymm R Q₂)) | ||
|
|
||
| variable (A) in | ||
| /-- The base change of a quadratic form. -/ | ||
| protected def baseChange (Q : QuadraticForm R M₂) : QuadraticForm A (A ⊗[R] M₂) := | ||
| QuadraticForm.tmul (R := R) (A := A) (M₁ := A) (M₂ := M₂) (QuadraticForm.sq (R := A)) Q | ||
|
|
||
| @[simp] | ||
| theorem baseChange_tmul (Q : QuadraticForm R M₂) (a : A) (m₂ : M₂) : | ||
| Q.baseChange A (a ⊗ₜ m₂) = Q m₂ • (a * a) := | ||
| tensorDistrib_tmul _ _ _ _ | ||
|
|
||
|
|
||
| theorem associated_baseChange [Invertible (2 : A)] (Q : QuadraticForm R M₂) : | ||
| associated (R₁ := A) (Q.baseChange A) = (associated (R₁ := R) Q).baseChange A := by | ||
| dsimp only [QuadraticForm.baseChange, BilinForm.baseChange] | ||
| rw [associated_tmul (QuadraticForm.sq (R := A)) Q, associated_sq] | ||
|
|
||
| end CommRing | ||
|
|
||
| end QuadraticForm | ||
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.
Uh oh!
There was an error while loading. Please reload this page.