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(data/zsqrtd/basic): add some lemmas about conj, norm #6715

Closed
wants to merge 2 commits into from

Conversation

Ruben-VandeVelde
Copy link
Collaborator


Open in Gitpod

Comment on lines 88 to 89
@[simp] lemma conj_zero : conj (0 : ℤ√d) = 0 :=
by rw [ext, conj_re, conj_im, zero_im, zero_re, neg_zero, and_self]
Copy link
Member

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.

Copy link
Collaborator Author

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.)

@eric-wieser eric-wieser added the awaiting-author A reviewer has asked the author a question or requested changes label Mar 17, 2021
@Ruben-VandeVelde Ruben-VandeVelde added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Mar 17, 2021
@eric-wieser
Copy link
Member

Thanks! Feel free to merge once CI passes

bors d+

@bors
Copy link

bors bot commented Mar 17, 2021

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

@eric-wieser eric-wieser added delegated The PR author may merge after reviewing final suggestions. and removed awaiting-review The author would like community review of the PR labels Mar 17, 2021
@Ruben-VandeVelde
Copy link
Collaborator Author

bors r+

@bors
Copy link

bors bot commented Mar 17, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/zsqrtd/basic): add some lemmas about conj, norm [Merged by Bors] - feat(data/zsqrtd/basic): add some lemmas about conj, norm Mar 17, 2021
@bors bors bot closed this Mar 17, 2021
@bors bors bot deleted the zsqrtd branch March 17, 2021 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated The PR author may merge after reviewing final suggestions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants