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=mulGrpfld
wilthlem.a A=x𝒫1P1|P1xyxyP2modPx
Assertion wilthlem3 PPP1!+1

Proof

Step Hyp Ref Expression
1 wilthlem.t T=mulGrpfld
2 wilthlem.a A=x𝒫1P1|P1xyxyP2modPx
3 prmuz2 PP2
4 uz2m1nn P2P1
5 3 4 syl PP1
6 nnuz =1
7 5 6 eleqtrdi PP11
8 eluzfz2 P11P11P1
9 7 8 syl PP11P1
10 simpl Py1P1P
11 elfzelz y1P1y
12 11 adantl Py1P1y
13 prmnn PP
14 fzm1ndvds Py1P1¬Py
15 13 14 sylan Py1P1¬Py
16 eqid yP2modP=yP2modP
17 16 prmdiv Py¬PyyP2modP1P1PyyP2modP1
18 10 12 15 17 syl3anc Py1P1yP2modP1P1PyyP2modP1
19 18 simpld Py1P1yP2modP1P1
20 19 ralrimiva Py1P1yP2modP1P1
21 ovex 1P1V
22 21 pwid 1P1𝒫1P1
23 eleq2 x=1P1P1xP11P1
24 eleq2 x=1P1yP2modPxyP2modP1P1
25 24 raleqbi1dv x=1P1yxyP2modPxy1P1yP2modP1P1
26 23 25 anbi12d x=1P1P1xyxyP2modPxP11P1y1P1yP2modP1P1
27 26 2 elrab2 1P1A1P1𝒫1P1P11P1y1P1yP2modP1P1
28 22 27 mpbiran 1P1AP11P1y1P1yP2modP1P1
29 9 20 28 sylanbrc P1P1A
30 fzfi 1P1Fin
31 eleq1 s=tsAtA
32 reseq2 s=tIs=It
33 32 oveq2d s=tTIs=TIt
34 33 oveq1d s=tTIsmodP=TItmodP
35 34 eqeq1d s=tTIsmodP=-1modPTItmodP=-1modP
36 31 35 imbi12d s=tsATIsmodP=-1modPtATItmodP=-1modP
37 36 imbi2d s=tPsATIsmodP=-1modPPtATItmodP=-1modP
38 eleq1 s=1P1sA1P1A
39 reseq2 s=1P1Is=I1P1
40 39 oveq2d s=1P1TIs=TI1P1
41 40 oveq1d s=1P1TIsmodP=TI1P1modP
42 41 eqeq1d s=1P1TIsmodP=-1modPTI1P1modP=-1modP
43 38 42 imbi12d s=1P1sATIsmodP=-1modP1P1ATI1P1modP=-1modP
44 43 imbi2d s=1P1PsATIsmodP=-1modPP1P1ATI1P1modP=-1modP
45 bi2.04 stPsATIsmodP=-1modPPstsATIsmodP=-1modP
46 pm2.27 PPstsATIsmodP=-1modPstsATIsmodP=-1modP
47 46 com34 PPstsATIsmodP=-1modPsAstTIsmodP=-1modP
48 45 47 biimtrid PstPsATIsmodP=-1modPsAstTIsmodP=-1modP
49 48 alimdv PsstPsATIsmodP=-1modPssAstTIsmodP=-1modP
50 df-ral sAstTIsmodP=-1modPssAstTIsmodP=-1modP
51 49 50 syl6ibr PsstPsATIsmodP=-1modPsAstTIsmodP=-1modP
52 simp1 PsAstTIsmodP=-1modPtAP
53 simp3 PsAstTIsmodP=-1modPtAtA
54 simp2 PsAstTIsmodP=-1modPtAsAstTIsmodP=-1modP
55 1 2 52 53 54 wilthlem2 PsAstTIsmodP=-1modPtATItmodP=-1modP
56 55 3exp PsAstTIsmodP=-1modPtATItmodP=-1modP
57 51 56 syldc sstPsATIsmodP=-1modPPtATItmodP=-1modP
58 57 a1i tFinsstPsATIsmodP=-1modPPtATItmodP=-1modP
59 37 44 58 findcard3 1P1FinP1P1ATI1P1modP=-1modP
60 30 59 ax-mp P1P1ATI1P1modP=-1modP
61 29 60 mpd PTI1P1modP=-1modP
62 cnfld1 1=1fld
63 1 62 ringidval 1=0T
64 cncrng fldCRing
65 1 crngmgp fldCRingTCMnd
66 64 65 mp1i PTCMnd
67 30 a1i P1P1Fin
68 zsubrg SubRingfld
69 1 subrgsubm SubRingfldSubMndT
70 68 69 mp1i PSubMndT
71 f1oi I1P1:1P11-1 onto1P1
72 f1of I1P1:1P11-1 onto1P1I1P1:1P11P1
73 71 72 ax-mp I1P1:1P11P1
74 fzssz 1P1
75 fss I1P1:1P11P11P1I1P1:1P1
76 73 74 75 mp2an I1P1:1P1
77 76 a1i PI1P1:1P1
78 1ex 1V
79 78 a1i P1V
80 77 67 79 fdmfifsupp PfinSupp1I1P1
81 63 66 67 70 77 80 gsumsubmcl PTI1P1
82 1z 1
83 znegcl 11
84 82 83 mp1i P1
85 moddvds PTI1P11TI1P1modP=-1modPPTI1P1-1
86 13 81 84 85 syl3anc PTI1P1modP=-1modPPTI1P1-1
87 61 86 mpbid PPTI1P1-1
88 fcoi1 I1P1:1P11P1I1P1I1P1=I1P1
89 73 88 ax-mp I1P1I1P1=I1P1
90 89 fveq1i I1P1I1P1k=I1P1k
91 fvres k1P1I1P1k=Ik
92 90 91 eqtrid k1P1I1P1I1P1k=Ik
93 92 adantl Pk1P1I1P1I1P1k=Ik
94 7 93 seqfveq Pseq1×I1P1I1P1P1=seq1×IP1
95 cnfldbas =Basefld
96 1 95 mgpbas =BaseT
97 cnfldmul ×=fld
98 1 97 mgpplusg ×=+T
99 eqid CntzT=CntzT
100 cnring fldRing
101 1 ringmgp fldRingTMnd
102 100 101 mp1i PTMnd
103 zsscn
104 fss I1P1:1P1I1P1:1P1
105 76 103 104 mp2an I1P1:1P1
106 105 a1i PI1P1:1P1
107 96 99 66 106 cntzcmnf PranI1P1CntzTranI1P1
108 f1of1 I1P1:1P11-1 onto1P1I1P1:1P11-11P1
109 71 108 mp1i PI1P1:1P11-11P1
110 suppssdm I1P1supp1domI1P1
111 dmresi domI1P1=1P1
112 110 111 sseqtri I1P1supp11P1
113 rnresi ranI1P1=1P1
114 112 113 sseqtrri I1P1supp1ranI1P1
115 114 a1i PI1P1supp1ranI1P1
116 eqid I1P1I1P1supp1=I1P1I1P1supp1
117 96 63 98 99 102 67 106 107 5 109 115 116 gsumval3 PTI1P1=seq1×I1P1I1P1P1
118 facnn P1P1!=seq1×IP1
119 5 118 syl PP1!=seq1×IP1
120 94 117 119 3eqtr4d PTI1P1=P1!
121 120 oveq1d PTI1P1-1=P1!-1
122 nnm1nn0 PP10
123 13 122 syl PP10
124 123 faccld PP1!
125 124 nncnd PP1!
126 ax-1cn 1
127 subneg P1!1P1!-1=P1!+1
128 125 126 127 sylancl PP1!-1=P1!+1
129 121 128 eqtrd PTI1P1-1=P1!+1
130 87 129 breqtrd PPP1!+1