MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  lgsfval Structured version   Visualization version   GIF version

Theorem lgsfval 25970
Description: Value of the function 𝐹 which defines the Legendre symbol at the primes. (Contributed by Mario Carneiro, 4-Feb-2015.)
Hypothesis
Ref Expression
lgsval.1 𝐹 = (𝑛 ∈ ℕ ↦ if(𝑛 ∈ ℙ, (if(𝑛 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑛 − 1) / 2)) + 1) mod 𝑛) − 1))↑(𝑛 pCnt 𝑁)), 1))
Assertion
Ref Expression
lgsfval (𝑀 ∈ ℕ → (𝐹𝑀) = if(𝑀 ∈ ℙ, (if(𝑀 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀) − 1))↑(𝑀 pCnt 𝑁)), 1))
Distinct variable groups:   𝐴,𝑛   𝑛,𝑀   𝑛,𝑁
Allowed substitution hint:   𝐹(𝑛)

Proof of Theorem lgsfval
StepHypRef Expression
1 eleq1 2838 . . 3 (𝑛 = 𝑀 → (𝑛 ∈ ℙ ↔ 𝑀 ∈ ℙ))
2 eqeq1 2763 . . . . 5 (𝑛 = 𝑀 → (𝑛 = 2 ↔ 𝑀 = 2))
3 oveq1 7150 . . . . . . . . . 10 (𝑛 = 𝑀 → (𝑛 − 1) = (𝑀 − 1))
43oveq1d 7158 . . . . . . . . 9 (𝑛 = 𝑀 → ((𝑛 − 1) / 2) = ((𝑀 − 1) / 2))
54oveq2d 7159 . . . . . . . 8 (𝑛 = 𝑀 → (𝐴↑((𝑛 − 1) / 2)) = (𝐴↑((𝑀 − 1) / 2)))
65oveq1d 7158 . . . . . . 7 (𝑛 = 𝑀 → ((𝐴↑((𝑛 − 1) / 2)) + 1) = ((𝐴↑((𝑀 − 1) / 2)) + 1))
7 id 22 . . . . . . 7 (𝑛 = 𝑀𝑛 = 𝑀)
86, 7oveq12d 7161 . . . . . 6 (𝑛 = 𝑀 → (((𝐴↑((𝑛 − 1) / 2)) + 1) mod 𝑛) = (((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀))
98oveq1d 7158 . . . . 5 (𝑛 = 𝑀 → ((((𝐴↑((𝑛 − 1) / 2)) + 1) mod 𝑛) − 1) = ((((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀) − 1))
102, 9ifbieq2d 4439 . . . 4 (𝑛 = 𝑀 → if(𝑛 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑛 − 1) / 2)) + 1) mod 𝑛) − 1)) = if(𝑀 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀) − 1)))
11 oveq1 7150 . . . 4 (𝑛 = 𝑀 → (𝑛 pCnt 𝑁) = (𝑀 pCnt 𝑁))
1210, 11oveq12d 7161 . . 3 (𝑛 = 𝑀 → (if(𝑛 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑛 − 1) / 2)) + 1) mod 𝑛) − 1))↑(𝑛 pCnt 𝑁)) = (if(𝑀 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀) − 1))↑(𝑀 pCnt 𝑁)))
131, 12ifbieq1d 4437 . 2 (𝑛 = 𝑀 → if(𝑛 ∈ ℙ, (if(𝑛 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑛 − 1) / 2)) + 1) mod 𝑛) − 1))↑(𝑛 pCnt 𝑁)), 1) = if(𝑀 ∈ ℙ, (if(𝑀 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀) − 1))↑(𝑀 pCnt 𝑁)), 1))
14 lgsval.1 . 2 𝐹 = (𝑛 ∈ ℕ ↦ if(𝑛 ∈ ℙ, (if(𝑛 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑛 − 1) / 2)) + 1) mod 𝑛) − 1))↑(𝑛 pCnt 𝑁)), 1))
15 ovex 7176 . . 3 (if(𝑀 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀) − 1))↑(𝑀 pCnt 𝑁)) ∈ V
16 1ex 10660 . . 3 1 ∈ V
1715, 16ifex 4463 . 2 if(𝑀 ∈ ℙ, (if(𝑀 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀) − 1))↑(𝑀 pCnt 𝑁)), 1) ∈ V
1813, 14, 17fvmpt 6752 1 (𝑀 ∈ ℕ → (𝐹𝑀) = if(𝑀 ∈ ℙ, (if(𝑀 = 2, if(2 ∥ 𝐴, 0, if((𝐴 mod 8) ∈ {1, 7}, 1, -1)), ((((𝐴↑((𝑀 − 1) / 2)) + 1) mod 𝑀) − 1))↑(𝑀 pCnt 𝑁)), 1))
Colors of variables: wff setvar class
Syntax hints:  wi 4   = wceq 1539  wcel 2112  ifcif 4413  {cpr 4517   class class class wbr 5025  cmpt 5105  cfv 6328  (class class class)co 7143  0cc0 10560  1c1 10561   + caddc 10563  cmin 10893  -cneg 10894   / cdiv 11320  cn 11659  2c2 11714  7c7 11719  8c8 11720   mod cmo 13271  cexp 13464  cdvds 15640  cprime 16052   pCnt cpc 16213
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1798  ax-4 1812  ax-5 1912  ax-6 1971  ax-7 2016  ax-8 2114  ax-9 2122  ax-10 2143  ax-11 2159  ax-12 2176  ax-ext 2730  ax-sep 5162  ax-nul 5169  ax-pr 5291  ax-1cn 10618
This theorem depends on definitions:  df-bi 210  df-an 401  df-or 846  df-3an 1087  df-tru 1542  df-ex 1783  df-nf 1787  df-sb 2071  df-mo 2558  df-eu 2589  df-clab 2737  df-cleq 2751  df-clel 2831  df-nfc 2899  df-ral 3073  df-rex 3074  df-rab 3077  df-v 3409  df-sbc 3694  df-dif 3857  df-un 3859  df-in 3861  df-ss 3871  df-nul 4222  df-if 4414  df-sn 4516  df-pr 4518  df-op 4522  df-uni 4792  df-br 5026  df-opab 5088  df-mpt 5106  df-id 5423  df-xp 5523  df-rel 5524  df-cnv 5525  df-co 5526  df-dm 5527  df-iota 6287  df-fun 6330  df-fv 6336  df-ov 7146
This theorem is referenced by:  lgsval2lem  25975
  Copyright terms: Public domain W3C validator