Metamath Proof Explorer


Theorem moddiffl

Description: Value of the modulo operation rewritten to give two ways of expressing the quotient when " A is divided by B using Euclidean division." Multiplying both sides by B , this implies that A mod B differs from A by an integer multiple of B . (Contributed by Jeff Madsen, 17-Jun-2010) (Revised by Mario Carneiro, 6-Sep-2016)

Ref Expression
Assertion moddiffl A B + A A mod B B = A B

Proof

Step Hyp Ref Expression
1 modval A B + A mod B = A B A B
2 1 oveq2d A B + A A mod B = A A B A B
3 simpl A B + A
4 3 recnd A B + A
5 rpcn B + B
6 5 adantl A B + B
7 rerpdivcl A B + A B
8 7 flcld A B + A B
9 8 zcnd A B + A B
10 6 9 mulcld A B + B A B
11 4 10 nncand A B + A A B A B = B A B
12 2 11 eqtrd A B + A A mod B = B A B
13 12 oveq1d A B + A A mod B B = B A B B
14 rpne0 B + B 0
15 14 adantl A B + B 0
16 9 6 15 divcan3d A B + B A B B = A B
17 13 16 eqtrd A B + A A mod B B = A B