Metamath Proof Explorer


Theorem lgssq

Description: The Legendre symbol at a square is equal to 1 . Together with lgsmod this implies that the Legendre symbol takes value 1 at every quadratic residue. (Contributed by Mario Carneiro, 5-Feb-2015) (Revised by AV, 20-Jul-2021)

Ref Expression
Assertion lgssq A A 0 N A gcd N = 1 A 2 / L N = 1

Proof

Step Hyp Ref Expression
1 simp1l A A 0 N A gcd N = 1 A
2 simp2 A A 0 N A gcd N = 1 N
3 simp1r A A 0 N A gcd N = 1 A 0
4 lgsdir A A N A 0 A 0 A A / L N = A / L N A / L N
5 1 1 2 3 3 4 syl32anc A A 0 N A gcd N = 1 A A / L N = A / L N A / L N
6 zcn A A
7 6 adantr A A 0 A
8 7 3ad2ant1 A A 0 N A gcd N = 1 A
9 8 sqvald A A 0 N A gcd N = 1 A 2 = A A
10 9 oveq1d A A 0 N A gcd N = 1 A 2 / L N = A A / L N
11 lgscl A N A / L N
12 1 2 11 syl2anc A A 0 N A gcd N = 1 A / L N
13 12 zred A A 0 N A gcd N = 1 A / L N
14 absresq A / L N A / L N 2 = A / L N 2
15 13 14 syl A A 0 N A gcd N = 1 A / L N 2 = A / L N 2
16 lgsabs1 A N A / L N = 1 A gcd N = 1
17 16 adantlr A A 0 N A / L N = 1 A gcd N = 1
18 17 biimp3ar A A 0 N A gcd N = 1 A / L N = 1
19 18 oveq1d A A 0 N A gcd N = 1 A / L N 2 = 1 2
20 sq1 1 2 = 1
21 19 20 eqtrdi A A 0 N A gcd N = 1 A / L N 2 = 1
22 12 zcnd A A 0 N A gcd N = 1 A / L N
23 22 sqvald A A 0 N A gcd N = 1 A / L N 2 = A / L N A / L N
24 15 21 23 3eqtr3d A A 0 N A gcd N = 1 1 = A / L N A / L N
25 5 10 24 3eqtr4d A A 0 N A gcd N = 1 A 2 / L N = 1