User:Marty/UCSC Math 110 Fall 2008/Week 10

This week, we are primarily discussing quadratic reciprocity.

=Computing Legendre Symbols=

We are interested in the following question:
 * Suppose that $p$ is a prime number, and $a$ is an integer. Is $\bar a$ a quadratic residue, modulo $p$?  In other words, does there exist an integer $b$ such that $b^2 - a$ is a multiple of $p$?

The answer to the above question is "yes", if $a$ is a multiple of $p$ (a somewhat trivial case, since then $\bar a = \bar 0$, modulo $p$), or if the Legendre symbol $\left( \frac{a}{p} \right)$ equals $1$.

Therefore, we are interested in computing the Legendre symbol $\left( \frac{a}{p} \right)$. When $p = 2$, this is again trivial (everything is a square, modulo $2$). Therefore, we are interested in computing the Legendre symbol $\left( \frac{a}{p} \right)$ when $p$ is an odd prime number.

Using Euler's criterion, the Legendre symbol is multiplicative in the following sense: $$\left( \frac{ab}{p} \right) = \left( \frac{a}{p} \right) \left( \frac{b}{p} \right).$$
 * If $a,b \in \ZZ$, and $p$ is a prime number, then:

This allows us to "break up" a Legendre symbol into pieces, each of the form $\left( \frac{q}{p} \right)$ for a prime number $q$ or for $q = -1$. For example, we can "break up" a Legendre symbol as follows: $$\left( \frac{6}{13} \right) = \left( \frac{2}{13} \right) \cdot \left( \frac{3}{13} \right).$$

Also, observe that Legendre symbols with square numerators can be "cancelled": $$\left( \frac{a^2}{p} \right) = 1.$$ This follows from the definition of the Legendre symbol as well as Euler's criterion.
 * If $a \in \ZZ$, and $p$ is a prime number, then:

Next, observe that Legendre symbols can be "reduced", so that the numerator is smaller than the denominator: $$\left( \frac{a}{p} \right) = \left( \frac{b}{p} \right).$$ This follows from the definition of the Legendre symbol.
 * If $a,b \in \ZZ$, and $p$ is a prime number, and $a$ is congruent to $b$, mod $p$, then:

As a result of "breaking up", the computation of Legendre symbols can be reduced to the following three classes of computation:
 * Compute $\left( \frac{-1}{p} \right)$, when $p$ is an odd prime number.
 * Compute $\left( \frac{2}{p} \right)$, when $p$ is an odd prime number.
 * Compute $\left( \frac{q}{p} \right)$, when $p,q$ are both odd prime numbers and $q$ is less than $p$.

The first computation is easiest using Euler's criterion:
 * $\left( \frac{-1}{p} \right) = (-1)^{(p-1)/2}$. This is equal to $1$, if $p$ is congruent to $1$, mod $4$, and equal to $-1$ if $p$ is congruent to $3$, mod $4$.

The second computation is more difficult:
 * $\left( \frac{2}{p} \right) = (-1)^{(p^2 - 1)/8}$. This is equal to $1$ if $p$ is congruent to $1$ or $7$, mod $8$, and equal to $-1$ if $p$ is congruent to $3$ or $5$, mod $8$.

The third computation can be reduced by quadratic reciprocity: $$\left( \frac{q}{p} \right) = \left( \frac{p}{q} \right) \cdot (-1)^{ \frac{p-1}{2} \cdot \frac{q-1}{2} }.$$

Notice that the right side involves a Legendre symbol with smaller "denominator" (since $q < p$). The "sign term" can be easily computed as follows: $$\mbox{Let } \epsilon(p,q) = (-1)^{ \frac{p-1}{2} \cdot \frac{q-1}{2} }.$$ Then, if $p$ and $q$ are both congruent to $3$, mod $4$, then $\epsilon(p,q) = -1$. Otherwise $\epsilon(p,q) = 1$.

Thus, the Legendre symbols $\left( \frac{q}{p} \right)$ and $\left( \frac{p}{q} \right)$ are equal, unless both $p$ and $q$ are congruent to $3$, mod $4$, in which case the two Legendre symbols are opposite.