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: add Repr instance for quaternions #13940

Closed
wants to merge 3 commits into from

Conversation

pauldavidrowe
Copy link
Collaborator

Adds a Repr instance for QuaternionAlgebra. A quaternion <w, x, y, z> is shown as "{ re := w, imI := x, imJ := y, imK := z }". The components are displayed as Cauchy sequences for quaternions over the Reals.


Open in Gitpod

@pauldavidrowe pauldavidrowe requested a review from urkud June 18, 2024 21:20
@github-actions github-actions bot added the new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! label Jun 18, 2024
Copy link

github-actions bot commented Jun 18, 2024

PR summary 1495383ce1

Import changes

No significant changes to the import graph


Declarations diff

+ instance [Repr R] {a b : R} : Repr ℍ[R, a, b]

You can run this locally as follows
## summary with just the declaration names:
./scripts/no_lost_declarations.sh short <optional_commit>

## more verbose report:
./scripts/no_lost_declarations.sh <optional_commit>

For the typical case of quaternions over ℝ, each component will show as a Cauchy sequence due to
the way Real numbers are represented.
-/
unsafe instance [Repr R] {a b : R} : Repr ℍ[R, a, b] where
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
unsafe instance [Repr R] {a b : R} : Repr ℍ[R, a, b] where
instance [Repr R] {a b : R} : Repr ℍ[R, a, b] where

@eric-wieser
Copy link
Member

Could you add a test? There should be one somewhere that already tests complex numbers that you can copy. If you can't find it, I can have a look in a day or two.

@j-loreaux
Copy link
Collaborator

@eric-wieser it seems like this might have fallen through the cracks. Are you happy?

bors d=eric-wieser

@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jun 25, 2024

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

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.

LGTM, thanks!

bors merge

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the ready-to-merge This PR has been sent to bors. label Jun 25, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jun 25, 2024
Adds a Repr instance for QuaternionAlgebra. A quaternion <w, x, y, z> is shown as "{ re := w, imI := x, imJ := y, imK := z }". The components are displayed as Cauchy sequences for quaternions over the Reals.
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jun 25, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: add Repr instance for quaternions [Merged by Bors] - feat: add Repr instance for quaternions Jun 25, 2024
@mathlib-bors mathlib-bors bot closed this Jun 25, 2024
@mathlib-bors mathlib-bors bot deleted the paul-rowe/quaternion-repr branch June 25, 2024 22:30
kbuzzard pushed a commit that referenced this pull request Jun 26, 2024
Adds a Repr instance for QuaternionAlgebra. A quaternion <w, x, y, z> is shown as "{ re := w, imI := x, imJ := y, imK := z }". The components are displayed as Cauchy sequences for quaternions over the Reals.
dagurtomas pushed a commit that referenced this pull request Jul 2, 2024
Adds a Repr instance for QuaternionAlgebra. A quaternion <w, x, y, z> is shown as "{ re := w, imI := x, imJ := y, imK := z }". The components are displayed as Cauchy sequences for quaternions over the Reals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated new-contributor This PR was made by a contributor with at most 5 merged PRs. Welcome to the community! ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants