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

Theorem 2sqlem9 24897
Description: Lemma for 2sq 24900. (Contributed by Mario Carneiro, 19-Jun-2015.)
Hypotheses
Ref Expression
2sq.1 𝑆 = ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2))
2sqlem7.2 𝑌 = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
2sqlem9.5 (𝜑 → ∀𝑏 ∈ (1...(𝑀 − 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆))
2sqlem9.7 (𝜑𝑀𝑁)
2sqlem9.6 (𝜑𝑀 ∈ ℕ)
2sqlem9.4 (𝜑𝑁𝑌)
Assertion
Ref Expression
2sqlem9 (𝜑𝑀𝑆)
Distinct variable groups:   𝑎,𝑏,𝑤,𝑥,𝑦,𝑧   𝜑,𝑥,𝑦   𝑀,𝑎,𝑏,𝑥,𝑦,𝑧   𝑆,𝑎,𝑏,𝑥,𝑦,𝑧   𝑥,𝑁,𝑦,𝑧   𝑌,𝑎,𝑏,𝑥,𝑦
Allowed substitution hints:   𝜑(𝑧,𝑤,𝑎,𝑏)   𝑆(𝑤)   𝑀(𝑤)   𝑁(𝑤,𝑎,𝑏)   𝑌(𝑧,𝑤)

Proof of Theorem 2sqlem9
Dummy variables 𝑢 𝑣 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 2sqlem9.4 . . 3 (𝜑𝑁𝑌)
2 eqeq1 2613 . . . . . . . 8 (𝑧 = 𝑁 → (𝑧 = ((𝑥↑2) + (𝑦↑2)) ↔ 𝑁 = ((𝑥↑2) + (𝑦↑2))))
32anbi2d 735 . . . . . . 7 (𝑧 = 𝑁 → (((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2))) ↔ ((𝑥 gcd 𝑦) = 1 ∧ 𝑁 = ((𝑥↑2) + (𝑦↑2)))))
432rexbidv 3038 . . . . . 6 (𝑧 = 𝑁 → (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2))) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑁 = ((𝑥↑2) + (𝑦↑2)))))
5 oveq1 6534 . . . . . . . . 9 (𝑥 = 𝑢 → (𝑥 gcd 𝑦) = (𝑢 gcd 𝑦))
65eqeq1d 2611 . . . . . . . 8 (𝑥 = 𝑢 → ((𝑥 gcd 𝑦) = 1 ↔ (𝑢 gcd 𝑦) = 1))
7 oveq1 6534 . . . . . . . . . 10 (𝑥 = 𝑢 → (𝑥↑2) = (𝑢↑2))
87oveq1d 6542 . . . . . . . . 9 (𝑥 = 𝑢 → ((𝑥↑2) + (𝑦↑2)) = ((𝑢↑2) + (𝑦↑2)))
98eqeq2d 2619 . . . . . . . 8 (𝑥 = 𝑢 → (𝑁 = ((𝑥↑2) + (𝑦↑2)) ↔ 𝑁 = ((𝑢↑2) + (𝑦↑2))))
106, 9anbi12d 742 . . . . . . 7 (𝑥 = 𝑢 → (((𝑥 gcd 𝑦) = 1 ∧ 𝑁 = ((𝑥↑2) + (𝑦↑2))) ↔ ((𝑢 gcd 𝑦) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑦↑2)))))
11 oveq2 6535 . . . . . . . . 9 (𝑦 = 𝑣 → (𝑢 gcd 𝑦) = (𝑢 gcd 𝑣))
1211eqeq1d 2611 . . . . . . . 8 (𝑦 = 𝑣 → ((𝑢 gcd 𝑦) = 1 ↔ (𝑢 gcd 𝑣) = 1))
13 oveq1 6534 . . . . . . . . . 10 (𝑦 = 𝑣 → (𝑦↑2) = (𝑣↑2))
1413oveq2d 6543 . . . . . . . . 9 (𝑦 = 𝑣 → ((𝑢↑2) + (𝑦↑2)) = ((𝑢↑2) + (𝑣↑2)))
1514eqeq2d 2619 . . . . . . . 8 (𝑦 = 𝑣 → (𝑁 = ((𝑢↑2) + (𝑦↑2)) ↔ 𝑁 = ((𝑢↑2) + (𝑣↑2))))
1612, 15anbi12d 742 . . . . . . 7 (𝑦 = 𝑣 → (((𝑢 gcd 𝑦) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑦↑2))) ↔ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2)))))
1710, 16cbvrex2v 3155 . . . . . 6 (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑁 = ((𝑥↑2) + (𝑦↑2))) ↔ ∃𝑢 ∈ ℤ ∃𝑣 ∈ ℤ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))))
184, 17syl6bb 274 . . . . 5 (𝑧 = 𝑁 → (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2))) ↔ ∃𝑢 ∈ ℤ ∃𝑣 ∈ ℤ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2)))))
19 2sqlem7.2 . . . . 5 𝑌 = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
2018, 19elab2g 3321 . . . 4 (𝑁𝑌 → (𝑁𝑌 ↔ ∃𝑢 ∈ ℤ ∃𝑣 ∈ ℤ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2)))))
2120ibi 254 . . 3 (𝑁𝑌 → ∃𝑢 ∈ ℤ ∃𝑣 ∈ ℤ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))))
221, 21syl 17 . 2 (𝜑 → ∃𝑢 ∈ ℤ ∃𝑣 ∈ ℤ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))))
23 simpr 475 . . . . . 6 ((((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2)))) ∧ 𝑀 = 1) → 𝑀 = 1)
24 1z 11243 . . . . . . . . 9 1 ∈ ℤ
25 zgz 15424 . . . . . . . . 9 (1 ∈ ℤ → 1 ∈ ℤ[i])
2624, 25ax-mp 5 . . . . . . . 8 1 ∈ ℤ[i]
27 sq1 12778 . . . . . . . . 9 (1↑2) = 1
2827eqcomi 2618 . . . . . . . 8 1 = (1↑2)
29 fveq2 6088 . . . . . . . . . . . 12 (𝑥 = 1 → (abs‘𝑥) = (abs‘1))
30 abs1 13834 . . . . . . . . . . . 12 (abs‘1) = 1
3129, 30syl6eq 2659 . . . . . . . . . . 11 (𝑥 = 1 → (abs‘𝑥) = 1)
3231oveq1d 6542 . . . . . . . . . 10 (𝑥 = 1 → ((abs‘𝑥)↑2) = (1↑2))
3332eqeq2d 2619 . . . . . . . . 9 (𝑥 = 1 → (1 = ((abs‘𝑥)↑2) ↔ 1 = (1↑2)))
3433rspcev 3281 . . . . . . . 8 ((1 ∈ ℤ[i] ∧ 1 = (1↑2)) → ∃𝑥 ∈ ℤ[i] 1 = ((abs‘𝑥)↑2))
3526, 28, 34mp2an 703 . . . . . . 7 𝑥 ∈ ℤ[i] 1 = ((abs‘𝑥)↑2)
36 2sq.1 . . . . . . . 8 𝑆 = ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2))
37362sqlem1 24887 . . . . . . 7 (1 ∈ 𝑆 ↔ ∃𝑥 ∈ ℤ[i] 1 = ((abs‘𝑥)↑2))
3835, 37mpbir 219 . . . . . 6 1 ∈ 𝑆
3923, 38syl6eqel 2695 . . . . 5 ((((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2)))) ∧ 𝑀 = 1) → 𝑀𝑆)
40 2sqlem9.5 . . . . . . . 8 (𝜑 → ∀𝑏 ∈ (1...(𝑀 − 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆))
4140ad2antrr 757 . . . . . . 7 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → ∀𝑏 ∈ (1...(𝑀 − 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆))
42 2sqlem9.7 . . . . . . . 8 (𝜑𝑀𝑁)
4342ad2antrr 757 . . . . . . 7 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑀𝑁)
4436, 192sqlem7 24894 . . . . . . . . . 10 𝑌 ⊆ (𝑆 ∩ ℕ)
45 inss2 3795 . . . . . . . . . 10 (𝑆 ∩ ℕ) ⊆ ℕ
4644, 45sstri 3576 . . . . . . . . 9 𝑌 ⊆ ℕ
4746, 1sseldi 3565 . . . . . . . 8 (𝜑𝑁 ∈ ℕ)
4847ad2antrr 757 . . . . . . 7 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑁 ∈ ℕ)
49 2sqlem9.6 . . . . . . . . 9 (𝜑𝑀 ∈ ℕ)
5049ad2antrr 757 . . . . . . . 8 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑀 ∈ ℕ)
51 simprr 791 . . . . . . . 8 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑀 ≠ 1)
52 eluz2b3 11597 . . . . . . . 8 (𝑀 ∈ (ℤ‘2) ↔ (𝑀 ∈ ℕ ∧ 𝑀 ≠ 1))
5350, 51, 52sylanbrc 694 . . . . . . 7 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑀 ∈ (ℤ‘2))
54 simplrl 795 . . . . . . 7 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑢 ∈ ℤ)
55 simplrr 796 . . . . . . 7 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑣 ∈ ℤ)
56 simprll 797 . . . . . . 7 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → (𝑢 gcd 𝑣) = 1)
57 simprlr 798 . . . . . . 7 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑁 = ((𝑢↑2) + (𝑣↑2)))
58 eqid 2609 . . . . . . 7 (((𝑢 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) = (((𝑢 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2))
59 eqid 2609 . . . . . . 7 (((𝑣 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) = (((𝑣 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2))
60 eqid 2609 . . . . . . 7 ((((𝑢 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) / ((((𝑢 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) gcd (((𝑣 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)))) = ((((𝑢 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) / ((((𝑢 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) gcd (((𝑣 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2))))
61 eqid 2609 . . . . . . 7 ((((𝑣 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) / ((((𝑢 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) gcd (((𝑣 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)))) = ((((𝑣 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) / ((((𝑢 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2)) gcd (((𝑣 + (𝑀 / 2)) mod 𝑀) − (𝑀 / 2))))
6236, 19, 41, 43, 48, 53, 54, 55, 56, 57, 58, 59, 60, 612sqlem8 24896 . . . . . 6 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) ∧ 𝑀 ≠ 1)) → 𝑀𝑆)
6362anassrs 677 . . . . 5 ((((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2)))) ∧ 𝑀 ≠ 1) → 𝑀𝑆)
6439, 63pm2.61dane 2868 . . . 4 (((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) ∧ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2)))) → 𝑀𝑆)
6564ex 448 . . 3 ((𝜑 ∧ (𝑢 ∈ ℤ ∧ 𝑣 ∈ ℤ)) → (((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) → 𝑀𝑆))
6665rexlimdvva 3019 . 2 (𝜑 → (∃𝑢 ∈ ℤ ∃𝑣 ∈ ℤ ((𝑢 gcd 𝑣) = 1 ∧ 𝑁 = ((𝑢↑2) + (𝑣↑2))) → 𝑀𝑆))
6722, 66mpd 15 1 (𝜑𝑀𝑆)
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 382   = wceq 1474  wcel 1976  {cab 2595  wne 2779  wral 2895  wrex 2896  cin 3538   class class class wbr 4577  cmpt 4637  ran crn 5029  cfv 5790  (class class class)co 6527  1c1 9794   + caddc 9796  cmin 10118   / cdiv 10536  cn 10870  2c2 10920  cz 11213  cuz 11522  ...cfz 12155   mod cmo 12488  cexp 12680  abscabs 13771  cdvds 14770   gcd cgcd 15003  ℤ[i]cgz 15420
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1712  ax-4 1727  ax-5 1826  ax-6 1874  ax-7 1921  ax-8 1978  ax-9 1985  ax-10 2005  ax-11 2020  ax-12 2033  ax-13 2233  ax-ext 2589  ax-sep 4703  ax-nul 4712  ax-pow 4764  ax-pr 4828  ax-un 6825  ax-cnex 9849  ax-resscn 9850  ax-1cn 9851  ax-icn 9852  ax-addcl 9853  ax-addrcl 9854  ax-mulcl 9855  ax-mulrcl 9856  ax-mulcom 9857  ax-addass 9858  ax-mulass 9859  ax-distr 9860  ax-i2m1 9861  ax-1ne0 9862  ax-1rid 9863  ax-rnegex 9864  ax-rrecex 9865  ax-cnre 9866  ax-pre-lttri 9867  ax-pre-lttrn 9868  ax-pre-ltadd 9869  ax-pre-mulgt0 9870  ax-pre-sup 9871
This theorem depends on definitions:  df-bi 195  df-or 383  df-an 384  df-3or 1031  df-3an 1032  df-tru 1477  df-ex 1695  df-nf 1700  df-sb 1867  df-eu 2461  df-mo 2462  df-clab 2596  df-cleq 2602  df-clel 2605  df-nfc 2739  df-ne 2781  df-nel 2782  df-ral 2900  df-rex 2901  df-reu 2902  df-rmo 2903  df-rab 2904  df-v 3174  df-sbc 3402  df-csb 3499  df-dif 3542  df-un 3544  df-in 3546  df-ss 3553  df-pss 3555  df-nul 3874  df-if 4036  df-pw 4109  df-sn 4125  df-pr 4127  df-tp 4129  df-op 4131  df-uni 4367  df-int 4405  df-iun 4451  df-br 4578  df-opab 4638  df-mpt 4639  df-tr 4675  df-eprel 4939  df-id 4943  df-po 4949  df-so 4950  df-fr 4987  df-we 4989  df-xp 5034  df-rel 5035  df-cnv 5036  df-co 5037  df-dm 5038  df-rn 5039  df-res 5040  df-ima 5041  df-pred 5583  df-ord 5629  df-on 5630  df-lim 5631  df-suc 5632  df-iota 5754  df-fun 5792  df-fn 5793  df-f 5794  df-f1 5795  df-fo 5796  df-f1o 5797  df-fv 5798  df-riota 6489  df-ov 6530  df-oprab 6531  df-mpt2 6532  df-om 6936  df-1st 7037  df-2nd 7038  df-wrecs 7272  df-recs 7333  df-rdg 7371  df-1o 7425  df-2o 7426  df-oadd 7429  df-er 7607  df-en 7820  df-dom 7821  df-sdom 7822  df-fin 7823  df-sup 8209  df-inf 8210  df-pnf 9933  df-mnf 9934  df-xr 9935  df-ltxr 9936  df-le 9937  df-sub 10120  df-neg 10121  df-div 10537  df-nn 10871  df-2 10929  df-3 10930  df-n0 11143  df-z 11214  df-uz 11523  df-rp 11668  df-fz 12156  df-fl 12413  df-mod 12489  df-seq 12622  df-exp 12681  df-cj 13636  df-re 13637  df-im 13638  df-sqrt 13772  df-abs 13773  df-dvds 14771  df-gcd 15004  df-prm 15173  df-gz 15421
This theorem is referenced by:  2sqlem10  24898
  Copyright terms: Public domain W3C validator