Metamath Proof Explorer


Theorem lgsval3

Description: The Legendre symbol at an odd prime (this is the traditional domain of the Legendre symbol). (Contributed by Mario Carneiro, 4-Feb-2015)

Ref Expression
Assertion lgsval3 A P 2 A / L P = A P 1 2 + 1 mod P 1

Proof

Step Hyp Ref Expression
1 eldifsn P 2 P P 2
2 lgsval2 A P A / L P = if P = 2 if 2 A 0 if A mod 8 1 7 1 1 A P 1 2 + 1 mod P 1
3 ifnefalse P 2 if P = 2 if 2 A 0 if A mod 8 1 7 1 1 A P 1 2 + 1 mod P 1 = A P 1 2 + 1 mod P 1
4 2 3 sylan9eq A P P 2 A / L P = A P 1 2 + 1 mod P 1
5 4 anasss A P P 2 A / L P = A P 1 2 + 1 mod P 1
6 1 5 sylan2b A P 2 A / L P = A P 1 2 + 1 mod P 1