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(data/zsqrtd/basic): add some lemmas about conj, norm #6715
Conversation
Ruben-VandeVelde
commented
Mar 16, 2021
src/data/zsqrtd/basic.lean
Outdated
@[simp] lemma conj_zero : conj (0 : ℤ√d) = 0 := | ||
by rw [ext, conj_re, conj_im, zero_im, zero_re, neg_zero, and_self] |
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.
Can you use this to show that conj
is an add_monoid_hom
?
That is, declare
/-- `conj` as an `add_monoid_hom`. -/
def conj_hom : ℤ√d →+ ℤ√d :=
{ to_fun := conj,
map_add' := λ ⟨a, ai⟩ ⟨b, bi⟩, ext.mpr ⟨rfl, neg_add _ _⟩,
map_zero' := ext.mpr ⟨rfl, neg_zero⟩ }
And then prove conj_zero
, conj_neg
, conj_add
, conj_sub
as conj_hom.map_zero
etc.
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.
Done. (I had to move the conj
section below the add_monoid
instance.)
Thanks! Feel free to merge once CI passes bors d+ |
✌️ Ruben-VandeVelde can now approve this pull request. To approve and merge a pull request, simply reply with |
bors r+ |
Pull request successfully merged into master. Build succeeded: |