I’m reading through *Primes of the Form *, by David Cox (link; it’s good!). Here are the high-level notes I took on the first chapter, which is about the theory of quadratic forms.

(Meta point re blog: I’m probably going to start posting more and more of these more high-level notes/sketches on this blog on topics that I’ve been just learning. Up til now I’ve been mostly only posting things that I understand well and for which I have a very polished exposition. But the perfect is the enemy of the good here; given that I’m taking these notes for my own sake, I may as well share them to help others.)

## 1. Overview

For example, we have the famous quadratic form

As readers are probably aware, we can say a lot about exactly which integers can be represented by : by **Fermat’s Christmas theorem**, the primes (and ) can all be written as the sum of two squares, while the primes cannot. For convenience, let us say that:

The basic question is: **what can we say about which primes/integers are properly represented by a quadratic form?** In fact, we will later restrict our attention to “positive definite” forms (described later).

For example, Fermat’s Christmas theorem now rewrites as:

**Theorem 3** **(Fermat’s Christmas theorem for primes)**

An odd prime is (properly) represented by if and only if .

The proof of this is classical, see for example my olympiad handout. We also have the formulation for odd integers:

**Theorem 4** **(Fermat’s Christmas theorem for odd integers)**

An odd integer is properly represented by if and only if all prime factors of are .

*Proof:* For the “if” direction, we use the fact that is multiplicative in the sense that

For the “only if” part we use the fact that if a multiple of a prime is properly represented by , then so is . This follows by noticing that if (and ) then .

Tangential remark: the two ideas in the proof will grow up in the following way.

- The fact that “multiplies nicely” will grow up to become the so-called
**composition** of quadratic forms.
- The second fact will
**not** generalize for an arbitrary form . Instead, we will see that if a multiple of is represented by a form then some form of the same “discriminant” will represent the prime , but this form need not be the same as itself.

## 2. Equivalence of forms, and the discriminant

The first thing we should do is figure out when two forms are essentially the same: for example, and should clearly be considered the same. More generally, if we think of as acting on and is any automorphism of , then should be considered the same as . Specifically,

**Definition 5**

Two forms and said to be **equivalent** if there exists

such that . We have and so we say the equivalence is

- a
**proper equivalence** if , and
- an
**improper equivalence** if .

So we generally will only care about forms up to proper equivalence. (It will be useful to distinguish between proper/improper equivalence later.)

Naturally we seek some invariants under this operation. By far the most important is:

**Definition 6**

The **discriminant** of a quadratic form is defined as

The discriminant is invariant under equivalence (check this). Note also that we also have .

Observe that we have

So if and (thus too) then for all . Such quadratic forms are called **positive definite**, and we will restrict our attention to these forms.

Now that we have this invariant, we may as well classify equivalence classes of quadratic forms for a fixed discriminant. It turns out this can be done explicitly.

**Exercise 8**

Check there only finitely many reduced forms of a fixed discriminant.

Then the big huge theorem is:

**Theorem 9** **(Reduced forms give a set of representatives)**

Every primitive positive definite form of discriminant is properly equivalent to a unique reduced form. We call this the **reduction** of .

*Proof:* Omitted due to length, but completely elementary. It is a reduction argument with some number of cases.

Thus, for any discriminant we can consider the set

which will be the equivalence classes of positive definite of discriminant . By abuse of notation we will also consider it as the set of equivalence classes of primitive positive definite forms of discriminant .

We also define ; by the exercise, . This is called the **class number**.

Moreover, we have , because we can take for and for . We call this form the **principal form**.

## 3. Tables of quadratic forms

**Example 11** **(Examples of quadratic forms with , )**

The following discriminants have class number , hence having only the principal form:

- , with form .
- , with form .
- , with form .
- , with form .
- , with form .
- , with form .
- , with form .
- , with form .

This is in fact the complete list when .

**Example 12** **(More examples of quadratic forms)**

Here are tables for small discriminants with . When we have

- , with forms and .
- , with forms and .
- , with forms and .
- , with forms and .
- , with forms and .
- , with forms and .

As for we have

- , with forms and .
- , with forms and .
- , with forms and .
- , with forms , and .

## 4. The Character

We can now connect this to primes as follows. Earlier we played with , and observed that for odd primes , if and only if some *multiple* of is properly represented by .

Our generalization is as follows:

This generalizes our result for , but note that it uses in an essential way! That is: if , we know is represented by *some* quadratic form of discriminant \dots but only since do we know that this form reduces to .

*Proof:* First assume WLOG that and . Thus , since otherwise this would imply . Then

hence .

The converse direction is amusing: let for integers , . Consider the quadratic form

It is primitive of discriminant and . Now may not be reduced, but that’s fine: just take the reduction of , which must also properly represent .

Thus to every discriminant we can attach the **Legendre character** (is that the name?), which is a homomorphism

with the property that if is a rational prime not dividing , then . This is abuse of notation since I should technically write , but there is no harm done: one can check by quadratic reciprocity that if then . Thus our previous result becomes:

As a corollary of this, using the fact that one can prove that

*Proof:* The congruence conditions are equivalent to , and as before the only point is that the only reduced quadratic form for these is the principal one.

