ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  4sq GIF version

Theorem 4sq 12542
Description: Lagrange's four-square theorem, or Bachet's conjecture: every nonnegative integer is expressible as a sum of four squares. This is Metamath 100 proof #19. (Contributed by Mario Carneiro, 16-Jul-2014.)
Assertion
Ref Expression
4sq (𝐴 ∈ ℕ0 ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
Distinct variable group:   𝑎,𝑏,𝑐,𝑑,𝐴

Proof of Theorem 4sq
Dummy variables 𝑚 𝑛 𝑤 𝑥 𝑦 𝑧 are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 eqeq1 2200 . . . . . 6 (𝑚 = 𝑛 → (𝑚 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
212rexbidv 2519 . . . . 5 (𝑚 = 𝑛 → (∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑚 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
322rexbidv 2519 . . . 4 (𝑚 = 𝑛 → (∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑚 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2))) ↔ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))))
43cbvabv 2318 . . 3 {𝑚 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑚 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))} = {𝑛 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑛 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
544sqlem19 12541 . 2 0 = {𝑚 ∣ ∃𝑥 ∈ ℤ ∃𝑦 ∈ ℤ ∃𝑧 ∈ ℤ ∃𝑤 ∈ ℤ 𝑚 = (((𝑥↑2) + (𝑦↑2)) + ((𝑧↑2) + (𝑤↑2)))}
654sqlem2 12521 1 (𝐴 ∈ ℕ0 ↔ ∃𝑎 ∈ ℤ ∃𝑏 ∈ ℤ ∃𝑐 ∈ ℤ ∃𝑑 ∈ ℤ 𝐴 = (((𝑎↑2) + (𝑏↑2)) + ((𝑐↑2) + (𝑑↑2))))
Colors of variables: wff set class
Syntax hints:  wb 105   = wceq 1364  wcel 2164  {cab 2179  wrex 2473  (class class class)co 5914   + caddc 7869  2c2 9027  0cn0 9234  cz 9311  cexp 10603
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 106  ax-ia2 107  ax-ia3 108  ax-in1 615  ax-in2 616  ax-io 710  ax-5 1458  ax-7 1459  ax-gen 1460  ax-ie1 1504  ax-ie2 1505  ax-8 1515  ax-10 1516  ax-11 1517  ax-i12 1518  ax-bndl 1520  ax-4 1521  ax-17 1537  ax-i9 1541  ax-ial 1545  ax-i5r 1546  ax-13 2166  ax-14 2167  ax-ext 2175  ax-coll 4144  ax-sep 4147  ax-nul 4155  ax-pow 4203  ax-pr 4238  ax-un 4462  ax-setind 4567  ax-iinf 4618  ax-cnex 7957  ax-resscn 7958  ax-1cn 7959  ax-1re 7960  ax-icn 7961  ax-addcl 7962  ax-addrcl 7963  ax-mulcl 7964  ax-mulrcl 7965  ax-addcom 7966  ax-mulcom 7967  ax-addass 7968  ax-mulass 7969  ax-distr 7970  ax-i2m1 7971  ax-0lt1 7972  ax-1rid 7973  ax-0id 7974  ax-rnegex 7975  ax-precex 7976  ax-cnre 7977  ax-pre-ltirr 7978  ax-pre-ltwlin 7979  ax-pre-lttrn 7980  ax-pre-apti 7981  ax-pre-ltadd 7982  ax-pre-mulgt0 7983  ax-pre-mulext 7984  ax-arch 7985  ax-caucvg 7986
This theorem depends on definitions:  df-bi 117  df-stab 832  df-dc 836  df-3or 981  df-3an 982  df-tru 1367  df-fal 1370  df-xor 1387  df-nf 1472  df-sb 1774  df-eu 2045  df-mo 2046  df-clab 2180  df-cleq 2186  df-clel 2189  df-nfc 2325  df-ne 2365  df-nel 2460  df-ral 2477  df-rex 2478  df-reu 2479  df-rmo 2480  df-rab 2481  df-v 2762  df-sbc 2986  df-csb 3081  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-nul 3447  df-if 3558  df-pw 3603  df-sn 3624  df-pr 3625  df-op 3627  df-uni 3836  df-int 3871  df-iun 3914  df-br 4030  df-opab 4091  df-mpt 4092  df-tr 4128  df-id 4322  df-po 4325  df-iso 4326  df-iord 4395  df-on 4397  df-ilim 4398  df-suc 4400  df-iom 4621  df-xp 4663  df-rel 4664  df-cnv 4665  df-co 4666  df-dm 4667  df-rn 4668  df-res 4669  df-ima 4670  df-iota 5211  df-fun 5252  df-fn 5253  df-f 5254  df-f1 5255  df-fo 5256  df-f1o 5257  df-fv 5258  df-isom 5259  df-riota 5869  df-ov 5917  df-oprab 5918  df-mpo 5919  df-1st 6188  df-2nd 6189  df-recs 6353  df-irdg 6418  df-frec 6439  df-1o 6464  df-2o 6465  df-oadd 6468  df-er 6582  df-en 6790  df-dom 6791  df-fin 6792  df-sup 7037  df-inf 7038  df-pnf 8050  df-mnf 8051  df-xr 8052  df-ltxr 8053  df-le 8054  df-sub 8186  df-neg 8187  df-reap 8588  df-ap 8595  df-div 8686  df-inn 8977  df-2 9035  df-3 9036  df-4 9037  df-n0 9235  df-z 9312  df-uz 9587  df-q 9679  df-rp 9714  df-fz 10069  df-fzo 10203  df-fl 10333  df-mod 10388  df-seqfrec 10513  df-exp 10604  df-ihash 10841  df-cj 10980  df-re 10981  df-im 10982  df-rsqrt 11136  df-abs 11137  df-dvds 11925  df-gcd 12074  df-prm 12240  df-gz 12502
This theorem is referenced by: (None)
  Copyright terms: Public domain W3C validator