Metamath Proof Explorer


Theorem wilthlem1

Description: The only elements that are equal to their own inverses in the multiplicative group of nonzero elements in ZZ / P ZZ are 1 and -u 1 == P - 1 . (Note that from prmdiveq , ( N ^ ( P - 2 ) ) mod P is the modular inverse of N in ZZ / P ZZ . (Contributed by Mario Carneiro, 24-Jan-2015)

Ref Expression
Assertion wilthlem1 PN1P1N=NP2modPN=1N=P1

Proof

Step Hyp Ref Expression
1 elfzelz N1P1N
2 1 adantl PN1P1N
3 peano2zm NN1
4 2 3 syl PN1P1N1
5 4 zcnd PN1P1N1
6 2 peano2zd PN1P1N+1
7 6 zcnd PN1P1N+1
8 5 7 mulcomd PN1P1N1N+1=N+1N1
9 2 zcnd PN1P1N
10 ax-1cn 1
11 subsq N1N212=N+1N1
12 9 10 11 sylancl PN1P1N212=N+1N1
13 9 sqvald PN1P1N2= N N
14 sq1 12=1
15 14 a1i PN1P112=1
16 13 15 oveq12d PN1P1N212= N N1
17 8 12 16 3eqtr2d PN1P1N1N+1= N N1
18 17 breq2d PN1P1PN1N+1P N N1
19 fz1ssfz0 1P10P1
20 simpr PN1P1N1P1
21 19 20 sselid PN1P1N0P1
22 21 biantrurd PN1P1P N N1N0P1P N N1
23 18 22 bitrd PN1P1PN1N+1N0P1P N N1
24 simpl PN1P1P
25 euclemma PN1N+1PN1N+1PN1PN+1
26 24 4 6 25 syl3anc PN1P1PN1N+1PN1PN+1
27 prmnn PP
28 fzm1ndvds PN1P1¬PN
29 27 28 sylan PN1P1¬PN
30 eqid NP2modP=NP2modP
31 30 prmdiveq PN¬PNN0P1P N N1N=NP2modP
32 24 2 29 31 syl3anc PN1P1N0P1P N N1N=NP2modP
33 23 26 32 3bitr3rd PN1P1N=NP2modPPN1PN+1
34 24 27 syl PN1P1P
35 1zzd PN1P11
36 moddvds PN1NmodP=1modPPN1
37 34 2 35 36 syl3anc PN1P1NmodP=1modPPN1
38 elfznn N1P1N
39 38 adantl PN1P1N
40 39 nnred PN1P1N
41 34 nnrpd PN1P1P+
42 39 nnnn0d PN1P1N0
43 42 nn0ge0d PN1P10N
44 elfzle2 N1P1NP1
45 44 adantl PN1P1NP1
46 prmz PP
47 zltlem1 NPN<PNP1
48 1 46 47 syl2anr PN1P1N<PNP1
49 45 48 mpbird PN1P1N<P
50 modid NP+0NN<PNmodP=N
51 40 41 43 49 50 syl22anc PN1P1NmodP=N
52 34 nnred PN1P1P
53 prmuz2 PP2
54 24 53 syl PN1P1P2
55 eluz2gt1 P21<P
56 54 55 syl PN1P11<P
57 1mod P1<P1modP=1
58 52 56 57 syl2anc PN1P11modP=1
59 51 58 eqeq12d PN1P1NmodP=1modPN=1
60 37 59 bitr3d PN1P1PN1N=1
61 35 znegcld PN1P11
62 moddvds PN1NmodP=-1modPPN-1
63 34 2 61 62 syl3anc PN1P1NmodP=-1modPPN-1
64 34 nncnd PN1P1P
65 64 mullidd PN1P11P=P
66 65 oveq2d PN1P1-1+1P=-1+P
67 neg1cn 1
68 addcom 1P-1+P=P+-1
69 67 64 68 sylancr PN1P1-1+P=P+-1
70 negsub P1P+-1=P1
71 64 10 70 sylancl PN1P1P+-1=P1
72 66 69 71 3eqtrd PN1P1-1+1P=P1
73 72 oveq1d PN1P1-1+1PmodP=P1modP
74 neg1rr 1
75 74 a1i PN1P11
76 modcyc 1P+1-1+1PmodP=-1modP
77 75 41 35 76 syl3anc PN1P1-1+1PmodP=-1modP
78 peano2rem PP1
79 52 78 syl PN1P1P1
80 nnm1nn0 PP10
81 34 80 syl PN1P1P10
82 81 nn0ge0d PN1P10P1
83 52 ltm1d PN1P1P1<P
84 modid P1P+0P1P1<PP1modP=P1
85 79 41 82 83 84 syl22anc PN1P1P1modP=P1
86 73 77 85 3eqtr3d PN1P1-1modP=P1
87 51 86 eqeq12d PN1P1NmodP=-1modPN=P1
88 subneg N1N-1=N+1
89 9 10 88 sylancl PN1P1N-1=N+1
90 89 breq2d PN1P1PN-1PN+1
91 63 87 90 3bitr3rd PN1P1PN+1N=P1
92 60 91 orbi12d PN1P1PN1PN+1N=1N=P1
93 33 92 bitrd PN1P1N=NP2modPN=1N=P1