Metamath Proof Explorer


Theorem ltmod

Description: A sufficient condition for a "less than" relationship for the mod operator. (Contributed by Glauco Siliprandi, 11-Dec-2019)

Ref Expression
Hypotheses ltmod.a φ A
ltmod.b φ B +
ltmod.c φ C A A mod B A
Assertion ltmod φ C mod B < A mod B

Proof

Step Hyp Ref Expression
1 ltmod.a φ A
2 ltmod.b φ B +
3 ltmod.c φ C A A mod B A
4 1 2 modcld φ A mod B
5 1 4 resubcld φ A A mod B
6 1 rexrd φ A *
7 icossre A A mod B A * A A mod B A
8 5 6 7 syl2anc φ A A mod B A
9 8 3 sseldd φ C
10 2 rpred φ B
11 9 2 rerpdivcld φ C B
12 11 flcld φ C B
13 12 zred φ C B
14 10 13 remulcld φ B C B
15 5 rexrd φ A A mod B *
16 icoltub A A mod B * A * C A A mod B A C < A
17 15 6 3 16 syl3anc φ C < A
18 9 1 14 17 ltsub1dd φ C B C B < A B C B
19 icossicc A A mod B A A A mod B A
20 19 3 sselid φ C A A mod B A
21 1 2 20 lefldiveq φ A B = C B
22 21 eqcomd φ C B = A B
23 22 oveq2d φ B C B = B A B
24 23 oveq2d φ A B C B = A B A B
25 18 24 breqtrd φ C B C B < A B A B
26 modval C B + C mod B = C B C B
27 9 2 26 syl2anc φ C mod B = C B C B
28 modval A B + A mod B = A B A B
29 1 2 28 syl2anc φ A mod B = A B A B
30 25 27 29 3brtr4d φ C mod B < A mod B