# The $p$-adic valuation of $u^2+1$

Let $R$ be a principal ideal domain, $p \in R$ be a prime element. Assume that $x^2+1 \equiv 0 \bmod p$ has a solution $i \in R$. Does it follow that there is some $u \in R$ such that $v_p(u^2+1)=1$? Here $v_p$ denotes the $p$-adic valuation. Equivalently, $u^2+1 \equiv p \cdot v \bmod p^2$ for some $p \nmid v$.

If $2$ is a unit in $R/p$, hence in $R/p^2$, then this is correct: Hensels Lemma gives a solution $i$ of $x^2+1 \equiv 0 \bmod p^2$. Then let $u=i(1-p/2)$ in $R/p^2$. Then $u^2+1=p$ holds in $R/p^2$.

If $p=2$, then we may take $u=1$.

This covers all cases for $R=\mathbb{Z}$.

• It is always false if $R$ has characteristic two, because $x^2+1 \in (p)$ implies $(x+1)^2 \in (p^2)$. And in char 2, we have that the latter is equal to $x^2+1$. So your proof for $K[T]$ is definitely flawed. – MooS Apr 27 '17 at 7:52
• @MooS: Thank you for pointing this out. Of course, you are right. So the simplest counterexample is actually $R=\mathbb{F}_2[T]$. – HeinrichD Apr 27 '17 at 7:55
• Sorry for asking again such a stupid question! – HeinrichD Apr 27 '17 at 11:08
• I don't think that it was a stupid question, it just turned out to be way less involved than one might guess at first glance. – MooS Apr 27 '17 at 11:10

You can give a very easy condition:

A solution to $x^2+1=0 \mod p$ implies a solution with $x^2+1 \neq 0 \mod {p^2}$ if and only if $2 \notin (p^2)$.

You have already covered the case, where $2 \notin (p)$: If $i$ is a solution, then $i(1-\frac{p}{2})$ is a solution $\neq 0 \mod{p^2}$. We dont need Hensel's Lemma there, because you assume the existence of $i$ anyway.

Here is the case $2 \in (p) \setminus (p^2)$: $2=1^2+1$ does the trick then.

Here is the case $2 \in (p^2)$: As I said in the comments, $x^2+1 \in (p)$ implies $(x+1)^2 \in (p^2)$, but then we have $x^2+1=(x+1)^2-2x \in (p^2)$.

The counterexample in the other answer is thus easily verified without any computations because $2=(1+i)(1-i) \in (1+i)^2$.

• Thank you. But $x^2+1 \neq 0 \bmod p^2$ is not what I wanted, right? – HeinrichD Apr 27 '17 at 11:34
• And I needed Hensel's Lemma in order to lift a solution of $x^2+1=0$ in $R/p$ to a solution in $R/p^2$. Of course one can also write it down explicitly here. – HeinrichD Apr 27 '17 at 12:02
• $x^2+1 \neq 0 \mod{p^2}$ is precisely what you wanted, because this is nothing else but saying that p-adic valuation is 1. – MooS Apr 27 '17 at 12:28
• No, we also need $x^2+1 = 0 \bmod p$. – HeinrichD Apr 27 '17 at 12:30
• This automatic if we dont change $x \mod p$... – MooS Apr 27 '17 at 12:31

In $\mathbb Z[i]$, $p=1+i$ this is not possible: If $(x+iy)^2+1=(a+ib)(1+i)$, then $2xy=a+b$, so $a\equiv b\pmod 2$. But then $$a+ib = \left(\frac{a+b}2+i\frac{b-a}2\right)(1+i)$$

• Thank you for that example! – HeinrichD Apr 27 '17 at 11:34