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: port Algebra.Quaternion #3776
Conversation
Mathbin -> Mathlib fix certain import statements move "by" to end of line add import to Mathlib.lean
Mathlib/Algebra/Quaternion.lean
Outdated
@@ -55,19 +55,19 @@ quaternion | |||
-/ | |||
|
|||
|
|||
/- ./././Mathport/Syntax/Translate/Command.lean:429:34: infer kinds are unsupported in Lean 4: mk {} -/ | |||
/-- Quaternion algebra over a type with fixed coefficients $a=i^2$ and $b=j^2$. | |||
Implemented as a structure with four fields: `re`, `im_i`, `im_j`, and `im_k`. -/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note these names in comments will need fixing.
@@ -1716,6 +1716,10 @@ theorem toNat_cast (n : ℕ) : Cardinal.toNat n = n := by | |||
exact (Classical.choose_spec (lt_aleph0.1 (nat_lt_aleph0 n))).symm | |||
#align cardinal.to_nat_cast Cardinal.toNat_cast | |||
|
|||
@[simp] | |||
theorem toNat_ofNat (n : ℕ) [n.AtLeastTwo] : Cardinal.toNat (OfNat.ofNat n) = OfNat.ofNat n := |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why n.AtLeastTwo
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/Nat/Cast/Defs.html#instOfNat
We have separate instances for OfNat R 0
, OfNat R 1
, and [n.AtLeastTwo] : OfNat R n
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🎉
bors merge
Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
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. |
Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>
The section about
DivisionRing
instance fails, even with η-experiment. I don't know how to fix it.