Metamath Proof Explorer


Theorem negmod0

Description: A is divisible by B iff its negative is. (Contributed by Jeff Madsen, 2-Sep-2009) (Proof shortened by Fan Zheng, 7-Jun-2016)

Ref Expression
Assertion negmod0 A B + A mod B = 0 A mod B = 0

Proof

Step Hyp Ref Expression
1 rerpdivcl A B + A B
2 recn A B A B
3 znegclb A B A B A B
4 1 2 3 3syl A B + A B A B
5 recn A A
6 5 adantr A B + A
7 rpcn B + B
8 7 adantl A B + B
9 rpne0 B + B 0
10 9 adantl A B + B 0
11 6 8 10 divnegd A B + A B = A B
12 11 eleq1d A B + A B A B
13 4 12 bitrd A B + A B A B
14 mod0 A B + A mod B = 0 A B
15 renegcl A A
16 mod0 A B + A mod B = 0 A B
17 15 16 sylan A B + A mod B = 0 A B
18 13 14 17 3bitr4d A B + A mod B = 0 A mod B = 0