Metamath Proof Explorer


Theorem nfermltlrev

Description: Fermat's little theorem reversed is not generally true: There are integers a and p so that " p is prime" does not follow from a ^ p == a (mod p ). (Contributed by AV, 3-Jun-2023)

Ref Expression
Assertion nfermltlrev ap3¬apmodp=amodpp

Proof

Step Hyp Ref Expression
1 8nn 8
2 1 elexi 8V
3 eleq1 a=8a8
4 oveq1 a=8ap=8p
5 4 oveq1d a=8apmodp=8pmodp
6 oveq1 a=8amodp=8modp
7 5 6 eqeq12d a=8apmodp=amodp8pmodp=8modp
8 7 imbi1d a=8apmodp=amodpp8pmodp=8modpp
9 8 notbid a=8¬apmodp=amodpp¬8pmodp=8modpp
10 9 rexbidv a=8p3¬apmodp=amodppp3¬8pmodp=8modpp
11 3 10 anbi12d a=8ap3¬apmodp=amodpp8p3¬8pmodp=8modpp
12 1 nnzi 8
13 nfermltl8rev p3¬8pmodp=8modpp
14 12 13 pm3.2i 8p3¬8pmodp=8modpp
15 2 11 14 ceqsexv2d aap3¬apmodp=amodpp
16 df-rex ap3¬apmodp=amodppaap3¬apmodp=amodpp
17 15 16 mpbir ap3¬apmodp=amodpp