For an integral domain $R$ when does $a^2 \equiv b^2 \bmod 4R$ imply $a \equiv b \bmod 2R$?

Suppose we have $$a^2 \equiv b^2 \bmod 4R$$ where $$R$$ is an integral domain. Under what conditions on $$R$$ can we conclude that $$a \equiv b \bmod 2R$$?

This would hold if $$2 \in R$$ is a prime or the product of distinct comaximal primes. This can fail when $$R$$ is not integrally closed: For $$R = \mathbb{Z}[\sqrt{-3}]$$ we have $$(4+\sqrt{-3})^2 \equiv 1^2 \bmod 4R$$ but $$4 + \sqrt{-3} \not\equiv 1 \bmod 2R$$.

Does this hold in a GCD domain? Does it hold, more generally, in an integrally closed domain?

Denote $$a-b=x$$, then $$a^2-b^2=x(x+2b)=4z$$ for $$z\in R$$. Assuming that $$R$$ is integrally closed, we see that $$(x/2)^2+b(x/2)-z=0$$, so $$x/2$$ is an algebraic integer, thus $$x/2\in R$$.
• Which claim for cubes do you mean? "If 9 divides $a^3-b^3$, then 3 divides $a-b$"? – Fedor Petrov Jul 14 at 21:15
• Yes. For an integrally closed integral domain $R$ do we have $a^3 \equiv b^3 \bmod 9R \implies a \equiv b \bmod 3R$? Do we have more generally for any $n > 2$ there exists an exponent $e$ such that $a^n \equiv b^n \bmod n^e R \implies a \equiv b \bmod nR$. – AJB Jul 14 at 21:22
• What about $a=1,b=w=e^{2\pi i/3}$ in $\mathbb{Z}[w]$? – Fedor Petrov Jul 14 at 21:58
• Yes, and this obviously generalizes: For $n > 2$ let $R = \mathbb{Z}[\theta]$ where $\theta = e^{2\pi i/n}$. Now for any $e \geq 1$ we have $1^n \equiv \theta^n \bmod n^e R$ but $1 \not\equiv \theta \bmod nR$. So this is special to squares. – AJB Jul 14 at 22:12