Metamath Proof Explorer


Theorem wilthlem3

Description: Lemma for wilth . Here we round out the argument of wilthlem2 with the final step of the induction. The induction argument shows that every subset of 1 ... ( P - 1 ) that is closed under inverse and contains P - 1 multiplies to -u 1 mod P , and clearly 1 ... ( P - 1 ) itself is such a set. Thus, the product of all the elements is -u 1 , and all that is left is to translate the group sum notation (which we used for its unordered summing capabilities) into an ordered sequence to match the definition of the factorial. (Contributed by Mario Carneiro, 24-Jan-2015) (Proof shortened by AV, 27-Jul-2019)

Ref Expression
Hypotheses wilthlem.t T = mulGrp fld
wilthlem.a A = x 𝒫 1 P 1 | P 1 x y x y P 2 mod P x
Assertion wilthlem3 P P P 1 ! + 1

Proof

Step Hyp Ref Expression
1 wilthlem.t T = mulGrp fld
2 wilthlem.a A = x 𝒫 1 P 1 | P 1 x y x y P 2 mod P x
3 prmuz2 P P 2
4 uz2m1nn P 2 P 1
5 3 4 syl P P 1
6 nnuz = 1
7 5 6 eleqtrdi P P 1 1
8 eluzfz2 P 1 1 P 1 1 P 1
9 7 8 syl P P 1 1 P 1
10 simpl P y 1 P 1 P
11 elfzelz y 1 P 1 y
12 11 adantl P y 1 P 1 y
13 prmnn P P
14 fzm1ndvds P y 1 P 1 ¬ P y
15 13 14 sylan P y 1 P 1 ¬ P y
16 eqid y P 2 mod P = y P 2 mod P
17 16 prmdiv P y ¬ P y y P 2 mod P 1 P 1 P y y P 2 mod P 1
18 10 12 15 17 syl3anc P y 1 P 1 y P 2 mod P 1 P 1 P y y P 2 mod P 1
19 18 simpld P y 1 P 1 y P 2 mod P 1 P 1
20 19 ralrimiva P y 1 P 1 y P 2 mod P 1 P 1
21 ovex 1 P 1 V
22 21 pwid 1 P 1 𝒫 1 P 1
23 eleq2 x = 1 P 1 P 1 x P 1 1 P 1
24 eleq2 x = 1 P 1 y P 2 mod P x y P 2 mod P 1 P 1
25 24 raleqbi1dv x = 1 P 1 y x y P 2 mod P x y 1 P 1 y P 2 mod P 1 P 1
26 23 25 anbi12d x = 1 P 1 P 1 x y x y P 2 mod P x P 1 1 P 1 y 1 P 1 y P 2 mod P 1 P 1
27 26 2 elrab2 1 P 1 A 1 P 1 𝒫 1 P 1 P 1 1 P 1 y 1 P 1 y P 2 mod P 1 P 1
28 22 27 mpbiran 1 P 1 A P 1 1 P 1 y 1 P 1 y P 2 mod P 1 P 1
29 9 20 28 sylanbrc P 1 P 1 A
30 fzfi 1 P 1 Fin
31 eleq1 s = t s A t A
32 reseq2 s = t I s = I t
33 32 oveq2d s = t T I s = T I t
34 33 oveq1d s = t T I s mod P = T I t mod P
35 34 eqeq1d s = t T I s mod P = -1 mod P T I t mod P = -1 mod P
36 31 35 imbi12d s = t s A T I s mod P = -1 mod P t A T I t mod P = -1 mod P
37 36 imbi2d s = t P s A T I s mod P = -1 mod P P t A T I t mod P = -1 mod P
38 eleq1 s = 1 P 1 s A 1 P 1 A
39 reseq2 s = 1 P 1 I s = I 1 P 1
40 39 oveq2d s = 1 P 1 T I s = T I 1 P 1
41 40 oveq1d s = 1 P 1 T I s mod P = T I 1 P 1 mod P
42 41 eqeq1d s = 1 P 1 T I s mod P = -1 mod P T I 1 P 1 mod P = -1 mod P
43 38 42 imbi12d s = 1 P 1 s A T I s mod P = -1 mod P 1 P 1 A T I 1 P 1 mod P = -1 mod P
44 43 imbi2d s = 1 P 1 P s A T I s mod P = -1 mod P P 1 P 1 A T I 1 P 1 mod P = -1 mod P
45 bi2.04 s t P s A T I s mod P = -1 mod P P s t s A T I s mod P = -1 mod P
46 pm2.27 P P s t s A T I s mod P = -1 mod P s t s A T I s mod P = -1 mod P
47 46 com34 P P s t s A T I s mod P = -1 mod P s A s t T I s mod P = -1 mod P
48 45 47 syl5bi P s t P s A T I s mod P = -1 mod P s A s t T I s mod P = -1 mod P
49 48 alimdv P s s t P s A T I s mod P = -1 mod P s s A s t T I s mod P = -1 mod P
50 df-ral s A s t T I s mod P = -1 mod P s s A s t T I s mod P = -1 mod P
51 49 50 syl6ibr P s s t P s A T I s mod P = -1 mod P s A s t T I s mod P = -1 mod P
52 simp1 P s A s t T I s mod P = -1 mod P t A P
53 simp3 P s A s t T I s mod P = -1 mod P t A t A
54 simp2 P s A s t T I s mod P = -1 mod P t A s A s t T I s mod P = -1 mod P
55 1 2 52 53 54 wilthlem2 P s A s t T I s mod P = -1 mod P t A T I t mod P = -1 mod P
56 55 3exp P s A s t T I s mod P = -1 mod P t A T I t mod P = -1 mod P
57 51 56 syldc s s t P s A T I s mod P = -1 mod P P t A T I t mod P = -1 mod P
58 57 a1i t Fin s s t P s A T I s mod P = -1 mod P P t A T I t mod P = -1 mod P
59 37 44 58 findcard3 1 P 1 Fin P 1 P 1 A T I 1 P 1 mod P = -1 mod P
60 30 59 ax-mp P 1 P 1 A T I 1 P 1 mod P = -1 mod P
61 29 60 mpd P T I 1 P 1 mod P = -1 mod P
62 cnfld1 1 = 1 fld
63 1 62 ringidval 1 = 0 T
64 cncrng fld CRing
65 1 crngmgp fld CRing T CMnd
66 64 65 mp1i P T CMnd
67 30 a1i P 1 P 1 Fin
68 zsubrg SubRing fld
69 1 subrgsubm SubRing fld SubMnd T
70 68 69 mp1i P SubMnd T
71 f1oi I 1 P 1 : 1 P 1 1-1 onto 1 P 1
72 f1of I 1 P 1 : 1 P 1 1-1 onto 1 P 1 I 1 P 1 : 1 P 1 1 P 1
73 71 72 ax-mp I 1 P 1 : 1 P 1 1 P 1
74 fzssz 1 P 1
75 fss I 1 P 1 : 1 P 1 1 P 1 1 P 1 I 1 P 1 : 1 P 1
76 73 74 75 mp2an I 1 P 1 : 1 P 1
77 76 a1i P I 1 P 1 : 1 P 1
78 1ex 1 V
79 78 a1i P 1 V
80 77 67 79 fdmfifsupp P finSupp 1 I 1 P 1
81 63 66 67 70 77 80 gsumsubmcl P T I 1 P 1
82 1z 1
83 znegcl 1 1
84 82 83 mp1i P 1
85 moddvds P T I 1 P 1 1 T I 1 P 1 mod P = -1 mod P P T I 1 P 1 -1
86 13 81 84 85 syl3anc P T I 1 P 1 mod P = -1 mod P P T I 1 P 1 -1
87 61 86 mpbid P P T I 1 P 1 -1
88 fcoi1 I 1 P 1 : 1 P 1 1 P 1 I 1 P 1 I 1 P 1 = I 1 P 1
89 73 88 ax-mp I 1 P 1 I 1 P 1 = I 1 P 1
90 89 fveq1i I 1 P 1 I 1 P 1 k = I 1 P 1 k
91 fvres k 1 P 1 I 1 P 1 k = I k
92 90 91 eqtrid k 1 P 1 I 1 P 1 I 1 P 1 k = I k
93 92 adantl P k 1 P 1 I 1 P 1 I 1 P 1 k = I k
94 7 93 seqfveq P seq 1 × I 1 P 1 I 1 P 1 P 1 = seq 1 × I P 1
95 cnfldbas = Base fld
96 1 95 mgpbas = Base T
97 cnfldmul × = fld
98 1 97 mgpplusg × = + T
99 eqid Cntz T = Cntz T
100 cnring fld Ring
101 1 ringmgp fld Ring T Mnd
102 100 101 mp1i P T Mnd
103 zsscn
104 fss I 1 P 1 : 1 P 1 I 1 P 1 : 1 P 1
105 76 103 104 mp2an I 1 P 1 : 1 P 1
106 105 a1i P I 1 P 1 : 1 P 1
107 96 99 66 106 cntzcmnf P ran I 1 P 1 Cntz T ran I 1 P 1
108 f1of1 I 1 P 1 : 1 P 1 1-1 onto 1 P 1 I 1 P 1 : 1 P 1 1-1 1 P 1
109 71 108 mp1i P I 1 P 1 : 1 P 1 1-1 1 P 1
110 suppssdm I 1 P 1 supp 1 dom I 1 P 1
111 dmresi dom I 1 P 1 = 1 P 1
112 110 111 sseqtri I 1 P 1 supp 1 1 P 1
113 rnresi ran I 1 P 1 = 1 P 1
114 112 113 sseqtrri I 1 P 1 supp 1 ran I 1 P 1
115 114 a1i P I 1 P 1 supp 1 ran I 1 P 1
116 eqid I 1 P 1 I 1 P 1 supp 1 = I 1 P 1 I 1 P 1 supp 1
117 96 63 98 99 102 67 106 107 5 109 115 116 gsumval3 P T I 1 P 1 = seq 1 × I 1 P 1 I 1 P 1 P 1
118 facnn P 1 P 1 ! = seq 1 × I P 1
119 5 118 syl P P 1 ! = seq 1 × I P 1
120 94 117 119 3eqtr4d P T I 1 P 1 = P 1 !
121 120 oveq1d P T I 1 P 1 -1 = P 1 ! -1
122 nnm1nn0 P P 1 0
123 13 122 syl P P 1 0
124 123 faccld P P 1 !
125 124 nncnd P P 1 !
126 ax-1cn 1
127 subneg P 1 ! 1 P 1 ! -1 = P 1 ! + 1
128 125 126 127 sylancl P P 1 ! -1 = P 1 ! + 1
129 121 128 eqtrd P T I 1 P 1 -1 = P 1 ! + 1
130 87 129 breqtrd P P P 1 ! + 1