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 A N A / L N = 1 A gcd N = 1

Proof

Step Hyp Ref Expression
1 lgscl A N A / L N
2 1 zcnd A N A / L N
3 2 abscld A N A / L N
4 1re 1
5 letri3 A / L N 1 A / L N = 1 A / L N 1 1 A / L N
6 3 4 5 sylancl A N A / L N = 1 A / L N 1 1 A / L N
7 lgsle1 A N A / L N 1
8 7 biantrurd A N 1 A / L N A / L N 1 1 A / L N
9 nnne0 A / L N A / L N 0
10 nn0abscl A / L N A / L N 0
11 1 10 syl A N A / L N 0
12 elnn0 A / L N 0 A / L N A / L N = 0
13 11 12 sylib A N A / L N A / L N = 0
14 13 ord A N ¬ A / L N A / L N = 0
15 14 necon1ad A N A / L N 0 A / L N
16 9 15 impbid2 A N A / L N A / L N 0
17 elnnnn0c A / L N A / L N 0 1 A / L N
18 17 baib A / L N 0 A / L N 1 A / L N
19 11 18 syl A N A / L N 1 A / L N
20 abs00 A / L N A / L N = 0 A / L N = 0
21 20 necon3bid A / L N A / L N 0 A / L N 0
22 2 21 syl A N A / L N 0 A / L N 0
23 lgsne0 A N A / L N 0 A gcd N = 1
24 22 23 bitrd A N A / L N 0 A gcd N = 1
25 16 19 24 3bitr3d A N 1 A / L N A gcd N = 1
26 6 8 25 3bitr2d A N A / L N = 1 A gcd N = 1