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

Theorem 4sqlem19 16354
Description: Lemma for 4sq 16355. The proof is by strong induction - we show that if all the integers less than 𝑘 are in 𝑆, then 𝑘 is as well. In this part of the proof we do the induction argument and dispense with all the cases except the odd prime case, which is sent to 4sqlem18 16353. If 𝑘 is 0, 1, 2, we show 𝑘𝑆 directly; otherwise if 𝑘 is composite, 𝑘 is the product of two numbers less than it (and hence in 𝑆 by assumption), so by mul4sq 16345 𝑘𝑆. (Contributed by Mario Carneiro, 14-Jul-2014.) (Revised by Mario Carneiro, 20-Jun-2015.)
Hypothesis
Ref Expression
4sq.1 𝑆 = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
Assertion
Ref Expression
4sqlem19 0 = 𝑆
Distinct variable groups:   𝑤,𝑛,𝑥,𝑦,𝑧   𝑆,𝑛
Allowed substitution hints:   𝑆(𝑥,𝑦,𝑧,𝑤)

Proof of Theorem 4sqlem19
Dummy variables 𝑗 𝑘 𝑖 𝑚 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 elnn0 11936 . . . 4 (𝑘 ∈ ℕ0 ↔ (𝑘 ∈ ℕ ∨ 𝑘 = 0))
2 eleq1 2839 . . . . . 6 (𝑗 = 1 → (𝑗𝑆 ↔ 1 ∈ 𝑆))
3 eleq1 2839 . . . . . 6 (𝑗 = 𝑚 → (𝑗𝑆𝑚𝑆))
4 eleq1 2839 . . . . . 6 (𝑗 = 𝑖 → (𝑗𝑆𝑖𝑆))
5 eleq1 2839 . . . . . 6 (𝑗 = (𝑚 · 𝑖) → (𝑗𝑆 ↔ (𝑚 · 𝑖) ∈ 𝑆))
6 eleq1 2839 . . . . . 6 (𝑗 = 𝑘 → (𝑗𝑆𝑘𝑆))
7 abs1 14705 . . . . . . . . . . 11 (abs‘1) = 1
87oveq1i 7160 . . . . . . . . . 10 ((abs‘1)↑2) = (1↑2)
9 sq1 13608 . . . . . . . . . 10 (1↑2) = 1
108, 9eqtri 2781 . . . . . . . . 9 ((abs‘1)↑2) = 1
11 abs0 14693 . . . . . . . . . . 11 (abs‘0) = 0
1211oveq1i 7160 . . . . . . . . . 10 ((abs‘0)↑2) = (0↑2)
13 sq0 13605 . . . . . . . . . 10 (0↑2) = 0
1412, 13eqtri 2781 . . . . . . . . 9 ((abs‘0)↑2) = 0
1510, 14oveq12i 7162 . . . . . . . 8 (((abs‘1)↑2) + ((abs‘0)↑2)) = (1 + 0)
16 1p0e1 11798 . . . . . . . 8 (1 + 0) = 1
1715, 16eqtri 2781 . . . . . . 7 (((abs‘1)↑2) + ((abs‘0)↑2)) = 1
18 1z 12051 . . . . . . . . 9 1 ∈ ℤ
19 zgz 16324 . . . . . . . . 9 (1 ∈ ℤ → 1 ∈ ℤ[i])
2018, 19ax-mp 5 . . . . . . . 8 1 ∈ ℤ[i]
21 0z 12031 . . . . . . . . 9 0 ∈ ℤ
22 zgz 16324 . . . . . . . . 9 (0 ∈ ℤ → 0 ∈ ℤ[i])
2321, 22ax-mp 5 . . . . . . . 8 0 ∈ ℤ[i]
24 4sq.1 . . . . . . . . 9 𝑆 = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
25244sqlem4a 16342 . . . . . . . 8 ((1 ∈ ℤ[i] ∧ 0 ∈ ℤ[i]) → (((abs‘1)↑2) + ((abs‘0)↑2)) ∈ 𝑆)
2620, 23, 25mp2an 691 . . . . . . 7 (((abs‘1)↑2) + ((abs‘0)↑2)) ∈ 𝑆
2717, 26eqeltrri 2849 . . . . . 6 1 ∈ 𝑆
28 eleq1 2839 . . . . . . 7 (𝑗 = 2 → (𝑗𝑆 ↔ 2 ∈ 𝑆))
29 eldifsn 4677 . . . . . . . . 9 (𝑗 ∈ (ℙ ∖ {2}) ↔ (𝑗 ∈ ℙ ∧ 𝑗 ≠ 2))
30 oddprm 16202 . . . . . . . . . . 11 (𝑗 ∈ (ℙ ∖ {2}) → ((𝑗 − 1) / 2) ∈ ℕ)
3130adantr 484 . . . . . . . . . 10 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → ((𝑗 − 1) / 2) ∈ ℕ)
32 eldifi 4032 . . . . . . . . . . . . . . . 16 (𝑗 ∈ (ℙ ∖ {2}) → 𝑗 ∈ ℙ)
3332adantr 484 . . . . . . . . . . . . . . 15 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 𝑗 ∈ ℙ)
34 prmnn 16070 . . . . . . . . . . . . . . 15 (𝑗 ∈ ℙ → 𝑗 ∈ ℕ)
35 nncn 11682 . . . . . . . . . . . . . . 15 (𝑗 ∈ ℕ → 𝑗 ∈ ℂ)
3633, 34, 353syl 18 . . . . . . . . . . . . . 14 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 𝑗 ∈ ℂ)
37 ax-1cn 10633 . . . . . . . . . . . . . 14 1 ∈ ℂ
38 subcl 10923 . . . . . . . . . . . . . 14 ((𝑗 ∈ ℂ ∧ 1 ∈ ℂ) → (𝑗 − 1) ∈ ℂ)
3936, 37, 38sylancl 589 . . . . . . . . . . . . 13 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (𝑗 − 1) ∈ ℂ)
40 2cnd 11752 . . . . . . . . . . . . 13 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 2 ∈ ℂ)
41 2ne0 11778 . . . . . . . . . . . . . 14 2 ≠ 0
4241a1i 11 . . . . . . . . . . . . 13 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 2 ≠ 0)
4339, 40, 42divcan2d 11456 . . . . . . . . . . . 12 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (2 · ((𝑗 − 1) / 2)) = (𝑗 − 1))
4443oveq1d 7165 . . . . . . . . . . 11 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → ((2 · ((𝑗 − 1) / 2)) + 1) = ((𝑗 − 1) + 1))
45 npcan 10933 . . . . . . . . . . . 12 ((𝑗 ∈ ℂ ∧ 1 ∈ ℂ) → ((𝑗 − 1) + 1) = 𝑗)
4636, 37, 45sylancl 589 . . . . . . . . . . 11 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → ((𝑗 − 1) + 1) = 𝑗)
4744, 46eqtr2d 2794 . . . . . . . . . 10 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 𝑗 = ((2 · ((𝑗 − 1) / 2)) + 1))
4843oveq2d 7166 . . . . . . . . . . . 12 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (0...(2 · ((𝑗 − 1) / 2))) = (0...(𝑗 − 1)))
49 nnm1nn0 11975 . . . . . . . . . . . . . . 15 (𝑗 ∈ ℕ → (𝑗 − 1) ∈ ℕ0)
5033, 34, 493syl 18 . . . . . . . . . . . . . 14 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (𝑗 − 1) ∈ ℕ0)
51 elnn0uz 12323 . . . . . . . . . . . . . 14 ((𝑗 − 1) ∈ ℕ0 ↔ (𝑗 − 1) ∈ (ℤ‘0))
5250, 51sylib 221 . . . . . . . . . . . . 13 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (𝑗 − 1) ∈ (ℤ‘0))
53 eluzfz1 12963 . . . . . . . . . . . . 13 ((𝑗 − 1) ∈ (ℤ‘0) → 0 ∈ (0...(𝑗 − 1)))
54 fzsplit 12982 . . . . . . . . . . . . 13 (0 ∈ (0...(𝑗 − 1)) → (0...(𝑗 − 1)) = ((0...0) ∪ ((0 + 1)...(𝑗 − 1))))
5552, 53, 543syl 18 . . . . . . . . . . . 12 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (0...(𝑗 − 1)) = ((0...0) ∪ ((0 + 1)...(𝑗 − 1))))
5648, 55eqtrd 2793 . . . . . . . . . . 11 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (0...(2 · ((𝑗 − 1) / 2))) = ((0...0) ∪ ((0 + 1)...(𝑗 − 1))))
57 fz0sn 13056 . . . . . . . . . . . . . 14 (0...0) = {0}
5814, 14oveq12i 7162 . . . . . . . . . . . . . . . . 17 (((abs‘0)↑2) + ((abs‘0)↑2)) = (0 + 0)
59 00id 10853 . . . . . . . . . . . . . . . . 17 (0 + 0) = 0
6058, 59eqtri 2781 . . . . . . . . . . . . . . . 16 (((abs‘0)↑2) + ((abs‘0)↑2)) = 0
61244sqlem4a 16342 . . . . . . . . . . . . . . . . 17 ((0 ∈ ℤ[i] ∧ 0 ∈ ℤ[i]) → (((abs‘0)↑2) + ((abs‘0)↑2)) ∈ 𝑆)
6223, 23, 61mp2an 691 . . . . . . . . . . . . . . . 16 (((abs‘0)↑2) + ((abs‘0)↑2)) ∈ 𝑆
6360, 62eqeltrri 2849 . . . . . . . . . . . . . . 15 0 ∈ 𝑆
64 snssi 4698 . . . . . . . . . . . . . . 15 (0 ∈ 𝑆 → {0} ⊆ 𝑆)
6563, 64ax-mp 5 . . . . . . . . . . . . . 14 {0} ⊆ 𝑆
6657, 65eqsstri 3926 . . . . . . . . . . . . 13 (0...0) ⊆ 𝑆
6766a1i 11 . . . . . . . . . . . 12 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (0...0) ⊆ 𝑆)
68 0p1e1 11796 . . . . . . . . . . . . . 14 (0 + 1) = 1
6968oveq1i 7160 . . . . . . . . . . . . 13 ((0 + 1)...(𝑗 − 1)) = (1...(𝑗 − 1))
70 simpr 488 . . . . . . . . . . . . . 14 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆)
71 dfss3 3880 . . . . . . . . . . . . . 14 ((1...(𝑗 − 1)) ⊆ 𝑆 ↔ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆)
7270, 71sylibr 237 . . . . . . . . . . . . 13 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (1...(𝑗 − 1)) ⊆ 𝑆)
7369, 72eqsstrid 3940 . . . . . . . . . . . 12 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → ((0 + 1)...(𝑗 − 1)) ⊆ 𝑆)
7467, 73unssd 4091 . . . . . . . . . . 11 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → ((0...0) ∪ ((0 + 1)...(𝑗 − 1))) ⊆ 𝑆)
7556, 74eqsstrd 3930 . . . . . . . . . 10 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → (0...(2 · ((𝑗 − 1) / 2))) ⊆ 𝑆)
76 oveq1 7157 . . . . . . . . . . . 12 (𝑘 = 𝑖 → (𝑘 · 𝑗) = (𝑖 · 𝑗))
7776eleq1d 2836 . . . . . . . . . . 11 (𝑘 = 𝑖 → ((𝑘 · 𝑗) ∈ 𝑆 ↔ (𝑖 · 𝑗) ∈ 𝑆))
7877cbvrabv 3404 . . . . . . . . . 10 {𝑘 ∈ ℕ ∣ (𝑘 · 𝑗) ∈ 𝑆} = {𝑖 ∈ ℕ ∣ (𝑖 · 𝑗) ∈ 𝑆}
79 eqid 2758 . . . . . . . . . 10 inf({𝑘 ∈ ℕ ∣ (𝑘 · 𝑗) ∈ 𝑆}, ℝ, < ) = inf({𝑘 ∈ ℕ ∣ (𝑘 · 𝑗) ∈ 𝑆}, ℝ, < )
8024, 31, 47, 33, 75, 78, 794sqlem18 16353 . . . . . . . . 9 ((𝑗 ∈ (ℙ ∖ {2}) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 𝑗𝑆)
8129, 80sylanbr 585 . . . . . . . 8 (((𝑗 ∈ ℙ ∧ 𝑗 ≠ 2) ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 𝑗𝑆)
8281an32s 651 . . . . . . 7 (((𝑗 ∈ ℙ ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) ∧ 𝑗 ≠ 2) → 𝑗𝑆)
8310, 10oveq12i 7162 . . . . . . . . . 10 (((abs‘1)↑2) + ((abs‘1)↑2)) = (1 + 1)
84 df-2 11737 . . . . . . . . . 10 2 = (1 + 1)
8583, 84eqtr4i 2784 . . . . . . . . 9 (((abs‘1)↑2) + ((abs‘1)↑2)) = 2
86244sqlem4a 16342 . . . . . . . . . 10 ((1 ∈ ℤ[i] ∧ 1 ∈ ℤ[i]) → (((abs‘1)↑2) + ((abs‘1)↑2)) ∈ 𝑆)
8720, 20, 86mp2an 691 . . . . . . . . 9 (((abs‘1)↑2) + ((abs‘1)↑2)) ∈ 𝑆
8885, 87eqeltrri 2849 . . . . . . . 8 2 ∈ 𝑆
8988a1i 11 . . . . . . 7 ((𝑗 ∈ ℙ ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 2 ∈ 𝑆)
9028, 82, 89pm2.61ne 3036 . . . . . 6 ((𝑗 ∈ ℙ ∧ ∀𝑚 ∈ (1...(𝑗 − 1))𝑚𝑆) → 𝑗𝑆)
9124mul4sq 16345 . . . . . . 7 ((𝑚𝑆𝑖𝑆) → (𝑚 · 𝑖) ∈ 𝑆)
9291a1i 11 . . . . . 6 ((𝑚 ∈ (ℤ‘2) ∧ 𝑖 ∈ (ℤ‘2)) → ((𝑚𝑆𝑖𝑆) → (𝑚 · 𝑖) ∈ 𝑆))
932, 3, 4, 5, 6, 27, 90, 92prmind2 16081 . . . . 5 (𝑘 ∈ ℕ → 𝑘𝑆)
94 id 22 . . . . . 6 (𝑘 = 0 → 𝑘 = 0)
9594, 63eqeltrdi 2860 . . . . 5 (𝑘 = 0 → 𝑘𝑆)
9693, 95jaoi 854 . . . 4 ((𝑘 ∈ ℕ ∨ 𝑘 = 0) → 𝑘𝑆)
971, 96sylbi 220 . . 3 (𝑘 ∈ ℕ0𝑘𝑆)
9897ssriv 3896 . 2 0𝑆
99244sqlem1 16339 . 2 𝑆 ⊆ ℕ0
10098, 99eqssi 3908 1 0 = 𝑆
Colors of variables: wff setvar class
Syntax hints:  wi 4  wa 399  wo 844   = wceq 1538  wcel 2111  {cab 2735  wne 2951  wral 3070  wrex 3071  {crab 3074  cdif 3855  cun 3856  wss 3858  {csn 4522  cfv 6335  (class class class)co 7150  infcinf 8938  cc 10573  cr 10574  0cc0 10575  1c1 10576   + caddc 10578   · cmul 10580   < clt 10713  cmin 10908   / cdiv 11335  cn 11674  2c2 11729  0cn0 11934  cz 12020  cuz 12282  ...cfz 12939  cexp 13479  abscabs 14641  cprime 16067  ℤ[i]cgz 16320
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1797  ax-4 1811  ax-5 1911  ax-6 1970  ax-7 2015  ax-8 2113  ax-9 2121  ax-10 2142  ax-11 2158  ax-12 2175  ax-ext 2729  ax-rep 5156  ax-sep 5169  ax-nul 5176  ax-pow 5234  ax-pr 5298  ax-un 7459  ax-cnex 10631  ax-resscn 10632  ax-1cn 10633  ax-icn 10634  ax-addcl 10635  ax-addrcl 10636  ax-mulcl 10637  ax-mulrcl 10638  ax-mulcom 10639  ax-addass 10640  ax-mulass 10641  ax-distr 10642  ax-i2m1 10643  ax-1ne0 10644  ax-1rid 10645  ax-rnegex 10646  ax-rrecex 10647  ax-cnre 10648  ax-pre-lttri 10649  ax-pre-lttrn 10650  ax-pre-ltadd 10651  ax-pre-mulgt0 10652  ax-pre-sup 10653
This theorem depends on definitions:  df-bi 210  df-an 400  df-or 845  df-3or 1085  df-3an 1086  df-tru 1541  df-fal 1551  df-ex 1782  df-nf 1786  df-sb 2070  df-mo 2557  df-eu 2588  df-clab 2736  df-cleq 2750  df-clel 2830  df-nfc 2901  df-ne 2952  df-nel 3056  df-ral 3075  df-rex 3076  df-reu 3077  df-rmo 3078  df-rab 3079  df-v 3411  df-sbc 3697  df-csb 3806  df-dif 3861  df-un 3863  df-in 3865  df-ss 3875  df-pss 3877  df-nul 4226  df-if 4421  df-pw 4496  df-sn 4523  df-pr 4525  df-tp 4527  df-op 4529  df-uni 4799  df-int 4839  df-iun 4885  df-br 5033  df-opab 5095  df-mpt 5113  df-tr 5139  df-id 5430  df-eprel 5435  df-po 5443  df-so 5444  df-fr 5483  df-we 5485  df-xp 5530  df-rel 5531  df-cnv 5532  df-co 5533  df-dm 5534  df-rn 5535  df-res 5536  df-ima 5537  df-pred 6126  df-ord 6172  df-on 6173  df-lim 6174  df-suc 6175  df-iota 6294  df-fun 6337  df-fn 6338  df-f 6339  df-f1 6340  df-fo 6341  df-f1o 6342  df-fv 6343  df-riota 7108  df-ov 7153  df-oprab 7154  df-mpo 7155  df-om 7580  df-1st 7693  df-2nd 7694  df-wrecs 7957  df-recs 8018  df-rdg 8056  df-1o 8112  df-2o 8113  df-oadd 8116  df-er 8299  df-en 8528  df-dom 8529  df-sdom 8530  df-fin 8531  df-sup 8939  df-inf 8940  df-dju 9363  df-card 9401  df-pnf 10715  df-mnf 10716  df-xr 10717  df-ltxr 10718  df-le 10719  df-sub 10910  df-neg 10911  df-div 11336  df-nn 11675  df-2 11737  df-3 11738  df-4 11739  df-n0 11935  df-xnn0 12007  df-z 12021  df-uz 12283  df-rp 12431  df-fz 12940  df-fl 13211  df-mod 13287  df-seq 13419  df-exp 13480  df-hash 13741  df-cj 14506  df-re 14507  df-im 14508  df-sqrt 14642  df-abs 14643  df-dvds 15656  df-gcd 15894  df-prm 16068  df-gz 16321
This theorem is referenced by:  4sq  16355
  Copyright terms: Public domain W3C validator