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

Theorem 2sqcoprm 26820
Description: If the sum of two squares is prime, the two original numbers are coprime. (Contributed by Thierry Arnoux, 2-Feb-2020.)
Hypotheses
Ref Expression
2sqcoprm.1 (𝜑𝑃 ∈ ℙ)
2sqcoprm.2 (𝜑𝐴 ∈ ℤ)
2sqcoprm.3 (𝜑𝐵 ∈ ℤ)
2sqcoprm.4 (𝜑 → ((𝐴↑2) + (𝐵↑2)) = 𝑃)
Assertion
Ref Expression
2sqcoprm (𝜑 → (𝐴 gcd 𝐵) = 1)

Proof of Theorem 2sqcoprm
StepHypRef Expression
1 2sqcoprm.1 . . 3 (𝜑𝑃 ∈ ℙ)
2 2sqcoprm.2 . . 3 (𝜑𝐴 ∈ ℤ)
3 2sqcoprm.3 . . 3 (𝜑𝐵 ∈ ℤ)
4 2sqcoprm.4 . . 3 (𝜑 → ((𝐴↑2) + (𝐵↑2)) = 𝑃)
51, 2, 3, 42sqn0 26819 . 2 (𝜑𝐴 ≠ 0)
62, 3gcdcld 16399 . . . 4 (𝜑 → (𝐴 gcd 𝐵) ∈ ℕ0)
76adantr 481 . . 3 ((𝜑𝐴 ≠ 0) → (𝐴 gcd 𝐵) ∈ ℕ0)
82adantr 481 . . . . . . . 8 ((𝜑𝐴 ≠ 0) → 𝐴 ∈ ℤ)
93adantr 481 . . . . . . . 8 ((𝜑𝐴 ≠ 0) → 𝐵 ∈ ℤ)
10 simpr 485 . . . . . . . . . 10 ((𝜑𝐴 ≠ 0) → 𝐴 ≠ 0)
1110neneqd 2944 . . . . . . . . 9 ((𝜑𝐴 ≠ 0) → ¬ 𝐴 = 0)
1211intnanrd 490 . . . . . . . 8 ((𝜑𝐴 ≠ 0) → ¬ (𝐴 = 0 ∧ 𝐵 = 0))
13 gcdn0cl 16393 . . . . . . . 8 (((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) ∧ ¬ (𝐴 = 0 ∧ 𝐵 = 0)) → (𝐴 gcd 𝐵) ∈ ℕ)
148, 9, 12, 13syl21anc 836 . . . . . . 7 ((𝜑𝐴 ≠ 0) → (𝐴 gcd 𝐵) ∈ ℕ)
1514nnsqcld 14157 . . . . . 6 ((𝜑𝐴 ≠ 0) → ((𝐴 gcd 𝐵)↑2) ∈ ℕ)
166nn0zd 12534 . . . . . . . . . . 11 (𝜑 → (𝐴 gcd 𝐵) ∈ ℤ)
17 sqnprm 16589 . . . . . . . . . . 11 ((𝐴 gcd 𝐵) ∈ ℤ → ¬ ((𝐴 gcd 𝐵)↑2) ∈ ℙ)
1816, 17syl 17 . . . . . . . . . 10 (𝜑 → ¬ ((𝐴 gcd 𝐵)↑2) ∈ ℙ)
19 zsqcl 14044 . . . . . . . . . . . . . . . 16 ((𝐴 gcd 𝐵) ∈ ℤ → ((𝐴 gcd 𝐵)↑2) ∈ ℤ)
2016, 19syl 17 . . . . . . . . . . . . . . 15 (𝜑 → ((𝐴 gcd 𝐵)↑2) ∈ ℤ)
21 zsqcl 14044 . . . . . . . . . . . . . . . 16 (𝐴 ∈ ℤ → (𝐴↑2) ∈ ℤ)
222, 21syl 17 . . . . . . . . . . . . . . 15 (𝜑 → (𝐴↑2) ∈ ℤ)
23 zsqcl 14044 . . . . . . . . . . . . . . . 16 (𝐵 ∈ ℤ → (𝐵↑2) ∈ ℤ)
243, 23syl 17 . . . . . . . . . . . . . . 15 (𝜑 → (𝐵↑2) ∈ ℤ)
25 gcddvds 16394 . . . . . . . . . . . . . . . . . 18 ((𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) ∥ 𝐴 ∧ (𝐴 gcd 𝐵) ∥ 𝐵))
262, 3, 25syl2anc 584 . . . . . . . . . . . . . . . . 17 (𝜑 → ((𝐴 gcd 𝐵) ∥ 𝐴 ∧ (𝐴 gcd 𝐵) ∥ 𝐵))
2726simpld 495 . . . . . . . . . . . . . . . 16 (𝜑 → (𝐴 gcd 𝐵) ∥ 𝐴)
28 dvdssqim 16446 . . . . . . . . . . . . . . . . 17 (((𝐴 gcd 𝐵) ∈ ℤ ∧ 𝐴 ∈ ℤ) → ((𝐴 gcd 𝐵) ∥ 𝐴 → ((𝐴 gcd 𝐵)↑2) ∥ (𝐴↑2)))
2928imp 407 . . . . . . . . . . . . . . . 16 ((((𝐴 gcd 𝐵) ∈ ℤ ∧ 𝐴 ∈ ℤ) ∧ (𝐴 gcd 𝐵) ∥ 𝐴) → ((𝐴 gcd 𝐵)↑2) ∥ (𝐴↑2))
3016, 2, 27, 29syl21anc 836 . . . . . . . . . . . . . . 15 (𝜑 → ((𝐴 gcd 𝐵)↑2) ∥ (𝐴↑2))
3126simprd 496 . . . . . . . . . . . . . . . 16 (𝜑 → (𝐴 gcd 𝐵) ∥ 𝐵)
32 dvdssqim 16446 . . . . . . . . . . . . . . . . 17 (((𝐴 gcd 𝐵) ∈ ℤ ∧ 𝐵 ∈ ℤ) → ((𝐴 gcd 𝐵) ∥ 𝐵 → ((𝐴 gcd 𝐵)↑2) ∥ (𝐵↑2)))
3332imp 407 . . . . . . . . . . . . . . . 16 ((((𝐴 gcd 𝐵) ∈ ℤ ∧ 𝐵 ∈ ℤ) ∧ (𝐴 gcd 𝐵) ∥ 𝐵) → ((𝐴 gcd 𝐵)↑2) ∥ (𝐵↑2))
3416, 3, 31, 33syl21anc 836 . . . . . . . . . . . . . . 15 (𝜑 → ((𝐴 gcd 𝐵)↑2) ∥ (𝐵↑2))
3520, 22, 24, 30, 34dvds2addd 16185 . . . . . . . . . . . . . 14 (𝜑 → ((𝐴 gcd 𝐵)↑2) ∥ ((𝐴↑2) + (𝐵↑2)))
3635, 4breqtrd 5136 . . . . . . . . . . . . 13 (𝜑 → ((𝐴 gcd 𝐵)↑2) ∥ 𝑃)
3736adantr 481 . . . . . . . . . . . 12 ((𝜑 ∧ ((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2)) → ((𝐴 gcd 𝐵)↑2) ∥ 𝑃)
38 simpr 485 . . . . . . . . . . . . 13 ((𝜑 ∧ ((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2)) → ((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2))
391adantr 481 . . . . . . . . . . . . 13 ((𝜑 ∧ ((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2)) → 𝑃 ∈ ℙ)
40 dvdsprm 16590 . . . . . . . . . . . . 13 ((((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2) ∧ 𝑃 ∈ ℙ) → (((𝐴 gcd 𝐵)↑2) ∥ 𝑃 ↔ ((𝐴 gcd 𝐵)↑2) = 𝑃))
4138, 39, 40syl2anc 584 . . . . . . . . . . . 12 ((𝜑 ∧ ((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2)) → (((𝐴 gcd 𝐵)↑2) ∥ 𝑃 ↔ ((𝐴 gcd 𝐵)↑2) = 𝑃))
4237, 41mpbid 231 . . . . . . . . . . 11 ((𝜑 ∧ ((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2)) → ((𝐴 gcd 𝐵)↑2) = 𝑃)
4342, 39eqeltrd 2832 . . . . . . . . . 10 ((𝜑 ∧ ((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2)) → ((𝐴 gcd 𝐵)↑2) ∈ ℙ)
4418, 43mtand 814 . . . . . . . . 9 (𝜑 → ¬ ((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2))
45 eluz2b3 12856 . . . . . . . . 9 (((𝐴 gcd 𝐵)↑2) ∈ (ℤ‘2) ↔ (((𝐴 gcd 𝐵)↑2) ∈ ℕ ∧ ((𝐴 gcd 𝐵)↑2) ≠ 1))
4644, 45sylnib 327 . . . . . . . 8 (𝜑 → ¬ (((𝐴 gcd 𝐵)↑2) ∈ ℕ ∧ ((𝐴 gcd 𝐵)↑2) ≠ 1))
47 imnan 400 . . . . . . . 8 ((((𝐴 gcd 𝐵)↑2) ∈ ℕ → ¬ ((𝐴 gcd 𝐵)↑2) ≠ 1) ↔ ¬ (((𝐴 gcd 𝐵)↑2) ∈ ℕ ∧ ((𝐴 gcd 𝐵)↑2) ≠ 1))
4846, 47sylibr 233 . . . . . . 7 (𝜑 → (((𝐴 gcd 𝐵)↑2) ∈ ℕ → ¬ ((𝐴 gcd 𝐵)↑2) ≠ 1))
4948adantr 481 . . . . . 6 ((𝜑𝐴 ≠ 0) → (((𝐴 gcd 𝐵)↑2) ∈ ℕ → ¬ ((𝐴 gcd 𝐵)↑2) ≠ 1))
5015, 49mpd 15 . . . . 5 ((𝜑𝐴 ≠ 0) → ¬ ((𝐴 gcd 𝐵)↑2) ≠ 1)
51 df-ne 2940 . . . . 5 (((𝐴 gcd 𝐵)↑2) ≠ 1 ↔ ¬ ((𝐴 gcd 𝐵)↑2) = 1)
5250, 51sylnib 327 . . . 4 ((𝜑𝐴 ≠ 0) → ¬ ¬ ((𝐴 gcd 𝐵)↑2) = 1)
5352notnotrd 133 . . 3 ((𝜑𝐴 ≠ 0) → ((𝐴 gcd 𝐵)↑2) = 1)
54 nn0sqeq1 15173 . . 3 (((𝐴 gcd 𝐵) ∈ ℕ0 ∧ ((𝐴 gcd 𝐵)↑2) = 1) → (𝐴 gcd 𝐵) = 1)
557, 53, 54syl2anc 584 . 2 ((𝜑𝐴 ≠ 0) → (𝐴 gcd 𝐵) = 1)
565, 55mpdan 685 1 (𝜑 → (𝐴 gcd 𝐵) = 1)
Colors of variables: wff setvar class
Syntax hints:  ¬ wn 3  wi 4  wb 205  wa 396   = wceq 1541  wcel 2106  wne 2939   class class class wbr 5110  cfv 6501  (class class class)co 7362  0cc0 11060  1c1 11061   + caddc 11063  cn 12162  2c2 12217  0cn0 12422  cz 12508  cuz 12772  cexp 13977  cdvds 16147   gcd cgcd 16385  cprime 16558
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 1913  ax-6 1971  ax-7 2011  ax-8 2108  ax-9 2116  ax-10 2137  ax-11 2154  ax-12 2171  ax-ext 2702  ax-sep 5261  ax-nul 5268  ax-pow 5325  ax-pr 5389  ax-un 7677  ax-cnex 11116  ax-resscn 11117  ax-1cn 11118  ax-icn 11119  ax-addcl 11120  ax-addrcl 11121  ax-mulcl 11122  ax-mulrcl 11123  ax-mulcom 11124  ax-addass 11125  ax-mulass 11126  ax-distr 11127  ax-i2m1 11128  ax-1ne0 11129  ax-1rid 11130  ax-rnegex 11131  ax-rrecex 11132  ax-cnre 11133  ax-pre-lttri 11134  ax-pre-lttrn 11135  ax-pre-ltadd 11136  ax-pre-mulgt0 11137  ax-pre-sup 11138
This theorem depends on definitions:  df-bi 206  df-an 397  df-or 846  df-3or 1088  df-3an 1089  df-tru 1544  df-fal 1554  df-ex 1782  df-nf 1786  df-sb 2068  df-mo 2533  df-eu 2562  df-clab 2709  df-cleq 2723  df-clel 2809  df-nfc 2884  df-ne 2940  df-nel 3046  df-ral 3061  df-rex 3070  df-rmo 3351  df-reu 3352  df-rab 3406  df-v 3448  df-sbc 3743  df-csb 3859  df-dif 3916  df-un 3918  df-in 3920  df-ss 3930  df-pss 3932  df-nul 4288  df-if 4492  df-pw 4567  df-sn 4592  df-pr 4594  df-op 4598  df-uni 4871  df-iun 4961  df-br 5111  df-opab 5173  df-mpt 5194  df-tr 5228  df-id 5536  df-eprel 5542  df-po 5550  df-so 5551  df-fr 5593  df-we 5595  df-xp 5644  df-rel 5645  df-cnv 5646  df-co 5647  df-dm 5648  df-rn 5649  df-res 5650  df-ima 5651  df-pred 6258  df-ord 6325  df-on 6326  df-lim 6327  df-suc 6328  df-iota 6453  df-fun 6503  df-fn 6504  df-f 6505  df-f1 6506  df-fo 6507  df-f1o 6508  df-fv 6509  df-riota 7318  df-ov 7365  df-oprab 7366  df-mpo 7367  df-om 7808  df-2nd 7927  df-frecs 8217  df-wrecs 8248  df-recs 8322  df-rdg 8361  df-1o 8417  df-2o 8418  df-er 8655  df-en 8891  df-dom 8892  df-sdom 8893  df-fin 8894  df-sup 9387  df-inf 9388  df-pnf 11200  df-mnf 11201  df-xr 11202  df-ltxr 11203  df-le 11204  df-sub 11396  df-neg 11397  df-div 11822  df-nn 12163  df-2 12225  df-3 12226  df-n0 12423  df-z 12509  df-uz 12773  df-rp 12925  df-seq 13917  df-exp 13978  df-cj 14996  df-re 14997  df-im 14998  df-sqrt 15132  df-abs 15133  df-dvds 16148  df-gcd 16386  df-prm 16559
This theorem is referenced by:  2sqmod  26821
  Copyright terms: Public domain W3C validator