Metamath Proof Explorer


Theorem dvdssqlem

Description: Lemma for dvdssq . (Contributed by Scott Fenton, 18-Apr-2014) (Revised by Mario Carneiro, 19-Apr-2014)

Ref Expression
Assertion dvdssqlem M N M N M 2 N 2

Proof

Step Hyp Ref Expression
1 nnz M M
2 nnz N N
3 dvdssqim M N M N M 2 N 2
4 1 2 3 syl2an M N M N M 2 N 2
5 sqgcd M N M gcd N 2 = M 2 gcd N 2
6 5 adantr M N M 2 N 2 M gcd N 2 = M 2 gcd N 2
7 nnsqcl M M 2
8 nnsqcl N N 2
9 gcdeq M 2 N 2 M 2 gcd N 2 = M 2 M 2 N 2
10 7 8 9 syl2an M N M 2 gcd N 2 = M 2 M 2 N 2
11 10 biimpar M N M 2 N 2 M 2 gcd N 2 = M 2
12 6 11 eqtrd M N M 2 N 2 M gcd N 2 = M 2
13 gcdcl M N M gcd N 0
14 1 2 13 syl2an M N M gcd N 0
15 14 nn0red M N M gcd N
16 14 nn0ge0d M N 0 M gcd N
17 nnre M M
18 17 adantr M N M
19 nnnn0 M M 0
20 19 nn0ge0d M 0 M
21 20 adantr M N 0 M
22 sq11 M gcd N 0 M gcd N M 0 M M gcd N 2 = M 2 M gcd N = M
23 15 16 18 21 22 syl22anc M N M gcd N 2 = M 2 M gcd N = M
24 23 adantr M N M 2 N 2 M gcd N 2 = M 2 M gcd N = M
25 12 24 mpbid M N M 2 N 2 M gcd N = M
26 gcddvds M N M gcd N M M gcd N N
27 1 2 26 syl2an M N M gcd N M M gcd N N
28 27 adantr M N M 2 N 2 M gcd N M M gcd N N
29 28 simprd M N M 2 N 2 M gcd N N
30 25 29 eqbrtrrd M N M 2 N 2 M N
31 30 ex M N M 2 N 2 M N
32 4 31 impbid M N M N M 2 N 2