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

Commit d0259b0

Browse files
committed
refactor(ring_theory/class_group): redefine class_group without fraction field (#16727)
Although the definition of the class group of a ring `R` involves the field of fractions, the definition does not depend (up to isomorphism) on the choice of field of fractions. This PR proposes to always choose `fraction_ring R` as that field, so that we don't need to carry around the mathematically unnecessary parameters `(K) [field K] [algebra R K] [is_fraction_ring R K]`. Instead, we insert the isomorphism between the definitions of class group at the API boundaries. This was inspired by our work on quadratic rings: it gets even more annoying when you need to start carrying around a proof that the field of fractions of `ℤ[1/2√-7]` is `ℚ(√-7)`. Co-authored-by: Anne Baanen <t.baanen@vu.nl> Co-authored-by: Anne Baanen <Vierkantor@users.noreply.github.com>
1 parent 446eb51 commit d0259b0

File tree

4 files changed

+196
-89
lines changed

4 files changed

+196
-89
lines changed

src/number_theory/class_number/finite.lean

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,8 @@ include ist iic
292292

293293
/-- Each class in the class group contains an ideal `J`
294294
such that `M := Π m ∈ finset_approx` is in `J`. -/
295-
theorem exists_mk0_eq_mk0 [is_dedekind_domain S] [is_fraction_ring S L]
296-
(h : algebra.is_algebraic R L) (I : (ideal S)⁰) :
297-
∃ (J : (ideal S)⁰), class_group.mk0 L I = class_group.mk0 L J ∧
295+
theorem exists_mk0_eq_mk0 [is_dedekind_domain S] (h : algebra.is_algebraic R L) (I : (ideal S)⁰) :
296+
∃ (J : (ideal S)⁰), class_group.mk0 I = class_group.mk0 J ∧
298297
algebra_map _ _ (∏ m in finset_approx bS adm, m) ∈ (J : ideal S) :=
299298
begin
300299
set M := ∏ m in finset_approx bS adm, m with M_eq,
@@ -332,17 +331,16 @@ omit iic ist
332331
/-- `class_group.mk_M_mem` is a specialization of `class_group.mk0` to (the finite set of)
333332
ideals that contain `M := ∏ m in finset_approx L f abs, m`.
334333
By showing this function is surjective, we prove that the class group is finite. -/
335-
noncomputable def mk_M_mem [is_fraction_ring S L] [is_dedekind_domain S]
334+
noncomputable def mk_M_mem [is_dedekind_domain S]
336335
(J : {J : ideal S // algebra_map _ _ (∏ m in finset_approx bS adm, m) ∈ J}) :
337-
class_group S L :=
338-
class_group.mk0 _ ⟨J.1, mem_non_zero_divisors_iff_ne_zero.mpr
336+
class_group S :=
337+
class_group.mk0 ⟨J.1, mem_non_zero_divisors_iff_ne_zero.mpr
339338
(ne_bot_of_prod_finset_approx_mem bS adm J.1 J.2)⟩
340339

341340
include iic ist
342341

343-
lemma mk_M_mem_surjective [is_fraction_ring S L] [is_dedekind_domain S]
344-
(h : algebra.is_algebraic R L) :
345-
function.surjective (class_group.mk_M_mem L bS adm) :=
342+
lemma mk_M_mem_surjective [is_dedekind_domain S] (h : algebra.is_algebraic R L) :
343+
function.surjective (class_group.mk_M_mem bS adm) :=
346344
begin
347345
intro I',
348346
obtain ⟨⟨I, hI⟩, rfl⟩ := class_group.mk0_surjective I',
@@ -358,8 +356,8 @@ algebraic extension `L` is finite if there is an admissible absolute value.
358356
See also `class_group.fintype_of_admissible_of_finite` where `L` is a finite
359357
extension of `K = Frac(R)`, supplying most of the required assumptions automatically.
360358
-/
361-
noncomputable def fintype_of_admissible_of_algebraic [is_fraction_ring S L] [is_dedekind_domain S]
362-
(h : algebra.is_algebraic R L) : fintype (class_group S L) :=
359+
noncomputable def fintype_of_admissible_of_algebraic [is_dedekind_domain S]
360+
(h : algebra.is_algebraic R L) : fintype (class_group S) :=
363361
@fintype.of_surjective _ _ _
364362
(@fintype.of_equiv _
365363
{J // J ∣ ideal.span ({algebra_map R S (∏ (m : R) in finset_approx bS adm, m)} : set S)}
@@ -368,9 +366,11 @@ noncomputable def fintype_of_admissible_of_algebraic [is_fraction_ring S L] [is_
368366
exact prod_finset_approx_ne_zero bS adm }))
369367
((equiv.refl _).subtype_equiv (λ I, ideal.dvd_iff_le.trans
370368
(by rw [equiv.refl_apply, ideal.span_le, set.singleton_subset_iff]))))
371-
(class_group.mk_M_mem L bS adm)
369+
(class_group.mk_M_mem bS adm)
372370
(class_group.mk_M_mem_surjective L bS adm h)
373371

372+
include K
373+
374374
/-- The main theorem: the class group of an integral closure `S` of `R` in a
375375
finite extension `L` of `K = Frac(R)` is finite if there is an admissible
376376
absolute value.
@@ -379,8 +379,7 @@ See also `class_group.fintype_of_admissible_of_algebraic` where `L` is an
379379
algebraic extension of `R`, that includes some extra assumptions.
380380
-/
381381
noncomputable def fintype_of_admissible_of_finite [is_dedekind_domain R] :
382-
fintype (@class_group S L _ _ _
383-
(is_integral_closure.is_fraction_ring_of_finite_extension R K L S)) :=
382+
fintype (class_group S) :=
384383
begin
385384
letI := classical.dec_eq L,
386385
letI := is_integral_closure.is_fraction_ring_of_finite_extension R K L S,

src/number_theory/class_number/function_field.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ namespace ring_of_integers
3333

3434
open function_field
3535

36-
noncomputable instance : fintype (class_group (ring_of_integers Fq F) F) :=
36+
noncomputable instance : fintype (class_group (ring_of_integers Fq F)) :=
3737
class_group.fintype_of_admissible_of_finite (ratfunc Fq) F
3838
(polynomial.card_pow_degree_is_admissible : absolute_value.is_admissible
3939
(polynomial.card_pow_degree : absolute_value Fq[X] ℤ))
4040

4141
end ring_of_integers
4242

4343
/-- The class number in a function field is the (finite) cardinality of the class group. -/
44-
noncomputable def class_number : ℕ := fintype.card (class_group (ring_of_integers Fq F) F)
44+
noncomputable def class_number : ℕ := fintype.card (class_group (ring_of_integers Fq F))
4545

4646
/-- The class number of a function field is `1` iff the ring of integers is a PID. -/
4747
theorem class_number_eq_one_iff :

src/number_theory/number_field/class_number.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ variables (K : Type*) [field K] [number_field K]
2525

2626
namespace ring_of_integers
2727

28-
noncomputable instance : fintype (class_group (ring_of_integers K) K) :=
29-
class_group.fintype_of_admissible_of_finite ℚ _ absolute_value.abs_is_admissible
28+
noncomputable instance : fintype (class_group (ring_of_integers K)) :=
29+
class_group.fintype_of_admissible_of_finite ℚ K absolute_value.abs_is_admissible
3030

3131
end ring_of_integers
3232

3333
/-- 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)
34+
noncomputable def class_number : ℕ := fintype.card (class_group (ring_of_integers K))
3535

3636
variables {K}
3737

0 commit comments

Comments
 (0)