2

I'm learning about quadratic residues.

So a quadratic residue $\bmod p$, fulfills the condition $a ≡ x^2 \bmod p$.

My question is why are there a finite number of quadratic residues for odd number primes?

For example, if $11 ≡ 4 ≡ 2^2 \bmod 7$ doesn't that make $11$ a quadratic residue as well? The book I'm reading says that $1,2, 4$ are the quadratic residues $\bmod 7$ but shouldn't there be more other than those $3$?

I'm just learning and any help will be appreciated.

Bill Dubuque
  • 282,220

3 Answers3

2

There's only $p$ numbers/residue classes $\mod p,$ oft represented by $\{0,1,2,\dots, p-1\}.$

The subset of residues which can be written as a square are the quadratic residues. Hence finite.

It's beginning/rudimentary group theory that there are only finitely many residue classes, each with infinitely many possible representatives.

My favorite reference is Fraleigh.

1

In the world of $\mod 7$, $4$ and $11$ are considered to be the exact same thing.

In the world of $\mod 7$ only $7$ things exist. These seven things are $0,1,2,3,4,5,6$.

But they can be written many different ways. For example, $4$ can be written as $4$ or as $-3$ or as $11$ or as $72139$. Although written different ways, they are all the same thing.

So as there are only a finite number of residues that exist at all, there are only a finite number of residues that are squares. They are $0^2=0, 1^2=1, 2^2=4, 3^2=2$ (Notice that $4^2$ and $3^2$ are the same thing, as are $5^2$ and $2^2$).

....

Now. An obedient student would accept that and quietly walk away. But an inquisitive student might ask. Wait, a minute. I get that $4$ and $11$ and $-3$ all have the same property in that they are all equivalent $\mod 7$ but that doesn't mean they are the same thing. $4\ne 11$ and we can't just pretend they are, can we?

And the answer is $a\equiv b \pmod 7$ is an equivalence relation and "equivalence" in math means pretty much the same thing as "equivalence" in English-- they share all relevant properties and an completely interchangeable for all intents and purposes.

And the thing is when we talk about $4$ or $11$ in terms of $\mod 7$ we aren't actually referring to the integers $4$ and $11$. We are talking about a class of integers represented by $4$ (or by $11$) and it is the class of all integers of the form $4 +7k; k\in \mathbb Z$ that we are considering to be the one single object. And we aren't talking about the integers at all, we are talking about the property of being $4+7k$.

Sometimes... it is written that $[4] = \{....., -17,-3,4,11,18, 25,...... \}$ and $4\equiv 11 \pmod 7$ is the same thing as $[4] =\{4+7k|k\in \mathbb Z\}=\{11 + 7j|j\in \mathbb Z\} = [11]$. In a way I like this as it is clear we are not referring to the integer $4$ but the entire class of integers. But on the other hand it can be obfuscating and difficult to make the distinction.

J. W. Tanner
  • 63,683
  • 4
  • 43
  • 88
fleablood
  • 130,341
-1

[Part of this answer was previously posted as a comment - with the intent to delete it once a good dupe target was found. Unfortunately the comment was wrongly deleted, so I have reposted it as an answer. When a good dupe target is located this answer will be deleted (alas, the approach0 server is currently down so dupe searching is not easy at the moment)].

Yes, using that older language, there are indeed an infinite number of quadratic residues (i.e. integers congruent to nonzero squares) $\!\bmod p,\,$ but there are only a finite number of residue classes. In your example, $\!\bmod 7\!:\,$ the class of $\,4\equiv 2^2$ is $\,[4]_7 = 4+7\Bbb Z = \{\ldots,-3,4,11,\ldots\},\,$ i.e. the set of all $\,x\equiv 4\pmod{\!7}.\,$ Similarly every nonzero polynomial has only a finite number of classes that are roots, but each root has infinitely many congruent "residue" roots in its class. Further, $\!\bmod n\!:\,$ a polynomial has a root iff it has a root in a complete residue system.

It may be helpful to consider an analogy with fractions, e.g. $\,x^2 = 4/9\,$ has only two rational roots $\,x=\pm 2/3,\,$ but there are infinitely many equivalent fractions $\,x = \pm(2n)/(3n),\ n\neq 0.\,$ The "numbers" here - the rationals - are classes of equivalent fractions, usually represented by their least element- just like above. Further, a polynomial has a rational root iff it has a root in the complete residue system of fractions in least terms (to which the Rational Root Test applies).

In older/elementary textbooks that do not mention equivalence classes there is usually a remark that serves to clarify that congruent integers are considered to be the same modular number [i.e. modular numbers are the congruence (equivalence) classes], e.g. Niven and Zuckerman write

"Since $a + m$ is a quadratic residue or nonresidue modulo $m$ according as $a$ is or is not, we consider as distinct residues or nonresidues only those that are distinct modulo $m$" (my emph.).

It is essential to keep in mind that in the arithmetic (ring) of integers $\!\bmod m\,$ it is the equivalence (congruence) classes (cosets) $\, [a]_n = a + n\Bbb Z\,$ that correspond to our modular "numbers". This is often obscured in treatments that instead work with convenient "normal form" representatives of each class (complete residues systems), such as choosing the least natural in each class as a rep, i.e. the system $\,0,1,2\ldots,n\!-\!1\pmod{\!n}$.

This way of constructing new algebraic objects by working modulo congruences is fundamental in algebra. Indeed, as Andy Magid wrote in his review of Jacobson's great textbook Basic Algebra I

the notion that the cosets of a normal subgroup of a group, while they have intrinsic meaning as subsets of the original group, are best thought of as unities, as elements of a new group, the quotient group, is often the pons asinorum of the Basic Algebra course. Those who cross it successfully usually do learn to think algebraically.

These matters become much clearer when one studies abstract algebra, where the integers $\!\bmod n\,$ are just a special case of a general quotient ring construction, e.g. see this answer for this case.

Bill Dubuque
  • 282,220
  • This is terrible. – suckling pig May 01 '25 at 01:36
  • @thejoyofcats Not clear what "this" refers to (the method used in N&Z?). $\ \ $ – Bill Dubuque May 01 '25 at 02:03
  • 1
    @the It seems you misunderstand. This answer does not intend to teach modular arithmetic (which the OP seems to already know). Rather, the point is to explain the older terminology and presentations that are the source of the OP's confusion (which is not explained anywhere else here). – Bill Dubuque May 01 '25 at 02:22
  • 2
    @BillDubuque Thanks for your exemplary patience at the flippant commenter and sticking to the technical point. I have read many of your answers and learnt things. – P Vanchinathan May 01 '25 at 04:46