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

Theorem 2sqlem10 25996
Description: Lemma for 2sq 25998. Every factor of a "proper" sum of two squares (where the summands are coprime) is a sum of two squares. (Contributed by Mario Carneiro, 19-Jun-2015.)
Hypotheses
Ref Expression
2sq.1 𝑆 = ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2))
2sqlem7.2 𝑌 = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
Assertion
Ref Expression
2sqlem10 ((𝐴𝑌𝐵 ∈ ℕ ∧ 𝐵𝐴) → 𝐵𝑆)
Distinct variable groups:   𝑥,𝑤,𝑦,𝑧   𝑥,𝐴,𝑦,𝑧   𝑥,𝐵,𝑦   𝑥,𝑆,𝑦,𝑧   𝑥,𝑌,𝑦
Allowed substitution hints:   𝐴(𝑤)   𝐵(𝑧,𝑤)   𝑆(𝑤)   𝑌(𝑧,𝑤)

Proof of Theorem 2sqlem10
Dummy variables 𝑎 𝑏 𝑛 𝑚 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 breq1 5060 . . . . . 6 (𝑏 = 𝐵 → (𝑏𝑎𝐵𝑎))
2 eleq1 2898 . . . . . 6 (𝑏 = 𝐵 → (𝑏𝑆𝐵𝑆))
31, 2imbi12d 347 . . . . 5 (𝑏 = 𝐵 → ((𝑏𝑎𝑏𝑆) ↔ (𝐵𝑎𝐵𝑆)))
43ralbidv 3195 . . . 4 (𝑏 = 𝐵 → (∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑎𝑌 (𝐵𝑎𝐵𝑆)))
5 oveq2 7156 . . . . . 6 (𝑚 = 1 → (1...𝑚) = (1...1))
65raleqdv 3414 . . . . 5 (𝑚 = 1 → (∀𝑏 ∈ (1...𝑚)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑏 ∈ (1...1)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
7 oveq2 7156 . . . . . 6 (𝑚 = 𝑛 → (1...𝑚) = (1...𝑛))
87raleqdv 3414 . . . . 5 (𝑚 = 𝑛 → (∀𝑏 ∈ (1...𝑚)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
9 oveq2 7156 . . . . . 6 (𝑚 = (𝑛 + 1) → (1...𝑚) = (1...(𝑛 + 1)))
109raleqdv 3414 . . . . 5 (𝑚 = (𝑛 + 1) → (∀𝑏 ∈ (1...𝑚)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑏 ∈ (1...(𝑛 + 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
11 oveq2 7156 . . . . . 6 (𝑚 = 𝐵 → (1...𝑚) = (1...𝐵))
1211raleqdv 3414 . . . . 5 (𝑚 = 𝐵 → (∀𝑏 ∈ (1...𝑚)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑏 ∈ (1...𝐵)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
13 elfz1eq 12910 . . . . . . . . 9 (𝑏 ∈ (1...1) → 𝑏 = 1)
14 1z 12004 . . . . . . . . . . . 12 1 ∈ ℤ
15 zgz 16261 . . . . . . . . . . . 12 (1 ∈ ℤ → 1 ∈ ℤ[i])
1614, 15ax-mp 5 . . . . . . . . . . 11 1 ∈ ℤ[i]
17 sq1 13550 . . . . . . . . . . . 12 (1↑2) = 1
1817eqcomi 2828 . . . . . . . . . . 11 1 = (1↑2)
19 fveq2 6663 . . . . . . . . . . . . . 14 (𝑥 = 1 → (abs‘𝑥) = (abs‘1))
20 abs1 14649 . . . . . . . . . . . . . 14 (abs‘1) = 1
2119, 20syl6eq 2870 . . . . . . . . . . . . 13 (𝑥 = 1 → (abs‘𝑥) = 1)
2221oveq1d 7163 . . . . . . . . . . . 12 (𝑥 = 1 → ((abs‘𝑥)↑2) = (1↑2))
2322rspceeqv 3636 . . . . . . . . . . 11 ((1 ∈ ℤ[i] ∧ 1 = (1↑2)) → ∃𝑥 ∈ ℤ[i] 1 = ((abs‘𝑥)↑2))
2416, 18, 23mp2an 690 . . . . . . . . . 10 𝑥 ∈ ℤ[i] 1 = ((abs‘𝑥)↑2)
25 2sq.1 . . . . . . . . . . 11 𝑆 = ran (𝑤 ∈ ℤ[i] ↦ ((abs‘𝑤)↑2))
26252sqlem1 25985 . . . . . . . . . 10 (1 ∈ 𝑆 ↔ ∃𝑥 ∈ ℤ[i] 1 = ((abs‘𝑥)↑2))
2724, 26mpbir 233 . . . . . . . . 9 1 ∈ 𝑆
2813, 27syl6eqel 2919 . . . . . . . 8 (𝑏 ∈ (1...1) → 𝑏𝑆)
2928a1d 25 . . . . . . 7 (𝑏 ∈ (1...1) → (𝑏𝑎𝑏𝑆))
3029ralrimivw 3181 . . . . . 6 (𝑏 ∈ (1...1) → ∀𝑎𝑌 (𝑏𝑎𝑏𝑆))
3130rgen 3146 . . . . 5 𝑏 ∈ (1...1)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)
32 2sqlem7.2 . . . . . . . . . . . . 13 𝑌 = {𝑧 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ((𝑥 gcd 𝑦) = 1 ∧ 𝑧 = ((𝑥↑2) + (𝑦↑2)))}
33 simplr 767 . . . . . . . . . . . . . 14 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆))
34 nncn 11638 . . . . . . . . . . . . . . . . . 18 (𝑛 ∈ ℕ → 𝑛 ∈ ℂ)
3534ad2antrr 724 . . . . . . . . . . . . . . . . 17 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → 𝑛 ∈ ℂ)
36 ax-1cn 10587 . . . . . . . . . . . . . . . . 17 1 ∈ ℂ
37 pncan 10884 . . . . . . . . . . . . . . . . 17 ((𝑛 ∈ ℂ ∧ 1 ∈ ℂ) → ((𝑛 + 1) − 1) = 𝑛)
3835, 36, 37sylancl 588 . . . . . . . . . . . . . . . 16 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → ((𝑛 + 1) − 1) = 𝑛)
3938oveq2d 7164 . . . . . . . . . . . . . . 15 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → (1...((𝑛 + 1) − 1)) = (1...𝑛))
4039raleqdv 3414 . . . . . . . . . . . . . 14 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → (∀𝑏 ∈ (1...((𝑛 + 1) − 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
4133, 40mpbird 259 . . . . . . . . . . . . 13 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → ∀𝑏 ∈ (1...((𝑛 + 1) − 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆))
42 simprr 771 . . . . . . . . . . . . 13 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → (𝑛 + 1) ∥ 𝑚)
43 peano2nn 11642 . . . . . . . . . . . . . 14 (𝑛 ∈ ℕ → (𝑛 + 1) ∈ ℕ)
4443ad2antrr 724 . . . . . . . . . . . . 13 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → (𝑛 + 1) ∈ ℕ)
45 simprl 769 . . . . . . . . . . . . 13 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → 𝑚𝑌)
4625, 32, 41, 42, 44, 452sqlem9 25995 . . . . . . . . . . . 12 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ (𝑚𝑌 ∧ (𝑛 + 1) ∥ 𝑚)) → (𝑛 + 1) ∈ 𝑆)
4746expr 459 . . . . . . . . . . 11 (((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) ∧ 𝑚𝑌) → ((𝑛 + 1) ∥ 𝑚 → (𝑛 + 1) ∈ 𝑆))
4847ralrimiva 3180 . . . . . . . . . 10 ((𝑛 ∈ ℕ ∧ ∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆)) → ∀𝑚𝑌 ((𝑛 + 1) ∥ 𝑚 → (𝑛 + 1) ∈ 𝑆))
4948ex 415 . . . . . . . . 9 (𝑛 ∈ ℕ → (∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) → ∀𝑚𝑌 ((𝑛 + 1) ∥ 𝑚 → (𝑛 + 1) ∈ 𝑆)))
50 breq2 5061 . . . . . . . . . . 11 (𝑎 = 𝑚 → ((𝑛 + 1) ∥ 𝑎 ↔ (𝑛 + 1) ∥ 𝑚))
5150imbi1d 344 . . . . . . . . . 10 (𝑎 = 𝑚 → (((𝑛 + 1) ∥ 𝑎 → (𝑛 + 1) ∈ 𝑆) ↔ ((𝑛 + 1) ∥ 𝑚 → (𝑛 + 1) ∈ 𝑆)))
5251cbvralvw 3448 . . . . . . . . 9 (∀𝑎𝑌 ((𝑛 + 1) ∥ 𝑎 → (𝑛 + 1) ∈ 𝑆) ↔ ∀𝑚𝑌 ((𝑛 + 1) ∥ 𝑚 → (𝑛 + 1) ∈ 𝑆))
5349, 52syl6ibr 254 . . . . . . . 8 (𝑛 ∈ ℕ → (∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) → ∀𝑎𝑌 ((𝑛 + 1) ∥ 𝑎 → (𝑛 + 1) ∈ 𝑆)))
54 ovex 7181 . . . . . . . . 9 (𝑛 + 1) ∈ V
55 breq1 5060 . . . . . . . . . . 11 (𝑏 = (𝑛 + 1) → (𝑏𝑎 ↔ (𝑛 + 1) ∥ 𝑎))
56 eleq1 2898 . . . . . . . . . . 11 (𝑏 = (𝑛 + 1) → (𝑏𝑆 ↔ (𝑛 + 1) ∈ 𝑆))
5755, 56imbi12d 347 . . . . . . . . . 10 (𝑏 = (𝑛 + 1) → ((𝑏𝑎𝑏𝑆) ↔ ((𝑛 + 1) ∥ 𝑎 → (𝑛 + 1) ∈ 𝑆)))
5857ralbidv 3195 . . . . . . . . 9 (𝑏 = (𝑛 + 1) → (∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑎𝑌 ((𝑛 + 1) ∥ 𝑎 → (𝑛 + 1) ∈ 𝑆)))
5954, 58ralsn 4611 . . . . . . . 8 (∀𝑏 ∈ {(𝑛 + 1)}∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑎𝑌 ((𝑛 + 1) ∥ 𝑎 → (𝑛 + 1) ∈ 𝑆))
6053, 59syl6ibr 254 . . . . . . 7 (𝑛 ∈ ℕ → (∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) → ∀𝑏 ∈ {(𝑛 + 1)}∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
6160ancld 553 . . . . . 6 (𝑛 ∈ ℕ → (∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) → (∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ∧ ∀𝑏 ∈ {(𝑛 + 1)}∀𝑎𝑌 (𝑏𝑎𝑏𝑆))))
62 elnnuz 12274 . . . . . . . . 9 (𝑛 ∈ ℕ ↔ 𝑛 ∈ (ℤ‘1))
63 fzsuc 12946 . . . . . . . . 9 (𝑛 ∈ (ℤ‘1) → (1...(𝑛 + 1)) = ((1...𝑛) ∪ {(𝑛 + 1)}))
6462, 63sylbi 219 . . . . . . . 8 (𝑛 ∈ ℕ → (1...(𝑛 + 1)) = ((1...𝑛) ∪ {(𝑛 + 1)}))
6564raleqdv 3414 . . . . . . 7 (𝑛 ∈ ℕ → (∀𝑏 ∈ (1...(𝑛 + 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ ∀𝑏 ∈ ((1...𝑛) ∪ {(𝑛 + 1)})∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
66 ralunb 4165 . . . . . . 7 (∀𝑏 ∈ ((1...𝑛) ∪ {(𝑛 + 1)})∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ (∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ∧ ∀𝑏 ∈ {(𝑛 + 1)}∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
6765, 66syl6bb 289 . . . . . 6 (𝑛 ∈ ℕ → (∀𝑏 ∈ (1...(𝑛 + 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ↔ (∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) ∧ ∀𝑏 ∈ {(𝑛 + 1)}∀𝑎𝑌 (𝑏𝑎𝑏𝑆))))
6861, 67sylibrd 261 . . . . 5 (𝑛 ∈ ℕ → (∀𝑏 ∈ (1...𝑛)∀𝑎𝑌 (𝑏𝑎𝑏𝑆) → ∀𝑏 ∈ (1...(𝑛 + 1))∀𝑎𝑌 (𝑏𝑎𝑏𝑆)))
696, 8, 10, 12, 31, 68nnind 11648 . . . 4 (𝐵 ∈ ℕ → ∀𝑏 ∈ (1...𝐵)∀𝑎𝑌 (𝑏𝑎𝑏𝑆))
70 elfz1end 12929 . . . . 5 (𝐵 ∈ ℕ ↔ 𝐵 ∈ (1...𝐵))
7170biimpi 218 . . . 4 (𝐵 ∈ ℕ → 𝐵 ∈ (1...𝐵))
724, 69, 71rspcdva 3623 . . 3 (𝐵 ∈ ℕ → ∀𝑎𝑌 (𝐵𝑎𝐵𝑆))
73 breq2 5061 . . . . 5 (𝑎 = 𝐴 → (𝐵𝑎𝐵𝐴))
7473imbi1d 344 . . . 4 (𝑎 = 𝐴 → ((𝐵𝑎𝐵𝑆) ↔ (𝐵𝐴𝐵𝑆)))
7574rspcv 3616 . . 3 (𝐴𝑌 → (∀𝑎𝑌 (𝐵𝑎𝐵𝑆) → (𝐵𝐴𝐵𝑆)))
7672, 75syl5 34 . 2 (𝐴𝑌 → (𝐵 ∈ ℕ → (𝐵𝐴𝐵𝑆)))
77763imp 1106 1 ((𝐴𝑌𝐵 ∈ ℕ ∧ 𝐵𝐴) → 𝐵𝑆)
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 398  w3a 1082   = wceq 1531  wcel 2108  {cab 2797  wral 3136  wrex 3137  cun 3932  {csn 4559   class class class wbr 5057  cmpt 5137  ran crn 5549  cfv 6348  (class class class)co 7148  cc 10527  1c1 10530   + caddc 10532  cmin 10862  cn 11630  2c2 11684  cz 11973  cuz 12235  ...cfz 12884  cexp 13421  abscabs 14585  cdvds 15599   gcd cgcd 15835  ℤ[i]cgz 16257
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1790  ax-4 1804  ax-5 1905  ax-6 1964  ax-7 2009  ax-8 2110  ax-9 2118  ax-10 2139  ax-11 2154  ax-12 2170  ax-ext 2791  ax-sep 5194  ax-nul 5201  ax-pow 5257  ax-pr 5320  ax-un 7453  ax-cnex 10585  ax-resscn 10586  ax-1cn 10587  ax-icn 10588  ax-addcl 10589  ax-addrcl 10590  ax-mulcl 10591  ax-mulrcl 10592  ax-mulcom 10593  ax-addass 10594  ax-mulass 10595  ax-distr 10596  ax-i2m1 10597  ax-1ne0 10598  ax-1rid 10599  ax-rnegex 10600  ax-rrecex 10601  ax-cnre 10602  ax-pre-lttri 10603  ax-pre-lttrn 10604  ax-pre-ltadd 10605  ax-pre-mulgt0 10606  ax-pre-sup 10607
This theorem depends on definitions:  df-bi 209  df-an 399  df-or 844  df-3or 1083  df-3an 1084  df-tru 1534  df-ex 1775  df-nf 1779  df-sb 2064  df-mo 2616  df-eu 2648  df-clab 2798  df-cleq 2812  df-clel 2891  df-nfc 2961  df-ne 3015  df-nel 3122  df-ral 3141  df-rex 3142  df-reu 3143  df-rmo 3144  df-rab 3145  df-v 3495  df-sbc 3771  df-csb 3882  df-dif 3937  df-un 3939  df-in 3941  df-ss 3950  df-pss 3952  df-nul 4290  df-if 4466  df-pw 4539  df-sn 4560  df-pr 4562  df-tp 4564  df-op 4566  df-uni 4831  df-iun 4912  df-br 5058  df-opab 5120  df-mpt 5138  df-tr 5164  df-id 5453  df-eprel 5458  df-po 5467  df-so 5468  df-fr 5507  df-we 5509  df-xp 5554  df-rel 5555  df-cnv 5556  df-co 5557  df-dm 5558  df-rn 5559  df-res 5560  df-ima 5561  df-pred 6141  df-ord 6187  df-on 6188  df-lim 6189  df-suc 6190  df-iota 6307  df-fun 6350  df-fn 6351  df-f 6352  df-f1 6353  df-fo 6354  df-f1o 6355  df-fv 6356  df-riota 7106  df-ov 7151  df-oprab 7152  df-mpo 7153  df-om 7573  df-1st 7681  df-2nd 7682  df-wrecs 7939  df-recs 8000  df-rdg 8038  df-1o 8094  df-2o 8095  df-er 8281  df-en 8502  df-dom 8503  df-sdom 8504  df-fin 8505  df-sup 8898  df-inf 8899  df-pnf 10669  df-mnf 10670  df-xr 10671  df-ltxr 10672  df-le 10673  df-sub 10864  df-neg 10865  df-div 11290  df-nn 11631  df-2 11692  df-3 11693  df-n0 11890  df-z 11974  df-uz 12236  df-rp 12382  df-fz 12885  df-fl 13154  df-mod 13230  df-seq 13362  df-exp 13422  df-cj 14450  df-re 14451  df-im 14452  df-sqrt 14586  df-abs 14587  df-dvds 15600  df-gcd 15836  df-prm 16008  df-gz 16258
This theorem is referenced by:  2sqlem11  25997
  Copyright terms: Public domain W3C validator