Metamath Proof Explorer


Theorem dvdssub2

Description: If an integer divides a difference, then it divides one term iff it divides the other. (Contributed by Mario Carneiro, 13-Jul-2014)

Ref Expression
Assertion dvdssub2 K M N K M N K M K N

Proof

Step Hyp Ref Expression
1 zsubcl M N M N
2 1 3adant1 K M N M N
3 dvds2sub K M M N K M K M N K M M N
4 2 3 syld3an3 K M N K M K M N K M M N
5 4 ancomsd K M N K M N K M K M M N
6 5 imp K M N K M N K M K M M N
7 zcn M M
8 zcn N N
9 nncan M N M M N = N
10 7 8 9 syl2an M N M M N = N
11 10 3adant1 K M N M M N = N
12 11 adantr K M N K M N K M M M N = N
13 6 12 breqtrd K M N K M N K M K N
14 13 expr K M N K M N K M K N
15 dvds2add K M N N K M N K N K M - N + N
16 2 15 syld3an2 K M N K M N K N K M - N + N
17 16 imp K M N K M N K N K M - N + N
18 npcan M N M - N + N = M
19 7 8 18 syl2an M N M - N + N = M
20 19 3adant1 K M N M - N + N = M
21 20 adantr K M N K M N K N M - N + N = M
22 17 21 breqtrd K M N K M N K N K M
23 22 expr K M N K M N K N K M
24 14 23 impbid K M N K M N K M K N