Metamath Proof Explorer


Theorem dvdssq

Description: Two numbers are divisible iff their squares are. (Contributed by Scott Fenton, 18-Apr-2014) (Revised by Mario Carneiro, 19-Apr-2014)

Ref Expression
Assertion dvdssq M N M N M 2 N 2

Proof

Step Hyp Ref Expression
1 breq1 M = 0 M N 0 N
2 sq0i M = 0 M 2 = 0
3 2 breq1d M = 0 M 2 N 2 0 N 2
4 1 3 bibi12d M = 0 M N M 2 N 2 0 N 0 N 2
5 nnabscl M M 0 M
6 breq2 N = 0 M N M 0
7 sq0i N = 0 N 2 = 0
8 7 breq2d N = 0 M 2 N 2 M 2 0
9 6 8 bibi12d N = 0 M N M 2 N 2 M 0 M 2 0
10 nnabscl N N 0 N
11 dvdssqlem M N M N M 2 N 2
12 10 11 sylan2 M N N 0 M N M 2 N 2
13 nnz M M
14 simpl N N 0 N
15 dvdsabsb M N M N M N
16 13 14 15 syl2an M N N 0 M N M N
17 nnsqcl M M 2
18 17 nnzd M M 2
19 zsqcl N N 2
20 19 adantr N N 0 N 2
21 dvdsabsb M 2 N 2 M 2 N 2 M 2 N 2
22 18 20 21 syl2an M N N 0 M 2 N 2 M 2 N 2
23 zcn N N
24 23 adantr N N 0 N
25 abssq N N 2 = N 2
26 24 25 syl N N 0 N 2 = N 2
27 26 breq2d N N 0 M 2 N 2 M 2 N 2
28 27 adantl M N N 0 M 2 N 2 M 2 N 2
29 22 28 bitr4d M N N 0 M 2 N 2 M 2 N 2
30 12 16 29 3bitr4d M N N 0 M N M 2 N 2
31 30 anassrs M N N 0 M N M 2 N 2
32 dvds0 M M 0
33 zsqcl M M 2
34 dvds0 M 2 M 2 0
35 33 34 syl M M 2 0
36 32 35 2thd M M 0 M 2 0
37 13 36 syl M M 0 M 2 0
38 37 adantr M N M 0 M 2 0
39 9 31 38 pm2.61ne M N M N M 2 N 2
40 5 39 sylan M M 0 N M N M 2 N 2
41 absdvdsb M N M N M N
42 41 adantlr M M 0 N M N M N
43 zsqcl M M 2
44 43 adantr M M 0 M 2
45 absdvdsb M 2 N 2 M 2 N 2 M 2 N 2
46 44 19 45 syl2an M M 0 N M 2 N 2 M 2 N 2
47 zcn M M
48 abssq M M 2 = M 2
49 47 48 syl M M 2 = M 2
50 49 eqcomd M M 2 = M 2
51 50 adantr M M 0 M 2 = M 2
52 51 breq1d M M 0 M 2 N 2 M 2 N 2
53 52 adantr M M 0 N M 2 N 2 M 2 N 2
54 46 53 bitrd M M 0 N M 2 N 2 M 2 N 2
55 40 42 54 3bitr4d M M 0 N M N M 2 N 2
56 55 an32s M N M 0 M N M 2 N 2
57 0dvds N 0 N N = 0
58 sqeq0 N N 2 = 0 N = 0
59 23 58 syl N N 2 = 0 N = 0
60 57 59 bitr4d N 0 N N 2 = 0
61 0dvds N 2 0 N 2 N 2 = 0
62 19 61 syl N 0 N 2 N 2 = 0
63 60 62 bitr4d N 0 N 0 N 2
64 63 adantl M N 0 N 0 N 2
65 4 56 64 pm2.61ne M N M N M 2 N 2