Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(number_theory/legendre_symbol/auxiliary, *): add/move lemmas in/…
…to various files, delete `auxiliary.lean` (#14572) This is the first PR in a series that will culminate in providing the proof of Quadratic Reciprocity using Gauss sums. Here we just add some lemmas to the file `auxiliary.lean` that will be used in new code later. We also generalize the lemmas `neg_one_ne_one_of_char_ne_two` and `neg_ne_self_of_char_ne_two` from finite fields to more general rings. See [this Zulipt topic](https://leanprover.zulipchat.com/#narrow/stream/116395-maths/topic/Quadratic.20Hilbert.20symbol.20over.20.E2.84.9A/near/285053214) for more information. **CHANGE OF PLAN:** Following the discussion on Zulip linked to above, the lemmas in `auxiliary.lean` are supposed to be moved to there proper places. I have added suggestions to each lemma or group of lemmas (or definitions) what the proper place could be (in some cases, there are alternatives). Please comment if you do not agree or to support one of the alternatives.
- Loading branch information
1 parent
97c9ef8
commit d6eb634
Showing
11 changed files
with
343 additions
and
174 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/- | ||
Copyright (c) 2022 Michael Stoll. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Michael Stoll | ||
-/ | ||
import algebra.char_p.basic | ||
import group_theory.perm.cycle.type | ||
|
||
/-! | ||
# Characteristic and cardinality | ||
We prove some results relating characteristic and cardinality of finite rings | ||
## Tags | ||
characterstic, cardinality, ring | ||
-/ | ||
|
||
/-- A prime `p` is a unit in a finite commutative ring `R` | ||
iff it does not divide the characteristic. -/ | ||
lemma is_unit_iff_not_dvd_char (R : Type*) [comm_ring R] [fintype R] (p : ℕ) [fact p.prime] : | ||
is_unit (p : R) ↔ ¬ p ∣ ring_char R := | ||
begin | ||
have hch := char_p.cast_eq_zero R (ring_char R), | ||
split, | ||
{ rintros h₁ ⟨q, hq⟩, | ||
rcases is_unit.exists_left_inv h₁ with ⟨a, ha⟩, | ||
have h₃ : ¬ ring_char R ∣ q := | ||
begin | ||
rintro ⟨r, hr⟩, | ||
rw [hr, ← mul_assoc, mul_comm p, mul_assoc] at hq, | ||
nth_rewrite 0 ← mul_one (ring_char R) at hq, | ||
exact nat.prime.not_dvd_one (fact.out p.prime) | ||
⟨r, mul_left_cancel₀ (char_p.char_ne_zero_of_fintype R (ring_char R)) hq⟩, | ||
end, | ||
have h₄ := mt (char_p.int_cast_eq_zero_iff R (ring_char R) q).mp, | ||
apply_fun (coe : ℕ → R) at hq, | ||
apply_fun ((*) a) at hq, | ||
rw [nat.cast_mul, hch, mul_zero, ← mul_assoc, ha, one_mul] at hq, | ||
norm_cast at h₄, | ||
exact h₄ h₃ hq.symm, }, | ||
{ intro h, | ||
rcases nat.is_coprime_iff_coprime.mpr ((nat.prime.coprime_iff_not_dvd (fact.out _)).mpr h) | ||
with ⟨a, b, hab⟩, | ||
apply_fun (coe : ℤ → R) at hab, | ||
push_cast at hab, | ||
rw [hch, mul_zero, add_zero, mul_comm] at hab, | ||
exact is_unit_of_mul_eq_one (p : R) a hab, }, | ||
end | ||
|
||
/-- The prime divisors of the characteristic of a finite commutative ring are exactly | ||
the prime divisors of its cardinality. -/ | ||
lemma prime_dvd_char_iff_dvd_card {R : Type*} [comm_ring R] [fintype R] (p : ℕ) [fact p.prime] : | ||
p ∣ ring_char R ↔ p ∣ fintype.card R := | ||
begin | ||
refine ⟨λ h, h.trans $ int.coe_nat_dvd.mp $ (char_p.int_cast_eq_zero_iff R (ring_char R) | ||
(fintype.card R)).mp $ char_p.cast_card_eq_zero R, λ h, _⟩, | ||
by_contra h₀, | ||
rcases exists_prime_add_order_of_dvd_card p h with ⟨r, hr⟩, | ||
have hr₁ := add_order_of_nsmul_eq_zero r, | ||
rw [hr, nsmul_eq_mul] at hr₁, | ||
rcases is_unit.exists_left_inv ((is_unit_iff_not_dvd_char R p).mpr h₀) with ⟨u, hu⟩, | ||
apply_fun ((*) u) at hr₁, | ||
rw [mul_zero, ← mul_assoc, hu, one_mul] at hr₁, | ||
exact mt add_monoid.order_of_eq_one_iff.mpr | ||
(ne_of_eq_of_ne hr (nat.prime.ne_one (fact.out p.prime))) hr₁, | ||
end | ||
|
||
/-- A prime that does not divide the cardinality of a finite commutative ring `R` | ||
is a unit in `R`. -/ | ||
lemma not_is_unit_prime_of_dvd_card {R : Type*} [comm_ring R] [fintype R] (p : ℕ) [fact p.prime] | ||
(hp : p ∣ fintype.card R) : ¬ is_unit (p : R) := | ||
mt (is_unit_iff_not_dvd_char R p).mp (not_not.mpr ((prime_dvd_char_iff_dvd_card p).mpr hp)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/- | ||
Copyright (c) 2022 Michael Stoll. All rights reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Michael Stoll | ||
-/ | ||
import ring_theory.trace | ||
import field_theory.finite.basic | ||
import field_theory.finite.galois_field | ||
|
||
/-! | ||
# The trace map for finite fields | ||
We define `trace_to_zmod F` for a finite field `F` as the trace map | ||
from `F` to its prime field `zmod p` (where `p = ring_char F`), | ||
and we state the fact that this trace map is nondegenerate. | ||
## Tags | ||
finite field, trace | ||
-/ | ||
|
||
namespace finite_field | ||
|
||
/-- The trace map from a finite field to its prime field is nongedenerate. -/ | ||
lemma trace_to_zmod_nondegenerate (F : Type*) [field F] [fintype F] {a : F} | ||
(ha : a ≠ 0) : ∃ b : F, algebra.trace (zmod (ring_char F)) F (a * b) ≠ 0 := | ||
begin | ||
haveI : fact (ring_char F).prime := ⟨char_p.char_is_prime F _⟩, | ||
have htr := trace_form_nondegenerate (zmod (ring_char F)) F a, | ||
simp_rw [algebra.trace_form_apply] at htr, | ||
by_contra' hf, | ||
exact ha (htr hf), | ||
end | ||
|
||
end finite_field |
Oops, something went wrong.