MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  dvdssq Structured version   Unicode version

Theorem dvdssq 13727
Description: Two numbers are divisible iff their squares are. (Contributed by Scott Fenton, 18-Apr-2014.) (Revised by Mario Carneiro, 19-Apr-2014.)
Assertion
Ref Expression
dvdssq  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  ||  N  <->  ( M ^ 2 ) 
||  ( N ^
2 ) ) )

Proof of Theorem dvdssq
StepHypRef Expression
1 breq1 4283 . . 3  |-  ( M  =  0  ->  ( M  ||  N  <->  0  ||  N ) )
2 sq0i 11942 . . . 4  |-  ( M  =  0  ->  ( M ^ 2 )  =  0 )
32breq1d 4290 . . 3  |-  ( M  =  0  ->  (
( M ^ 2 )  ||  ( N ^ 2 )  <->  0  ||  ( N ^ 2 ) ) )
41, 3bibi12d 321 . 2  |-  ( M  =  0  ->  (
( M  ||  N  <->  ( M ^ 2 ) 
||  ( N ^
2 ) )  <->  ( 0 
||  N  <->  0  ||  ( N ^ 2 ) ) ) )
5 nnabscl 12797 . . . . 5  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( abs `  M
)  e.  NN )
6 breq2 4284 . . . . . . 7  |-  ( N  =  0  ->  (
( abs `  M
)  ||  N  <->  ( abs `  M )  ||  0
) )
7 sq0i 11942 . . . . . . . 8  |-  ( N  =  0  ->  ( N ^ 2 )  =  0 )
87breq2d 4292 . . . . . . 7  |-  ( N  =  0  ->  (
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
96, 8bibi12d 321 . . . . . 6  |-  ( N  =  0  ->  (
( ( abs `  M
)  ||  N  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) )  <-> 
( ( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) ) )
10 nnabscl 12797 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( abs `  N
)  e.  NN )
11 dvdssqlem 13726 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( abs `  N )  e.  NN )  -> 
( ( abs `  M
)  ||  ( abs `  N )  <->  ( ( abs `  M ) ^
2 )  ||  (
( abs `  N
) ^ 2 ) ) )
1210, 11sylan2 471 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  ( abs `  N )  <-> 
( ( abs `  M
) ^ 2 ) 
||  ( ( abs `  N ) ^ 2 ) ) )
13 nnz 10656 . . . . . . . . 9  |-  ( ( abs `  M )  e.  NN  ->  ( abs `  M )  e.  ZZ )
14 simpl 454 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  ->  N  e.  ZZ )
15 dvdsabsb 13535 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  N  <->  ( abs `  M )  ||  ( abs `  N ) ) )
1613, 14, 15syl2an 474 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  N 
<->  ( abs `  M
)  ||  ( abs `  N ) ) )
17 nnsqcl 11919 . . . . . . . . . . 11  |-  ( ( abs `  M )  e.  NN  ->  (
( abs `  M
) ^ 2 )  e.  NN )
1817nnzd 10734 . . . . . . . . . 10  |-  ( ( abs `  M )  e.  NN  ->  (
( abs `  M
) ^ 2 )  e.  ZZ )
19 zsqcl 11920 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  ( N ^ 2 )  e.  ZZ )
2019adantr 462 . . . . . . . . . 10  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( N ^ 2 )  e.  ZZ )
21 dvdsabsb 13535 . . . . . . . . . 10  |-  ( ( ( ( abs `  M
) ^ 2 )  e.  ZZ  /\  ( N ^ 2 )  e.  ZZ )  ->  (
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
2218, 20, 21syl2an 474 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
23 zcn 10639 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  N  e.  CC )
2423adantr 462 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  ->  N  e.  CC )
25 abssq 12779 . . . . . . . . . . . 12  |-  ( N  e.  CC  ->  (
( abs `  N
) ^ 2 )  =  ( abs `  ( N ^ 2 ) ) )
2624, 25syl 16 . . . . . . . . . . 11  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( ( abs `  N
) ^ 2 )  =  ( abs `  ( N ^ 2 ) ) )
2726breq2d 4292 . . . . . . . . . 10  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( ( ( abs `  M ) ^ 2 )  ||  ( ( abs `  N ) ^ 2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
2827adantl 463 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( ( abs `  N ) ^ 2 )  <->  ( ( abs `  M ) ^ 2 )  ||  ( abs `  ( N ^ 2 ) ) ) )
2922, 28bitr4d 256 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  (
( abs `  N
) ^ 2 ) ) )
3012, 16, 293bitr4d 285 . . . . . . 7  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  N 
<->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
3130anassrs 641 . . . . . 6  |-  ( ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  /\  N  =/=  0
)  ->  ( ( abs `  M )  ||  N 
<->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
32 dvds0 13531 . . . . . . . . 9  |-  ( ( abs `  M )  e.  ZZ  ->  ( abs `  M )  ||  0 )
33 zsqcl 11920 . . . . . . . . . 10  |-  ( ( abs `  M )  e.  ZZ  ->  (
( abs `  M
) ^ 2 )  e.  ZZ )
34 dvds0 13531 . . . . . . . . . 10  |-  ( ( ( abs `  M
) ^ 2 )  e.  ZZ  ->  (
( abs `  M
) ^ 2 ) 
||  0 )
3533, 34syl 16 . . . . . . . . 9  |-  ( ( abs `  M )  e.  ZZ  ->  (
( abs `  M
) ^ 2 ) 
||  0 )
3632, 352thd 240 . . . . . . . 8  |-  ( ( abs `  M )  e.  ZZ  ->  (
( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
3713, 36syl 16 . . . . . . 7  |-  ( ( abs `  M )  e.  NN  ->  (
( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
3837adantr 462 . . . . . 6  |-  ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
399, 31, 38pm2.61ne 2676 . . . . 5  |-  ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  N  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
405, 39sylan 468 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( abs `  M )  ||  N  <->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
41 absdvdsb 13534 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  ||  N  <->  ( abs `  M ) 
||  N ) )
4241adantlr 707 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( M  ||  N 
<->  ( abs `  M
)  ||  N )
)
43 zsqcl 11920 . . . . . . 7  |-  ( M  e.  ZZ  ->  ( M ^ 2 )  e.  ZZ )
4443adantr 462 . . . . . 6  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( M ^ 2 )  e.  ZZ )
45 absdvdsb 13534 . . . . . 6  |-  ( ( ( M ^ 2 )  e.  ZZ  /\  ( N ^ 2 )  e.  ZZ )  -> 
( ( M ^
2 )  ||  ( N ^ 2 )  <->  ( abs `  ( M ^ 2 ) )  ||  ( N ^ 2 ) ) )
4644, 19, 45syl2an 474 . . . . 5  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( M ^ 2 )  ||  ( N ^ 2 )  <-> 
( abs `  ( M ^ 2 ) ) 
||  ( N ^
2 ) ) )
47 zcn 10639 . . . . . . . . . 10  |-  ( M  e.  ZZ  ->  M  e.  CC )
48 abssq 12779 . . . . . . . . . 10  |-  ( M  e.  CC  ->  (
( abs `  M
) ^ 2 )  =  ( abs `  ( M ^ 2 ) ) )
4947, 48syl 16 . . . . . . . . 9  |-  ( M  e.  ZZ  ->  (
( abs `  M
) ^ 2 )  =  ( abs `  ( M ^ 2 ) ) )
5049eqcomd 2438 . . . . . . . 8  |-  ( M  e.  ZZ  ->  ( abs `  ( M ^
2 ) )  =  ( ( abs `  M
) ^ 2 ) )
5150adantr 462 . . . . . . 7  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( abs `  ( M ^ 2 ) )  =  ( ( abs `  M ) ^ 2 ) )
5251breq1d 4290 . . . . . 6  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( ( abs `  ( M ^ 2 ) ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
5352adantr 462 . . . . 5  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( abs `  ( M ^ 2 ) )  ||  ( N ^ 2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
5446, 53bitrd 253 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( M ^ 2 )  ||  ( N ^ 2 )  <-> 
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
5540, 42, 543bitr4d 285 . . 3  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( M  ||  N 
<->  ( M ^ 2 )  ||  ( N ^ 2 ) ) )
5655an32s 795 . 2  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  M  =/=  0
)  ->  ( M  ||  N  <->  ( M ^
2 )  ||  ( N ^ 2 ) ) )
57 0dvds 13536 . . . . 5  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  N  = 
0 ) )
58 sqeq0 11914 . . . . . 6  |-  ( N  e.  CC  ->  (
( N ^ 2 )  =  0  <->  N  =  0 ) )
5923, 58syl 16 . . . . 5  |-  ( N  e.  ZZ  ->  (
( N ^ 2 )  =  0  <->  N  =  0 ) )
6057, 59bitr4d 256 . . . 4  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  ( N ^ 2 )  =  0 ) )
61 0dvds 13536 . . . . 5  |-  ( ( N ^ 2 )  e.  ZZ  ->  (
0  ||  ( N ^ 2 )  <->  ( N ^ 2 )  =  0 ) )
6219, 61syl 16 . . . 4  |-  ( N  e.  ZZ  ->  (
0  ||  ( N ^ 2 )  <->  ( N ^ 2 )  =  0 ) )
6360, 62bitr4d 256 . . 3  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  0  ||  ( N ^ 2 ) ) )
6463adantl 463 . 2  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( 0  ||  N  <->  0 
||  ( N ^
2 ) ) )
654, 56, 64pm2.61ne 2676 1  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  ||  N  <->  ( M ^ 2 ) 
||  ( N ^
2 ) ) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 184    /\ wa 369    = wceq 1362    e. wcel 1755    =/= wne 2596   class class class wbr 4280   ` cfv 5406  (class class class)co 6080   CCcc 9268   0cc0 9270   NNcn 10310   2c2 10359   ZZcz 10634   ^cexp 11849   abscabs 12707    || cdivides 13518
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1594  ax-4 1605  ax-5 1669  ax-6 1707  ax-7 1727  ax-8 1757  ax-9 1759  ax-10 1774  ax-11 1779  ax-12 1791  ax-13 1942  ax-ext 2414  ax-sep 4401  ax-nul 4409  ax-pow 4458  ax-pr 4519  ax-un 6361  ax-cnex 9326  ax-resscn 9327  ax-1cn 9328  ax-icn 9329  ax-addcl 9330  ax-addrcl 9331  ax-mulcl 9332  ax-mulrcl 9333  ax-mulcom 9334  ax-addass 9335  ax-mulass 9336  ax-distr 9337  ax-i2m1 9338  ax-1ne0 9339  ax-1rid 9340  ax-rnegex 9341  ax-rrecex 9342  ax-cnre 9343  ax-pre-lttri 9344  ax-pre-lttrn 9345  ax-pre-ltadd 9346  ax-pre-mulgt0 9347  ax-pre-sup 9348
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 959  df-3an 960  df-tru 1365  df-ex 1590  df-nf 1593  df-sb 1700  df-eu 2258  df-mo 2259  df-clab 2420  df-cleq 2426  df-clel 2429  df-nfc 2558  df-ne 2598  df-nel 2599  df-ral 2710  df-rex 2711  df-reu 2712  df-rmo 2713  df-rab 2714  df-v 2964  df-sbc 3176  df-csb 3277  df-dif 3319  df-un 3321  df-in 3323  df-ss 3330  df-pss 3332  df-nul 3626  df-if 3780  df-pw 3850  df-sn 3866  df-pr 3868  df-tp 3870  df-op 3872  df-uni 4080  df-iun 4161  df-br 4281  df-opab 4339  df-mpt 4340  df-tr 4374  df-eprel 4619  df-id 4623  df-po 4628  df-so 4629  df-fr 4666  df-we 4668  df-ord 4709  df-on 4710  df-lim 4711  df-suc 4712  df-xp 4833  df-rel 4834  df-cnv 4835  df-co 4836  df-dm 4837  df-rn 4838  df-res 4839  df-ima 4840  df-iota 5369  df-fun 5408  df-fn 5409  df-f 5410  df-f1 5411  df-fo 5412  df-f1o 5413  df-fv 5414  df-riota 6039  df-ov 6083  df-oprab 6084  df-mpt2 6085  df-om 6466  df-2nd 6567  df-recs 6818  df-rdg 6852  df-er 7089  df-en 7299  df-dom 7300  df-sdom 7301  df-sup 7679  df-pnf 9408  df-mnf 9409  df-xr 9410  df-ltxr 9411  df-le 9412  df-sub 9585  df-neg 9586  df-div 9982  df-nn 10311  df-2 10368  df-3 10369  df-n0 10568  df-z 10635  df-uz 10850  df-rp 10980  df-fl 11626  df-mod 11693  df-seq 11791  df-exp 11850  df-cj 12572  df-re 12573  df-im 12574  df-sqr 12708  df-abs 12709  df-dvds 13519  df-gcd 13674
This theorem is referenced by:  pythagtriplem19  13883  4sqlem9  13990  4sqlem10  13991  lgsdir  22554  2sqlem8a  22595
  Copyright terms: Public domain W3C validator