-
Notifications
You must be signed in to change notification settings - Fork 298
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
Changes from 24 commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
5ff4ad5
multiplicative group of finite field is cyclic
ChrisHughes24 83a9210
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 d1d520f
more stuff
ChrisHughes24 63c7461
merge upstream
ChrisHughes24 4f1fed5
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 1fc07c2
change chinese remainder to def
ChrisHughes24 e987636
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 7b4d77f
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 942a1da
get rid of nonsense
ChrisHughes24 745b145
delete extra line break
ChrisHughes24 3e8d0cc
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 5aed06a
one prod_bij left
ChrisHughes24 36f1081
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 b51eb0d
move lemmas to correct places
ChrisHughes24 44bd6c6
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 f42ff9b
delete prod_instances
ChrisHughes24 37ea42c
almost done
ChrisHughes24 fc73ff2
move lamms to correct places
ChrisHughes24 ea31b30
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 c1168d1
more moving lemmas
ChrisHughes24 a196644
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 76d2900
finished off moving lemmas
ChrisHughes24 876e1bf
fix build
ChrisHughes24 75cd567
move quadratic reciprocity to zmod
ChrisHughes24 686e13b
improve readability
ChrisHughes24 c5df782
remove unnecessary alphas
ChrisHughes24 95a7443
move `prod_range_id`
ChrisHughes24 17a59ae
Merge branch 'master' into QR2
ChrisHughes24 14e4c6f
fix build
ChrisHughes24 a04aa47
fix build
ChrisHughes24 25eb48f
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 eb1bc23
Merge branch 'QR2' of https://github.com/dorhinj/mathlib into QR2
ChrisHughes24 754d69e
fix build
ChrisHughes24 9c941f6
fix build
ChrisHughes24 ed11402
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 c964632
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 e6c3baa
delete mk_of_ne_zero
ChrisHughes24 d643eb6
move odd_mul_odd_div_two
ChrisHughes24 87d290c
extra a few lemmas
ChrisHughes24 3d435cf
improving readability
ChrisHughes24 911bf60
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 b6957a8
delete duplicate lemmas
ChrisHughes24 e005c39
forgot to save
ChrisHughes24 2ff8a18
delete duplicate lemma
ChrisHughes24 c8bcdbc
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 7785e8b
Merge branch 'master' into QR2
ChrisHughes24 5a4f607
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 734fdcb
Merge branch 'QR2' of https://github.com/dorhinj/mathlib into QR2
ChrisHughes24 1291d2d
indent calc proofs
ChrisHughes24 07508cb
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 8b37975
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 ba6c89f
fix build
ChrisHughes24 3ee6ace
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 ff09305
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 1df9f0a
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 7c2338c
fix build
ChrisHughes24 eed134a
forgot to save
ChrisHughes24 d04dabc
Merge remote-tracking branch 'upstream/master' into QR2
ChrisHughes24 68edc78
fix build
ChrisHughes24 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -225,10 +225,10 @@ instance : has_one (units α) := ⟨⟨1, 1, mul_one 1, one_mul 1⟩⟩ | |
instance : has_inv (units α) := ⟨units.inv'⟩ | ||
|
||
variables (a b) | ||
@[simp] lemma mul_coe : (↑(a * b) : α) = a * b := rfl | ||
@[simp] lemma one_coe : ((1 : units α) : α) = 1 := rfl | ||
@[simp] lemma coe_mul : (↑(a * b) : α) = a * b := rfl | ||
@[simp] lemma coe_one : ((1 : units α) : α) = 1 := rfl | ||
lemma val_coe : (↑a : α) = a.val := rfl | ||
lemma inv_coe : ((a⁻¹ : units α) : α) = a.inv := rfl | ||
lemma coe_inv : ((a⁻¹ : units α) : α) = a.inv := rfl | ||
@[simp] lemma inv_mul : (↑a⁻¹ * a : α) = 1 := inv_val _ | ||
@[simp] lemma mul_inv : (a * ↑a⁻¹ : α) = 1 := val_inv _ | ||
|
||
|
@@ -274,6 +274,16 @@ end | |
def units.mk_of_mul_eq_one [comm_monoid α] (a b : α) (hab : a * b = 1) : units α := | ||
⟨a, b, hab, by rwa mul_comm a b at hab⟩ | ||
|
||
def units.mk_of_ne_zero [field α] {a : α} (ha : a ≠ 0) : units α := | ||
⟨a, a⁻¹, mul_inv_cancel ha, inv_mul_cancel ha⟩ | ||
ChrisHughes24 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@[simp] lemma units.mk_of_ne_zero_inj {α : Type*} [field α] {a b : α} (ha : a ≠ 0) (hb : b ≠ 0) : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a reason to have |
||
units.mk_of_ne_zero ha = units.mk_of_ne_zero hb ↔ a = b := | ||
⟨λ h, by injection h, λ h, units.ext h⟩ | ||
|
||
@[simp] lemma units.coe_mk_of_ne_zero {α : Type*} [field α] {a : α} (ha : a ≠ 0) : | ||
(units.mk_of_ne_zero ha : α) = a := rfl | ||
|
||
@[to_additive with_zero] | ||
def with_one (α) := option α | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I guess this and the next lemmas should be proven on
multiset
and then derived from this. Then theseclassical.dec_eq
are not necessary anymore.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.
Is this comment meant to be somewhere else?
prod_image
doesn't mentionclassical.dec_eq
, and thedecidable_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 usedclassical.dec_eq
in the proof, to save the small bother of a user having to provide thedec_eq
.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.
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.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.
Oh sorry, my comment on
classical.dec_eq
was unnecessary.For me using
classical.dec_eq
is also fine, just a little bit annoying..