2

I need to prove that $x^2\equiv -1\pmod p$ if $p=4n+1$.

($p$ is prime of course...)

I need to use Wilson theorem.

Tomas
  • 4,585
CS1
  • 2,091

2 Answers2

3

We have, $p-r\equiv-r\pmod p$

Putting $r=1,2,\cdots,\frac{p-1}2$ and multiplying we get $$\prod_{1\le r\le \frac{p-1}2}(p-r)\equiv(-1)^{\frac{p-1}2}\prod_{1\le r\le \frac{p-1}2} r$$

Multiplying either sides by $\prod_{1\le r\le \frac{p-1}2} r$

$$(p-1)!\equiv(-1)^{\frac{p-1}2}\left(\prod_{1\le r\le \frac{p-1}2} r\right)^2\pmod p$$

Wilson theorem says: $(p-1)!\equiv-1\pmod p$

If $p=1+4n, \frac{p-1}2=2n$ which is even $\implies (-1)^{\frac{p-1}2}=\cdots$

  • Thank you!! but where you mention the $x^2$?? – CS1 Oct 31 '13 at 20:48
  • The second term on the RHS is square, get it? – Stefan4024 Oct 31 '13 at 20:51
  • and at the $(-1)^{2n}$ it's always 1, yes? But we had to proof the it is -1,right? Thank you! – CS1 Oct 31 '13 at 20:52
  • @Stefan4024, I'm sorry, but no... I didn't understand where is the $x^2$... – CS1 Oct 31 '13 at 20:56
  • 1
    Actually this is the "homework" @lab bhattavharjee gave you. First denote $\prod_{1\le r\le \frac{p-1}{2}} r = x$, so the congruence relation becomes:

    $$(-1)^{\frac{p-1}{2}}x^2 \equiv (p-1)! \equiv -1 \pmod p$$

    Can you obtain from this why $(-1)^{\frac{p-1}{2}} = 1$? Take a look at the first line of your question.

    P.S. LHS means Left-Hand Side, and RHS means Right-Hand Side

    – Stefan4024 Oct 31 '13 at 20:58
  • becuse -1 will be 1 at even power, right? and 2n it's an even power. – CS1 Oct 31 '13 at 21:41
  • And I still didn't understand where is the $x^2$... – CS1 Oct 31 '13 at 21:45
  • @YoavFridman Denote the product as $x$. That's $x$. – Stefan4024 Oct 31 '13 at 22:01
  • OK, and why we get $(-1)^{\frac{p-1}{2}}$? I don't understand the RHS at this (the formula at the third line). – CS1 Oct 31 '13 at 22:21
  • 1
    As lab said $r=1,2,...,\frac{p-1}{2}$ then we have:

    $$p - 1 \equiv -1 \pmod p$$ $$p - 2 \equiv -2 \pmod p$$ $$\cdots$$ $$p - \frac{p-1}{2} \equiv -\frac{p-1}{2} \pmod p$$

    Multiply all LHS and all RHS and the RHS will become:

    $$RHS = (-1)(-2)(-3)...(-\frac{p-1}{2}) = (-1)(1)(-1)(2)(-1)(3)...(-1)(\frac{p-1}{2})$$

    Because we have $\frac{p-1}{2}$ terms on the right the exponent for $(-1)$ is $\frac{p-1}{2}$

    – Stefan4024 Nov 01 '13 at 00:54
  • @Stefan4024, thanks a lot for your explanations – lab bhattacharjee Nov 01 '13 at 03:55
  • @labbhattacharjee I'll do anything in my powers to make things clearer to other users – Stefan4024 Nov 01 '13 at 11:54
  • Thank you for your answer, but I still don't understand where is the $x^2$... sorry for all of my Q... – CS1 Nov 01 '13 at 21:25
  • But $\left(-1\right)^{\left(\frac{p-1}{2}\right)}=1$ [Because the exponent is even]. So why @labbhattacharjee says it's -1, I didn't understand this... – CS1 Nov 01 '13 at 21:48
  • If $p=1+4n,$ $$-1\equiv\left(\prod_{1\le r\le \frac{p-1}2} r\right)^2\pmod p,$$ right? – lab bhattacharjee Nov 05 '13 at 15:54
1

The following argument is closely related to the one given by lab bhattacharjee, but is easier to type. It goes back at least to Dirichlet.

Note that for every $x$ between $1$ and $p-1$, there is a unique $y$ such that $xy\equiv -1\pmod{p}$: for $y$ is just the negative of the inverse of $x$.

Call the $y$ such that $xy\equiv -1\pmod{p}$ the partner of $x$. (Dirichlet did not use the term partner, that is a more modern notion.)

We want to show that there is an $x$ which is its own partner. (There are actually two.) Such an $x$ will satisfy $x^2\equiv -1\pmod{p}$.

Suppose to the contrary that no one is his own partner. Then the numbers $1$ to $p-1$ are divided into $2n$ couples, each of which has product $\equiv -1\pmod{p}$. Thus $(p-1)!\equiv (-1)^{2n}\equiv 1\pmod{p}$. This contradicts Wilson's Theorem, and the result follows.

Remark: The same idea can be used to show that if $p$ is of the form $4n+3$, then the congruence $x^2\equiv -1\pmod{p}$ has no solution. (There are simpler ways to do that.)

For it is easy to see if the congruence $x^2\equiv -1\pmod{p}$ has a solution $s$, then it has exactly two solutions, $s$ and $-s$. Then $(s)(-s)\equiv 1\pmod{p}$. The other $4n$ numbers between $1$ and $p-1$ are divided into $2n$ pairs of partners, each of which has product congruent to $-1$. Thus $(p-1)!\equiv (-1)^{2n}(s)(-s)\equiv 1\pmod{p}$, again contradicting Wilson's Theorem.

André Nicolas
  • 514,336