The beginnings of algebraic number theory can be traced to Diophantine equations,[1] named after the 3rd-century Alexandrian mathematician, Diophantus, who studied them and developed methods for the solution of some kinds of Diophantine equations. A typical Diophantine problem is to find two integers x and y such that their sum, and the sum of their squares, equal two given numbers A and B, respectively:

A=x+y{\displaystyle A=x+y\ }

B=x2+y2.{\displaystyle B=x^{2}+y^{2}.\ }

Diophantine equations have been studied for thousands of years. For example, the solutions to the quadratic Diophantine equation x2 + y2 = z2 are given by the Pythagorean triples, originally solved by the Babylonians (c. 1800 BC).[2] Solutions to linear Diophantine equations, such as 26x + 65y = 13, may be found using the Euclidean algorithm (c. 5th century BC).[3]

Diophantus' major work was the Arithmetica, of which only a portion has survived.

Fermat's last theorem was first conjectured by Pierre de Fermat in 1637, famously in the margin of a copy of Arithmetica where he claimed he had a proof that was too large to fit in the margin. No successful proof was published until 1995 despite the efforts of countless mathematicians during the 358 intervening years. The unsolved problem stimulated the development of algebraic number theory in the 19th century and the proof of the modularity theorem in the 20th century.

One of the founding works of algebraic number theory, the Disquisitiones Arithmeticae (Latin: Arithmetical Investigations) is a textbook of number theory written in Latin[4] by Carl Friedrich Gauss in 1798 when Gauss was 21 and first published in 1801 when he was 24. In this book Gauss brings together results in number theory obtained by mathematicians such as Fermat, Euler, Lagrange and Legendre and adds important new results of his own. Before the Disquisitiones was published, number theory consisted of a collection of isolated theorems and conjectures. Gauss brought the work of his predecessors together with his own original work into a systematic framework, filled in gaps, corrected unsound proofs, and extended the subject in numerous ways.

The Disquisitiones was the starting point for the work of other nineteenth century European mathematicians including Ernst Kummer, Peter Gustav Lejeune Dirichlet and Richard Dedekind. Many of the annotations given by Gauss are in effect announcements of further research of his own, some of which remained unpublished. They must have appeared particularly cryptic to his contemporaries; we can now read them as containing the germs of the theories of L-functions and complex multiplication, in particular.

Richard Dedekind's study of Lejeune Dirichlet's work was what led him to his later study of algebraic number fields and ideals. In 1863, he published Lejeune Dirichlet's lectures on number theory as Vorlesungen über Zahlentheorie ("Lectures on Number Theory") about which it has been written that:

"Although the book is assuredly based on Dirichlet's lectures, and although Dedekind himself referred to the book throughout his life as Dirichlet's, the book itself was entirely written by Dedekind, for the most part after Dirichlet's death." (Edwards 1983)