## 5. Genus theory

What if ? Sometimes, we can still figure out which primes go where just by taking mods.

Let . Then it **represents** some residue classes of . In that case we call the set of residue classes represented the **genus** of the quadratic form .

The thing that makes this work is that each genus appears exactly once. We are not always so lucky: for example when we have that

We now prove that:

*Proof:* For the first part, we aim to show is multiplicatively closed. For , we use the fact that

For , we instead appeal to another “magic” identity

and it follows from here that is actually the set of squares in , which is obviously a subgroup.

Now we show that other quadratic forms have genus equal to a coset of the principal genus. For , with we can write

and thus the desired coset is shown to be . As for , we have

so the desired coset is also , since was the set of squares.

Thus every genus is a *coset* of in . Thus:

**Definition 20**

We define the quotient group

which is the set of all genuses in discriminant . One can view this as an abelian group by coset multiplication.

Thus there is a natural map

(The map is surjective by Theorem~14.) We also remark than is quite well-behaved:

**Proposition 21** **(Structure of )**

The group is isomorphic to for some integer .

*Proof:* Observe that contains all the squares of : if is the principal form then . Thus claim each element of has order at most , which implies the result since is a finite abelian group.

In fact, one can compute the order of exactly, but for this post I Will just state the result.

## 6. Composition

We have already used once the nice identity

We are going to try and generalize this for any two quadratic forms in . Specifically,

**Proposition 23** **(Composition defines a group operation)**

Let . Then there is a unique and bilinear forms for such that

In fact, without the latter two constraints we would instead have and , and each choice of signs would yield one of four (possibly different) forms. So requiring both signs to be positive makes this operation well-defined. (This is why we like proper equivalence; it gives us a well-defined group structure, whereas with improper equivalence it would be impossible to put a group structure on the forms above.)

Taking this for granted, we then have that

**Theorem 24** **(Form class group)**

Let , be a discriminant. Then becomes an abelian group under composition, where

- The identity of is the principal form, and
- The inverse of the form is .

This group is called the **form class group**.

We then have a group homomorphism

Observe that and are inverses and that their images coincide (being improperly equivalent); this is expressed in the fact that has elements of order . As another corollary, the number of elements of with a given genus is always a power of two.

We now define:

**Definition 25**

An integer is **convenient** if the following equivalent conditions hold:

- The principal form is the only reduced form with the principal genus.
- is injective (hence an isomorphism).
- .

Thus we arrive at the following corollary:

**Corollary 26** **(Convenient numbers have nice representations)**

Let be convenient. Then is of the form if and only if lies in the principal genus.

Hence the represent-ability depends only on .

OEIS A000926 lists 65 convenient numbers. This sequence is known to be complete except for at most one more number; moreover the list is complete assuming the Grand Riemann Hypothesis.

## 7. Cubic and quartic reciprocity

To treat the cases where is not convenient, the correct thing to do is develop class field theory. However, we can still make a little bit more progress if we bring higher reciprocity theorems to bear: we’ll handle the cases and , two examples of numbers which are not convenient.

### 7.1. Cubic reciprocity

First, we prove that

To do this we use cubic reciprocity, which requires working in the Eisenstein integers where is a cube root of unity. There are six units in (the sixth roots of unity), hence each nonzero number has six **associates** (differing by a unit), and the ring is in fact a PID.

Now if we let be a prime not dividing , and is coprime to , then we can define the **cubic Legendre symbol** by setting

Moreover, we can define a **primary** prime to be one such that ; given any prime exactly one of the six associates is primary. We then have the following reciprocity theorem:

**Theorem 28** **(Cubic reciprocity)**

If and are disjoint primary primes in then

We also have the following supplementary laws: if , then

The first supplementary law is for the unit (analogous to ) while the second reciprocity law handles the prime divisors of (analogous to .)

We can tie this back into as follows. If is a rational prime then it is represented by , and thus we can put for some prime , . Consequently, we have a natural isomorphism

Therefore, we see that a given is a cubic residue if and only if .

In particular, we have the following corollary, which is all we will need:

*Proof:* By cubic reciprocity:

Now we give the proof of Theorem~27. *Proof:* First assume

Let be primary, noting that . Now clearly , so done by corollary.

For the converse, assume , with primary and . If we set for integers and , then the fact that and is enough to imply that (check it!). Moreover,

as desired.

### 7.2. Quartic reciprocity

This time we work in , for which there are four units , . A prime is **primary** if ; every prime not dividing has a unique associate which is primary. Then we can as before define

where is primary, and is nonzero mod . As before , we have that is a quartic residue modulo if and only if thanks to the isomorphism

Now we have

**Theorem 30** **(Quartic reciprocity)**

If and are distinct primary primes in then

We also have supplementary laws that state that if is primary, then

Again, the first law handles units, and the second law handles the prime divisors of . The corollary we care about this time in fact uses only the supplemental laws:

*Proof:* Note that and applying the above. Therefore

Now we assumed is primary. We claim that

Note that since was is divisible by , hence divides . Thus

since is odd and is even. Finally,

From here we quickly deduce