Metamath Proof Explorer


Theorem mod0

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

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

Proof

Step Hyp Ref Expression
1 modval A B + A mod B = A B A B
2 1 eqeq1d A B + A mod B = 0 A B A B = 0
3 recn A A
4 3 adantr A B + A
5 rpre B + B
6 5 adantl A B + B
7 refldivcl A B + A B
8 6 7 remulcld A B + B A B
9 8 recnd A B + B A B
10 4 9 subeq0ad A B + A B A B = 0 A = B A B
11 2 10 bitrd A B + A mod B = 0 A = B A B
12 7 recnd A B + A B
13 rpcnne0 B + B B 0
14 13 adantl A B + B B 0
15 divmul2 A A B B B 0 A B = A B A = B A B
16 4 12 14 15 syl3anc A B + A B = A B A = B A B
17 eqcom A B = A B A B = A B
18 16 17 bitr3di A B + A = B A B A B = A B
19 11 18 bitrd A B + A mod B = 0 A B = A B
20 rerpdivcl A B + A B
21 flidz A B A B = A B A B
22 20 21 syl A B + A B = A B A B
23 19 22 bitrd A B + A mod B = 0 A B