Metamath Proof Explorer


Theorem gcdneg

Description: Negating one operand of the gcd operator does not alter the result. (Contributed by Paul Chapman, 21-Mar-2011)

Ref Expression
Assertion gcdneg M N M gcd -N = M gcd N

Proof

Step Hyp Ref Expression
1 oveq12 M = 0 N = 0 M gcd N = 0 gcd 0
2 1 adantl M N M = 0 N = 0 M gcd N = 0 gcd 0
3 zcn N N
4 3 negeq0d N N = 0 N = 0
5 4 anbi2d N M = 0 N = 0 M = 0 N = 0
6 5 adantl M N M = 0 N = 0 M = 0 N = 0
7 oveq12 M = 0 N = 0 M gcd -N = 0 gcd 0
8 6 7 syl6bi M N M = 0 N = 0 M gcd -N = 0 gcd 0
9 8 imp M N M = 0 N = 0 M gcd -N = 0 gcd 0
10 2 9 eqtr4d M N M = 0 N = 0 M gcd N = M gcd -N
11 gcddvds M N M gcd N M M gcd N N
12 gcdcl M N M gcd N 0
13 12 nn0zd M N M gcd N
14 dvdsnegb M gcd N N M gcd N N M gcd N -N
15 13 14 sylancom M N M gcd N N M gcd N -N
16 15 anbi2d M N M gcd N M M gcd N N M gcd N M M gcd N -N
17 11 16 mpbid M N M gcd N M M gcd N -N
18 6 notbid M N ¬ M = 0 N = 0 ¬ M = 0 N = 0
19 simpl M N M
20 znegcl N N
21 20 adantl M N N
22 dvdslegcd M gcd N M N ¬ M = 0 N = 0 M gcd N M M gcd N -N M gcd N M gcd -N
23 22 ex M gcd N M N ¬ M = 0 N = 0 M gcd N M M gcd N -N M gcd N M gcd -N
24 13 19 21 23 syl3anc M N ¬ M = 0 N = 0 M gcd N M M gcd N -N M gcd N M gcd -N
25 18 24 sylbid M N ¬ M = 0 N = 0 M gcd N M M gcd N -N M gcd N M gcd -N
26 25 com12 ¬ M = 0 N = 0 M N M gcd N M M gcd N -N M gcd N M gcd -N
27 17 26 mpdi ¬ M = 0 N = 0 M N M gcd N M gcd -N
28 27 impcom M N ¬ M = 0 N = 0 M gcd N M gcd -N
29 gcddvds M N M gcd -N M M gcd -N -N
30 20 29 sylan2 M N M gcd -N M M gcd -N -N
31 gcdcl M N M gcd -N 0
32 31 nn0zd M N M gcd -N
33 20 32 sylan2 M N M gcd -N
34 dvdsnegb M gcd -N N M gcd -N N M gcd -N -N
35 33 34 sylancom M N M gcd -N N M gcd -N -N
36 35 anbi2d M N M gcd -N M M gcd -N N M gcd -N M M gcd -N -N
37 30 36 mpbird M N M gcd -N M M gcd -N N
38 simpr M N N
39 dvdslegcd M gcd -N M N ¬ M = 0 N = 0 M gcd -N M M gcd -N N M gcd -N M gcd N
40 39 ex M gcd -N M N ¬ M = 0 N = 0 M gcd -N M M gcd -N N M gcd -N M gcd N
41 33 19 38 40 syl3anc M N ¬ M = 0 N = 0 M gcd -N M M gcd -N N M gcd -N M gcd N
42 41 com12 ¬ M = 0 N = 0 M N M gcd -N M M gcd -N N M gcd -N M gcd N
43 37 42 mpdi ¬ M = 0 N = 0 M N M gcd -N M gcd N
44 43 impcom M N ¬ M = 0 N = 0 M gcd -N M gcd N
45 13 zred M N M gcd N
46 33 zred M N M gcd -N
47 45 46 letri3d M N M gcd N = M gcd -N M gcd N M gcd -N M gcd -N M gcd N
48 47 adantr M N ¬ M = 0 N = 0 M gcd N = M gcd -N M gcd N M gcd -N M gcd -N M gcd N
49 28 44 48 mpbir2and M N ¬ M = 0 N = 0 M gcd N = M gcd -N
50 10 49 pm2.61dan M N M gcd N = M gcd -N
51 50 eqcomd M N M gcd -N = M gcd N