Repository navigation
[Merged by Bors] - feat(LinearAlgebra/QuadraticForm/TensorProduct): base change of quadratic forms - #6636
Closed
eric-wieser wants to merge 9 commits into
Closed
[Merged by Bors] - feat(LinearAlgebra/QuadraticForm/TensorProduct): base change of quadratic forms#6636eric-wieser wants to merge 9 commits into
eric-wieser wants to merge 9 commits into
Conversation
Member
Author
|
I also tried to prove: theorem _root_.BilinForm.toQuadraticForm_tmul (B₁ : BilinForm A M₁) (B₂ : BilinForm R M₂) :
(B₁.tmul B₂).toQuadraticForm
= B₁.toQuadraticForm.tmul B₂.toQuadraticForm := by
letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm
rw [QuadraticForm.tmul, tensorDistrib, BilinForm.tmul]
dsimp
refine (associated_rightInverse R).injective ?_
refine BilinForm.toLin.injective ?_
ext a₁ a₂ b₁ b₂
dsimp [-associated_apply]
simp [sub_smul, smul_sub, add_smul, smul_add, ←smul_mul_smul]
set aa₁ := B₁ a₁ a₁
set ab₁ := B₁ a₁ b₁
set ba₁ := B₁ b₁ a₁
set bb₁ := B₁ b₁ b₁
set aa₂ := B₂ a₂ a₂
set ab₂ := B₂ a₂ b₂
set ba₂ := B₂ b₂ a₂
set bb₂ := B₂ b₂ b₂
sorrythough the algebra is too painful to get to a point where it's obvious whether it's true. |
|
This PR/issue depends on: |
alexjbest
reviewed
Aug 17, 2023
alexjbest
reviewed
Aug 17, 2023
Co-authored-by: Alex J Best <[email protected]>
Member
|
maintainer merge |
|
🚀 Pull request has been placed on the maintainer queue by alexjbest. |
8 tasks done
ocfnash
approved these changes
Aug 25, 2023
|
✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with |
Member
Author
|
bors merge |
|
Pull request successfully merged into master. Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
tau-ceti-bors Bot
pushed a commit
to TauCetiProject/TauCeti
that referenced
this pull request
Oct 14, 2026
…ase change (#16538) This PR makes the Spin base-change lemmas in `TauCeti/LinearAlgebra/CliffordAlgebra/Spin/BaseChange.lean` take `[Invertible (2 : A)]` as an instance argument. Until now each statement fixed that instance with `letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 _`. Five lemmas change: `spinVectorAction_baseChange_tmul`, `spinToSpecialOrthogonal_baseChange`, `spinGroupBaseChange_spinTransvection`, `spinToOrthogonal_baseChange` and `spinGroupBaseChange_comp_spinTransvectionHom`. Their proofs are the same except that the `let` restating the transported instance is gone. No proof depended on which inverse of two it was given. The old statements broke at concrete fields. Over `ℝ` or `ℚ_[p]` the goal uses the field's own instance (`invertibleTwo`, `TauCeti.instInvertibleTwoPadic`), and these are not definitionally equal to the transported one, so `rfl` cannot identify them. As a result `exact spinToSpecialOrthogonal_baseChange Q x` fails with a type mismatch between the two instances. `rw` rewrites the left side and then leaves a goal whose two sides print the same but are not closed. `simp`, `simp only` and `erw` all leave the goal unsolved, and `convert` ends with the side goal `invertibleTwo = (Invertible.map (algebraMap ℚ ℝ) 2).copy 2 _`. So every caller at a concrete field had to align the instances by hand: - `finiteAdelicSpinToSpecialOrthogonal_comp_finiteAdelicSpinDiagonal` (`Diagonal/Finite.lean`), `fullAdelicSpinToSpecialOrthogonal_comp_fullAdelicSpinDiagonal` (`Diagonal/Full.lean`) and `eventually_mem_integralSpinSubgroup` (`Integral/Spin.lean`) each used `have h := …` followed by `rw [Subsingleton.elim (transported) (inferInstance : Invertible (2 : _))] at h`. These steps are now gone: the lemma goes straight into the existing `simp only` or `exact`, which saves 5 lines at each site. - `tendsto_finiteAdelicSpinDiagonal_spinTransvection_factorial` (`Diagonal/NonDiscrete/Spin.lean`) pinned the transported instance on `ℚ_[p]` for a whole block, so that `spinGroupBaseChange_spinTransvection` could rewrite. That `let` is removed. Without the pin, the old lemma fails `rw` with "synthesized type class instance is not definitionally equal to expression inferred by typing rules". The `@[simp]` attributes on these lemmas now fire at concrete fields. Before, they could never match there. Inside the generic files, callers that build the transported instance with `let` (for example `spinorNormKernelBaseChange_spinToSpinorNormKernel` in `Spin/SpinorNorm/BaseChange.lean`) are unaffected, because instance search returns their local instance. This is the shape Mathlib uses for statements about quadratic forms after base change. `QuadraticForm.associated_baseChange` and `QuadraticForm.polarBilin_baseChange` take `[Invertible (2 : A)]` (`Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean:135`, `:141`). `QuadraticMap.associated_tmul` (`:72`) does the same and aligns the instances once inside its proof (`:75-77`). The transported `letI` appears only in definition bodies (`QuadraticMap.tensorDistrib`, `:50`) and in proofs whose statements do not mention the instance (`tensorDistrib_tmul`, `:63`). This split goes back to the file's introduction in leanprover-community/mathlib4#6636, where `associated_tmul` and `associated_baseChange` were already stated with `[Invertible (2 : A)]`. The old design had one advantage. With no `Invertible (2 : A)` instance in scope, the old lemmas still applied and produced the transported instance themselves. Such a caller now needs one `letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm` before using the lemma, and this recovers the old statement exactly. No caller in the library is in that position. Two lemmas in this file, `spinGroupBaseChange_baseChange` and `evenUnitaryGroupBaseChange_baseChange`, keep the transported instance, because the type of the definition `QuadraticForm.baseChangeBaseChange` they are stated through fixes it. No declarations are removed or renamed. The five lemmas above keep their names and change only in that the instance is now an argument. Roadmap: OrthogonalSpinGroups <!--tauceti-target:v1 {"focus":"OrthogonalSpinGroups","id":"cliffordalgebra-spintospecialorthogonal-basechange"}--> 🤖 Prepared with Claude Code
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.
Uh oh!
There was an error while loading. Please reload this page.