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

feat(data/zmod/quadratic_reciprocity): quadratic reciprocity #327

Merged
merged 59 commits into from Oct 1, 2018

Conversation

ChrisHughes24
Copy link
Member

Proof of the law of quadratic reciprocity,
Create field_theory/finite, and prove the multiplicative group of a finite field is cyclic
Createdata/nat/totient
along with minor changes to other files that were necessary for the proof

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

For reviewers: code review check list

@kbuzzard
Copy link
Member

kbuzzard commented Sep 8, 2018

Nice!

def units.mk_of_ne_zero [field α] {a : α} (ha : a ≠ 0) : units α :=
⟨a, a⁻¹, mul_inv_cancel ha, inv_mul_cancel ha⟩

@[simp] lemma units.mk_of_ne_zero_inj {α : Type*} [field α] {a b : α} (ha : a ≠ 0) (hb : b ≠ 0) :
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reason to have {α : Type*} here and in the next lemma?

@@ -42,7 +42,7 @@ by simp [finset.prod]
attribute [to_additive finset.sum_const_zero] prod_const_one

@[simp, to_additive finset.sum_image]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess this and the next lemmas should be proven on multiset and then derived from this. Then these classical.dec_eq are not necessary anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this comment meant to be somewhere else? prod_image doesn't mention classical.dec_eq, and the decidable_eq is necessary to state the theorem. In general, what's the policy on lemmas that require decidability for the proof, but not the statement? I thought the policy was that classical logic was fine even when unnecessary, so there are a few lemmas where I just used classical.dec_eq in the proof, to save the small bother of a user having to provide the dec_eq.

Copy link
Member

Choose a reason for hiding this comment

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

I've use that policy in a few places already. If the statement doesn't require decidable_eq, but the proof does, then you can use classical.dec_eq to locally assume it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh sorry, my comment on classical.dec_eq was unnecessary.
For me using classical.dec_eq is also fine, just a little bit annoying..

data/zmod/quadratic_reciprocity.lean Outdated Show resolved Hide resolved
@jcommelin
Copy link
Member

Chapeau! 🥂

@kckennylau
Copy link
Collaborator

Oh my god this is brilliant!

@johoelzl johoelzl merged commit dbb3ff0 into leanprover-community:master Oct 1, 2018
@ChrisHughes24 ChrisHughes24 deleted the QR2 branch October 3, 2018 08:21
bors bot pushed a commit that referenced this pull request Dec 10, 2022
A few missing lemmas. `finset.sum_smul_sum` matches `finset.sum_mul_sum`.

Unrelatingly, fix the copyright after the split in #17764. I list as authors:
* Chris for #327
* Yury for #1910
* myself for this PR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants