1

Given an odd prime $p$, we say that a polynomial $f \in \mathbb Z[x]$ has the property $L_p$, if

$ f(m) \text{ is a QR for all $m \in \mathbb Z$} \implies f = g^{2} \text{ in } \mathbb F_p \text{ for some } g \in \mathbb F_p[x]$

(so in particular, if $f$ has a non-QR on its image, then it has $L_p$) This property is just a local version of the fact that an integer polynomial that outputs only squares is also itself a square of some polynomial.

The question is, is it true for all $n \ge 1$, then we can find a constant $N$ such that all integer polynomials $f$ with $\deg f = n$ has the $L_p$ all $p > N$? If this is not true, can we find a constant dependent on the polynomial?

Edit. I'm very sorry about how my initial nomenclature was confusing, here's what I initially wrote so you can laugh at me

Given a prime $p$ and a polynomial $f \in \mathbb{Z}[x]$, if it outputs only square residues in $\bmod p$ (i.e $f(m)$ is QR for all $m$ integer), implies that $f = g^{2} \text{ in } \mathbb F_p$ for some $g \mathbb \in \mathbb F_p[X]$, then we say that $f$ is locally square for $p$. (If a polynomial does not outputs only quadratic residues, I'll still refer to it as locally square)

The answers are very useful in any case, and in fact shows that if $f$ outputs only square residues for infinitely many large primes, then it is a square. An polynomial version of Q1 given in the first answer.

Curious
  • 148

2 Answers2

4

I don't think you've asked the question you've meant to ask; as written what you're asking for is much too strong, and already the polynomial $f(x) = x$ is a counterexample; it's not locally a square $\bmod p$ for any prime $p$.

The question I think you intended to ask is some variation of the following questions (but I can't tell which):

Q1: Is it true that if an integer $n \in \mathbb{Z}$ is a square $\bmod p$ for all primes $p$, or sufficiently large primes $p$, then it's a square in $\mathbb{Z}$?

Yes, and it suffices to ask for sufficiently large primes $p$. This follows from the Grunwald-Wang theorem; IIRC this case has a reasonably elementary proof using quadratic reciprocity, and you may or may not have to use Dirichlet's theorem. As a last-ditch resort, this definitely follows from the Frobenius density theorem applied to the polynomial $f(x) = x^2 - n$.

Q2: Is it true that if a polynomial $f \in \mathbb{F}_p[x]$ only takes on square values $\bmod p$ for all $x \in \mathbb{F}_p$, then it's a square in $\mathbb{F}_p[x]$ ?

No. For example, $f(x) = x^p - x$ only takes on the value $0 \bmod p$ for all $x \in \mathbb{F}_p$, but if $p$ is odd it can't be a square (and it's not a square when $p = 2$ either).

Q3: Is it true that if a polynomial $f \in \mathbb{Z}[x]$ takes only square values $f(k)$ for all $k \in \mathbb{Z}$, then it's a square in $\mathbb{Z}[x]$?

Yes. This is Theorem 4 in Ram Murty's Polynomials assuming square values which also discusses the multivariate case. The argument is pretty straightforward; I found it discussed on math.SE here by Andrew Dudzik.

Note that by Q1 this condition is equivalent to the condition that for all $k$, $f(k) \bmod p$ is square for all sufficiently large primes $p$.

Q4: Is it true that if a polynomial $f \in \mathbb{Z}[x]$ is a square polynomial in $\mathbb{F}_p[x]$ for all primes $p$, or sufficiently large $p$, then it's a square in $\mathbb{Z}[x]$?

Yes. This in particular implies that $f$ takes on square values $\bmod p$ for sufficiently large primes $p$, so it follows from Q1 + Q3. Likely there is an alternative direct argument.

Qiaochu Yuan
  • 468,795
  • sorry, I'll add some clarification, but for the question I'm currently asking, the identity is not a counterexample because the condition of locally square would vacuously hold for any prime, as it does not outputs only quadratic residues for any odd prime. – Curious Jul 27 '24 at 10:00
  • @Curious: it is incredibly confusing to use "locally a square" to refer to a condition which is not equivalent to being locally a square! – Qiaochu Yuan Jul 27 '24 at 17:38
  • Yeah, I was made aware of that, thanks in any case, I'm sorry for the inconvenient – Curious Jul 27 '24 at 19:06
3

Adding one more candidate for the intended question to the nice list Qiaochu Yuan posted.


Assume that the degree of the polynomial $f(x)\in\Bbb{F}_p[x]$ is $n$, and that $f(x)$ is not a square. If we further assume that $p$ is large enough (approximately $p>n^2$ will do), then it follows that some of the values of $f(x)$ are not quadratic residues modulo $p$.

This follows from the Weil bound on character sums. Particular for the quadratic character aka Legendre character aka Legendre symbol $$\eta:\Bbb{F}_p\to\{0,-1,+1\}\subset\Bbb{Z}$$ defined by $$ \eta(x)=\begin{cases}+1, &\ \text{if $x$ is a non-zero quadratic residue modulo $p$,}\\ 0, &\ \text{if $x=0$},\\ -1, &\ \text{if $x$ is a quadratic non-residue modulo $p$.} \end{cases} $$ In that case the Weil bound says, that if $f(x)$ has $m$ (distinct!) zeros in the algebraic closure $\overline{\Bbb{F}_p}$ (so $f$ is squarefree, and $m=\deg f$, then $$ \left\vert\sum_{x\in\Bbb{F}_p}\eta(f(x))\right\vert\le (m-1)\sqrt p. $$

If all the values of $f(x)$, $x$ ranging over the prime field, were squares, then the sum on the left would be equal to $|p-N|$, where $N\le m$ is the number of zeros in the prime field. A comparison with the Weil bound implies $|p-N|\le (m-1)\sqrt p$ then forces $m$ to be large enough, roughly $>\sqrt p$.


I don't have a good idea how tight this bound is in general. It is easy to find polynomials of the form $f(x)=x^{(p-1)/2}+a$ taking only square values. That's because $x^{(p-1)/2}$ only ever takes values $0,\pm 1$. Meaning that if we find three consecutive quadratic residues $a-1,a,a+1$ (probably exist for all large enough $p$), we are in business. That is, assuming $a\neq0$ when the roots of $f(x)$ are simple. Examples:

  • $x^3+1$ modulo $p=7$ takes only values $0,1$ and $2=3^2$,
  • $x^5+4$ modulo $p=11$ takes only values $3=5^2$, $4$ and $5=4^2$.

Of these the cubic modulo $7$ is the lowest degree possibility, because we can complete any quadratic to a constant times a square + another constant, which won't do. There may be a lower degree example for $p=11$, but I don't have the time to search for one systematically.

Jyrki Lahtonen
  • 140,891