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: some basic quaternion facts #7119

Closed
wants to merge 8 commits into from

Conversation

ericrbg
Copy link
Collaborator

@ericrbg ericrbg commented Sep 12, 2023


Open in Gitpod

@ericrbg ericrbg added awaiting-review The author would like community review of the PR awaiting-CI t-algebra Algebra (groups, rings, fields etc) labels Sep 12, 2023
@@ -102,6 +102,10 @@ theorem mk.eta {R : Type*} {c₁ c₂} (a : ℍ[R,c₁,c₂]) : mk a.1 a.2 a.3 a

variable {S T R : Type*} [CommRing R] {c₁ c₂ : R} (r x y z : R) (a b c : ℍ[R,c₁,c₂])

instance : Nonempty ℍ[R, c₁, c₂] := ⟨⟨c₁,c₁,c₁,c₁⟩⟩
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
instance : Nonempty ℍ[R, c₁, c₂] := ⟨⟨c₁,c₁,c₁,c₁⟩
instance : Inhabited ℍ[R, c₁, c₂] := ⟨0

would be more canonical

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh, I just noticed I accidentally put a Ring in there. I wanted to make them general, so that TC has to do less searching.

Copy link
Member

Choose a reason for hiding this comment

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

I think TC is fast enough when it comes to finding a zero element.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this Inhabited instance already exists further down the file, L189. Should I just delete this?

Copy link
Member

Choose a reason for hiding this comment

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

Deleting it sounds good to me.

Comment on lines 588 to 589
/-- There is a natural equivalence when swapping the coefficients of a quaternion algebra. -/
def swapEquiv : ℍ[R,c₁,c₂] ≃ₐ[R] ℍ[R, c₂, c₁] where
Copy link
Member

Choose a reason for hiding this comment

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

In the context of , this doesn't seem natural at all; it treats i and j specially, without swapping the others!

I suppose this is natural for ℍ[R,c₁,c₂], though I believe it is still available as dot notation on Quaternion.

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 mean, technically it turns ij into ji = -ij in that special case, I think. Did I mess up the namespacing?

Copy link
Member

Choose a reason for hiding this comment

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

No, but Quaternion := QuaternionAlgebra _ _ _ so dot notation naturally falls back on this definition.

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 didn't know dot notation could see through defs. Not sure what's best to do in this case. This is obviously not the standard involution...

@@ -102,6 +102,10 @@ theorem mk.eta {R : Type*} {c₁ c₂} (a : ℍ[R,c₁,c₂]) : mk a.1 a.2 a.3 a

variable {S T R : Type*} [CommRing R] {c₁ c₂ : R} (r x y z : R) (a b c : ℍ[R,c₁,c₂])

instance : Nonempty ℍ[R, c₁, c₂] := ⟨⟨c₁,c₁,c₁,c₁⟩⟩
Copy link
Member

Choose a reason for hiding this comment

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

I think TC is fast enough when it comes to finding a zero element.

Mathlib/Algebra/Quaternion.lean Show resolved Hide resolved
@jcommelin jcommelin added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Sep 14, 2023
@ericrbg ericrbg added awaiting-review The author would like community review of the PR awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-author A reviewer has asked the author a question or requested changes labels Sep 27, 2023
Comment on lines +106 to +107
instance [Subsingleton R] : Subsingleton ℍ[R, c₁, c₂] := (equivTuple c₁ c₂).subsingleton
instance [Nontrivial R] : Nontrivial ℍ[R, c₁, c₂] := (equivTuple c₁ c₂).surjective.nontrivial
Copy link
Member

Choose a reason for hiding this comment

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

Do we have these instances for Quaternion? If not, can you add them?

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.

bors d+

@bors
Copy link

bors bot commented Oct 9, 2023

✌️ ericrbg can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added delegated and removed awaiting-review The author would like community review of the PR labels Oct 9, 2023
@ericrbg
Copy link
Collaborator Author

ericrbg commented Oct 14, 2023

bors r+

bors bot pushed a commit that referenced this pull request Oct 14, 2023
Co-authored-by: Eric Rodriguez <37984851+ericrbg@users.noreply.github.com>
@bors
Copy link

bors bot commented Oct 14, 2023

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.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat: some basic quaternion facts [Merged by Bors] - feat: some basic quaternion facts Oct 14, 2023
@bors bors bot closed this Oct 14, 2023
@bors bors bot deleted the ericrbg/basic_quaternion branch October 14, 2023 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-author A reviewer has asked the author a question or requested changes delegated t-algebra Algebra (groups, rings, fields etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants