Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit d6b83d8

Browse files
Vierkantorjcommelin
andcommitted
feat(number_theory): define the class number (#9071)
We instantiate the finiteness proof of the class group for rings of integers, and define the class number of a number field, or of a separable function field, as the finite cardinality of the class group. Co-Authored-By: Ashvni <ashvni.n@gmail.com> Co-Authored-By: Filippo A. E. Nuccio <filippo.nuccio@univ-st-etienne.fr> Co-authored-by: Johan Commelin <johan@commelin.net> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
1 parent f780788 commit d6b83d8

File tree

7 files changed

+113
-5
lines changed

7 files changed

+113
-5
lines changed

src/data/polynomial/field_division.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ lemma coe_norm_unit_of_ne_zero (hp : p ≠ 0) : (norm_unit p : polynomial R) = C
369369
have p.leading_coeff ≠ 0 := mt leading_coeff_eq_zero.mp hp,
370370
by simp [comm_group_with_zero.coe_norm_unit _ this]
371371

372+
lemma normalize_monic (h : monic p) : normalize p = p := by simp [h]
373+
372374
theorem map_dvd_map' [field k] (f : R →+* k) {x y : polynomial R} : x.map f ∣ y.map f ↔ x ∣ y :=
373375
if H : x = 0 then by rw [H, map_zero, zero_dvd_iff, zero_dvd_iff, map_eq_zero]
374376
else by rw [← normalize_dvd_iff, ← @normalize_dvd_iff (polynomial R),

src/number_theory/class_number/finite.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ Authors: Anne Baanen
77
import linear_algebra.free_module.pid
88
import linear_algebra.matrix.absolute_value
99
import number_theory.class_number.admissible_absolute_value
10-
import number_theory.function_field
11-
import number_theory.number_field
1210
import ring_theory.class_group
1311
import ring_theory.norm
1412

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/-
2+
Copyright (c) 2021 Anne Baanen. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Anne Baanen
5+
-/
6+
import number_theory.class_number.admissible_card_pow_degree
7+
import number_theory.class_number.finite
8+
import number_theory.function_field
9+
10+
/-!
11+
# Class numbers of function fields
12+
13+
This file defines the class number of a function field as the (finite) cardinality of
14+
the class group of its ring of integers. It also proves some elementary results
15+
on the class number.
16+
17+
## Main definitions
18+
- `function_field.class_number`: the class number of a function field is the (finite)
19+
cardinality of the class group of its ring of integers
20+
-/
21+
22+
namespace function_field
23+
24+
variables (Fq F : Type) [field Fq] [fintype Fq] [field F]
25+
variables [algebra (polynomial Fq) F] [algebra (ratfunc Fq) F]
26+
variables [is_scalar_tower (polynomial Fq) (ratfunc Fq) F]
27+
variables [function_field Fq F] [is_separable (ratfunc Fq) F]
28+
29+
open_locale classical
30+
31+
namespace ring_of_integers
32+
33+
open function_field
34+
35+
noncomputable instance : fintype (class_group (ring_of_integers Fq F) F) :=
36+
class_group.fintype_of_admissible_of_finite (ratfunc Fq) F
37+
(polynomial.card_pow_degree_is_admissible : absolute_value.is_admissible
38+
(polynomial.card_pow_degree : absolute_value (polynomial Fq) ℤ))
39+
40+
end ring_of_integers
41+
42+
/-- The class number in a function field is the (finite) cardinality of the class group. -/
43+
noncomputable def class_number : ℕ := fintype.card (class_group (ring_of_integers Fq F) F)
44+
45+
/-- The class number of a function field is `1` iff the ring of integers is a PID. -/
46+
theorem class_number_eq_one_iff :
47+
class_number Fq F = 1 ↔ is_principal_ideal_ring (ring_of_integers Fq F) :=
48+
card_class_group_eq_one_iff
49+
50+
end function_field
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/-
2+
Copyright (c) 2021 Anne Baanen. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Anne Baanen
5+
-/
6+
import number_theory.class_number.admissible_abs
7+
import number_theory.class_number.finite
8+
import number_theory.number_field
9+
10+
/-!
11+
# Class numbers of number fields
12+
13+
This file defines the class number of a number field as the (finite) cardinality of
14+
the class group of its ring of integers. It also proves some elementary results
15+
on the class number.
16+
17+
## Main definitions
18+
- `number_field.class_number`: the class number of a number field is the (finite)
19+
cardinality of the class group of its ring of integers
20+
-/
21+
22+
namespace number_field
23+
24+
variables (K : Type*) [field K] [number_field K]
25+
26+
namespace ring_of_integers
27+
28+
noncomputable instance : fintype (class_group (ring_of_integers K) K) :=
29+
class_group.fintype_of_admissible_of_finite ℚ _ absolute_value.abs_is_admissible
30+
31+
end ring_of_integers
32+
33+
/-- The class number of a number field is the (finite) cardinality of the class group. -/
34+
noncomputable def class_number : ℕ := fintype.card (class_group (ring_of_integers K) K)
35+
36+
variables {K}
37+
38+
/-- The class number of a number field is `1` iff the ring of integers is a PID. -/
39+
theorem class_number_eq_one_iff :
40+
class_number K = 1 ↔ is_principal_ideal_ring (ring_of_integers K) :=
41+
card_class_group_eq_one_iff
42+
43+
end number_field
44+
45+
namespace rat
46+
47+
open number_field
48+
49+
theorem class_number_eq : number_field.class_number ℚ = 1 :=
50+
class_number_eq_one_iff.mpr $ by convert is_principal_ideal_ring.of_surjective
51+
(rat.ring_of_integers_equiv.symm : ℤ →+* ring_of_integers ℚ)
52+
(rat.ring_of_integers_equiv.symm.surjective)
53+
54+
end rat

src/number_theory/function_field.lean

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Authors: Anne Baanen, Ashvni Narayanan
55
-/
66
import field_theory.ratfunc
77
import ring_theory.algebraic
8+
import ring_theory.dedekind_domain
89
import ring_theory.integrally_closed
910

1011
/-!
@@ -99,7 +100,9 @@ integral_closure.is_fraction_ring_of_finite_extension (ratfunc Fq) F
99100
instance : is_integrally_closed (ring_of_integers Fq F) :=
100101
integral_closure.is_integrally_closed_of_finite_extension (ratfunc Fq)
101102

102-
-- TODO: show `ring_of_integers Fq F` is a Dedekind domain
103+
instance [is_separable (ratfunc Fq) F] :
104+
is_dedekind_domain (ring_of_integers Fq F) :=
105+
is_integral_closure.is_dedekind_domain (polynomial Fq) (ratfunc Fq) F _
103106

104107
end ring_of_integers
105108

src/number_theory/number_field.lean

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ variables (K)
8484

8585
instance [number_field K] : char_zero (ring_of_integers K) := char_zero.of_algebra K
8686

87-
-- TODO: show `ring_of_integers K` is a Dedekind domain
87+
instance [number_field K] : is_dedekind_domain (ring_of_integers K) :=
88+
is_integral_closure.is_dedekind_domain ℤ ℚ K _
8889

8990
end ring_of_integers
9091

src/ring_theory/unique_factorization_domain.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class unique_factorization_monoid (α : Type*) [comm_cancel_monoid_with_zero α]
139139
(irreducible_iff_prime : ∀ {a : α}, irreducible a ↔ prime a)
140140

141141
/-- Can't be an instance because it would cause a loop `ufm → wf_dvd_monoid → ufm → ...`. -/
142-
lemma ufm_of_gcd_of_wf_dvd_monoid [comm_cancel_monoid_with_zero α]
142+
@[reducible] lemma ufm_of_gcd_of_wf_dvd_monoid [comm_cancel_monoid_with_zero α]
143143
[wf_dvd_monoid α] [gcd_monoid α] : unique_factorization_monoid α :=
144144
{ irreducible_iff_prime := λ _, gcd_monoid.irreducible_iff_prime
145145
.. ‹wf_dvd_monoid α› }

0 commit comments

Comments
 (0)