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

Theorem dvdssq 12755
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 4042 . . 3  |-  ( M  =  0  ->  ( M  ||  N  <->  0  ||  N ) )
2 sq0i 11212 . . . 4  |-  ( M  =  0  ->  ( M ^ 2 )  =  0 )
32breq1d 4049 . . 3  |-  ( M  =  0  ->  (
( M ^ 2 )  ||  ( N ^ 2 )  <->  0  ||  ( N ^ 2 ) ) )
41, 3bibi12d 312 . 2  |-  ( M  =  0  ->  (
( M  ||  N  <->  ( M ^ 2 ) 
||  ( N ^
2 ) )  <->  ( 0 
||  N  <->  0  ||  ( N ^ 2 ) ) ) )
5 nnabscl 11825 . . . . 5  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( abs `  M
)  e.  NN )
6 breq2 4043 . . . . . . 7  |-  ( N  =  0  ->  (
( abs `  M
)  ||  N  <->  ( abs `  M )  ||  0
) )
7 sq0i 11212 . . . . . . . 8  |-  ( N  =  0  ->  ( N ^ 2 )  =  0 )
87breq2d 4051 . . . . . . 7  |-  ( N  =  0  ->  (
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
96, 8bibi12d 312 . . . . . 6  |-  ( N  =  0  ->  (
( ( abs `  M
)  ||  N  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) )  <-> 
( ( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) ) )
10 nnabscl 11825 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( abs `  N
)  e.  NN )
11 dvdssqlem 12754 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( abs `  N )  e.  NN )  -> 
( ( abs `  M
)  ||  ( abs `  N )  <->  ( ( abs `  M ) ^
2 )  ||  (
( abs `  N
) ^ 2 ) ) )
1210, 11sylan2 460 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  ( abs `  N )  <-> 
( ( abs `  M
) ^ 2 ) 
||  ( ( abs `  N ) ^ 2 ) ) )
13 nnz 10061 . . . . . . . . 9  |-  ( ( abs `  M )  e.  NN  ->  ( abs `  M )  e.  ZZ )
14 simpl 443 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  ->  N  e.  ZZ )
15 dvdsabsb 12564 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  N  <->  ( abs `  M )  ||  ( abs `  N ) ) )
1613, 14, 15syl2an 463 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  N 
<->  ( abs `  M
)  ||  ( abs `  N ) ) )
17 nnsqcl 11189 . . . . . . . . . . 11  |-  ( ( abs `  M )  e.  NN  ->  (
( abs `  M
) ^ 2 )  e.  NN )
1817nnzd 10132 . . . . . . . . . 10  |-  ( ( abs `  M )  e.  NN  ->  (
( abs `  M
) ^ 2 )  e.  ZZ )
19 zsqcl 11190 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  ( N ^ 2 )  e.  ZZ )
2019adantr 451 . . . . . . . . . 10  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( N ^ 2 )  e.  ZZ )
21 dvdsabsb 12564 . . . . . . . . . 10  |-  ( ( ( ( abs `  M
) ^ 2 )  e.  ZZ  /\  ( N ^ 2 )  e.  ZZ )  ->  (
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
2218, 20, 21syl2an 463 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
23 zcn 10045 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  N  e.  CC )
2423adantr 451 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  ->  N  e.  CC )
25 abssq 11807 . . . . . . . . . . . 12  |-  ( N  e.  CC  ->  (
( abs `  N
) ^ 2 )  =  ( abs `  ( N ^ 2 ) ) )
2624, 25syl 15 . . . . . . . . . . 11  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( ( abs `  N
) ^ 2 )  =  ( abs `  ( N ^ 2 ) ) )
2726breq2d 4051 . . . . . . . . . 10  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( ( ( abs `  M ) ^ 2 )  ||  ( ( abs `  N ) ^ 2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
2827adantl 452 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( ( abs `  N ) ^ 2 )  <->  ( ( abs `  M ) ^ 2 )  ||  ( abs `  ( N ^ 2 ) ) ) )
2922, 28bitr4d 247 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  (
( abs `  N
) ^ 2 ) ) )
3012, 16, 293bitr4d 276 . . . . . . 7  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  N 
<->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
3130anassrs 629 . . . . . 6  |-  ( ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  /\  N  =/=  0
)  ->  ( ( abs `  M )  ||  N 
<->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
32 dvds0 12560 . . . . . . . . 9  |-  ( ( abs `  M )  e.  ZZ  ->  ( abs `  M )  ||  0 )
33 zsqcl 11190 . . . . . . . . . 10  |-  ( ( abs `  M )  e.  ZZ  ->  (
( abs `  M
) ^ 2 )  e.  ZZ )
34 dvds0 12560 . . . . . . . . . 10  |-  ( ( ( abs `  M
) ^ 2 )  e.  ZZ  ->  (
( abs `  M
) ^ 2 ) 
||  0 )
3533, 34syl 15 . . . . . . . . 9  |-  ( ( abs `  M )  e.  ZZ  ->  (
( abs `  M
) ^ 2 ) 
||  0 )
3632, 352thd 231 . . . . . . . 8  |-  ( ( abs `  M )  e.  ZZ  ->  (
( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
3713, 36syl 15 . . . . . . 7  |-  ( ( abs `  M )  e.  NN  ->  (
( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
3837adantr 451 . . . . . 6  |-  ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
399, 31, 38pm2.61ne 2534 . . . . 5  |-  ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  N  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
405, 39sylan 457 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( abs `  M )  ||  N  <->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
41 absdvdsb 12563 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  ||  N  <->  ( abs `  M ) 
||  N ) )
4241adantlr 695 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( M  ||  N 
<->  ( abs `  M
)  ||  N )
)
43 zsqcl 11190 . . . . . . 7  |-  ( M  e.  ZZ  ->  ( M ^ 2 )  e.  ZZ )
4443adantr 451 . . . . . 6  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( M ^ 2 )  e.  ZZ )
45 absdvdsb 12563 . . . . . 6  |-  ( ( ( M ^ 2 )  e.  ZZ  /\  ( N ^ 2 )  e.  ZZ )  -> 
( ( M ^
2 )  ||  ( N ^ 2 )  <->  ( abs `  ( M ^ 2 ) )  ||  ( N ^ 2 ) ) )
4644, 19, 45syl2an 463 . . . . 5  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( M ^ 2 )  ||  ( N ^ 2 )  <-> 
( abs `  ( M ^ 2 ) ) 
||  ( N ^
2 ) ) )
47 zcn 10045 . . . . . . . . . 10  |-  ( M  e.  ZZ  ->  M  e.  CC )
48 abssq 11807 . . . . . . . . . 10  |-  ( M  e.  CC  ->  (
( abs `  M
) ^ 2 )  =  ( abs `  ( M ^ 2 ) ) )
4947, 48syl 15 . . . . . . . . 9  |-  ( M  e.  ZZ  ->  (
( abs `  M
) ^ 2 )  =  ( abs `  ( M ^ 2 ) ) )
5049eqcomd 2301 . . . . . . . 8  |-  ( M  e.  ZZ  ->  ( abs `  ( M ^
2 ) )  =  ( ( abs `  M
) ^ 2 ) )
5150adantr 451 . . . . . . 7  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( abs `  ( M ^ 2 ) )  =  ( ( abs `  M ) ^ 2 ) )
5251breq1d 4049 . . . . . 6  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( ( abs `  ( M ^ 2 ) ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
5352adantr 451 . . . . 5  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( abs `  ( M ^ 2 ) )  ||  ( N ^ 2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
5446, 53bitrd 244 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( M ^ 2 )  ||  ( N ^ 2 )  <-> 
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
5540, 42, 543bitr4d 276 . . 3  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( M  ||  N 
<->  ( M ^ 2 )  ||  ( N ^ 2 ) ) )
5655an32s 779 . 2  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  M  =/=  0
)  ->  ( M  ||  N  <->  ( M ^
2 )  ||  ( N ^ 2 ) ) )
57 0dvds 12565 . . . . 5  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  N  = 
0 ) )
58 sqeq0 11184 . . . . . 6  |-  ( N  e.  CC  ->  (
( N ^ 2 )  =  0  <->  N  =  0 ) )
5923, 58syl 15 . . . . 5  |-  ( N  e.  ZZ  ->  (
( N ^ 2 )  =  0  <->  N  =  0 ) )
6057, 59bitr4d 247 . . . 4  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  ( N ^ 2 )  =  0 ) )
61 0dvds 12565 . . . . 5  |-  ( ( N ^ 2 )  e.  ZZ  ->  (
0  ||  ( N ^ 2 )  <->  ( N ^ 2 )  =  0 ) )
6219, 61syl 15 . . . 4  |-  ( N  e.  ZZ  ->  (
0  ||  ( N ^ 2 )  <->  ( N ^ 2 )  =  0 ) )
6360, 62bitr4d 247 . . 3  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  0  ||  ( N ^ 2 ) ) )
6463adantl 452 . 2  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( 0  ||  N  <->  0 
||  ( N ^
2 ) ) )
654, 56, 64pm2.61ne 2534 1  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  ||  N  <->  ( M ^ 2 ) 
||  ( N ^
2 ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 176    /\ wa 358    = wceq 1632    e. wcel 1696    =/= wne 2459   class class class wbr 4039   ` cfv 5271  (class class class)co 5874   CCcc 8751   0cc0 8753   NNcn 9762   2c2 9811   ZZcz 10040   ^cexp 11120   abscabs 11735    || cdivides 12547
This theorem is referenced by:  pythagtriplem19  12902  4sqlem9  13009  4sqlem10  13010  lgsdir  20585  2sqlem8a  20626
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-13 1698  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-sep 4157  ax-nul 4165  ax-pow 4204  ax-pr 4230  ax-un 4528  ax-cnex 8809  ax-resscn 8810  ax-1cn 8811  ax-icn 8812  ax-addcl 8813  ax-addrcl 8814  ax-mulcl 8815  ax-mulrcl 8816  ax-mulcom 8817  ax-addass 8818  ax-mulass 8819  ax-distr 8820  ax-i2m1 8821  ax-1ne0 8822  ax-1rid 8823  ax-rnegex 8824  ax-rrecex 8825  ax-cnre 8826  ax-pre-lttri 8827  ax-pre-lttrn 8828  ax-pre-ltadd 8829  ax-pre-mulgt0 8830  ax-pre-sup 8831
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-nel 2462  df-ral 2561  df-rex 2562  df-reu 2563  df-rmo 2564  df-rab 2565  df-v 2803  df-sbc 3005  df-csb 3095  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-pss 3181  df-nul 3469  df-if 3579  df-pw 3640  df-sn 3659  df-pr 3660  df-tp 3661  df-op 3662  df-uni 3844  df-iun 3923  df-br 4040  df-opab 4094  df-mpt 4095  df-tr 4130  df-eprel 4321  df-id 4325  df-po 4330  df-so 4331  df-fr 4368  df-we 4370  df-ord 4411  df-on 4412  df-lim 4413  df-suc 4414  df-om 4673  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-rn 4716  df-res 4717  df-ima 4718  df-iota 5235  df-fun 5273  df-fn 5274  df-f 5275  df-f1 5276  df-fo 5277  df-f1o 5278  df-fv 5279  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-2nd 6139  df-riota 6320  df-recs 6404  df-rdg 6439  df-er 6676  df-en 6880  df-dom 6881  df-sdom 6882  df-sup 7210  df-pnf 8885  df-mnf 8886  df-xr 8887  df-ltxr 8888  df-le 8889  df-sub 9055  df-neg 9056  df-div 9440  df-nn 9763  df-2 9820  df-3 9821  df-n0 9982  df-z 10041  df-uz 10247  df-rp 10371  df-fl 10941  df-mod 10990  df-seq 11063  df-exp 11121  df-cj 11600  df-re 11601  df-im 11602  df-sqr 11736  df-abs 11737  df-dvds 12548  df-gcd 12702
  Copyright terms: Public domain W3C validator