Welcome to the first lesson of your course on class numbers. Your ultimate goal is to understand the class number of a number field and the powerful analytic formula that computes it. To begin this journey, we must first establish a firm grasp of the fundamental objects we'll be working with. This lesson is dedicated to defining number fields and their rings of integers, the essential settings for the arithmetic we aim to explore.
We will start by formally defining what a number field is, building upon core concepts from field theory. Then, we will introduce the notion of an algebraic integer, which allows us to define the ring of integers within a given number field. This ring is the proper analogue of the familiar integers and will be the central stage for our study of factorization and ideals. We'll also take our first steps with the PARI/GP software to see how these abstract objects are represented computationally.
What is a Number Field?
In essence, algebraic number theory studies number systems that are larger than the rational numbers but still manageable. These systems are called number fields. Formally, a number field is a field that is a finite extension of the field of rational numbers .
This means two things:
- is a field containing as a subfield.
- When viewed as a vector space over , has a finite dimension. This dimension is called the degree of the extension, denoted .
To fully unpack this, it's helpful to review a few foundational concepts from field theory. The following reading from Martin Orr's "Algebraic Number Theory" lecture notes provides a clear and efficient summary. Given your background in mathematics, this should serve as a good refresher.
These sections cover the core definitions needed to understand what a number field is. The notes are structured to move from general field extensions to the specific case of number fields.
Please read through the following parts of the notes: In Section 2, "Field extensions," focus on the definitions of a field extension, an element being algebraic over a field, and the minimal polynomial. In Section 3, "Algebraic and finite extensions," review the definition of the degree of an extension. Pay close attention to Theorem 4 (Tower Law), as it's a fundamental tool for calculating degrees. The proof is sketched and provides insight into the structure of stacked extensions. Finally, in Section 4, "Number fields and embeddings," you will find the formal definition of a number field. Note the examples of quadratic and cyclotomic fields.
The Tower Law is particularly important. For a tower of finite extensions , it states that . This multiplicative property of degrees is analogous to how dimensions of nested vector subspaces relate.
For instance, consider the field , which is obtained by adjoining both and to . We can view this as a tower of extensions: .
- We know , since is a basis.
- The minimal polynomial of over is . This polynomial has no roots in , so it remains the minimal polynomial of over . Therefore, .
By the Tower Law, the total degree is . This field contains intermediate subfields, which can be organized into a lattice diagram.

A key result, which we will use without proof, is the Primitive Element Theorem. It states that every number field can be generated by a single element, meaning for some algebraic number . This is convenient because it allows us to represent the entire field using polynomials in that single element .
The Ring of Integers
Now that we have defined our fields, we need to identify the "integers" within them. We can't simply take elements of the form where the coefficients are in , because this definition would depend on our choice of the primitive element . For example, , but the ring is different from . We need a more intrinsic definition.
The correct approach, developed by Dedekind, is to define what it means for a number to be an "algebraic integer" and then to collect all such numbers that lie within our number field.
The following video gives an excellent historical and conceptual introduction to this idea.
Algebraic number theory and rings I | Math History | NJ Wildberger
In this clip from his "Math History" series, N J Wildberger presents Dedekind's definition of an algebraic integer and provides a simple, elegant proof for why a rational number that is also an algebraic integer must be a standard integer.
Please watch the segment from this clip. Pay attention to the crucial role of the polynomial being monic (leading coefficient of 1).
As the video explains, an algebraic integer is a root of a monic polynomial with coefficients in . For example, is an algebraic integer because it's a root of the monic polynomial . The golden ratio is an algebraic integer because it's a root of . In contrast, is not, as its minimal polynomial over is , which is not in .
This leads to a powerful criterion, which is one of the most useful characterizations of algebraic integers.
[PDF] Introduction to Algebraic Number Theory - William Stein
This excerpt from William Stein's notes provides the formal definitions and key properties of algebraic integers and rings of integers.
Please read the following parts of Chapter 2, Section 3: "Rings of Algebraic Integers". Start with Definition 2.3.1. Read Lemma 2.3.4 and its proof. This lemma establishes the crucial fact that the minimal polynomial of an algebraic integer must have integer coefficients. This is the practical test we often use. Next, read the definition of the ring of integers, O_K. Finally, look at the definition of an Order. This formalizes the idea that rings like \mathbb{Z}[\alpha] are interesting subsets of O_K, but may not be the whole thing.
With these definitions, we can now formally define the central object of study:
The ring of integers of a number field , denoted , is the set of all elements in that are algebraic integers. That is, , where is the ring of all algebraic integers.
For , the ring of integers is just . But for other number fields, it can be more interesting. The canonical example is the ring of integers of a quadratic field.
This section provides a complete derivation of the ring of integers for any quadratic field \mathbb{Q}(\sqrt{d}). This is a foundational calculation in algebraic number theory.
Please read Section 9, "Rings of integers," focusing on Proposition 27. Follow the proof to see how the structure of O_K depends on the value of the square-free integer d modulo 4. The statement of the proposition is a result you will use frequently.
The result from the reading is worth summarizing: for where is a square-free integer:
- If , then .
- If , then .
This explains why for , where , the ring of integers is . However, for , where , the ring of integers is the larger ring . Here, is an order, but not the full ring of integers (which is the maximal order).
First Steps with PARI/GP
You expressed a preference for using PARI/GP for computations. Let's see how to define the objects we've just discussed.
You can start PARI/GP by typing gp in your terminal. We define a number field by specifying the minimal polynomial of a generator. For example, to define , whose generator is a root of , you would type:
K = nfinit(x^2 - 5);
The nfinit command initializes a structure containing a lot of information about the number field.
To find the ring of integers, we ask PARI/GP for an integral basis. The command is nfbasis. The output is a basis for as a -module, expressed in terms of powers of the generator x (which represents in this case).
nfbasis(x^2 - 5)
The output should be [1, 1/2*x + 1/2]. This corresponds to the basis , confirming that .
Now try it for , where . What do you expect the basis to be?
nfbasis(x^2 - 3)
The output here should be [1, x], corresponding to the basis , confirming that .
Feel free to experiment with other quadratic fields. This immediate computational feedback is one of the strengths of using a system like PARI/GP.
Conclusion
In this lesson, we have laid the essential groundwork for our study of class numbers. We've established our main objects of interest and their formal definitions:
- A number field is a finite field extension of .
- An algebraic integer is a root of a monic polynomial with integer coefficients.
- The ring of integers of a number field is the set of all algebraic integers within . It serves as the correct generalization of for doing number theory in .
We saw that for quadratic fields , the ring of integers has a simple, explicit description that depends on , and we learned how to verify this using PARI/GP.
In the next lesson, we will define the norm and trace of elements in a number field. These are two fundamental maps from down to that provide invaluable information about the arithmetic structure of the elements in . You have already seen them appear in the proof for determining the ring of integers of a quadratic field, and we will now study them in their own right.