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