Metamath Proof Explorer


Theorem lgsabs1

Description: The Legendre symbol is nonzero (and hence equal to 1 or -u 1 ) precisely when the arguments are coprime. (Contributed by Mario Carneiro, 5-Feb-2015)

Ref Expression
Assertion lgsabs1 ANA/LN=1AgcdN=1

Proof

Step Hyp Ref Expression
1 lgscl ANA/LN
2 1 zcnd ANA/LN
3 2 abscld ANA/LN
4 1re 1
5 letri3 A/LN1A/LN=1A/LN11A/LN
6 3 4 5 sylancl ANA/LN=1A/LN11A/LN
7 lgsle1 ANA/LN1
8 7 biantrurd AN1A/LNA/LN11A/LN
9 nnne0 A/LNA/LN0
10 nn0abscl A/LNA/LN0
11 1 10 syl ANA/LN0
12 elnn0 A/LN0A/LNA/LN=0
13 11 12 sylib ANA/LNA/LN=0
14 13 ord AN¬A/LNA/LN=0
15 14 necon1ad ANA/LN0A/LN
16 9 15 impbid2 ANA/LNA/LN0
17 elnnnn0c A/LNA/LN01A/LN
18 17 baib A/LN0A/LN1A/LN
19 11 18 syl ANA/LN1A/LN
20 abs00 A/LNA/LN=0A/LN=0
21 20 necon3bid A/LNA/LN0A/LN0
22 2 21 syl ANA/LN0A/LN0
23 lgsne0 ANA/LN0AgcdN=1
24 22 23 bitrd ANA/LN0AgcdN=1
25 16 19 24 3bitr3d AN1A/LNAgcdN=1
26 6 8 25 3bitr2d ANA/LN=1AgcdN=1