Metamath Proof Explorer


Theorem modltm1p1mod

Description: If a real number modulo a positive real number is less than the positive real number decreased by 1, the real number increased by 1 modulo the positive real number equals the real number modulo the positive real number increased by 1. (Contributed by AV, 2-Nov-2018)

Ref Expression
Assertion modltm1p1mod A M + A mod M < M 1 A + 1 mod M = A mod M + 1

Proof

Step Hyp Ref Expression
1 simpl A M + A
2 1red A M + 1
3 simpr A M + M +
4 1 2 3 3jca A M + A 1 M +
5 4 3adant3 A M + A mod M < M 1 A 1 M +
6 modaddmod A 1 M + A mod M + 1 mod M = A + 1 mod M
7 5 6 syl A M + A mod M < M 1 A mod M + 1 mod M = A + 1 mod M
8 modcl A M + A mod M
9 peano2re A mod M A mod M + 1
10 8 9 syl A M + A mod M + 1
11 10 3 jca A M + A mod M + 1 M +
12 11 3adant3 A M + A mod M < M 1 A mod M + 1 M +
13 0red A M + 0
14 modge0 A M + 0 A mod M
15 8 lep1d A M + A mod M A mod M + 1
16 13 8 10 14 15 letrd A M + 0 A mod M + 1
17 16 3adant3 A M + A mod M < M 1 0 A mod M + 1
18 rpre M + M
19 18 adantl A M + M
20 8 2 19 ltaddsubd A M + A mod M + 1 < M A mod M < M 1
21 20 biimp3ar A M + A mod M < M 1 A mod M + 1 < M
22 modid A mod M + 1 M + 0 A mod M + 1 A mod M + 1 < M A mod M + 1 mod M = A mod M + 1
23 12 17 21 22 syl12anc A M + A mod M < M 1 A mod M + 1 mod M = A mod M + 1
24 7 23 eqtr3d A M + A mod M < M 1 A + 1 mod M = A mod M + 1