A formalization of Dedekind domains and class groups of global fields
Anne Baanen, Sander R. Dahmen, Ashvni Narayanan, Filippo A. E. Nuccio
AA formalization of Dedekind domains and classgroups of global fields
Anne Baanen ! ˇ (cid:18) Department of Computer Science, Vrije Universiteit Amsterdam, The Netherlands
Sander R. Dahmen ! ˇ (cid:18) Department of Mathematics, Vrije Universiteit Amsterdam, The Netherlands
Ashvni Narayanan ! (cid:18) London School of Geometry and Number Theory
Filippo A. E. Nuccio Mortarino Majno di Capriglio ! ˇ (cid:18) Univ Lyon, Université Jean Monnet Saint-Étienne, CNRS UMR 5208, Institut Camille Jordan,F-42023 Saint-Étienne, France
Abstract
Dedekind domains and their class groups are notions in commutative algebra that are essentialin algebraic number theory. We formalized these structures and several fundamental properties,including number theoretic finiteness results for class groups, in the Lean prover as part of the mathlib mathematical library. This paper describes the formalization process, noting the idioms wefound useful in our development and mathlib ’s decentralized collaboration processes involved in thisproject.
Mathematics of computing → Mathematical software; Securityand privacy → Logic and verification
Keywords and phrases formal math, algebraic number theory, commutative algebra, Lean, mathlib
Digital Object Identifier
Supplementary Material
Full source code of the formalization is part of mathlib . Copies of thesource files relevant to this paper are available in a separate repository.
Software : https://github.com/lean-forward/class-number Funding
Anne Baanen : NWO Vidi grant No. 016.Vidi.189.037, Lean Forward
Sander R. Dahmen : NWO Vidi grant No. 639.032.613, New Diophantine Directions
Ashvni Narayanan : EPSRC Grant EP/S021590/1 (UK)
Acknowledgements
We would like to thank Jasmin Blanchette for useful comments on a first versionof the manuscript.A. N. would like to thank Prof. Kevin Buzzard for his constant support and encouragement, and forintroducing her to the other co-authors.A. N. and F. N. wish to express their deepest gratitude to Anne Baanen for the generosity shownalong all stages of the project. Without Anne’s never-ending patience, it would have been impossiblefor them to contribute to this project, and to overcome several difficulties.Finally, we would like to thank the whole mathlib community for invaluable advice all along theproject.
In its basic form, number theory studies properties of the integers Z and its fraction field,the rational numbers Q . Both for the sake of generalization, as well as for providing powerfultechniques to answer questions about the original objects Z and Q , it is worthwhile to studyfinite extensions of Q , called number fields , as well as their rings of integers (Section 2), © Anne Baanen, Sander R. Dahmen, Ashvni Narayanan, and Filippo A. E. Nuccio Mortarino Majnodi Capriglio;licensed under Creative Commons License CC-BY 4.0Interactive Theorem Proving 2021 (ITP 2021).Leibniz International Proceedings in InformaticsSchloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl Publishing, Germany a r X i v : . [ c s . L O ] F e b X:2 Dedekind domains and class groups whose relations mirror the way Q contains Z as a subring. In this paper, we describe ourproject aiming at formalizing these notions and some of their important properties. Our goal,however, is not to get to the definitions and properties as quickly as possible, but rather tolay the foundations for future work, as part of a natural and more general theory as we shallexplain below.In particular, our project resulted in formalized definitions and elementary properties ofnumber fields and their rings of integers (Section 3.3), Dedekind domains (Section 4), andthe ideal class group and class number (Section 7). Apart form the very basics concerningnumber fields, these concepts were not formalized before as far as we are aware of. We notethat our formal definition of the class number is an essential requirement for the use oftheorem provers in modern number theory research. The main proofs that we formalizedshow that two definitions of Dedekind domains are equivalent (Section 4.3), that the ringof integers is a Dedekind domain (Section 6) and that the class group of a number field isfinite (Section 7). In fact, most of our results for number fields are also obtained in the moregeneral setting of global fields .Our work is developed as part of the mathematical library mathlib [20] for the Lean 3theorem prover [6]. The formal system of Lean is a dependent type theory based on thecalculus of inductive constructions, with a proof-irrelevant impredicative universe Prop at thebottom of a noncumulative hierarchy of universes
Prop : Type : Type 1 : Type 2 : ... ;“an arbitrary Type u ” is abbreviated as
Type* . Other important characteristics of Lean asused in mathlib are the use of quotient types, ubiquitous classical reasoning and the use oftypeclasses to define the hierarchy of algebraic structures.Organizationally, mathlib is characterized by a distributed and decentralized communityof contributors, a willingness to refactor its basic definitions, and a preference for small yetcomplete contributions over larger projects added all at once. In this project, as part ofthe development of mathlib , we follow this philosophy by contributing pieces of our workas they are finished. We, in turn, use results contributed by others after the start of theproject. At several points, we had just merged a formalization into mathlib that anothercontributor needed, immediately before they contributed a result that we needed. Dueto the decentralized organization and fluid nature of contributions to mathlib , its contentsare built up of many different contributions from over 100 different authors. Attributingeach formalization to a single set of main authors would not do justice to all others whoseadditions and tweaks are essential to its current use. Therefore, we will make clear whethera contribution is part of our project or not, but we will not stress whom we consider to bethe main authors.The source files of the formalization are currently in the process of being merged into mathlib . The up-to-date development branch is publically available. We also maintain arepository containing the source code referred to in this paper. Let us now introduce some of the main objects we study, described informally. We assumesome familiarity with basic ring and field theory.A number field K is a finite extension of the field Q , and as such has the structureof a finite dimensional vector space over Q ; its dimension is called the degree of K . The https://github.com/leanprover-community/mathlib/tree/dedekind-domain-dev https://github.com/lean-forward/class-number . Baanen, S. R. Dahmen, A. Narayanan, and F. A. E. Nuccio XX:3 easiest example is Q itself, and the two-dimensional cases are given by the quadratic numberfields Q ( √ d ) = { a + b √ d : a, b ∈ Q } where d ∈ Z is not a square. For an interestingcubic example, let α be the unique real number satisfying α + α − α + 8 = 0. It givesrise to the number field Q ( α ) = { a + bα + cα : a, b, c ∈ Q } . In general, taking anyroot α of an irreducible polynomial of degree n over Q yields a number field of degree n : Q ( α ) = { c + c α + . . . + c n − α n − : c , c , . . . , c n − ∈ Q } , and, up to isomorphism, theseare all the number fields of degree n .The ring of integers O K of a number field K is defined as the integral closure of Z in K ,which amounts to O K := (cid:8) x ∈ K : f ( x ) = 0 for some monic polynomial f with integer coefficients (cid:9) , where we recall that a polynomial is called monic if its leading coefficient equals 1. Whileit might not be immediately obvious that O K is a ring, this follows from general algebraicproperties of integral closures. Some examples of O K are the following. Taking K = Q ,we get O K = Z back. For K = Q ( i ) = Q ( √−
1) we get that O K is the ring of Gaussianintegers Z [ i ] = { a + bi : a, b ∈ Z } . But for K = Q ( √
5) we do not simply get Z [ √
5] = { a + b √ a, b ∈ Z } as O K , since the golden ratio φ := (1 + √ / ̸∈ Z [ √
5] satisfiesthe monic polynomial equation φ − φ − φ ∈ O K . It turnsout that O K = Z [ φ ] = { a + bφ : a, b ∈ Z } . Finally, if K = Q ( α ) with α as before, then O K = { a + bα + c ( α + α ) / a, b, c ∈ Z } , illustrating that explicitly writing down O K canquickly become complicated. Further well-known rings of integers are the Eisenstein integers Z [(1 + √− /
2] and the ring Z [ √ O K as a generalization of Z , it is natural to ask which of its properties stillhold in O K and, when this fails, if a reasonable weakening does.An important property of Z is that it is a principal ideal domain (PID), meaning thatevery ideal is generated by one element. This implies that every nonzero nonunit elementcan be written as a finite product of prime elements, which is unique up to reordering andmultiplying by ±
1: a ring where this holds is called a unique factorization domain, or UFD.For example, 6 can be factored in primes in 4 equivalent ways, namely 6 = 2 · · − · ( −
3) = ( − · ( − does not hold in Z [ √− · √− − √− Z [ √− ideals instead of elements: given a number field K , with ring of integers O K , a beautifuland classical result by Dedekind shows that every nonzero ideal of O K can be factored as aproduct of prime ideals in a unique way, up to reordering.Although unique factorization in terms of ideals is of great importance, it is still interesting,and sometimes necessary, to also consider factorization properties in terms of elements. Wementioned that unique factorization in Z follows from the fact that every ideal is generatedby a single element. We can extend the monoid of ideals of Z to a group of fractional ideals .These are additive subgroups of Q of the form d I with I an ideal of Z and d a nonzerointeger. When the distinction is important, we refer to an ideal I ⊆ Z as an integral ideal .The nonzero fractional ideals of Z naturally form a multiplicative group (whereas there is nointegral ideal I ⊆ Z such that I ∗ (2 Z ) = (1)). The statement that every ideal is generatedby a single element translates to the fact that the quotient group of nonzero fractional idealsmodulo Q × (where ab ∈ Q × corresponds to b a Z ) is trivial.It turns out that this quotient group can be defined for every ring of integers O K .The fundamental theoretical notion beneath this construction is that of Dedekind domain: I T P 2 0 2 1
X:4 Dedekind domains and class groups these are integral domains D which are Noetherian (every ideal of D is finitely generated),integrally closed (if an element x in the fraction field of D is a root of a monic polynomialwith coefficients in D , then actually x ∈ D ), and of Krull dimension at most 1 (every nonzeroprime ideal of D is maximal). It can be proved that the nonzero fractional ideals of D againform a group, and the quotient of this group by the image of the natural embedding of(Frac D ) × is called the ( ideal ) class group C l D .What is arithmetically crucial is the theorem ensuring that the ring of integers O K ofevery number field K is a Dedekind domain, and that in this case the class group C l O K isactually finite . In particular, C l O K can be seen as “measuring” how far ideals of O K arefrom being generated by a single element and, consequently, as a measure of the failure ofunique factorization. The order of C l O K is called the class number of K . Intuitively, then,the smaller the class number, the fewer factorizations are possible.The statements in the previous paragraph also hold for function fields , namely fieldswhich are finite extensions of F q ( t ) ≃ Frac F q [ t ], where F q is a finite field with q elements.Recall that when q is a prime number, F q is simply the field Z /q Z . A field which is either anumber field or a function field is called a global field .In the next sections we will describe the formalization of the above concepts. We refer the reader to Section 2 for the mathematical background needed in this section.We formalized number fields as the following typeclass: class is_number_field (K : Type*) [field K] : Prop :=[cz : char_zero K] [fd : finite_dimensional Q K] The class keyword declares a structure type (in other words, a type of records) and enablestypeclass inference for terms of this type. Round brackets mark parameters explicitly suppliedby the user, such as (K : Type*) , square brackets mark instance parameters inferred by thetypeclass system, such as [field K] . The condition [cz : char_zero K] states that K hascharacteristic zero, so the canonical ring homomorphism Z → K is an embedding. This impliesthat there is a Q -algebra structure on K (found by typeclass instance search), endowing K withthe Q -vector space structure used in the [fd : finite_dimensional Q K] hypothesis.We defined the function fields K over a finite field F q using the following typeclass: class is_function_field_over { F q F : Type*} [field F q ] [fintype F q ][field F] (f : fraction_map (polynomial F q ) F) (L : Type*) [field L][algebra f.codomain L] : Prop :=[fd : finite_dimensional f.codomain L] Curly brackets mark implicit parameters inferred through unification, such as { F q F :Type*} . The map f witnesses that F is a fraction field of the polynomial ring F q [ t ], thenotation f.codomain endows F with the F q [ t ]-algebra structure of F q ( t ). We present a moredetailed analysis of fraction_map in Section 3.5. The definition of is_number_field illustrates our treatment of field extensions. A field L containing a subfield K is said to be a field extension L/K . Often we encounter towers offield extensions: we might have that Q is contained in K , K is contained in L , L is contained . Baanen, S. R. Dahmen, A. Narayanan, and F. A. E. Nuccio XX:5 in an algebraic closure K of K , and K is contained in C . We might formalize this situationby viewing Q , K , L and K as sets of complex numbers C and defining field extensions assubset relations between these subfields. This way, no coercions need to be inserted in orderto map elements of one field into a larger field. Unfortunately, we can only avoid coercionsas far as we are able to stay within one largest field. For example, the definition of complexnumbers depends on many results for rational numbers, which would need to be provedagain, or transported, for the subfield of C isomorphic to Q .Instead, we formalized results about field extensions through parametrization. The fields K and L can be arbitrary types and the hypothesis “ L is a field extension of K ” is representedby an instance parameter [algebra K L] denoting a K -algebra structure on L . There aremultiple possible K -algebra structures for a field L and Lean does not enforce uniquenessof typeclass instances, but the mathlib maintainers try to ensure all instances that can beinferred are definitionally equal. The algebra structure provides us with a canonical ringhomomorphism algebra_map K L : K → L ; this map is injective because K and L are fields.In other words, field extensions are given by their canonical embeddings. The main drawback of using arbitrary embeddings to represent field extensions is that weneed to prove that these maps commute. For example, we might start with a field extension L/ Q , then define a subfield K of L , resulting in a tower of extensions L/K/ Q . In such atower, the map Q → L should be equal to the composition Q → K followed by K → L . Suchan equality cannot always be achieved by defining the map Q → L to be this composition:in the example, the map Q → K depends on the map Q → L .The solution in mathlib is to parametrize over all three maps, as long a there is alsoa proof of coherence: a hypothesis of the form “ L/K/F is a tower of field extensions” istranslated into three instance parameters [algebra F K] , [algebra K L] and [algebraF L] , along with an additional parameter [is_scalar_tower F K L] expressing that themaps commute.The is_scalar_tower typeclass derives its name from its applicability to any three typesbetween which exist scalar multiplication operations: class is_scalar_tower (M N α : Type*)[has_scalar M N] [has_scalar N α ] [has_scalar M α ] : Prop :=(smul_assoc : ∀ (x : M) (y : N) (z : α ), (x · y) · z = x · (y · z)) For example, if R is a ring, A is an R -algebra and M an A -module, we can state that M is also an R -module by adding a [is_scalar_tower R A M] parameter. Since x · y for an R -algebra A is defined as algebra_map R A x * y , applying smul_assoc for each x : K with y = (1 : L ) and z = (1 : F ) shows that the algebra_map s indeed commute.Common is_scalar_tower instances are declared in mathlib , such as for the maps R → S → A when S is a R -subalgebra of A . The effect is that almost all coherence proofobligations are automated through typeclass instance search. When K is a number field, the ring O K of integers in K is defined as the integral closure of Z in K . This is the subring containing those x : K that are the roots of monic polynomialswith coefficients in Z , which we formalized as: I T P 2 0 2 1
X:6 Dedekind domains and class groups def number_field.ring_of_integers (K : Type*) [field K][is_number_field K] : subalgebra Z K :=integral_closure Z K where integral_closure was previously defined in mathlib .When K is a function field over the finite field F q , we defined O K analogously as integral_closure (polynomial K) F . To treat both definitions of ring of integers on anequal footing, we will work with the integral closure of any principal ideal domain whenpossible. The ring of integers is one example of a subobject, such as a subfield, subring or subalgebra,defined through a characteristic predicate. In mathlib , subobjects are “bundled”, in the formof a structure comprising the carrier set and proofs showing the carrier set is closed underthe relevant operations.Two new subobjects that we defined in our development were subfield as well as intermediate_field . We defined a subfield of a field K as a subset of K that contains 0and 1 and is closed under addition, negation, multiplication and taking inverses. If L is a fieldextension of K , we defined an intermediate field as a subfield that is also a K -subalgebra:a subfield that contains the image of algebra_map K L . Other examples of subobjectsavailable in mathlib are submonoids, subgroups and submodules (with ideals as a special caseof submodules).The new definitions found immediate use: soon after we contributed our definition of intermediate_field to mathlib , the Berkeley Galois theory group used it in a formalizationof the primitive element theorem. Soon after the primitive element theorem was mergedinto mathlib , we used it in our development of the trace form. This anecdote illustrates thedecentralized development style of mathlib , with different groups and people building on eachother’s results in a collaborative process.By providing a coercion from subobjects to types, sending a subobject S to the subtypeof all elements of S , and putting typeclass instances on this subtype, we could reason aboutinductively defined rings such as Z and subrings such as integral_closure Z K uniformly.If S : subfield K , there is a canonical ring embedding, the map that sends x : S to K by “forgetting” that x ∈ S , and we registered this map as an algebra S K instance, alsoallowing us to treat field extensions of the form Q → C and subfields uniformly. Similarly,for F : intermediate_field K L , we defined the corresponding algebra K F , algebra FL and is_scalar_tower K F L instances. The fraction field Frac R of an integral domain R can be defined explicitly as a quotienttype as follows: starting from the set of pairs ( a, b ) with a, b ∈ R such that b ̸ = 0, onequotients by the equivalence relation generated by ( αa, αb ) ∼ ( a, b ) for all α ̸ = 0 : R , writingthe equivalence class of ( a, b ) as ab . It can easily be proved that the ring structure on R extends uniquely to a field structure on Frac R ; in mathlib this construction is called fraction_ring R . When R = Z , this yields the traditional description of Q as the set ofequivalence classes of fractions, where = − − , etc. The drawback of this construction is thatthere are many other fields that can serve as the field of fractions for the same ring. Consider . Baanen, S. R. Dahmen, A. Narayanan, and F. A. E. Nuccio XX:7 the field { z ∈ C : ℜ z ∈ Q , ℑ z ∈ Q } , which is isomorphic to Frac( Z [ i ]) but not definitionallyequal to it.The strategy used in mathlib is to rather allow for many different fraction fields of ourgiven integral domain R , as fields F along with an injective fraction map f : R → F whichwitnesses that all elements of F are “fractions” of elements of R , and to parametrize everyresult over the choice of f . In the definition used by mathlib , a fraction map is a specialcase of a localization map . Different localizations restrict the denominators to differentmultiplicative submonoids of R \ { } .The conditions on f imply that F is the smallest field containing R , expressed by thefollowing unique mapping property. If g : R → A is an injective map to a ring A such that g ( x ) has a multiplicative inverse for all x ̸ = 0 : R , then it can be extended uniquely to a map F → A compatible with f and g . In particular, if f : R → F and f : R → F are fractionmaps, they induce an isomorphism F ≃ F . The construction of Frac R then results in a field of fractions (with fraction map fraction_ring.of R ) rather than the field of fractions.This comes at a price: informally, at any given stage of one’s reasoning, the field F isfixed and the map f : R → F is applied implicitly, just viewing every x : R as x : F . It is nowimpossible to view f ( R ) ≤ F as an inclusion of subalgebras, because the map f is neededexplicitly to give the R -algebra structure on F . We use a type synonym f.codomain := F and instantiate the R -algebra structure given by f on this synonym. In Section 2 we have informally said that every number field K can be written as K = Q ( α )for a root α of an irreducible polynomial P ∈ Q [ X ]. This can be made precise in several ways.For instance, one can consider a large field E (of characteristic 0) where P splits completely,then choose a root α ∈ E and let Q ( α ) be the smallest subfield of E containing α . Or, onecan consider the quotient ring Q [ X ] /P and observe that this is a field where the class X (mod P ) is a root of P . The assignment α X (mod P ) yields an isomorphism of the twofields, but any other choice of a root α ′ ∈ E leads to another isomorphism Q ( α ′ ) ∼ = Q [ X ] /P .Although mathematically we often tacitly identify the constructions, there is no canonicalrepresentation of the monogenic extensions of Q , those which can be obtained by adjoining asingle root of one polynomial.The same continues to hold if we replace the base field Q with another field F , thusconsidering extensions of the form F ( α ), now requiring that α be a root of some P ∈ F [ X ].Various constructions of F ( α ) have already been formalized in mathlib . The ability to switchbetween these representations is important: sometimes K and F are fixed and we want anarbitrary α ; sometimes α is fixed and we want an arbitrary type representing F ( α ).To find a uniform way to reason about all these definitions, we chose to formalize thenotion of power basis to represent monogenic field extensions: this is a basis of the form1 , x, x , . . . , x n − : K (viewing K as a F -vector space). We defined a structure type bundlingthe information of a power basis. Omitting some generalizations not needed in this paper,the definition reads: structure power_basis (F K : Type*) [field F] [field K] [algebra F K] :=(gen : S) (dim : N )(is_basis : is_basis F ( λ (i : fin dim), gen ^ (i : N ))) We formalized that the previously defined notions of monogenic field extensions are equivalentto the existence of a power basis.
I T P 2 0 2 1
X:8 Dedekind domains and class groups
With the power_basis structure, we gained the ability to parametrize our results,being able to choose the F and K in a monogenic field extension K/F , or being able tochoose the α generating F ( α ) (by setting power_basis.gen pb equal to α ). To specializea result from an arbitrary K with a power basis over F to a specific value of K such as F ( α ) = algebra.adjoin F { α } , one can apply the result to the power basis generated by α and rewrite power_basis.gen (adjoin.power_basis F α ) = α . The right setting to study algebraic properties of number fields are
Dedekind domains . Weformalized fundamental results on Dedekind domains, including the equivalence of twodefinitions of Dedekind domain.
There are various equivalent conditions, used at various times, for an integral domain D tobe a Dedekind domain. The following three have been formalized in mathlib : is_dedekind_domain D : D is a Noetherian integral domain, integrally closed in itsfraction field and has Krull dimension at most 1; is_dedekind_domain_inv D : D is an integral domain and nonzero fractional ideals of D have a multiplicative inverse (we discuss the notion and formalization of fractional idealsin Section 4.2); is_dedekind_domain_dvr D : D is a Noetherian integral domain and the localization of D at each nonzero prime ideal is a discrete valuation ring.Note that fields are Dedekind domains according to these conventions.The mathlib community chose is_dedekind_domain as the main definition, since thiscondition is usually the one checked in practice [17]. The other two equivalent definitions wereadded to mathlib , but before formalizing the proof that they are indeed equivalent. Havingmultiple definitions allowed us to do our work in parallel without depending on unformalizedresults. For example, the proof of unique ideal factorization in a Dedekind domain ini-tially assumed is_dedekind_domain_inv D , and the proof that the ring of integers O K is aDedekind domain concluded is_dedekind_domain (ring_of_integers K) . After the equiv-alence between is_dedekind_domain D and is_dedekind_domain_inv D was formalized,we could easily replace usages of is_dedekind_domain_inv with is_dedekind_domain .The conditions is_dedekind_domain and is_dedekind_domain_inv require a fractionfield F , although the truth value of the predicates does not depend on the choice of F .For ease of use, we let the type of is_dedekind_domain depend only on the domain D byinstantiating F in the definition as fraction_ring D . From now on, we fix a fraction map f : D → F . class is_dedekind_domain (D : Type*) [integral_domain D] : Prop :=(to_is_noetherian_ring : is_noetherian_ring D)(dimension_le_one : dimension_le_one D)(is_integrally_closed : integral_closure D (fraction_ring D) = ⊥ ) Applications of is_dedekind_domain can choose a specific fraction field through the followinglemma exposing the alternate definition: lemma is_dedekind_domain_iff (f : fraction_map D F) :is_dedekind_domain D ↔ . Baanen, S. R. Dahmen, A. Narayanan, and F. A. E. Nuccio XX:9 is_noetherian_ring D ∧ dimension_le_one D ∧ integral_closure D f.codomain = ⊥ We marked is_dedekind_domain as a typeclass by using the keyword class ratherthan structure , allowing the typeclass system to automatically infer the Dedekind domainstructure when an appropriate instance is declared, such as for PIDs or rings of integers.
The notion that is pivotal to the definition of the ideal class group of a Dedekind domainis that of fractional ideals : given any integral domain R with a field of fractions F , theseare R -submodules J of F such that there is an x : R with xJ ⊆ R . For a Dedekind domain,they form a group under multiplication. As seen in Section 3.5, this notion depends on thefield F as well as on the fraction map f : R → F . A more precise way of stating the abovecondition is then f ( x ) J ⊆ f ( R ). We formalized the definition of fractional ideals relativeto a map f : R → F as a type fractional_ideal f . The structure of fractional idealsdoes not depend on the choice of a fraction map, which we formalized as an isomorphism fractional_ideal.canonical_equiv between the fractional ideals relative to fraction maps f : R → F and f : R → F .We defined the addition, multiplication and intersection operations on fractional ideals,by showing the corresponding operations on submodules map fractional ideals to fractionalideals. We also formalized that these operations give a commutative semiring structure onthe type of fractional ideals. For example, multiplication of fractional ideals is defined as lemma fractional_mul (I J : fractional_ideal f) :is_fractional f (I.1 * J.1) := _ -- proof omitted instance : has_mul (fractional_ideal f) := ⟨ λ I J, ⟨ I.1 * J.1, fractional_mul I J ⟩⟩ Defining the quotient of two fractional ideals requires slightly more work. Consider any R -algebra A and an injection R , → A . Given ideals I, J ≤ R , the submodule quotient I/J ≤ A is characterized by the property lemma submodule.mem_div_iff_forall_mul_mem {x : A} {I J : submodule R A} :x ∈ I / J ↔ ∀ y ∈ J, x * y ∈ I Beware that the notation 1 /I might be misleading here: indeed, for general integral domains,the equality I ∗ /I = 1 might not hold. As an example, one can consider the ideal ( X, Y ) in C [ X, Y ]. On the other hand, we formalized that this equality holds for Dedekind domains(Section 4.3) as the following lemma: lemma fractional_ideal.is_unit {hD : is_dedekind_domain D}(I : fractional_ideal f) (hne : I ̸ = ⊥ ) : is_unit I This justifies the notation I − = 1 /I . In fact, we define this notation even for the ideal 0,by declaring that 0 − = 0. This reflects the existence of the typeclass group_with_zero in mathlib , consisting of groups endowed with an extra element whose inverse is again .Moreover, mathlib used to define a/b := a ∗ b − , but our definition of I − = 1 /I wouldcause circularity. This led us to a major refactor of this core definition. In particular, wehad to weaken the definitional equality to a proposition; this involved many small changesthroughout mathlib . I T P 2 0 2 1
X:10 Dedekind domains and class groups
We now describe how we proved and formalized that the two definitions is_dedekind_domain and is_dedekind_domain_inv of being a Dedekind domain are equivalent. Let D be aDedekind domain, and f : D → F a fraction map to a field of fractions F of D .To show that is_dedekind_domain_inv implies is_dedekind_domain , we follow theproof given by Fröhlich in [11, Chapter 1, § 2, Proposition 1.2.1]. A constant challenge thatwas faced while coding this proof was already mentioned in Section 3.5, namely the fact thatelements of the ring must be traced along the fraction map. The proofs for being integrallyclosed and of dimension being less than or equal to 1 are fairly straightforward.Formalizing the Noetherian condition was the most challenging. Fröhlich considerselements a , . . . , a n ∈ I and b , . . . , b n ∈ I − for any nonempty fractional ideal I , satisfying P i a i b i = 1. However, it is quite challenging to prove that an element of the product of two D -submodules A and B must be of the form P mi =1 a i ∗ b i , for a i ∈ A and b i ∈ B for all 1 ≤ i ≤ m .Instead, we show that, for every element of A ∗ B , there are finite sets T ⊆ A , T ′ ⊆ B such that x : span (T * T’) , formalized as submodule.mem_span_mul_finite_of_mem_mul . Nowconsidering a nonzero integral ideal I of the ring D , its invertibility allows to write : (1 : fractional_ideal f) = I * 1 / I . Hence, we obtain finite sets T ⊂ I and T ′ ⊂ /I suchthat 1 is contained in the D -span of T ∗ T ′ . We used norm_cast to resolve most coercions,however, this tactic did not solve coercions coming from the fraction map. With coercions,the actual statement of the latter expression in Lean is ↑T’ ⊆ ↑↑(1 / ↑I) , which reads (T’ : set (fraction_ring.of D).codomain) ⊆ (((1 / (I : fractional_ideal (fraction_ring.of D))): submodule D (fraction_ring.of D).codomain): set (fraction_ring.of D).codomain The lemma fg_of_one_mem_span_mul then shows that I is finitely generated, concludingthe proof.The theorem fractional_ideal.mul_inv_cancel proves the converse, namely that is_dedekind_domain implies is_dedekind_domain_inv . The classical proof consists ofthree steps: first, every maximal ideal M ⊆ D , seen as a fractional ideal, is invertible;secondly, every nonzero ideal is invertible, using that it is contained in a maximal ideal;thirdly, the fact that every fractional ideal J satisfies xJ ≤ I for a suitable x ∈ D and anideal I ⊆ D implies that every fractional ideal is invertible, concluding the proof that nonzerofractional ideals form a group. The third step was easy, building upon the material developedfor the general theory of fractional_ideals f . Concerning the first two, we found thatpassing from the case where M is maximal to the general case required more code thandirectly showing invertibility of arbitrary nonzero ideals. The formal statement reads lemma coe_ideal_mul_one_div [hD : is_dedekind_domain D](I : ideal D) (hne : I ̸ = ⊥ ) : ↑ I * ((1 : fractional_ideal f) / ↑ I) = (1 : fractional_ideal f) from where it becomes apparent that we had to repeatedly distinguish between I : idealD , and its coercion ↑I : fractional_ideal f although these objects, from a mathematicalpoint of view, are identical.The formal proof of the above result relies on the lemma exists_not_mem_one_of_ne_bot ,which says that for every non-trivial ideal 0 ⊊ I ⊊ D , there exists an element in the field F which is not integral (so, not in f ( D )) but lies in 1 /I . The proof begins by invoking thatevery nonzero ideal in the Noetherian ring D contains a product of nonzero prime ideals. This . Baanen, S. R. Dahmen, A. Narayanan, and F. A. E. Nuccio XX:11 result was not previously available in mathlib . The dimension condition shows its full forcewhen applying this lemma: each prime ideal in the product, being nonzero, will be maximalbecause the Krull dimension of D is at most 1; from this, exists_not_mem_one_of_ne_bot follows easily. Having the above lemma at our disposal, we were able to prove that everyideal I ̸ = 0 is invertible by arguing by contradiction: if I ∗ /I ⪇ D , we can find an element x ∈ F \ f ( R ) which is in 1 / (1 ∗ /I ) thanks to exists_not_mem_one_of_ne_bot and someeasy algebraic manipulation will imply that x is actually integral over D . Since D is integrallyclosed, it must lie in f ( D ), contradicting the construction of x . Combining these resultsgives the equivalence between the two conditions for being a Dedekind domain. As an example of our definitions, we discuss in some detail our formalization of the factthat a principal ideal domain is a Dedekind domain. There is no explicit definition ofPIDs in mathlib , rather it is split up into two hypotheses. One uses [integral_domain R][is_principal_ideal_ring R] to denote a PID R , where is_principal_ideal_ring is atypeclass defined for all commutative rings: class is_principal_ideal_ring (R : Type*) [comm_ring R] : Prop :=(principal : ∀ (I : ideal R), is_principal I) Our proof that the hypotheses [integral_domain R] [is_principal_ideal_ring R] imply is_dedekind_domain R was relatively short: instance principal_ideal_ring.to_dedekind_domain (R : Type*)[integral_domain R] [is_principal_ideal_ring R] :is_dedekind_domain R := ⟨ principal_ideal_ring.is_noetherian_ring,dimension_le_one.principal_ideal_ring _,unique_factorization_monoid.integrally_closed (fraction_ring.of R) ⟩ The instance keyword marks the declaration for inference by the typeclass system.The Noetherian property of a Dedekind domain followed easily by the previously definedlemma principal_ideal_ring.is_noetherian_ring , since, by definition, each ideal in aprincipal ideal ring is finitely generated (by a single element).We proved the lemma dimension_le_one.principal_ideal_ring , which is an instanti-ation of the existing result is_prime.to_maximal_ideal , showing a nonzero prime ideal ina PID is maximal. The latter lemma uses the characterization that I is a maximal ideal ifand only if any strictly larger ideal J ⊋ I is the full ring R . If I is a nonzero prime idealand J ⊋ I in the PID R , we have that the generator j of J is a divisor of the generator i of I . Since I is prime, this implies that either j ∈ I , contradicting the assumption that J ⊋ I , i = 0, contradicting that I is nonzero, or that j is a unit, implying J = R as desired.The final condition of a PID being integrally closed was the most challenging. We used thepreviously defined instance principal_ideal_ring.to_unique_factorization_monoid thata PID is a unique factorisation monoid (UFM), to instantiate our proof that every UFM isintegrally closed. In the same way that principal ideal domains are generalized to principalideal rings, mathlib generalizes unique factorization domains to unique factorization monoids.A commutative monoid R with an absorbing element 0 and injectivity of multiplication isdefined to be a UFM, if the relation “ x properly divides y ” is well-founded (implying eachelement can be factored as a product of irreducibles) and an element of R is prime if and only I T P 2 0 2 1
X:12 Dedekind domains and class groups if it is irreducible (implying the factorization is unique). The first condition is satisfied for aPID since the Noetherian property implies that the division relation is well-founded. Thesecond condition followed from principal_ideal_ring.irreducible_iff_prime . To provethat an irreducible element p is prime, the proof uses that prime elements generate primeideals and irreducible elements of a PID generate maximal ideals. Since all maximal ideals areprime ideals, the ideal generated by p is maximal, hence prime, thus p is prime. We provedthe lemma irreducible_of_prime , which shows the converse holds in any commutativemonoid with zero.To show that a UFM is integrally closed, we first formalized the Rational Root Theorem,named denom_dvd_of_is_root , which states that for a polynomial p : R [ X ] and an elementof the fraction field x : Frac R such that p ( x ) = 0, the denominator of x divides the leadingcoefficient of p . If x is integral with minimal polynomial p , the leading coefficient is 1,therefore the denominator is a unit and x is an element of R . This gave us the requiredlemma unique_factorization_monoid.integrally_closed , which states that the integralclosure of R in its fraction field is R itself. An important classical result in algebraic number theory is that the ring of integers ofa number field K , defined as the integral closure of Z in K , is a Dedekind domain. Weformalized a stronger result: given a Dedekind domain D and a field of fractions F , if L is afinite separable extension of F , then the integral closure of D in L is a Dedekind domain withfraction field L . Our approach was adapted from Neukirch [17, Theorem 3.1]. Throughoutthis section, let D be a Dedekind domain with a field of fractions F (given by the map f : D → F ), L a finite, separable field extension of F and let S denote the integral closure of D in L .The first step was to show that L is a field of fractions for the integral closure, namely,there is a map fraction_map_of_finite_extension f L : fraction_map S L . The maincontent of fraction_map_of_finite_extension consisted of showing that all elements x : L can be written as y/z for elements y ∈ S , z ∈ D ⊆ S ; the standard proof of this fact (see [7,Theorem 15.29]) formalized readily.We could then show that the integral closure of D in L is a Dedekind domain, by provingit is integrally closed in L , has Krull dimension at most 1 and is Noetherian. The fact thatthe integral closure is integrally closed was immediate.To show the Krull dimension is at most 1, we needed to develop basic going-up theoryfor ideals. In particular, we showed that an ideal I in an integral extension is maximal if itlies over a maximal ideal, and used a result already available in mathlib that a prime ideal I in an integral extension lies over a prime ideal. lemma is_maximal_of_is_integral_of_is_maximal_comap(I : ideal S) [is_prime I](hI : is_maximal (comap f I)) : is_maximal Itheorem is_prime.comap (I : ideal S) [hI : is_prime I] :is_prime (comap f I) The final condition, that the integral closure S of D in L is a Noetherian ring, requiredthe most work. We started by following the first half of [7, Theorem 15.29], so that itsufficed to find a nondegenerate bilinear form B such that all integral x, y : L satisfy B ( x, y ) ∈ integral_closure D L . We formalized the results in Neukirch [17, §§ 2.5–2.8], . Baanen, S. R. Dahmen, A. Narayanan, and F. A. E. Nuccio XX:13 and showed that the trace form is a bilinear form satisfying these requirements.
In the notation from the previous section, consider the bilinear form lmul := λ x y : L,x * y . The trace of the linear map lmul x is called the algebra trace Tr L/F ( x ) of x . Wedefined the algebra trace as a linear map, in this case from L to F : noncomputable def trace : L → l [F] F :=linear_map.comp (linear_map.trace F L) (to_linear_map (lmul F L)) This definition was marked noncomputable since linear_map.trace makes a case distinctionon the existence of a basis, choosing an arbitrary basis if one exists and returning 0 otherwise.This latter case did not occur in our development.We defined the trace form to be an F -bilinear form on L , mapping x, y : L to Tr L/F ( xy ). noncomputable def trace_form : bilin_form F L :={ bilin := λ x y, trace F L (x * y), .. /- proofs omitted -/ } In the following, let
E/L/F be a tower of finite extensions of fields, namely we assumed [algebra E L] [algebra L F] [algebra E F] [is_scalar_tower E L F] , as describedin Section 3.2.The value of the trace depends on the choice of E and L ; we formalized this as lemmas trace_algebra_map x : trace E L (algebra_map E L x) = findim E L • x as well as trace_comp L x : trace E F x = trace E L (trace L F x) . These results followed bydirect computation.To compute Tr L/F ( x ), it therefore suffices to consider the trace of x in the smallest fieldcontaining x and F , which is the monogenic extension F ( x ) discussed in Section 3.6. Thereis a nice formula for the trace in F ( x ), although the terms in this formula are elements in alarger field E (such as the splitting field of the minimal polynomial of x ). In formalizing thisformula, we first mapped the trace to F using the canonical embedding algebra_map E F ,which gave the following lemma statement: lemma power_basis.trace_gen_eq_sum_roots (pb : power_basis F L)(h : polynomial.splits (algebra_map F E) pb.minpoly_gen) :algebra_map F E (trace F L pb.gen) =sum (roots (map (algebra_map F E) pb.minpoly_gen)) We formulated the lemma in terms of the power basis, since we needed to use it for F ( x )here and for an arbitrary finite separable extension L/F later in the proof.The elements of (pb.minpoly_gen.map (algebra_map F E)).roots are called conju-gates of x in E . Each conjugate of x is integral since it is a root of (the same) monicpolynomial, and integer multiples and sums of integral elements are integral. Combining trace_gen_eq_sum_roots and trace_algebra_map showed that the trace of x is an integermultiple (namely findim F(x) L ) of a sum of conjugate roots, hence we concluded that thetrace (and trace form) of an integral element is also integral.Finally, we showed that the trace form is nondegenerate, following Neukirch [17, Proposi-tion 2.8]. Since L/F is a finite, separable field extension, it has a power basis pb generatedby x . Letting x k denote the k -th conjugate of x in an algebraically closed field E/L/F ,the main difficulty was in checking the equality P k x i + jk = Tr L/F ( x i + j ). Directly applying trace_gen_eq_sum_roots was tempting, since we had a sum over conjugates of powers on I T P 2 0 2 1
X:14 Dedekind domains and class groups both sides. However, the two expressions did not precisely match: the left hand side is a sumof conjugates of x , where each conjugate is raised to the power i + j , while the conclusion of trace_gen_eq_sum_roots resulted in a sum over conjugates of x i + j .Instead, the paper proof switched here to an equivalent definition of conjugate: theconjugates of x in E are the images (counted with multiplicity) of x under each embedding σ : F ( x ) → E that fixes F . This equivalence between the two notions of conjugate wascontributed to mathlib by the Berkeley group in the week before we realized we neededit. Mapping trace_gen_eq_sum_roots through the equivalence gave Tr L/F ( x ) = P σ σx .Since each σ is a ring homomorphism, σ x i + j = ( σ x ) i + j , so the conjugates of x i + j are the( i + j )-th powers of conjugates of x , which concluded the proof. Given a Dedekind domain with fraction map f : D → F , we formalized the notion ofclass group in Lean by defining a map to_principal_ideal f:units f.codomain → units(fractional_ideal f) , and defined the class group as def class_group := quotient_group.quotient (to_principal_ideal (range f)) In general, Dedekind domains can have infinite class groups. However, as discussed inSection 2, the rings of integers of global fields have finite class groups.We let K be a number field and K ′ be a function field, with ring of integers O K and O K ′ (w.r.t. a fixed F q [ t ]), respectively. Most proofs of the finiteness of C l O K one findsin a modern textbook (see [17, Theorems 4.4, 5.3, 6.3]) depend on Minkowski’s latticepoint theorem, a result from the geometry of numbers (which has been formalized inIsabelle/HOL [8]). Extending this proof to show the finiteness of C l O K ′ is quite involvedand does not result in a uniform proof for C l O K and C l O K ′ . Our formalization adapted andgeneralized a classical approach to the finiteness of C l O K , where the use of Minkowski’stheorem is replaced by the pigeonhole principle. For an informal writeup of the proof, usedin the formalization efforts, see https://github.com/lean-forward/class-number/blob/main/FiniteClassGroup.pdf . The classical approach seems to go back to Kronecker andcan be found, for instance, in [14]. We note that some other “uniform” approaches can befound in [1] and [19].Let D be an Euclidean domain: in particular, it will be a PID and hence a Dedekinddomain. Given a fraction map f : D → F , let L be a finite separable field extension of F . We formalized, in the theorem class_group.finite_of_admissible , that the integralclosure of D in L has a finite class group if D has an “admissible” absolute value abs . Veryinformally, the admissibility conditions require that the remainder operator produces valuesthat are not too far apart. Formally, we defined the type of admissible absolute values on D as follows, where to_fun stands for an application of the absolute value operator: structure admissible_absolute_value (D : Type*) [euclidean_domain D]extends euclidean_absolute_value D Z :=(card : R → N ) (exists_partition : ∀ (n : N ) ( ε > (0 : R ) (b ̸ = (0 : D)) (A : fin n → D), ∃ (t : fin n → fin (card ε )), ∀ i i , t i = t i → (to_fun (A i % b - A i % b) : R ) < to_fun b · ε ) The above condition formalizes and generalizes an intermediate result in paper finitenessproofs; the different proofs for number fields and function fields (still assuming
L/F separable) . Baanen, S. R. Dahmen, A. Narayanan, and F. A. E. Nuccio XX:15 become the same after this point. We used division with remainder to replace the fractionalpart operator on F in the classical proof, which was essential to incorporate function fields,and at the same time allowing our proof to stay entirely within D to avoid coercions.The absolute value extends to a norm abs_norm f abs:integral_closure D L → Z .We used the admissibility of abs to find a finite set finset_approx L f abs of elements of D , such that the following generalization of [14, Theorem 12.2.1] holds. theorem exists_mem_finset_approx’ (a b : integral_closure D L) := ∃ (q : integral_closure D L) (r ∈ finset_approx L f abs),abs_norm f abs (r · a - q * b) < abs_norm f abs b After this, the classical approach mentioned above formalized smoothly.It remained to define an admissible absolute value for Z and F q [ t ]. On Z , it wasstraightforward to formalize that the usual Archimedean absolute value fulfils the requirements.For F q [ t ], we showed that | f | deg := q deg f for f ∈ F q [ t ] is the required admissible absolutevalue; observe that this was somewhat more involved to formalize. We concluded that when K is a global field, restricting to separable extensions of F q ( t ) in the function field case, theclass group is finite: noncomputable instance : fintype(class_group (number_field.ring_of_integers.fraction_map K)) :=class_group.finite_of_admissible K int.fraction_map int.admissible_absnoncomputable instance [is_separable f.codomain K] : fintype(class_group (function_field.ring_of_integers.fraction_map f K)) :=class_group.finite_of_admissible F f polynomial.admissible_card_pow_degree Finally, we defined number_field.class_number and function_field.class_number as the cardinality of the respective class groups.
Broadly speaking, one could see the formalization work as part of number theory. There areseveral formalization results in this direction. Most notably, Eberl formalized a substantialpart of analytic number theory in Isabelle/HOL [9]. Narrowing somewhat to a more algebraicsetting, we are not aware of any other formal developments of fractional ideals, Dedekinddomains or class groups of global fields.There are many libraries formalizing basic notions of commutative algebra such asfield extensions and ideals, including the Mathematical Components library in Coq [15],the algebraic library for Isabelle/HOL [2], the set.mm database for MetaMath [16] andthe Mizar Mathematical Library [13]. The field of algebraic numbers, or more generallyalgebraic closures of arbitrary fields, are also available in many provers. For example,Blot [3] formalized algebraic numbers in Coq, Thiemann, Yamada and Joosten [22] inIsabelle/HOL, Carneiro [4] in MetaMath, and Watase [23] in Mizar. To our knowledge, theCoq Mathematical Components library is the only formal development beside ours specificallydealing with number fields [15, field/algnum.v ].Apart from the general theory of algebraic numbers, there are formalizations of specificrings of integers. For instance, the Gaussian integers Z [ i ] have been formalized in Isabelle/HOLby Eberl [10], in MetaMath by Carneiro [5] and in Mizar by Futa, Mizushima, and Okazaki [12]. I T P 2 0 2 1
X:16 Dedekind domains and class groups
Eberl’s Isabelle/HOL formalization deserves special mention in this context since it introducestechniques from algebraic number theory, defining the integer-valued norm on Z [ i ] andclassifying the prime elements of Z [ i ]. Having formalized various basic results of algebraic number theory, there are several naturaldirections for future work, including formalizing some of the following results.Finiteness of the class group for rings of integers in all global fields. This would entail,apart from some details at the end of the proof, dropping the separability condition inthe result mentioned in the first paragraph of Section 6.The group of units of the ring of integers in a number field is finitely generated, or slightlystronger, Dirichlet’s unit theorem [17, Theorem 7.4] (and the function field analogue).Other finiteness results in algebraic number theory, most notably Hermite’s theoremabout the existence of finitely many number fields, up to isomorphism, with boundeddiscriminant [17, Theorem 2.16] (and the function field analogue).Class number computations, say of quadratic number fields. This could be part of verifyingcorrectness of number theoretic software, such as KASH/KANT [18] and PARI/GP [21].Applications of algebraic number theory to solving Diophantine equations, such asdetermining all pairs of integers ( x, y ) such that y = x + D for given nonzero D ∈ Z . In this project, we confirmed the rule that the hardest part of formalization is to get thedefinitions right. Once this is accomplished, the paper proof (sometimes first adapted withformalization in mind) almost always translates into a formal proof without too much effort.In particular, we regularly had to invent abstractions to treat instances of the “same” situationuniformly. Instead of fixing a canonical representation, be it K ⊆ L ⊆ F as subfields orthe field of fractions Frac R , or the monogenic K ( α ), we found that making the essence ofthe situation an explicit parameter, as in is_scalar_tower , fraction_map or power_basis ,allows to treat equivalent viewpoints uniformly without the need for transferring results.The formalization efforts described in this paper cannot be cleanly separated from thedevelopment of mathlib as a whole. The decentralized organization and highly integrateddesign of mathlib meant that we could contribute our formalizations as we completed them,resulting in a quick integration into the rest of the library. Other contributors building onthese results often extended them to meet our requirements, before we could identify thatwe needed them, as the anecdote in Section 3.4 illustrates. In other words, the low barriersfor contributions ensured mutually beneficial collaboration.The formalization project described in this paper resulted in the contribution of thousandsof lines of Lean code involving hundreds of declarations. We validated existing design choicesused in mathlib , refactored those that did not scale well and contributed our own set of designs.The real achievement was not to complete each proof, but to build a better foundation forformal mathematics. References E. Artin and G. Whaples. Axiomatic characterization of fields by the product formula forvaluations.
Bull. Amer. Math. Soc. , 51(7):469–492, 07 1945. URL: https://projecteuclid.org:443/euclid.bams/1183507128 . . Baanen, S. R. Dahmen, A. Narayanan, and F. A. E. Nuccio XX:17 C. Ballarin editor, J. Aransay, M. Baillon, P. E. de Vilhena, S. Hohe, F. Kammüller, and L. C.Paulson. The Isabelle/HOL algebra library. http://isabelle.in.tum.de/dist/library/HOL/HOL-Algebra/index.html . Valentin Blot. Basics for algebraic numbers and a proof of Liouville’s theorem in C-CoRN,2009. MSc internship report. M. Carneiro. Definition df-aa . http://us.metamath.org/mpeuni/df-aa.html . M. Carneiro. Definition df-gz . http://us.metamath.org/mpeuni/df-gz.html . L. de Moura, S. Kong, J. Avigad, F. van Doorn, and J. von Raumer. The Lean theoremprover (system description). In A. P. Felty and A. Middeldorp, editors,
Automated Deduction- CADE-25 , volume 9195 of
LNCS , pages 378–388. Springer, Cham, 2015. doi:10.1007/978-3-319-21401-6_26 . D. S. Dummit and R. M. Foote.
Abstract algebra . John Wiley & Sons, Inc., Hoboken, NJ,third edition, 2004. M. Eberl. Minkowski’s theorem.
Archive of Formal Proofs , July 2017. https://isa-afp.org/entries/Minkowskis_Theorem.html , Formal proof development. M. Eberl. Nine chapters of analytic number theory in Isabelle/HOL. In J. Harrison, J. O’Leary,and A. Tolmach, editors,
ITP 2019 , volume 141 of
LIPIcs , pages 16:1–16:19. Schloss Dagstuhl,Leibniz-Zentrum fuer Informatik, 2019. doi:10.4230/LIPIcs.ITP.2019.16 . M. Eberl. Gaussian integers.
Archive of Formal Proofs , April 2020. https://isa-afp.org/entries/Gaussian_Integers.html , Formal proof development. A. Fröhlich. Local fields. In
Algebraic Number Theory (Proc. Instructional Conf., Brighton,1965) , pages 1–41. Thompson, Washington, D.C., 1967. Y. Futa, D. Mizushima, and H. Okazaki. Formalization of Gaussian integers, Gaussian rationalnumbers, and their algebraic structures with Mizar. In , pages 591–595, 2012. A. Grabowski, A. Kornilowicz, and C. Schwarzweller. On algebraic hierarchies in mathematicalrepository of Mizar. In M. Ganzha, L. Maciaszek, and M. Paprzycki, editors,
Proceedings ofthe 2016 Federated Conference on Computer Science and Information Systems , volume 8 of
ACSIS , pages 363–371, 2016. K. Ireland and M. Roosen.
A Classical Introduction to Modern Number Theory . Springer-VerlagNew York, second edition, 1990. A. Mahboubi and E. Tassi.
The Mathematical Components Libraries . https://math-comp.github.io/mcb/ , 2017. N. D. Megill and D. A. Wheeler.
Metamath: A Computer Languagefor Mathematical Proofs . Lulu Press, Morrisville, North Carolina, 2019. http://us.metamath.org/downloads/metamath.pdf . J. Neukirch.
Algebraic number theory , volume 322 of
Fundamental Principles of Mathe-matical Sciences . Springer-Verlag, Berlin, 1999. Translated from the 1992 German orig-inal and with a note by Norbert Schappacher, With a foreword by G. Harder. doi:10.1007/978-3-662-03983-0 . M. E. et al Pohst. The computer algebra system KASH/KANT. . A. Stasinski. A uniform proof of the finiteness of the class group of a global field. to appear inAmer. Math. Monthly . URL: https://arxiv.org/abs/1909.07121 . The mathlib Community. The Lean mathematical library. In J. Blanchette and C. Hrit , cu,editors, CPP 2020 , page 367–381. ACM, 2020. doi:10.1145/3372885.3373824 . The PARI Group, Univ. Bordeaux.
PARI/GP version , 2019. available from http://pari.math.u-bordeaux.fr/ . R. Thiemann, A. Yamada, and S. Joosten. Algebraic numbers in Isabelle/HOL.
Archive ofFormal Proofs , December 2015. https://isa-afp.org/entries/Algebraic_Numbers.html ,Formal proof development.
I T P 2 0 2 1
X:18 Dedekind domains and class groups Y. Watase. Algebraic numbers.
Formalized Mathematics , 24( ):291–299, 2016. doi:10.1515/forma-2016-0025doi:10.1515/forma-2016-0025