Verify that ## x\equiv a^{p-2}b\pmod {p} ## is a solution

  • Thread starter Thread starter Math100
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
6 replies · 2K views
Math100
Messages
823
Reaction score
234
Homework Statement
Let ## p ## be a prime and ## gcd(a, p)=1 ##. Use Fermat's theorem to verify that ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
Relevant Equations
None.
Proof:

Suppose ## gcd(a, p)=1 ## where ## p ## is a prime.
Consider the linear congruence ## ax\equiv b\pmod {p} ##.
By Fermat's theorem, we have that ## a^{p-1}\equiv 1\pmod {p} ##.
Observe that ## a^{p-1}\equiv 1\pmod {p}\implies a^{p-1}b\equiv b\pmod {p}\implies a(a^{p-2}b)\equiv b\pmod {p} ##.
Thus ## ax\equiv b\pmod {p}\implies x\equiv a^{p-2}b\pmod {p} ##.
Therefore, ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
 
Physics news on Phys.org
Math100 said:
Homework Statement:: Let ## p ## be a prime and ## gcd(a, p)=1 ##. Use Fermat's theorem to verify that ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
Relevant Equations:: None.

Proof:

Suppose ## gcd(a, p)=1 ## where ## p ## is a prime.
Consider the linear congruence ## ax\equiv b\pmod {p} ##.
By Fermat's theorem, we have that ## a^{p-1}\equiv 1\pmod {p} ##.
Observe that ## a^{p-1}\equiv 1\pmod {p}\implies a^{p-1}b\equiv b\pmod {p}\implies a(a^{p-2}b)\equiv b\pmod {p} ##.
Nice and correct so far.
Math100 said:
Thus ## ax\equiv b\pmod {p}\implies x\equiv a^{p-2}b\pmod {p} ##.
This line is a bit confusing. You can simply remove this line.
You haven't solved for ##x##. You have shown what you wrote next:

Math100 said:
Therefore, ## x\equiv a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
##x## set as ##x:=a^{p-2}b## solves the congruence, and this was all that had to be shown.
There are other numbers that solve it as well, namely all ##x\in a^{p-2}b+p\mathbb{Z}.##
 
  • Like
Likes   Reactions: Math100
Observe that
\begin{align*}
&ax\equiv b\pmod {p}\implies ax\cdot a^{p-2}\equiv b\cdot a^{p-2}\pmod {p}\\
&\implies a^{p-1}x\equiv a^{p-2}b\pmod {p}.\\
\end{align*}
By Fermat's theorem, we have ## a^{p-1}x\equiv x\pmod {p} ##.
Thus ## x\equiv xa^{p-1}\equiv a^{p-2}b\pmod {p} ##.
 
Should I insert that above in my proof and delete what I wrote in my previous proof?
 
Math100 said:
Should I insert that above in my proof and delete what I wrote in my previous proof?
Your first proof was perfect, just one line too many. You should remove the line before last. And if you want to be perfect then write:

...
Observe that ## a^{p-1}\equiv 1\pmod {p}\implies a^{p-1}b\equiv b\pmod {p}\implies a(a^{p-2}b)\equiv b\pmod {p} ##.

Therefore, ## x:= a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
 
  • Haha
Likes   Reactions: Math100
fresh_42 said:
Your first proof was perfect, just one line too many. You should remove the line before last. And if you want to be perfect then write:

...
Observe that ## a^{p-1}\equiv 1\pmod {p}\implies a^{p-1}b\equiv b\pmod {p}\implies a(a^{p-2}b)\equiv b\pmod {p} ##.

Therefore, ## x:= a^{p-2}b\pmod {p} ## is a solution of the linear congruence ## ax\equiv b\pmod {p} ##.
When you were in college, did you pursue perfection as well?