Metamath Proof Explorer


Theorem prmdivdiv

Description: The (modular) inverse of the inverse of a number is itself. (Contributed by Mario Carneiro, 24-Jan-2015)

Ref Expression
Hypothesis prmdiv.1 R=AP2modP
Assertion prmdivdiv PA1P1A=RP2modP

Proof

Step Hyp Ref Expression
1 prmdiv.1 R=AP2modP
2 fz1ssfz0 1P10P1
3 simpr PA1P1A1P1
4 2 3 sselid PA1P1A0P1
5 simpl PA1P1P
6 elfznn A1P1A
7 6 adantl PA1P1A
8 7 nnzd PA1P1A
9 prmnn PP
10 fzm1ndvds PA1P1¬PA
11 9 10 sylan PA1P1¬PA
12 1 prmdiv PA¬PAR1P1PAR1
13 5 8 11 12 syl3anc PA1P1R1P1PAR1
14 13 simprd PA1P1PAR1
15 7 nncnd PA1P1A
16 13 simpld PA1P1R1P1
17 elfznn R1P1R
18 16 17 syl PA1P1R
19 18 nncnd PA1P1R
20 15 19 mulcomd PA1P1AR=RA
21 20 oveq1d PA1P1AR1=RA1
22 14 21 breqtrd PA1P1PRA1
23 16 elfzelzd PA1P1R
24 fzm1ndvds PR1P1¬PR
25 9 16 24 syl2an2r PA1P1¬PR
26 eqid RP2modP=RP2modP
27 26 prmdiveq PR¬PRA0P1PRA1A=RP2modP
28 5 23 25 27 syl3anc PA1P1A0P1PRA1A=RP2modP
29 4 22 28 mpbi2and PA1P1A=RP2modP