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

Theorem dvdssq 13062
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 4217 . . 3  |-  ( M  =  0  ->  ( M  ||  N  <->  0  ||  N ) )
2 sq0i 11476 . . . 4  |-  ( M  =  0  ->  ( M ^ 2 )  =  0 )
32breq1d 4224 . . 3  |-  ( M  =  0  ->  (
( M ^ 2 )  ||  ( N ^ 2 )  <->  0  ||  ( N ^ 2 ) ) )
41, 3bibi12d 314 . 2  |-  ( M  =  0  ->  (
( M  ||  N  <->  ( M ^ 2 ) 
||  ( N ^
2 ) )  <->  ( 0 
||  N  <->  0  ||  ( N ^ 2 ) ) ) )
5 nnabscl 12131 . . . . 5  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( abs `  M
)  e.  NN )
6 breq2 4218 . . . . . . 7  |-  ( N  =  0  ->  (
( abs `  M
)  ||  N  <->  ( abs `  M )  ||  0
) )
7 sq0i 11476 . . . . . . . 8  |-  ( N  =  0  ->  ( N ^ 2 )  =  0 )
87breq2d 4226 . . . . . . 7  |-  ( N  =  0  ->  (
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
96, 8bibi12d 314 . . . . . 6  |-  ( N  =  0  ->  (
( ( abs `  M
)  ||  N  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) )  <-> 
( ( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) ) )
10 nnabscl 12131 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( abs `  N
)  e.  NN )
11 dvdssqlem 13061 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( abs `  N )  e.  NN )  -> 
( ( abs `  M
)  ||  ( abs `  N )  <->  ( ( abs `  M ) ^
2 )  ||  (
( abs `  N
) ^ 2 ) ) )
1210, 11sylan2 462 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  ( abs `  N )  <-> 
( ( abs `  M
) ^ 2 ) 
||  ( ( abs `  N ) ^ 2 ) ) )
13 nnz 10305 . . . . . . . . 9  |-  ( ( abs `  M )  e.  NN  ->  ( abs `  M )  e.  ZZ )
14 simpl 445 . . . . . . . . 9  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  ->  N  e.  ZZ )
15 dvdsabsb 12871 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  ZZ  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  N  <->  ( abs `  M )  ||  ( abs `  N ) ) )
1613, 14, 15syl2an 465 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  N 
<->  ( abs `  M
)  ||  ( abs `  N ) ) )
17 nnsqcl 11453 . . . . . . . . . . 11  |-  ( ( abs `  M )  e.  NN  ->  (
( abs `  M
) ^ 2 )  e.  NN )
1817nnzd 10376 . . . . . . . . . 10  |-  ( ( abs `  M )  e.  NN  ->  (
( abs `  M
) ^ 2 )  e.  ZZ )
19 zsqcl 11454 . . . . . . . . . . 11  |-  ( N  e.  ZZ  ->  ( N ^ 2 )  e.  ZZ )
2019adantr 453 . . . . . . . . . 10  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( N ^ 2 )  e.  ZZ )
21 dvdsabsb 12871 . . . . . . . . . 10  |-  ( ( ( ( abs `  M
) ^ 2 )  e.  ZZ  /\  ( N ^ 2 )  e.  ZZ )  ->  (
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
2218, 20, 21syl2an 465 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
23 zcn 10289 . . . . . . . . . . . . 13  |-  ( N  e.  ZZ  ->  N  e.  CC )
2423adantr 453 . . . . . . . . . . . 12  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  ->  N  e.  CC )
25 abssq 12113 . . . . . . . . . . . 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 4226 . . . . . . . . . 10  |-  ( ( N  e.  ZZ  /\  N  =/=  0 )  -> 
( ( ( abs `  M ) ^ 2 )  ||  ( ( abs `  N ) ^ 2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( abs `  ( N ^
2 ) ) ) )
2827adantl 454 . . . . . . . . 9  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( ( abs `  N ) ^ 2 )  <->  ( ( abs `  M ) ^ 2 )  ||  ( abs `  ( N ^ 2 ) ) ) )
2922, 28bitr4d 249 . . . . . . . 8  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( (
( abs `  M
) ^ 2 ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  (
( abs `  N
) ^ 2 ) ) )
3012, 16, 293bitr4d 278 . . . . . . 7  |-  ( ( ( abs `  M
)  e.  NN  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  ->  ( ( abs `  M )  ||  N 
<->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
3130anassrs 631 . . . . . 6  |-  ( ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  /\  N  =/=  0
)  ->  ( ( abs `  M )  ||  N 
<->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
32 dvds0 12867 . . . . . . . . 9  |-  ( ( abs `  M )  e.  ZZ  ->  ( abs `  M )  ||  0 )
33 zsqcl 11454 . . . . . . . . . 10  |-  ( ( abs `  M )  e.  ZZ  ->  (
( abs `  M
) ^ 2 )  e.  ZZ )
34 dvds0 12867 . . . . . . . . . 10  |-  ( ( ( abs `  M
) ^ 2 )  e.  ZZ  ->  (
( abs `  M
) ^ 2 ) 
||  0 )
3533, 34syl 16 . . . . . . . . 9  |-  ( ( abs `  M )  e.  ZZ  ->  (
( abs `  M
) ^ 2 ) 
||  0 )
3632, 352thd 233 . . . . . . . 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 453 . . . . . 6  |-  ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  0  <->  ( ( abs `  M ) ^
2 )  ||  0
) )
399, 31, 38pm2.61ne 2681 . . . . 5  |-  ( ( ( abs `  M
)  e.  NN  /\  N  e.  ZZ )  ->  ( ( abs `  M
)  ||  N  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
405, 39sylan 459 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( abs `  M )  ||  N  <->  ( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
41 absdvdsb 12870 . . . . 5  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  ||  N  <->  ( abs `  M ) 
||  N ) )
4241adantlr 697 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( M  ||  N 
<->  ( abs `  M
)  ||  N )
)
43 zsqcl 11454 . . . . . . 7  |-  ( M  e.  ZZ  ->  ( M ^ 2 )  e.  ZZ )
4443adantr 453 . . . . . 6  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( M ^ 2 )  e.  ZZ )
45 absdvdsb 12870 . . . . . 6  |-  ( ( ( M ^ 2 )  e.  ZZ  /\  ( N ^ 2 )  e.  ZZ )  -> 
( ( M ^
2 )  ||  ( N ^ 2 )  <->  ( abs `  ( M ^ 2 ) )  ||  ( N ^ 2 ) ) )
4644, 19, 45syl2an 465 . . . . 5  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( M ^ 2 )  ||  ( N ^ 2 )  <-> 
( abs `  ( M ^ 2 ) ) 
||  ( N ^
2 ) ) )
47 zcn 10289 . . . . . . . . . 10  |-  ( M  e.  ZZ  ->  M  e.  CC )
48 abssq 12113 . . . . . . . . . 10  |-  ( M  e.  CC  ->  (
( abs `  M
) ^ 2 )  =  ( abs `  ( M ^ 2 ) ) )
4947, 48syl 16 . . . . . . . . 9  |-  ( M  e.  ZZ  ->  (
( abs `  M
) ^ 2 )  =  ( abs `  ( M ^ 2 ) ) )
5049eqcomd 2443 . . . . . . . 8  |-  ( M  e.  ZZ  ->  ( abs `  ( M ^
2 ) )  =  ( ( abs `  M
) ^ 2 ) )
5150adantr 453 . . . . . . 7  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( abs `  ( M ^ 2 ) )  =  ( ( abs `  M ) ^ 2 ) )
5251breq1d 4224 . . . . . 6  |-  ( ( M  e.  ZZ  /\  M  =/=  0 )  -> 
( ( abs `  ( M ^ 2 ) ) 
||  ( N ^
2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
5352adantr 453 . . . . 5  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( abs `  ( M ^ 2 ) )  ||  ( N ^ 2 )  <->  ( ( abs `  M ) ^
2 )  ||  ( N ^ 2 ) ) )
5446, 53bitrd 246 . . . 4  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( ( M ^ 2 )  ||  ( N ^ 2 )  <-> 
( ( abs `  M
) ^ 2 ) 
||  ( N ^
2 ) ) )
5540, 42, 543bitr4d 278 . . 3  |-  ( ( ( M  e.  ZZ  /\  M  =/=  0 )  /\  N  e.  ZZ )  ->  ( M  ||  N 
<->  ( M ^ 2 )  ||  ( N ^ 2 ) ) )
5655an32s 781 . 2  |-  ( ( ( M  e.  ZZ  /\  N  e.  ZZ )  /\  M  =/=  0
)  ->  ( M  ||  N  <->  ( M ^
2 )  ||  ( N ^ 2 ) ) )
57 0dvds 12872 . . . . 5  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  N  = 
0 ) )
58 sqeq0 11448 . . . . . 6  |-  ( N  e.  CC  ->  (
( N ^ 2 )  =  0  <->  N  =  0 ) )
5923, 58syl 16 . . . . 5  |-  ( N  e.  ZZ  ->  (
( N ^ 2 )  =  0  <->  N  =  0 ) )
6057, 59bitr4d 249 . . . 4  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  ( N ^ 2 )  =  0 ) )
61 0dvds 12872 . . . . 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 249 . . 3  |-  ( N  e.  ZZ  ->  (
0  ||  N  <->  0  ||  ( N ^ 2 ) ) )
6463adantl 454 . 2  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( 0  ||  N  <->  0 
||  ( N ^
2 ) ) )
654, 56, 64pm2.61ne 2681 1  |-  ( ( M  e.  ZZ  /\  N  e.  ZZ )  ->  ( M  ||  N  <->  ( M ^ 2 ) 
||  ( N ^
2 ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    <-> wb 178    /\ wa 360    = wceq 1653    e. wcel 1726    =/= wne 2601   class class class wbr 4214   ` cfv 5456  (class class class)co 6083   CCcc 8990   0cc0 8992   NNcn 10002   2c2 10051   ZZcz 10284   ^cexp 11384   abscabs 12041    || cdivides 12854
This theorem is referenced by:  pythagtriplem19  13209  4sqlem9  13316  4sqlem10  13317  lgsdir  21116  2sqlem8a  21157
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-sep 4332  ax-nul 4340  ax-pow 4379  ax-pr 4405  ax-un 4703  ax-cnex 9048  ax-resscn 9049  ax-1cn 9050  ax-icn 9051  ax-addcl 9052  ax-addrcl 9053  ax-mulcl 9054  ax-mulrcl 9055  ax-mulcom 9056  ax-addass 9057  ax-mulass 9058  ax-distr 9059  ax-i2m1 9060  ax-1ne0 9061  ax-1rid 9062  ax-rnegex 9063  ax-rrecex 9064  ax-cnre 9065  ax-pre-lttri 9066  ax-pre-lttrn 9067  ax-pre-ltadd 9068  ax-pre-mulgt0 9069  ax-pre-sup 9070
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2712  df-rex 2713  df-reu 2714  df-rmo 2715  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-uni 4018  df-iun 4097  df-br 4215  df-opab 4269  df-mpt 4270  df-tr 4305  df-eprel 4496  df-id 4500  df-po 4505  df-so 4506  df-fr 4543  df-we 4545  df-ord 4586  df-on 4587  df-lim 4588  df-suc 4589  df-om 4848  df-xp 4886  df-rel 4887  df-cnv 4888  df-co 4889  df-dm 4890  df-rn 4891  df-res 4892  df-ima 4893  df-iota 5420  df-fun 5458  df-fn 5459  df-f 5460  df-f1 5461  df-fo 5462  df-f1o 5463  df-fv 5464  df-ov 6086  df-oprab 6087  df-mpt2 6088  df-2nd 6352  df-riota 6551  df-recs 6635  df-rdg 6670  df-er 6907  df-en 7112  df-dom 7113  df-sdom 7114  df-sup 7448  df-pnf 9124  df-mnf 9125  df-xr 9126  df-ltxr 9127  df-le 9128  df-sub 9295  df-neg 9296  df-div 9680  df-nn 10003  df-2 10060  df-3 10061  df-n0 10224  df-z 10285  df-uz 10491  df-rp 10615  df-fl 11204  df-mod 11253  df-seq 11326  df-exp 11385  df-cj 11906  df-re 11907  df-im 11908  df-sqr 12042  df-abs 12043  df-dvds 12855  df-gcd 13009
  Copyright terms: Public domain W3C validator