1879 and 1894 editions of the Vorlesungen included supplements introducing the notion of an ideal, fundamental to ring theory. (The word "Ring", introduced later by Hilbert, does not appear in Dedekind's work.) Dedekind defined an ideal as a subset of a set of numbers, composed of algebraic integers that satisfy polynomial equations with integer coefficients. The concept underwent further development in the hands of Hilbert and, especially, of Emmy Noether. Ideals generalize Ernst Eduard Kummer's ideal numbers, devised as part of Kummer's 1843 attempt to prove Fermat's Last Theorem.

David Hilbert unified the field of algebraic number theory with his 1897 treatise Zahlbericht (literally "report on numbers"). He also resolved a significant number-theory problem formulated by Waring in 1770. As with the finiteness theorem, he used an existence proof that shows there must be solutions for the problem rather than providing a mechanism to produce the answers.[7] He then had little more to publish on the subject; but the emergence of Hilbert modular forms in the dissertation of a student means his name is further attached to a major area.

It was initially dismissed as unlikely or highly speculative, and was taken more seriously when number theorist André Weil found evidence supporting it, but no proof; as a result the "astounding"[10] conjecture was often known as the Taniyama–Shimura-Weil conjecture. It became a part of the Langlands program, a list of important conjectures needing proof or disproof.

From 1993 to 1994, Andrew Wiles provided a proof of the modularity theorem for semistable elliptic curves, which, together with Ribet's theorem, provided a proof for Fermat's Last Theorem. Almost every mathematician at the time had previously considered both Fermat's Last Theorem and the Modularity Theorem either impossible or virtually impossible to prove, even given the most cutting edge developments. Wiles first announced his proof in June 1993[11] in a version that was soon recognized as having a serious gap at a key point. The proof was corrected by Wiles, partly in collaboration with Richard Taylor, and the final, widely accepted version was released in September 1994, and formally published in 1995. The proof uses many techniques from algebraic geometry and number theory, and has many ramifications in these branches of mathematics. It also uses standard constructions of modern algebraic geometry, such as the category of schemes and Iwasawa theory, and other 20th-century techniques not available to Fermat.

An important property of the ring of integers is that it satisfies the fundamental theorem of arithmetic, that every (positive) integer has a factorization into a product of prime numbers, and this factorization is unique up to the ordering of the factors. This may no longer be true in the ring of integers O of an algebraic number field K.

A prime element is an element p of O such that if p divides a product ab, then it divides one of the factors a or b. This property is closely related to primality in the integers, because any positive integer satisfying this property is either 1 or a prime number. However, it is strictly weaker. For example, −2 is not a prime number because it is negative, but it is a prime element. If factorizations into prime elements are permitted, then, even in the integers, there are alternative factorizations such as

6=2⋅3=(−2)⋅(−3).{\displaystyle 6=2\cdot 3=(-2)\cdot (-3).}

In general, if u is a unit, meaning a number with a multiplicative inverse in O, and if p is a prime element, then up is also a prime element. Numbers such as p and up are said to be associate. In the integers, the primes p and −p are associate, but only one of these is positive. Requiring that prime numbers be positive selects a unique element from among a set of associated prime elements. When K is not the rational numbers, however, there is no analog of positivity. For example, in the Gaussian integersZ[i],[12] the numbers 1 + 2i and −2 + i are associate because the latter is the product of the former by i, but there is no way to single out one as being more canonical than the other. This leads to equations such as

5=(1+2i)(1−2i)=(2+i)(2−i),{\displaystyle 5=(1+2i)(1-2i)=(2+i)(2-i),}

which prove that in Z[i], it is not true that factorizations are unique up to the order of the factors. For this reason, one adopts the definition of unique factorization used in unique factorization domains (UFDs). In a UFD, the prime elements occurring in a factorization are only expected to be unique up to units and their ordering.

However, even with this weaker definition, many rings of integers in algebraic number fields do not admit unique factorization. There is an algebraic obstruction called the ideal class group. When the ideal class group is trivial, the ring is a UFD. When it is not, there is a distinction between a prime element and an irreducible element. An irreducible elementx is an element such that if x = yz, then either y or z is a unit. These are the elements that cannot be factored any further. Every element in O admits a factorization into irreducible elements, but it may admit more than one. This is because, while all prime elements are irreducible, some irreducible elements may not be prime. For example, consider the ring Z[√-5].[13] In this ring, the numbers 3, 2 + √-5 and 2 - √-5 are irreducible. This means that the number 9 has two factorizations into irreducible elements,

This equation shows that 3 divides the product (2 + √-5)(2 - √-5) = 9. If 3 were a prime element, then it would divide 2 + √-5 or 2 - √-5, but it does not, because all elements divisible by 3 are of the form 3a + 3b√-5. Similarly, 2 + √-5 and 2 - √-5 divide the product 32, but neither of these elements divides 3 itself, so neither of them are prime. As there is no sense in which the elements 3, 2 + √-5 and 2 - √-5 can be made equivalent, unique factorization fails in Z[√-5]. Unlike the situation with units, where uniqueness could be repaired by weakening the definition, overcoming this failure requires a new perspective.

where each pi{\displaystyle {\mathfrak {p}}_{i}} is a prime ideal, and where this expression is unique up to the order of the factors. In particular, this is true if I is the principal ideal generated by a single element. This is the strongest sense in which the ring of integers of a general number field admits unique factorization. In the language of ring theory, it says that rings of integers are Dedekind domains.

When O is a UFD, every prime ideal is generated by a prime element. Otherwise, there are prime ideals which are not generated by prime elements. In Z[√-5], for instance, the ideal (2, 1 + √-5) is a prime ideal which cannot be generated by a single element.

Historically, the idea of factoring ideals into prime ideals was preceded by Ernst Kummer's introduction of ideal numbers. These are numbers lying in an extension field E of K. This extension field is now known as the Hilbert class field. By the principal ideal theorem, every prime ideal of O generates a principal ideal of the ring of integers of E. A generator of this principal ideal is called an ideal number. Kummer used these as a substitute for the failure of unique factorization in cyclotomic fields. These eventually led Richard Dedekind to introduce a forerunner of ideals and to prove unique factorization of ideals.

An ideal which is prime in the ring of integers in one number field may fail to be prime when extended to a larger number field. Consider, for example, the prime numbers. The corresponding ideals pZ are prime ideals of the ring Z. However, when this ideal is extended to the Gaussian integers to obtain pZ[i], it may or may not be prime. For example, the factorization 2 = (1 + i)(1 − i) implies that

note that because 1 + i = (1 − i) ⋅ i, the ideals generated by 1 + i and 1 − i are the same. A complete answer to the question of which ideals remain prime in the Gaussian integers is provided by Fermat's theorem on sums of two squares. It implies that for an odd prime number p, pZ[i] is a prime ideal if p ≡ 3 (mod 4) and is not a prime ideal if p ≡ 1 (mod 4). This, together with the observation that the ideal (1 + i)Z[i] is prime, provides a complete description of the prime ideals in the Gaussian integers. Generalizing this simple result to more general rings of integers is a basic problem in algebraic number theory. Class field theory accomplishes this goal when K is an abelian extension of Q (that is, a Galois extension with abelian Galois group).

Unique factorization fails if and only if there are prime ideals that fail to be principal. The object which measures the failure of prime ideals to be principal is called the ideal class group. Defining the ideal class group requires enlarging the set of ideals in a ring of algebraic integers so that they admit a group structure. This is done by generalizing ideals to fractional ideals. A fractional ideal is an additive subgroup J of K which is closed under multiplication by elements of O, meaning that xJ ⊆ J if x ∈ O. All ideals of O are also fractional ideals. If I and J are fractional ideals, then the set IJ of all products of an element in I and an element in J is also a fractional ideal. This operation makes the set of non-zero fractional ideals into a group. The group identity is the ideal (1) = O, and the inverse of J is a (generalized) ideal quotient:

The principal fractional ideals, meaning the ones of the form Ox where x ∈ K×, form a subgroup of the group of all non-zero fractional ideals. The quotient of the group of non-zero fractional ideals by this subgroup is the ideal class group. Two fractional ideals I and J represent the same element of the ideal class group if and only if there exists an element x ∈ K such that xI = J. Therefore, the ideal class group makes two fractional ideals equivalent if one is as close to being principal as the other is. The ideal class group is generally denoted Cl K, Cl O, or Pic O (with the last notation identifying it with the Picard group in algebraic geometry).

The number of elements in the class group is called the class number of K. The class number of Q(√-5) is 2. This means that there are only two ideal classes, the class of principal fractional ideals, and the class of a non-principal fractional ideal such as (2, 1 + √-5).

The ideal class group has another description in terms of divisors. These are formal objects which represent possible factorizations of numbers. The divisor group Div K is defined to be the free abelian group generated by the prime ideals of O. There is a group homomorphism from K×, the non-zero elements of K up to multiplication, to Div K. Suppose that x ∈ K satisfies

Some number fields, such as Q(√2), can be specified as subfields of the real numbers. Others, such as Q(√−1), cannot. Abstractly, such a specification corresponds to a field homomorphism K → R or K → C. These are called real embeddings and complex embeddings, respectively.

A real quadratic field Q(√a), with a ∈ R, a > 0, and a not a perfect square, is so-called because it admits two real embeddings but no complex embeddings. These are the field homomorphisms which send √a to √a and to −√a, respectively. Dually, an imaginary quadratic field Q(√−a) admits no real embeddings but admits a conjugate pair of complex embeddings. One of these embeddings sends √−a to √−a, while the other sends it to its complex conjugate, −√−a.

Conventionally, the number of real embeddings of K is denoted r1, while the number of conjugate pairs of complex embeddings is denoted r2. The signature of K is the pair (r1, r2). It is a theorem that r1 + 2r2 = d, where d is the degree of K.

This is called the Minkowski embedding. The subspace of the codomain fixed by complex conjugation is a real vector space of dimension d called Minkowski space. Because the Minkowski embedding is defined by field homomorphisms, multiplication of elements of K by an element x ∈ K corresponds to multiplication by a diagonal matrix in the Minkowski embedding. The dot product on Minkowski space corresponds to the trace form ⟨x,y⟩=Tr⁡(xy){\displaystyle \langle x,y\rangle =\operatorname {Tr} (xy)}.

The image of O under the Minkowski embedding is a d-dimensional lattice. If B is a basis for this lattice, then det BTB is the discriminant of O. The discriminant is denoted Δ or D. The covolume of the image of O is |Δ|{\displaystyle {\sqrt {|\Delta |}}}.

Real and complex embeddings can be put on the same footing as prime ideals by adopting a perspective based on valuations. Consider, for example, the integers. In addition to the usual absolute value function |·| : Q → R, there are p-adic absolute value functions |·|p : Q → R, defined for each prime number p, which measure divisibility by p. Ostrowski's theorem states that these are all possible absolute value functions on Q (up to equivalence). Therefore, absolute values are a common language to describe both the real embedding of Q and the prime numbers.

A place of an algebraic number field is an equivalence class of absolute value functions on K. There are two types of places. There is a p{\displaystyle {\mathfrak {p}}}-adic absolute value for each prime ideal p{\displaystyle {\mathfrak {p}}} of O, and, like the p-adic absolute values, it measures divisibility. These are called finite places. The other type of place is specified using a real or complex embedding of K and the standard absolute value function on R or C. These are infinite places. Because absolute values are unable to distinguish between a complex embedding and its conjugate, a complex embedding and its conjugate determine the same place. Therefore, there are r1 real places and r2 complex places. Because places encompass the primes, places are sometimes referred to as primes. When this is done, finite places are called finite primes and infinite places are called infinite primes. If v is a valuation corresponding to an absolute value, then one frequently writes v∣∞{\displaystyle v\mid \infty } to mean that v is an infinite place and v∤∞{\displaystyle v\nmid \infty } to mean that it is a finite place.

Considering all the places of the field together produces the adele ring of the number field. The adele ring allows one to simultaneously track all the data available using absolute values. This produces significant advantages in situations where the behavior at one place can affect the behavior at other places, as in the Artin reciprocity law.

The integers have only two units, 1 and −1. Other rings of integers may admit more units. The Gaussian integers have four units, the previous two as well as ±i. The Eisenstein integersZ[exp(2πi / 3)] have six units. The integers in real quadratic number fields have infinitely many units. For example, in Z[√3], every power of 2 + √3 is a unit, and all these powers are distinct.

In general, the group of units of O, denoted O×, is a finitely generated abelian group. The fundamental theorem of finitely generated abelian groups therefore implies that it is a direct sum of a torsion part and a free part. Reinterpreting this in the context of a number field, the torsion part consists of the roots of unity that lie in O. This group is cyclic. The free part is described by Dirichlet's unit theorem. This theorem says that rank of the free part is r1 + r2 − 1. Thus, for example, the only fields for which the rank of the free part is zero are Q and the imaginary quadratic fields. A more precise statement giving the structure of O× ⊗ZQ as a Galois module for the Galois group of K/Q is also possible.[14]

The free part of the unit group can be studied using the infinite places of K. Consider the function

where v varies over the infinite places of K and |·|v is the absolute value associated with v. The function L is a homomorphism from K× to a real vector space. It can be shown that the image of O× is a lattice that spans the hyperplane defined by x1+⋯+xr1+r2=0.{\displaystyle x_{1}+\cdots +x_{r_{1}+r_{2}}=0.} The covolume of this lattice is the regulator of the number field. One of the simplifications made possible by working with the adele ring is that there is a single object, the idele class group, that describes both the quotient by this lattice and the ideal class group.

Completing a number field K at a place w gives a complete field. If the valuation is Archimedean, one obtains R or C, if it is non-Archimedean and lies over a prime p of the rationals, one obtains a finite extension Kw/Qp:{\displaystyle K_{w}/\mathbf {Q} _{p}:} a complete, discrete valued field with finite residue field. This process simplifies the arithmetic of the field and allows the local study of problems. For example, the Kronecker–Weber theorem can be deduced easily from the analogous local statement. The philosophy behind the study of local fields is largely motivated by geometric methods. In algebraic geometry, it is common to study varieties locally at a point by localizing to a maximal ideal. Global information can then be recovered by gluing together local data. This spirit is adopted in algebraic number theory. Given a prime in the ring of algebraic integers in a number field, it is desirable to study the field locally at that prime. Therefore, one localizes the ring of algebraic integers to that prime and then completes the fraction field much in the spirit of geometry.

One of the classical results in algebraic number theory is that the ideal class group of an algebraic number field K is finite. This is a consequence of Minkowski's theorem since there are only finitely many Integral ideals with norm less than a fixed positive integer[15]page 78. The order of the class group is called the class number, and is often denoted by the letter h.

Dirichlet's unit theorem provides a description of the structure of the multiplicative group of units O× of the ring of integers O. Specifically, it states that O× is isomorphic to G × Zr, where G is the finite cyclic group consisting of all the roots of unity in O, and r = r1 + r2 − 1 (where r1 (respectively, r2) denotes the number of real embeddings (respectively, pairs of conjugate non-real embeddings) of K). In other words, O× is a finitely generated abelian group of rankr1 + r2 − 1 whose torsion consists of the roots of unity in O.

There are several different ways to express reciprocity laws. The early reciprocity laws found in the 19th century were usually expressed in terms of a power residue symbol (p/q) generalizing the quadratic reciprocity symbol, that describes when a prime number is an nth power residue modulo another prime, and gave a relation between (p/q) and (q/p). Hilbert reformulated the reciprocity laws as saying that a product over p of Hilbert symbols (a,b/p), taking values in roots of unity, is equal to 1. Artin's reformulated reciprocity law states that the Artin symbol from ideals (or ideles) to elements of a Galois group is trivial on a certain subgroup. Several more recent generalizations express reciprocity laws using cohomology of groups or representations of adelic groups or algebraic K-groups, and their relationship with the original quadratic reciprocity law can be hard to see.

Algebraic number theory interacts with many other mathematical disciplines. It uses tools from homological algebra. Via the analogy of function fields vs. number fields, it relies on techniques and ideas from algebraic geometry. Moreover, the study of higher-dimensional schemes over Z instead of number rings is referred to as arithmetic geometry. Algebraic number theory is also used in the study of arithmetic hyperbolic 3-manifolds.