Metamath Proof Explorer


Theorem lgsprme0

Description: The Legendre symbol at any prime (even at 2) is 0 iff the prime does not divide the first argument. See definition in ApostolNT p. 179. (Contributed by AV, 20-Jul-2021)

Ref Expression
Assertion lgsprme0 APA/LP=0AmodP=0

Proof

Step Hyp Ref Expression
1 prmz PP
2 lgsne0 APA/LP0AgcdP=1
3 1 2 sylan2 APA/LP0AgcdP=1
4 coprm PA¬PAPgcdA=1
5 4 ancoms AP¬PAPgcdA=1
6 1 anim1i PAPA
7 6 ancoms APPA
8 gcdcom PAPgcdA=AgcdP
9 7 8 syl APPgcdA=AgcdP
10 9 eqeq1d APPgcdA=1AgcdP=1
11 5 10 bitr2d APAgcdP=1¬PA
12 prmnn PP
13 dvdsval3 PAPAAmodP=0
14 12 13 sylan PAPAAmodP=0
15 14 ancoms APPAAmodP=0
16 15 notbid AP¬PA¬AmodP=0
17 3 11 16 3bitrd APA/LP0¬AmodP=0
18 17 necon4abid APA/LP=0AmodP=0