Metamath Proof Explorer


Theorem vfermltlALT

Description: Alternate proof of vfermltl , not using Euler's theorem. (Contributed by AV, 21-Aug-2020) (New usage is discouraged.) (Proof modification is discouraged.)

Ref Expression
Assertion vfermltlALT PA¬PAAP1modP=1

Proof

Step Hyp Ref Expression
1 2m1e1 21=1
2 1 a1i P21=1
3 2 eqcomd P1=21
4 3 oveq2d PP1=P21
5 prmz PP
6 5 zcnd PP
7 2cnd P2
8 1cnd P1
9 6 7 8 subsubd PP21=P-2+1
10 4 9 eqtrd PP1=P-2+1
11 10 3ad2ant1 PA¬PAP1=P-2+1
12 11 oveq2d PA¬PAAP1=AP-2+1
13 zcn AA
14 13 3ad2ant2 PA¬PAA
15 prmm2nn0 PP20
16 15 3ad2ant1 PA¬PAP20
17 14 16 expp1d PA¬PAAP-2+1=AP2A
18 12 17 eqtrd PA¬PAAP1=AP2A
19 18 oveq1d PA¬PAAP1modP=AP2AmodP
20 15 anim1i PAP20A
21 20 ancomd PAAP20
22 zexpcl AP20AP2
23 21 22 syl PAAP2
24 23 zred PAAP2
25 24 3adant3 PA¬PAAP2
26 simp2 PA¬PAA
27 prmnn PP
28 27 nnrpd PP+
29 28 3ad2ant1 PA¬PAP+
30 modmulmod AP2AP+AP2modPAmodP=AP2AmodP
31 25 26 29 30 syl3anc PA¬PAAP2modPAmodP=AP2AmodP
32 zre AA
33 32 adantl PAA
34 15 adantr PAP20
35 33 34 reexpcld PAAP2
36 28 adantr PAP+
37 35 36 modcld PAAP2modP
38 37 recnd PAAP2modP
39 13 adantl PAA
40 38 39 mulcomd PAAP2modPA=AAP2modP
41 40 3adant3 PA¬PAAP2modPA=AAP2modP
42 41 oveq1d PA¬PAAP2modPAmodP=AAP2modPmodP
43 19 31 42 3eqtr2d PA¬PAAP1modP=AAP2modPmodP
44 eqid AP2modP=AP2modP
45 44 modprminv PA¬PAAP2modP1P1AAP2modPmodP=1
46 45 simprd PA¬PAAAP2modPmodP=1
47 43 46 eqtrd PA¬PAAP1modP=1