Skip to content

Commit

Permalink
Merge pull request OI-wiki#2577 from xyf007/patch-1
Browse files Browse the repository at this point in the history
修改了证明部分
  • Loading branch information
StudyingFather authored Aug 20, 2020
2 parents 01446a5 + d418b20 commit 19e71c9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/math/quad-residue.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@ $$

### 证明

$x^2 \equiv n \pmod p$ ,如果存在不同的数 $u$ 和 $v$ 使它们代入方程后有解,也就是 $u^2 \equiv v^2\pmod p$ ,显然满足 $u^2-v^2\mid p$ ,那么就有 $(u-v)\cdot (u+v)\mid p$ 并且 $p$ 不是 $(u-v)$ 的倍数,所以 $(u+v)\mid p$ ,这样的数对在 $p$ 中可以找到 $\frac{p-1}{2}$ 个。
$x=0$ 对应了 $n=0$ 的特殊情况,因此我们只用考虑 $x \in [1,\frac{p-1}{2}]$ 的情况。

一个显然的性质是 $(p-x)^2 \equiv x^2 \pmod p$ ,那么当 $x \in [1,\frac{p-1}{2}]$ 我们可以取到所有解。

接下来我们只需要证明当 $x\in[1,\frac{p-1}{2}]$ 时 $x^2 \bmod p$ 两两不同。

运用反证法,假设存在不同的两个整数 $x,y \in [1,\frac{p-1}{2}]$ 且 $x^2 \equiv y^2 \pmod p$ ,

则有 $(x+y)(x-y) \equiv 0 \pmod p$

显然 $-p<x+y<p,-p<x-y<p,x+y \neq 0,x-y \neq 0$ ,故假设不成立,原命题成立。

## 勒让德符号

Expand Down

0 comments on commit 19e71c9

Please sign in to comment.