Metamath Proof Explorer


Theorem fldivmod

Description: Expressing the floor of a division by the modulo operator. (Contributed by AV, 6-Jun-2020)

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

Proof

Step Hyp Ref Expression
1 rerpdivcl A B + A B
2 1 flcld A B + A B
3 2 zcnd A B + A B
4 rpcn B + B
5 4 adantl A B + B
6 3 5 mulcld A B + A B B
7 modcl A B + A mod B
8 7 recnd A B + A mod B
9 6 8 pncand A B + A B B + A mod B - A mod B = A B B
10 6 8 addcld A B + A B B + A mod B
11 10 8 subcld A B + A B B + A mod B - A mod B
12 rpne0 B + B 0
13 12 adantl A B + B 0
14 11 3 5 13 divmul3d A B + A B B + A mod B - A mod B B = A B A B B + A mod B - A mod B = A B B
15 9 14 mpbird A B + A B B + A mod B - A mod B B = A B
16 flpmodeq A B + A B B + A mod B = A
17 16 oveq1d A B + A B B + A mod B - A mod B = A A mod B
18 17 oveq1d A B + A B B + A mod B - A mod B B = A A mod B B
19 15 18 eqtr3d A B + A B = A A mod B B