Metamath Proof Explorer


Theorem modprminveq

Description: The modular inverse of A mod P is unique. (Contributed by Alexander van der Vekens, 17-May-2018)

Ref Expression
Hypothesis modprminv.1 R=AP2modP
Assertion modprminveq PA¬PAS0P1ASmodP=1S=R

Proof

Step Hyp Ref Expression
1 modprminv.1 R=AP2modP
2 elfzelz S0P1S
3 zmulcl ASAS
4 2 3 sylan2 AS0P1AS
5 modprm1div PASASmodP=1PAS1
6 4 5 sylan2 PAS0P1ASmodP=1PAS1
7 6 expr PAS0P1ASmodP=1PAS1
8 7 3adant3 PA¬PAS0P1ASmodP=1PAS1
9 8 pm5.32d PA¬PAS0P1ASmodP=1S0P1PAS1
10 1 prmdiveq PA¬PAS0P1PAS1S=R
11 9 10 bitrd PA¬PAS0P1ASmodP=1S=R