Metamath Proof Explorer


Theorem modlt

Description: The modulo operation is less than its second argument. (Contributed by NM, 10-Nov-2008)

Ref Expression
Assertion modlt A B + A mod B < B

Proof

Step Hyp Ref Expression
1 recn A A
2 rpcnne0 B + B B 0
3 divcan2 A B B 0 B A B = A
4 3 3expb A B B 0 B A B = A
5 1 2 4 syl2an A B + B A B = A
6 5 oveq1d A B + B A B B A B = A B A B
7 rpcn B + B
8 7 adantl A B + B
9 rerpdivcl A B + A B
10 9 recnd A B + A B
11 refldivcl A B + A B
12 11 recnd A B + A B
13 8 10 12 subdid A B + B A B A B = B A B B A B
14 modval A B + A mod B = A B A B
15 6 13 14 3eqtr4rd A B + A mod B = B A B A B
16 fraclt1 A B A B A B < 1
17 9 16 syl A B + A B A B < 1
18 divid B B 0 B B = 1
19 2 18 syl B + B B = 1
20 19 adantl A B + B B = 1
21 17 20 breqtrrd A B + A B A B < B B
22 9 11 resubcld A B + A B A B
23 rpre B + B
24 23 adantl A B + B
25 rpregt0 B + B 0 < B
26 25 adantl A B + B 0 < B
27 ltmuldiv2 A B A B B B 0 < B B A B A B < B A B A B < B B
28 22 24 26 27 syl3anc A B + B A B A B < B A B A B < B B
29 21 28 mpbird A B + B A B A B < B
30 15 29 eqbrtrd A B + A mod B < B