# Cubic reciprocity

Cubic reciprocity is a collection of theorems in elementary and algebraic number theory that state conditions under which the congruence x$^3$ ≡ p (mod q) is solvable; the word "reciprocity" comes from the form of the main theorem, which states that if p and q are primary numbers in the ring of Eisenstein integers, both coprime to 3, the congruence x$^3$ ≡ p (mod q) is solvable if and only if x$^3$ ≡ q (mod p) is solvable.

## History

Sometime before 1748 Euler made the first conjectures about the cubic residuacity of small integers, but they were not published until 1849, 62 years after his death.
Gauss's published works mention cubic residues and reciprocity three times: there is one result pertaining to cubic residues in the Disquisitiones Arithmeticae (1801). In the introduction to the fifth and sixth proofs of quadratic reciprocity (1818) he said that he was publishing these proofs because their techniques (Gauss's lemma and Gaussian sums, respectively) can be applied to cubic and biquadratic reciprocity. Finally, a footnote in the second (of two) monographs on biquadratic reciprocity (1832) states that cubic reciprocity is most easily described in the ring of Eisenstein integers.
From his diary and other unpublished sources, it appears that Gauss knew the rules for the cubic and quartic residuacity of integers by 1805, and discovered the full-blown theorems and proofs of cubic and biquadratic reciprocity around 1814. Proofs of these were found in his posthumous papers, but it is not clear if they are his or Eisenstein's.
Jacobi published several theorems about cubic residuacity in 1827, but no proofs. In his Königsberg lectures of 1836–37 Jacobi presented proofs. The first published proofs were by Eisenstein (1844).

## Integers

A cubic residue (mod p) is any number congruent to the third power of an integer (mod p). If x$^3$ ≡ a (mod p) does not have an integer solution, a is a cubic nonresidue (mod p).
Cubic residues are usually only defined in modulus n such that $\lambda (n)$ (the Carmichael lambda function of n) is divisible by 3, since for other integer n, all residues are cubic residues.
As is often the case in number theory, it is easier to work modulo prime numbers, so in this section all moduli p, q, etc., are assumed to be positive odd primes.
We first note that if q ≡ 2 (mod 3) is a prime then every number is a cubic residue modulo q. Let q = 3n + 2; since 0 = 0$^3$ is obviously a cubic residue, assume x is not divisible by q. Then by Fermat's little theorem,
    $x^{q}\equiv x{\bmod {q}},\qquad x^{q-1}\equiv 1{\bmod {q}}$
Multiplying the two congruences we have
    $x^{2q-1}\equiv x{\bmod {q}}$
Now substituting 3n + 2 for q we have:
    $x^{2q-1}=x^{6n+3}=\left(x^{2n+1}\right)^{3}.$
Therefore, the only interesting case is when the modulus p ≡ 1 (mod 3). In this case the non-zero residue classes (mod p) can be divided into three sets, each containing (p−1)/3 numbers. Let e be a cubic non-residue. The first set is the cubic residues; the second one is e times the numbers in the first set, and the third is e$^2$ times the numbers in the first set. Another way to describe this division is to let e be a primitive root (mod p); then the first (resp. second, third) set is the numbers whose indices with respect to this root are congruent to 0 (resp. 1, 2) (mod 3). In the vocabulary of group theory, the cubic residues form a subgroup of index 3 of the multiplicative group $(\mathbb {Z} /p\mathbb {Z} )^{\times }$ and the three sets are its cosets.

### Primes ≡ 1 (mod 3)

A theorem of Fermat states that every prime p ≡ 1 (mod 3) can be written as p = a$^2$ + 3b$^2$ and (except for the signs of a and b) this representation is unique.
Letting m = a + b and n = a − b, we see that this is equivalent to p = m$^2$ − mn + n$^2$ (which equals (n − m)$^2$ − (n − m)n + n$^2$ = m$^2$ + m(n − m) + (n − m)$^2$, so m and n are not determined uniquely). Thus,
    ${\begin{aligned}4p&=(2m-n)^{2}+3n^{2}\\&=(2n-m)^{2}+3m^{2}\\&=(m+n)^{2}+3(m-n)^{2}\end{aligned}}$
and it is a straightforward exercise to show that exactly one of m, n, or m − n is a multiple of 3, so
    $p={\frac {1}{4}}(L^{2}+27M^{2}),$
and this representation is unique up to the signs of L and M.
For relatively prime integers m and n define the rational cubic residue symbol as
    $\left[{\frac {m}{n}}\right]_{3}={\begin{cases}1&m{\text{ is a cubic residue }}{\bmod {n}}\\-1&m{\text{ is a cubic non-residue }}{\bmod {n}}\end{cases}}$
