Metamath Proof Explorer


Theorem lgsvalmod

Description: The Legendre symbol is equivalent to a ^ ( ( p - 1 ) / 2 ) , mod p . This theorem is also called "Euler's criterion", see theorem 9.2 in ApostolNT p. 180, or a representation of Euler's criterion using the Legendre symbol, see also lgsqr . (Contributed by Mario Carneiro, 4-Feb-2015)

Ref Expression
Assertion lgsvalmod AP2A/LPmodP=AP12modP

Proof

Step Hyp Ref Expression
1 eldifi P2P
2 1 adantl AP2P
3 prmz PP
4 2 3 syl AP2P
5 lgscl APA/LP
6 4 5 syldan AP2A/LP
7 6 zred AP2A/LP
8 peano2re A/LPA/LP+1
9 7 8 syl AP2A/LP+1
10 oddprm P2P12
11 10 adantl AP2P12
12 11 nnnn0d AP2P120
13 zexpcl AP120AP12
14 12 13 syldan AP2AP12
15 14 zred AP2AP12
16 peano2re AP12AP12+1
17 15 16 syl AP2AP12+1
18 neg1rr 1
19 18 a1i AP21
20 prmnn PP
21 2 20 syl AP2P
22 21 nnrpd AP2P+
23 lgsval3 AP2A/LP=AP12+1modP1
24 23 eqcomd AP2AP12+1modP1=A/LP
25 17 22 modcld AP2AP12+1modP
26 25 recnd AP2AP12+1modP
27 ax-1cn 1
28 27 a1i AP21
29 7 recnd AP2A/LP
30 26 28 29 subadd2d AP2AP12+1modP1=A/LPA/LP+1=AP12+1modP
31 24 30 mpbid AP2A/LP+1=AP12+1modP
32 31 oveq1d AP2A/LP+1modP=AP12+1modPmodP
33 modabs2 AP12+1P+AP12+1modPmodP=AP12+1modP
34 17 22 33 syl2anc AP2AP12+1modPmodP=AP12+1modP
35 32 34 eqtrd AP2A/LP+1modP=AP12+1modP
36 modadd1 A/LP+1AP12+11P+A/LP+1modP=AP12+1modPA/LP+1+-1modP=AP12+1+-1modP
37 9 17 19 22 35 36 syl221anc AP2A/LP+1+-1modP=AP12+1+-1modP
38 9 recnd AP2A/LP+1
39 negsub A/LP+11A/LP+1+-1=A/LP+1-1
40 38 27 39 sylancl AP2A/LP+1+-1=A/LP+1-1
41 pncan A/LP1A/LP+1-1=A/LP
42 29 27 41 sylancl AP2A/LP+1-1=A/LP
43 40 42 eqtrd AP2A/LP+1+-1=A/LP
44 43 oveq1d AP2A/LP+1+-1modP=A/LPmodP
45 17 recnd AP2AP12+1
46 negsub AP12+11AP12+1+-1=AP12+1-1
47 45 27 46 sylancl AP2AP12+1+-1=AP12+1-1
48 15 recnd AP2AP12
49 pncan AP121AP12+1-1=AP12
50 48 27 49 sylancl AP2AP12+1-1=AP12
51 47 50 eqtrd AP2AP12+1+-1=AP12
52 51 oveq1d AP2AP12+1+-1modP=AP12modP
53 37 44 52 3eqtr3d AP2A/LPmodP=AP12modP