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

Theorem 2lgslem3 25666
Description: Lemma 3 for 2lgs 25669. (Contributed by AV, 16-Jul-2021.)
Hypothesis
Ref Expression
2lgslem2.n 𝑁 = (((𝑃 − 1) / 2) − (⌊‘(𝑃 / 4)))
Assertion
Ref Expression
2lgslem3 ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1))

Proof of Theorem 2lgslem3
StepHypRef Expression
1 nnz 11858 . . 3 (𝑃 ∈ ℕ → 𝑃 ∈ ℤ)
2 lgsdir2lem3 25589 . . 3 ((𝑃 ∈ ℤ ∧ ¬ 2 ∥ 𝑃) → (𝑃 mod 8) ∈ ({1, 7} ∪ {3, 5}))
31, 2sylan 580 . 2 ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑃 mod 8) ∈ ({1, 7} ∪ {3, 5}))
4 elun 4052 . . 3 ((𝑃 mod 8) ∈ ({1, 7} ∪ {3, 5}) ↔ ((𝑃 mod 8) ∈ {1, 7} ∨ (𝑃 mod 8) ∈ {3, 5}))
5 ovex 7055 . . . . . . . . 9 (𝑃 mod 8) ∈ V
65elpr 4501 . . . . . . . 8 ((𝑃 mod 8) ∈ {1, 7} ↔ ((𝑃 mod 8) = 1 ∨ (𝑃 mod 8) = 7))
7 2lgslem2.n . . . . . . . . . . . . 13 𝑁 = (((𝑃 − 1) / 2) − (⌊‘(𝑃 / 4)))
872lgslem3a1 25662 . . . . . . . . . . . 12 ((𝑃 ∈ ℕ ∧ (𝑃 mod 8) = 1) → (𝑁 mod 2) = 0)
98a1d 25 . . . . . . . . . . 11 ((𝑃 ∈ ℕ ∧ (𝑃 mod 8) = 1) → (¬ 2 ∥ 𝑃 → (𝑁 mod 2) = 0))
109expcom 414 . . . . . . . . . 10 ((𝑃 mod 8) = 1 → (𝑃 ∈ ℕ → (¬ 2 ∥ 𝑃 → (𝑁 mod 2) = 0)))
1110impd 411 . . . . . . . . 9 ((𝑃 mod 8) = 1 → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = 0))
1272lgslem3d1 25665 . . . . . . . . . . . 12 ((𝑃 ∈ ℕ ∧ (𝑃 mod 8) = 7) → (𝑁 mod 2) = 0)
1312a1d 25 . . . . . . . . . . 11 ((𝑃 ∈ ℕ ∧ (𝑃 mod 8) = 7) → (¬ 2 ∥ 𝑃 → (𝑁 mod 2) = 0))
1413expcom 414 . . . . . . . . . 10 ((𝑃 mod 8) = 7 → (𝑃 ∈ ℕ → (¬ 2 ∥ 𝑃 → (𝑁 mod 2) = 0)))
1514impd 411 . . . . . . . . 9 ((𝑃 mod 8) = 7 → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = 0))
1611, 15jaoi 852 . . . . . . . 8 (((𝑃 mod 8) = 1 ∨ (𝑃 mod 8) = 7) → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = 0))
176, 16sylbi 218 . . . . . . 7 ((𝑃 mod 8) ∈ {1, 7} → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = 0))
1817imp 407 . . . . . 6 (((𝑃 mod 8) ∈ {1, 7} ∧ (𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃)) → (𝑁 mod 2) = 0)
19 iftrue 4393 . . . . . . 7 ((𝑃 mod 8) ∈ {1, 7} → if((𝑃 mod 8) ∈ {1, 7}, 0, 1) = 0)
2019adantr 481 . . . . . 6 (((𝑃 mod 8) ∈ {1, 7} ∧ (𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃)) → if((𝑃 mod 8) ∈ {1, 7}, 0, 1) = 0)
2118, 20eqtr4d 2836 . . . . 5 (((𝑃 mod 8) ∈ {1, 7} ∧ (𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃)) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1))
2221ex 413 . . . 4 ((𝑃 mod 8) ∈ {1, 7} → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1)))
235elpr 4501 . . . . 5 ((𝑃 mod 8) ∈ {3, 5} ↔ ((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5))
2472lgslem3b1 25663 . . . . . . . . . . 11 ((𝑃 ∈ ℕ ∧ (𝑃 mod 8) = 3) → (𝑁 mod 2) = 1)
2524expcom 414 . . . . . . . . . 10 ((𝑃 mod 8) = 3 → (𝑃 ∈ ℕ → (𝑁 mod 2) = 1))
2672lgslem3c1 25664 . . . . . . . . . . 11 ((𝑃 ∈ ℕ ∧ (𝑃 mod 8) = 5) → (𝑁 mod 2) = 1)
2726expcom 414 . . . . . . . . . 10 ((𝑃 mod 8) = 5 → (𝑃 ∈ ℕ → (𝑁 mod 2) = 1))
2825, 27jaoi 852 . . . . . . . . 9 (((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) → (𝑃 ∈ ℕ → (𝑁 mod 2) = 1))
2928imp 407 . . . . . . . 8 ((((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) ∧ 𝑃 ∈ ℕ) → (𝑁 mod 2) = 1)
30 1re 10494 . . . . . . . . . . . . . . . 16 1 ∈ ℝ
31 1lt3 11664 . . . . . . . . . . . . . . . 16 1 < 3
3230, 31ltneii 10606 . . . . . . . . . . . . . . 15 1 ≠ 3
3332nesymi 3043 . . . . . . . . . . . . . 14 ¬ 3 = 1
34 3re 11571 . . . . . . . . . . . . . . . 16 3 ∈ ℝ
35 3lt7 11680 . . . . . . . . . . . . . . . 16 3 < 7
3634, 35ltneii 10606 . . . . . . . . . . . . . . 15 3 ≠ 7
3736neii 2988 . . . . . . . . . . . . . 14 ¬ 3 = 7
3833, 37pm3.2i 471 . . . . . . . . . . . . 13 (¬ 3 = 1 ∧ ¬ 3 = 7)
39 eqeq1 2801 . . . . . . . . . . . . . . 15 ((𝑃 mod 8) = 3 → ((𝑃 mod 8) = 1 ↔ 3 = 1))
4039notbid 319 . . . . . . . . . . . . . 14 ((𝑃 mod 8) = 3 → (¬ (𝑃 mod 8) = 1 ↔ ¬ 3 = 1))
41 eqeq1 2801 . . . . . . . . . . . . . . 15 ((𝑃 mod 8) = 3 → ((𝑃 mod 8) = 7 ↔ 3 = 7))
4241notbid 319 . . . . . . . . . . . . . 14 ((𝑃 mod 8) = 3 → (¬ (𝑃 mod 8) = 7 ↔ ¬ 3 = 7))
4340, 42anbi12d 630 . . . . . . . . . . . . 13 ((𝑃 mod 8) = 3 → ((¬ (𝑃 mod 8) = 1 ∧ ¬ (𝑃 mod 8) = 7) ↔ (¬ 3 = 1 ∧ ¬ 3 = 7)))
4438, 43mpbiri 259 . . . . . . . . . . . 12 ((𝑃 mod 8) = 3 → (¬ (𝑃 mod 8) = 1 ∧ ¬ (𝑃 mod 8) = 7))
45 1lt5 11671 . . . . . . . . . . . . . . . 16 1 < 5
4630, 45ltneii 10606 . . . . . . . . . . . . . . 15 1 ≠ 5
4746nesymi 3043 . . . . . . . . . . . . . 14 ¬ 5 = 1
48 5re 11578 . . . . . . . . . . . . . . . 16 5 ∈ ℝ
49 5lt7 11678 . . . . . . . . . . . . . . . 16 5 < 7
5048, 49ltneii 10606 . . . . . . . . . . . . . . 15 5 ≠ 7
5150neii 2988 . . . . . . . . . . . . . 14 ¬ 5 = 7
5247, 51pm3.2i 471 . . . . . . . . . . . . 13 (¬ 5 = 1 ∧ ¬ 5 = 7)
53 eqeq1 2801 . . . . . . . . . . . . . . 15 ((𝑃 mod 8) = 5 → ((𝑃 mod 8) = 1 ↔ 5 = 1))
5453notbid 319 . . . . . . . . . . . . . 14 ((𝑃 mod 8) = 5 → (¬ (𝑃 mod 8) = 1 ↔ ¬ 5 = 1))
55 eqeq1 2801 . . . . . . . . . . . . . . 15 ((𝑃 mod 8) = 5 → ((𝑃 mod 8) = 7 ↔ 5 = 7))
5655notbid 319 . . . . . . . . . . . . . 14 ((𝑃 mod 8) = 5 → (¬ (𝑃 mod 8) = 7 ↔ ¬ 5 = 7))
5754, 56anbi12d 630 . . . . . . . . . . . . 13 ((𝑃 mod 8) = 5 → ((¬ (𝑃 mod 8) = 1 ∧ ¬ (𝑃 mod 8) = 7) ↔ (¬ 5 = 1 ∧ ¬ 5 = 7)))
5852, 57mpbiri 259 . . . . . . . . . . . 12 ((𝑃 mod 8) = 5 → (¬ (𝑃 mod 8) = 1 ∧ ¬ (𝑃 mod 8) = 7))
5944, 58jaoi 852 . . . . . . . . . . 11 (((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) → (¬ (𝑃 mod 8) = 1 ∧ ¬ (𝑃 mod 8) = 7))
6059adantr 481 . . . . . . . . . 10 ((((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) ∧ 𝑃 ∈ ℕ) → (¬ (𝑃 mod 8) = 1 ∧ ¬ (𝑃 mod 8) = 7))
61 ioran 978 . . . . . . . . . . 11 (¬ ((𝑃 mod 8) = 1 ∨ (𝑃 mod 8) = 7) ↔ (¬ (𝑃 mod 8) = 1 ∧ ¬ (𝑃 mod 8) = 7))
6261, 6xchnxbir 334 . . . . . . . . . 10 (¬ (𝑃 mod 8) ∈ {1, 7} ↔ (¬ (𝑃 mod 8) = 1 ∧ ¬ (𝑃 mod 8) = 7))
6360, 62sylibr 235 . . . . . . . . 9 ((((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) ∧ 𝑃 ∈ ℕ) → ¬ (𝑃 mod 8) ∈ {1, 7})
6463iffalsed 4398 . . . . . . . 8 ((((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) ∧ 𝑃 ∈ ℕ) → if((𝑃 mod 8) ∈ {1, 7}, 0, 1) = 1)
6529, 64eqtr4d 2836 . . . . . . 7 ((((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) ∧ 𝑃 ∈ ℕ) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1))
6665a1d 25 . . . . . 6 ((((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) ∧ 𝑃 ∈ ℕ) → (¬ 2 ∥ 𝑃 → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1)))
6766expimpd 454 . . . . 5 (((𝑃 mod 8) = 3 ∨ (𝑃 mod 8) = 5) → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1)))
6823, 67sylbi 218 . . . 4 ((𝑃 mod 8) ∈ {3, 5} → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1)))
6922, 68jaoi 852 . . 3 (((𝑃 mod 8) ∈ {1, 7} ∨ (𝑃 mod 8) ∈ {3, 5}) → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1)))
704, 69sylbi 218 . 2 ((𝑃 mod 8) ∈ ({1, 7} ∪ {3, 5}) → ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1)))
713, 70mpcom 38 1 ((𝑃 ∈ ℕ ∧ ¬ 2 ∥ 𝑃) → (𝑁 mod 2) = if((𝑃 mod 8) ∈ {1, 7}, 0, 1))
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wa 396  wo 842   = wceq 1525  wcel 2083  cun 3863  ifcif 4387  {cpr 4480   class class class wbr 4968  cfv 6232  (class class class)co 7023  0cc0 10390  1c1 10391  cmin 10723   / cdiv 11151  cn 11492  2c2 11546  3c3 11547  4c4 11548  5c5 11549  7c7 11551  8c8 11552  cz 11835  cfl 13014   mod cmo 13091  cdvds 15444
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1781  ax-4 1795  ax-5 1892  ax-6 1951  ax-7 1996  ax-8 2085  ax-9 2093  ax-10 2114  ax-11 2128  ax-12 2143  ax-13 2346  ax-ext 2771  ax-sep 5101  ax-nul 5108  ax-pow 5164  ax-pr 5228  ax-un 7326  ax-cnex 10446  ax-resscn 10447  ax-1cn 10448  ax-icn 10449  ax-addcl 10450  ax-addrcl 10451  ax-mulcl 10452  ax-mulrcl 10453  ax-mulcom 10454  ax-addass 10455  ax-mulass 10456  ax-distr 10457  ax-i2m1 10458  ax-1ne0 10459  ax-1rid 10460  ax-rnegex 10461  ax-rrecex 10462  ax-cnre 10463  ax-pre-lttri 10464  ax-pre-lttrn 10465  ax-pre-ltadd 10466  ax-pre-mulgt0 10467  ax-pre-sup 10468
This theorem depends on definitions:  df-bi 208  df-an 397  df-or 843  df-3or 1081  df-3an 1082  df-tru 1528  df-ex 1766  df-nf 1770  df-sb 2045  df-mo 2578  df-eu 2614  df-clab 2778  df-cleq 2790  df-clel 2865  df-nfc 2937  df-ne 2987  df-nel 3093  df-ral 3112  df-rex 3113  df-reu 3114  df-rmo 3115  df-rab 3116  df-v 3442  df-sbc 3712  df-csb 3818  df-dif 3868  df-un 3870  df-in 3872  df-ss 3880  df-pss 3882  df-nul 4218  df-if 4388  df-pw 4461  df-sn 4479  df-pr 4481  df-tp 4483  df-op 4485  df-uni 4752  df-iun 4833  df-br 4969  df-opab 5031  df-mpt 5048  df-tr 5071  df-id 5355  df-eprel 5360  df-po 5369  df-so 5370  df-fr 5409  df-we 5411  df-xp 5456  df-rel 5457  df-cnv 5458  df-co 5459  df-dm 5460  df-rn 5461  df-res 5462  df-ima 5463  df-pred 6030  df-ord 6076  df-on 6077  df-lim 6078  df-suc 6079  df-iota 6196  df-fun 6234  df-fn 6235  df-f 6236  df-f1 6237  df-fo 6238  df-f1o 6239  df-fv 6240  df-riota 6984  df-ov 7026  df-oprab 7027  df-mpo 7028  df-om 7444  df-1st 7552  df-2nd 7553  df-wrecs 7805  df-recs 7867  df-rdg 7905  df-er 8146  df-en 8365  df-dom 8366  df-sdom 8367  df-sup 8759  df-inf 8760  df-pnf 10530  df-mnf 10531  df-xr 10532  df-ltxr 10533  df-le 10534  df-sub 10725  df-neg 10726  df-div 11152  df-nn 11493  df-2 11554  df-3 11555  df-4 11556  df-5 11557  df-6 11558  df-7 11559  df-8 11560  df-n0 11752  df-z 11836  df-uz 12098  df-rp 12244  df-ico 12598  df-fz 12747  df-fl 13016  df-mod 13092  df-dvds 15445
This theorem is referenced by:  2lgs  25669
  Copyright terms: Public domain W3C validator