It is important to note that this symbol does not have the multiplicative properties of the Legendre symbol; for this, we need the true cubic character defined below.
    Euler's Conjectures. Let p = a$^2$ + 3b$^2$ be a prime. Then the following hold:
       ${\begin{aligned}\left[{\tfrac {2}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad 3\mid b\\\left[{\tfrac {3}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad 9\mid b{\text{ or }}9\mid (a\pm b)\\\left[{\tfrac {5}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad 15\mid b{\text{ or }}3\mid b{\text{ and }}5\mid a{\text{ or }}15\mid (a\pm b){\text{ or }}15\mid (2a\pm b)\\\left[{\tfrac {6}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad 9\mid b{\text{ or }}9\mid (a\pm 2b)\\\left[{\tfrac {7}{p}}\right]_{3}=1\quad &\Longrightarrow \quad (3\mid b{\text{ and }}7\mid a){\text{ or }}21\mid (b\pm a){\text{ or }}7\mid (4b\pm a){\text{ or }}21\mid b{\text{ or }}7\mid (b\pm 2a)\end{aligned}}$
The first two can be restated as follows. Let p be a prime that is congruent to 1 modulo 3. Then:
* 2 is a cubic residue of p if and only if p = a$^2$ + 27b$^2$.
* 3 is a cubic residue of p if and only if 4p = a$^2$ + 243b$^2$.
    Gauss's Theorem. Let p be a positive prime such that
       $p=3n+1={\tfrac {1}{4}}\left(L^{2}+27M^{2}\right).$
    Then $L(n!)^{3}\equiv 1{\bmod {p}}.$
One can easily see that Gauss's Theorem implies:
    $\left[{\tfrac {L}{p}}\right]_{3}=\left[{\tfrac {M}{p}}\right]_{3}=1.$
    Jacobi's Theorem (stated without proof). Let q ≡ p ≡ 1 (mod 6) be positive primes. Obviously both p and q are also congruent to 1 modulo 3, therefore assume:
       $p={\tfrac {1}{4}}\left(L^{2}+27M^{2}\right),\qquad q={\tfrac {1}{4}}\left(L'^{2}+27M'^{2}\right).$
    Let x be a solution of x$^2$ ≡ −3 (mod q). Then
       $x\equiv \pm {\frac {L'}{3M'}}{\bmod {q}},$
    and we have:
       ${\begin{aligned}\left[{\frac {q}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad \left[{\frac {{\frac {L+3Mx}{2}}p}{q}}\right]_{3}=1\quad \Longleftrightarrow \quad \left[{\frac {\frac {L+3Mx}{L-3Mx}}{q}}\right]_{3}=1\\\left[{\frac {q}{p}}\right]_{3}=1\quad &\Longrightarrow \quad \left[{\frac {\frac {LM'+L'M}{LM'-L'M}}{q}}\right]_{3}=1\end{aligned}}$
    Lehmer's Theorem. Let q and p be primes, with $p={\tfrac {1}{4}}\left(L^{2}+27M^{2}\right).$ Then:
       $\left[{\frac {q}{p}}\right]_{3}=1\quad \Longleftrightarrow \quad q\mid LM{\text{ or }}L\equiv \pm {\frac {9r}{2u+1}}M{\bmod {q}},$
    where
       $u\not \equiv 0,1,-{\tfrac {1}{2}},-{\tfrac {1}{3}}{\bmod {q}}\quad {\text{and}}\quad 3u+1\equiv r^{2}(3u-3){\bmod {q}}.$
Note that the first condition implies: that any number that divides L or M is a cubic residue (mod p).
The first few examples of this are equivalent to Euler's conjectures:
    ${\begin{aligned}\left[{\frac {2}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad L\equiv M\equiv 0{\bmod {2}}\\\left[{\frac {3}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad M\equiv 0{\bmod {3}}\\\left[{\frac {5}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad LM\equiv 0{\bmod {5}}\\\left[{\frac {7}{p}}\right]_{3}=1\quad &\Longleftrightarrow \quad LM\equiv 0{\bmod {7}}\end{aligned}}$
Since obviously L ≡ M (mod 2), the criterion for q = 2 can be simplified as:
    $\left[{\frac {2}{p}}\right]_{3}=1\quad \Longleftrightarrow \quad M\equiv 0{\bmod {2}}.$
    Martinet's theorem. Let p ≡ q ≡ 1 (mod 3) be primes, $pq={\tfrac {1}{4}}(L^{2}+27M^{2}).$ Then
       $\left[{\frac {L}{p}}\right]_{3}\left[{\frac {L}{q}}\right]_{3}=1\quad \Longleftrightarrow \quad \left[{\frac {q}{p}}\right]_{3}\left[{\frac {p}{q}}\right]_{3}=1.$
    Sharifi's theorem. Let p = 1 + 3x + 9x$^2$ be a prime. Then any divisor of x is a cubic residue (mod p).

## Eisenstein integers
### Background

In his second monograph on biquadratic reciprocity, Gauss says:
   The theorems on biquadratic residues gleam with the greatest simplicity and genuine beauty only when the field of arithmetic is extended to imaginary numbers, so that without restriction, the numbers of the form a + bi constitute the object of study ... we call such numbers integral complex numbers. [bold in the original]
These numbers are now called the ring of Gaussian integers, denoted by Z[i]. Note that i is a fourth root of 1.
In a footnote he adds
   The theory of cubic residues must be based in a similar way on a consideration of numbers of the form a + bh where h is an imaginary root of the equation h$^3$ = 1 ... and similarly the theory of residues of higher powers leads to the introduction of other imaginary quantities.
In his first monograph on cubic reciprocity Eisenstein developed the theory of the numbers built up from a cube root of unity; they are now called the ring of Eisenstein integers. Eisenstein said that to investigate the properties of this ring one need only consult Gauss's work on Z[i] and modify the proofs. This is not surprising since both rings are unique factorization domains.
The "other imaginary quantities" needed for the "theory of residues of higher powers" are the rings of integers of the cyclotomic number fields; the Gaussian and Eisenstein integers are the simplest examples of these.

### Facts and terminology

Let
    $\omega ={\frac {-1+i{\sqrt {3}}}{2}}=e^{\frac {2\pi i}{3}},\qquad \omega ^{3}=1.$
And consider the ring of Eisenstein integers:
    $\mathbb {Z} [\omega ]=\left\{a+b\omega \ :\ a,b\in \mathbb {Z} \right\}.$
This is a Euclidean domain with the norm function given by:
    $N(a+b\omega )=a^{2}-ab+b^{2}.$
Note that the norm is always congruent to 0 or 1 (mod 3).
The group of units in $\mathbb {Z} [\omega ]$ (the elements with a multiplicative inverse or equivalently those with unit norm) is a cyclic group of the sixth roots of unity,
    $\left\{\pm 1,\pm \omega ,\pm \omega ^{2}\right\}.$
$\mathbb {Z} [\omega ]$ is a unique factorization domain. The primes fall into three classes:
* 3 is a special case:
       $3=-\omega ^{2}(1-\omega )^{2}.$
    It is the only prime in $\mathbb {Z}$ divisible by the square of a prime in $\mathbb {Z} [\omega ]$. The prime 3 is said to ramify in $\mathbb {Z} [\omega ]$.
* Positive primes in $\mathbb {Z}$ congruent to 2 (mod 3) are also primes in $\mathbb {Z} [\omega ]$. These primes are said to remain inert in $\mathbb {Z} [\omega ]$. Note that if $q$ is any inert prime then:
       $N(q)=q^{2}\equiv 1{\bmod {3}}.$
* Positive primes in $\mathbb {Z}$ congruent to 1 (mod 3) are the product of two conjugate primes in $\mathbb {Z} [\omega ]$. These primes are said to split in $\mathbb {Z} [\omega ]$. Their factorization is given by:
       $p=N(\pi )=N({\overline {\pi }})=\pi {\overline {\pi }}.$
    for example
       $7=(3+\omega )(2-\omega ).$
A number is primary if it is coprime to 3 and congruent to an ordinary integer modulo $(1-\omega )^{2},$ which is the same as saying it is congruent to $\pm 2$ modulo 3. If $\gcd(N(\lambda ),3)=1$ one of $\lambda ,\omega \lambda ,$ or $\omega ^{2}\lambda$ is primary. Moreover, the product of two primary numbers is primary and the conjugate of a primary number is also primary.
The unique factorization theorem for $\mathbb {Z} [\omega ]$ is: if $\lambda \neq 0,$ then
    $\lambda =\pm \omega ^{\mu }(1-\omega )^{\nu }\pi _{1}^{\alpha _{1}}\pi _{2}^{\alpha _{2}}\pi _{3}^{\alpha _{3}}\cdots ,\qquad \mu \in \{0,1,2\},\quad \nu ,\alpha _{1},\alpha _{2},\ldots \geqslant 0$
where each $\pi _{i}$ is a primary (under Eisenstein's definition) prime. And this representation is unique, up to the order of the factors.
The notions of congruence and greatest common divisor are defined the same way in $\mathbb {Z} [\omega ]$ as they are for the ordinary integers $\mathbb {Z}$. Because the units divide all numbers, a congruence modulo $\lambda$ is also true modulo any associate of $\lambda$, and any associate of a GCD is also a GCD.

### Cubic residue character
#### Definition

An analogue of Fermat's little theorem is true in $\mathbb {Z} [\omega ]$: if $\alpha$ is not divisible by a prime $\pi$,
    $\alpha ^{N(\pi )-1}\equiv 1{\bmod {\pi }}.$
Now assume that $N(\pi )\neq 3$ so that $N(\pi )\equiv 1{\bmod {3}}.$ Or put differently $3\mid N(\pi )-1.$ Then we can write:
    $\alpha ^{\frac {N(\pi )-1}{3}}\equiv \omega ^{k}{\bmod {\pi }},$
for a unique unit $\omega ^{k}.$ This unit is called the cubic residue character of $\alpha$ modulo $\pi$ and is denoted by
    $\left({\frac {\alpha }{\pi }}\right)_{3}=\omega ^{k}\equiv \alpha ^{\frac {N(\pi )-1}{3}}{\bmod {\pi }}.$

#### Properties

The cubic residue character has formal properties similar to those of the Legendre symbol:
* If $\alpha \equiv \beta {\bmod {\pi }}$ then $\left({\tfrac {\alpha }{\pi }}\right)_{3}=\left({\tfrac {\beta }{\pi }}\right)_{3}.$
* $\left({\tfrac {\alpha \beta }{\pi }}\right)_{3}=\left({\tfrac {\alpha }{\pi }}\right)_{3}\left({\tfrac {\beta }{\pi }}\right)_{3}.$
* ${\overline {\left({\tfrac {\alpha }{\pi }}\right)_{3}}}=\left({\tfrac {\overline {\alpha }}{\overline {\pi }}}\right)_{3},$ where the bar denotes complex conjugation.
* If $\pi$ and $\theta$ are associates then $\left({\tfrac {\alpha }{\pi }}\right)_{3}=\left({\tfrac {\alpha }{\theta }}\right)_{3}$
* The congruence $x^{3}\equiv \alpha {\bmod {\pi }}$ has a solution in $\mathbb {Z} [\omega ]$ if and only if $\left({\tfrac {\alpha }{\pi }}\right)_{3}=1.$
* If $a,b\in \mathbb {Z}$ are such that $\gcd(a,b)=\gcd(b,3)=1,$ then $\left({\tfrac {a}{b}}\right)_{3}=1.$
* The cubic character can be extended multiplicatively to composite numbers (coprime to 3) in the "denominator" in the same way the Legendre symbol is generalized into the Jacobi symbol. As with the Jacobi symbol, this extension sacrifices the "numerator is a cubic residue mod the denominator" meaning: the symbol is still guaranteed to be 1 when the "numerator" is a cubic residue, but the converse no longer holds.
       $\left({\frac {\alpha }{\lambda }}\right)_{3}=\left({\frac {\alpha }{\pi _{1}}}\right)_{3}^{\alpha _{1}}\left({\frac {\alpha }{\pi _{2}}}\right)_{3}^{\alpha _{2}}\cdots ,$
    where
       $\lambda =\pi _{1}^{\alpha _{1}}\pi _{2}^{\alpha _{2}}\pi _{3}^{\alpha _{3}}\cdots$

### Statement of the theorem

Let α and β be primary. Then
    ${\Bigg{\frac {\alpha }{\beta }}{\Bigg )}_{3}={\Bigg{\frac {\beta }{\alpha }}{\Bigg )}_{3}.$
There are supplementary theorems for the units and the prime 1 − ω:
Let α = a + bω be primary, a = 3m + 1 and b = 3n. (If a ≡ 2 (mod 3) replace α with its associate −α; this will not change the value of the cubic characters.) Then
    ${\Bigg{\frac {\omega }{\alpha }}{\Bigg )}_{3}=\omega ^{\frac {1-a-b}{3}}=\omega ^{-m-n},\;\;\;{\Bigg{\frac {1-\omega }{\alpha }}{\Bigg )}_{3}=\omega ^{\frac {a-1}{3}}=\omega ^{m},\;\;\;{\Bigg{\frac {3}{\alpha }}{\Bigg )}_{3}=\omega ^{\frac {b}{3}}=\omega ^{n}.$