Metamath Proof Explorer


Theorem vfermltl

Description: Variant of Fermat's little theorem if A is not a multiple of P , see theorem 5.18 in ApostolNT p. 113. (Contributed by AV, 21-Aug-2020) (Proof shortened by AV, 5-Sep-2020)

Ref Expression
Assertion vfermltl PA¬PAAP1modP=1

Proof

Step Hyp Ref Expression
1 phiprm PϕP=P1
2 1 eqcomd PP1=ϕP
3 2 3ad2ant1 PA¬PAP1=ϕP
4 3 oveq2d PA¬PAAP1=AϕP
5 4 oveq1d PA¬PAAP1modP=AϕPmodP
6 prmnn PP
7 6 3ad2ant1 PA¬PAP
8 simp2 PA¬PAA
9 prmz PP
10 9 anim1ci PAAP
11 10 3adant3 PA¬PAAP
12 gcdcom APAgcdP=PgcdA
13 11 12 syl PA¬PAAgcdP=PgcdA
14 coprm PA¬PAPgcdA=1
15 14 biimp3a PA¬PAPgcdA=1
16 13 15 eqtrd PA¬PAAgcdP=1
17 eulerth PAAgcdP=1AϕPmodP=1modP
18 7 8 16 17 syl3anc PA¬PAAϕPmodP=1modP
19 6 nnred PP
20 prmgt1 P1<P
21 19 20 jca PP1<P
22 21 3ad2ant1 PA¬PAP1<P
23 1mod P1<P1modP=1
24 22 23 syl PA¬PA1modP=1
25 5 18 24 3eqtrd PA¬PAAP1modP=1