ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  nn0gcdsq Unicode version

Theorem nn0gcdsq 11260
Description: Squaring commutes with GCD, in particular two coprime numbers have coprime squares. (Contributed by Stefan O'Rear, 15-Sep-2014.)
Assertion
Ref Expression
nn0gcdsq  |-  ( ( A  e.  NN0  /\  B  e.  NN0 )  -> 
( ( A  gcd  B ) ^ 2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) ) )

Proof of Theorem nn0gcdsq
StepHypRef Expression
1 elnn0 8645 . 2  |-  ( A  e.  NN0  <->  ( A  e.  NN  \/  A  =  0 ) )
2 elnn0 8645 . 2  |-  ( B  e.  NN0  <->  ( B  e.  NN  \/  B  =  0 ) )
3 sqgcd 11100 . . 3  |-  ( ( A  e.  NN  /\  B  e.  NN )  ->  ( ( A  gcd  B ) ^ 2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) ) )
4 nncn 8402 . . . . . . 7  |-  ( B  e.  NN  ->  B  e.  CC )
5 abssq 10479 . . . . . . 7  |-  ( B  e.  CC  ->  (
( abs `  B
) ^ 2 )  =  ( abs `  ( B ^ 2 ) ) )
64, 5syl 14 . . . . . 6  |-  ( B  e.  NN  ->  (
( abs `  B
) ^ 2 )  =  ( abs `  ( B ^ 2 ) ) )
7 nnz 8739 . . . . . . . 8  |-  ( B  e.  NN  ->  B  e.  ZZ )
8 gcd0id 11052 . . . . . . . 8  |-  ( B  e.  ZZ  ->  (
0  gcd  B )  =  ( abs `  B
) )
97, 8syl 14 . . . . . . 7  |-  ( B  e.  NN  ->  (
0  gcd  B )  =  ( abs `  B
) )
109oveq1d 5649 . . . . . 6  |-  ( B  e.  NN  ->  (
( 0  gcd  B
) ^ 2 )  =  ( ( abs `  B ) ^ 2 ) )
11 sq0 10010 . . . . . . . . 9  |-  ( 0 ^ 2 )  =  0
1211a1i 9 . . . . . . . 8  |-  ( B  e.  NN  ->  (
0 ^ 2 )  =  0 )
1312oveq1d 5649 . . . . . . 7  |-  ( B  e.  NN  ->  (
( 0 ^ 2 )  gcd  ( B ^ 2 ) )  =  ( 0  gcd  ( B ^ 2 ) ) )
14 zsqcl 9990 . . . . . . . 8  |-  ( B  e.  ZZ  ->  ( B ^ 2 )  e.  ZZ )
15 gcd0id 11052 . . . . . . . 8  |-  ( ( B ^ 2 )  e.  ZZ  ->  (
0  gcd  ( B ^ 2 ) )  =  ( abs `  ( B ^ 2 ) ) )
167, 14, 153syl 17 . . . . . . 7  |-  ( B  e.  NN  ->  (
0  gcd  ( B ^ 2 ) )  =  ( abs `  ( B ^ 2 ) ) )
1713, 16eqtrd 2120 . . . . . 6  |-  ( B  e.  NN  ->  (
( 0 ^ 2 )  gcd  ( B ^ 2 ) )  =  ( abs `  ( B ^ 2 ) ) )
186, 10, 173eqtr4d 2130 . . . . 5  |-  ( B  e.  NN  ->  (
( 0  gcd  B
) ^ 2 )  =  ( ( 0 ^ 2 )  gcd  ( B ^ 2 ) ) )
1918adantl 271 . . . 4  |-  ( ( A  =  0  /\  B  e.  NN )  ->  ( ( 0  gcd  B ) ^
2 )  =  ( ( 0 ^ 2 )  gcd  ( B ^ 2 ) ) )
20 oveq1 5641 . . . . . . 7  |-  ( A  =  0  ->  ( A  gcd  B )  =  ( 0  gcd  B
) )
2120oveq1d 5649 . . . . . 6  |-  ( A  =  0  ->  (
( A  gcd  B
) ^ 2 )  =  ( ( 0  gcd  B ) ^
2 ) )
22 oveq1 5641 . . . . . . 7  |-  ( A  =  0  ->  ( A ^ 2 )  =  ( 0 ^ 2 ) )
2322oveq1d 5649 . . . . . 6  |-  ( A  =  0  ->  (
( A ^ 2 )  gcd  ( B ^ 2 ) )  =  ( ( 0 ^ 2 )  gcd  ( B ^ 2 ) ) )
2421, 23eqeq12d 2102 . . . . 5  |-  ( A  =  0  ->  (
( ( A  gcd  B ) ^ 2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) )  <->  ( (
0  gcd  B ) ^ 2 )  =  ( ( 0 ^ 2 )  gcd  ( B ^ 2 ) ) ) )
2524adantr 270 . . . 4  |-  ( ( A  =  0  /\  B  e.  NN )  ->  ( ( ( A  gcd  B ) ^ 2 )  =  ( ( A ^
2 )  gcd  ( B ^ 2 ) )  <-> 
( ( 0  gcd 
B ) ^ 2 )  =  ( ( 0 ^ 2 )  gcd  ( B ^
2 ) ) ) )
2619, 25mpbird 165 . . 3  |-  ( ( A  =  0  /\  B  e.  NN )  ->  ( ( A  gcd  B ) ^
2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) ) )
27 nncn 8402 . . . . . . 7  |-  ( A  e.  NN  ->  A  e.  CC )
28 abssq 10479 . . . . . . 7  |-  ( A  e.  CC  ->  (
( abs `  A
) ^ 2 )  =  ( abs `  ( A ^ 2 ) ) )
2927, 28syl 14 . . . . . 6  |-  ( A  e.  NN  ->  (
( abs `  A
) ^ 2 )  =  ( abs `  ( A ^ 2 ) ) )
30 nnz 8739 . . . . . . . 8  |-  ( A  e.  NN  ->  A  e.  ZZ )
31 gcdid0 11053 . . . . . . . 8  |-  ( A  e.  ZZ  ->  ( A  gcd  0 )  =  ( abs `  A
) )
3230, 31syl 14 . . . . . . 7  |-  ( A  e.  NN  ->  ( A  gcd  0 )  =  ( abs `  A
) )
3332oveq1d 5649 . . . . . 6  |-  ( A  e.  NN  ->  (
( A  gcd  0
) ^ 2 )  =  ( ( abs `  A ) ^ 2 ) )
3411a1i 9 . . . . . . . 8  |-  ( A  e.  NN  ->  (
0 ^ 2 )  =  0 )
3534oveq2d 5650 . . . . . . 7  |-  ( A  e.  NN  ->  (
( A ^ 2 )  gcd  ( 0 ^ 2 ) )  =  ( ( A ^ 2 )  gcd  0 ) )
36 zsqcl 9990 . . . . . . . 8  |-  ( A  e.  ZZ  ->  ( A ^ 2 )  e.  ZZ )
37 gcdid0 11053 . . . . . . . 8  |-  ( ( A ^ 2 )  e.  ZZ  ->  (
( A ^ 2 )  gcd  0 )  =  ( abs `  ( A ^ 2 ) ) )
3830, 36, 373syl 17 . . . . . . 7  |-  ( A  e.  NN  ->  (
( A ^ 2 )  gcd  0 )  =  ( abs `  ( A ^ 2 ) ) )
3935, 38eqtrd 2120 . . . . . 6  |-  ( A  e.  NN  ->  (
( A ^ 2 )  gcd  ( 0 ^ 2 ) )  =  ( abs `  ( A ^ 2 ) ) )
4029, 33, 393eqtr4d 2130 . . . . 5  |-  ( A  e.  NN  ->  (
( A  gcd  0
) ^ 2 )  =  ( ( A ^ 2 )  gcd  ( 0 ^ 2 ) ) )
4140adantr 270 . . . 4  |-  ( ( A  e.  NN  /\  B  =  0 )  ->  ( ( A  gcd  0 ) ^
2 )  =  ( ( A ^ 2 )  gcd  ( 0 ^ 2 ) ) )
42 oveq2 5642 . . . . . . 7  |-  ( B  =  0  ->  ( A  gcd  B )  =  ( A  gcd  0
) )
4342oveq1d 5649 . . . . . 6  |-  ( B  =  0  ->  (
( A  gcd  B
) ^ 2 )  =  ( ( A  gcd  0 ) ^
2 ) )
44 oveq1 5641 . . . . . . 7  |-  ( B  =  0  ->  ( B ^ 2 )  =  ( 0 ^ 2 ) )
4544oveq2d 5650 . . . . . 6  |-  ( B  =  0  ->  (
( A ^ 2 )  gcd  ( B ^ 2 ) )  =  ( ( A ^ 2 )  gcd  ( 0 ^ 2 ) ) )
4643, 45eqeq12d 2102 . . . . 5  |-  ( B  =  0  ->  (
( ( A  gcd  B ) ^ 2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) )  <->  ( ( A  gcd  0 ) ^
2 )  =  ( ( A ^ 2 )  gcd  ( 0 ^ 2 ) ) ) )
4746adantl 271 . . . 4  |-  ( ( A  e.  NN  /\  B  =  0 )  ->  ( ( ( A  gcd  B ) ^ 2 )  =  ( ( A ^
2 )  gcd  ( B ^ 2 ) )  <-> 
( ( A  gcd  0 ) ^ 2 )  =  ( ( A ^ 2 )  gcd  ( 0 ^ 2 ) ) ) )
4841, 47mpbird 165 . . 3  |-  ( ( A  e.  NN  /\  B  =  0 )  ->  ( ( A  gcd  B ) ^
2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) ) )
49 gcd0val 11034 . . . . . 6  |-  ( 0  gcd  0 )  =  0
5049oveq1i 5644 . . . . 5  |-  ( ( 0  gcd  0 ) ^ 2 )  =  ( 0 ^ 2 )
5111, 11oveq12i 5646 . . . . . 6  |-  ( ( 0 ^ 2 )  gcd  ( 0 ^ 2 ) )  =  ( 0  gcd  0
)
5251, 49eqtri 2108 . . . . 5  |-  ( ( 0 ^ 2 )  gcd  ( 0 ^ 2 ) )  =  0
5311, 50, 523eqtr4i 2118 . . . 4  |-  ( ( 0  gcd  0 ) ^ 2 )  =  ( ( 0 ^ 2 )  gcd  (
0 ^ 2 ) )
54 oveq12 5643 . . . . 5  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( A  gcd  B )  =  ( 0  gcd  0 ) )
5554oveq1d 5649 . . . 4  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( ( A  gcd  B ) ^
2 )  =  ( ( 0  gcd  0
) ^ 2 ) )
5622, 44oveqan12d 5653 . . . 4  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( ( A ^ 2 )  gcd  ( B ^ 2 ) )  =  ( ( 0 ^ 2 )  gcd  ( 0 ^ 2 ) ) )
5753, 55, 563eqtr4a 2146 . . 3  |-  ( ( A  =  0  /\  B  =  0 )  ->  ( ( A  gcd  B ) ^
2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) ) )
583, 26, 48, 57ccase 910 . 2  |-  ( ( ( A  e.  NN  \/  A  =  0
)  /\  ( B  e.  NN  \/  B  =  0 ) )  -> 
( ( A  gcd  B ) ^ 2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) ) )
591, 2, 58syl2anb 285 1  |-  ( ( A  e.  NN0  /\  B  e.  NN0 )  -> 
( ( A  gcd  B ) ^ 2 )  =  ( ( A ^ 2 )  gcd  ( B ^ 2 ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 102    <-> wb 103    \/ wo 664    = wceq 1289    e. wcel 1438   ` cfv 5002  (class class class)co 5634   CCcc 7327   0cc0 7329   NNcn 8394   2c2 8444   NN0cn0 8643   ZZcz 8720   ^cexp 9919   abscabs 10395    gcd cgcd 11020
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-mp 7  ax-ia1 104  ax-ia2 105  ax-ia3 106  ax-in1 579  ax-in2 580  ax-io 665  ax-5 1381  ax-7 1382  ax-gen 1383  ax-ie1 1427  ax-ie2 1428  ax-8 1440  ax-10 1441  ax-11 1442  ax-i12 1443  ax-bndl 1444  ax-4 1445  ax-13 1449  ax-14 1450  ax-17 1464  ax-i9 1468  ax-ial 1472  ax-i5r 1473  ax-ext 2070  ax-coll 3946  ax-sep 3949  ax-nul 3957  ax-pow 4001  ax-pr 4027  ax-un 4251  ax-setind 4343  ax-iinf 4393  ax-cnex 7415  ax-resscn 7416  ax-1cn 7417  ax-1re 7418  ax-icn 7419  ax-addcl 7420  ax-addrcl 7421  ax-mulcl 7422  ax-mulrcl 7423  ax-addcom 7424  ax-mulcom 7425  ax-addass 7426  ax-mulass 7427  ax-distr 7428  ax-i2m1 7429  ax-0lt1 7430  ax-1rid 7431  ax-0id 7432  ax-rnegex 7433  ax-precex 7434  ax-cnre 7435  ax-pre-ltirr 7436  ax-pre-ltwlin 7437  ax-pre-lttrn 7438  ax-pre-apti 7439  ax-pre-ltadd 7440  ax-pre-mulgt0 7441  ax-pre-mulext 7442  ax-arch 7443  ax-caucvg 7444
This theorem depends on definitions:  df-bi 115  df-dc 781  df-3or 925  df-3an 926  df-tru 1292  df-fal 1295  df-nf 1395  df-sb 1693  df-eu 1951  df-mo 1952  df-clab 2075  df-cleq 2081  df-clel 2084  df-nfc 2217  df-ne 2256  df-nel 2351  df-ral 2364  df-rex 2365  df-reu 2366  df-rmo 2367  df-rab 2368  df-v 2621  df-sbc 2839  df-csb 2932  df-dif 2999  df-un 3001  df-in 3003  df-ss 3010  df-nul 3285  df-if 3390  df-pw 3427  df-sn 3447  df-pr 3448  df-op 3450  df-uni 3649  df-int 3684  df-iun 3727  df-br 3838  df-opab 3892  df-mpt 3893  df-tr 3929  df-id 4111  df-po 4114  df-iso 4115  df-iord 4184  df-on 4186  df-ilim 4187  df-suc 4189  df-iom 4396  df-xp 4434  df-rel 4435  df-cnv 4436  df-co 4437  df-dm 4438  df-rn 4439  df-res 4440  df-ima 4441  df-iota 4967  df-fun 5004  df-fn 5005  df-f 5006  df-f1 5007  df-fo 5008  df-f1o 5009  df-fv 5010  df-riota 5590  df-ov 5637  df-oprab 5638  df-mpt2 5639  df-1st 5893  df-2nd 5894  df-recs 6052  df-frec 6138  df-sup 6658  df-pnf 7503  df-mnf 7504  df-xr 7505  df-ltxr 7506  df-le 7507  df-sub 7634  df-neg 7635  df-reap 8028  df-ap 8035  df-div 8114  df-inn 8395  df-2 8452  df-3 8453  df-4 8454  df-n0 8644  df-z 8721  df-uz 8989  df-q 9074  df-rp 9104  df-fz 9394  df-fzo 9519  df-fl 9642  df-mod 9695  df-iseq 9818  df-seq3 9819  df-exp 9920  df-cj 10241  df-re 10242  df-im 10243  df-rsqrt 10396  df-abs 10397  df-dvds 10879  df-gcd 11021
This theorem is referenced by:  zgcdsq  11261
  Copyright terms: Public domain W3C validator