# 费马平方和定理

## 内容

${\displaystyle 5=1^{2}+2^{2}}$  那么 ${\displaystyle 5\equiv 1{\pmod {4}}}$ ，反之亦然。

## 欧拉的证明

${\displaystyle (pb-aq)(pb+aq)=p^{2}b^{2}-a^{2}q^{2}=p^{2}(a^{2}+b^{2})-a^{2}(p^{2}+q^{2}).}$

${\displaystyle (a^{2}+b^{2})(p^{2}+q^{2})=(ap+bq)^{2}+(aq-bp)^{2}\,}$

${\displaystyle {\frac {a^{2}+b^{2}}{p^{2}+q^{2}}}=\left({\frac {ap+bq}{p^{2}+q^{2}}}\right)^{2}+\left({\frac {aq-bp}{p^{2}+q^{2}}}\right)^{2}}$

${\displaystyle (a^{2}+b^{2})(q^{2}+p^{2})=(aq+bp)^{2}+(ap-bq)^{2}\,}$

${\displaystyle a=mx\pm c,\qquad b=nx\pm d}$

${\displaystyle a^{2}+b^{2}=m^{2}x^{2}\pm 2mxc+c^{2}+n^{2}x^{2}\pm 2nxd+d^{2}=Ax+(c^{2}+d^{2}).}$

${\displaystyle zx=e^{2}+f^{2}\leq c^{2}+d^{2}\leq \left({\frac {x}{2}}\right)^{2}+\left({\frac {x}{2}}\right)^{2}={\frac {1}{2}}x^{2}.}$

${\displaystyle a^{4n}-b^{4n}=\left(a^{2n}+b^{2n}\right)\left(a^{2n}-b^{2n}\right).}$

## 扎吉尔“一句话”证明

${\displaystyle (x,y,z)\mapsto {\begin{cases}(x+2z,\,z,\,y-x-z)&x2y\end{cases}}}$

## 参考文献

• Richard Dedekind，“费马的理论”。
• C. F. Gauss，“Disquisitiones Arithmeticae”（费马版）。由Apple翻译。俊洪，1365年。
• Don Zagier, A one-sentence proof that every prime p ≡ 1 mod 4 is a sum of two squares. Amer. Math. Monthly 97 (1990), no. 2, 144