Metamath Proof Explorer


Theorem modabs

Description: Absorption law for modulo. (Contributed by NM, 29-Dec-2008)

Ref Expression
Assertion modabs A B + C + B C A mod B mod C = A mod B

Proof

Step Hyp Ref Expression
1 modcl A B + A mod B
2 1 anim1i A B + C + A mod B C +
3 2 3impa A B + C + A mod B C +
4 3 adantr A B + C + B C A mod B C +
5 modge0 A B + 0 A mod B
6 5 3adant3 A B + C + 0 A mod B
7 6 adantr A B + C + B C 0 A mod B
8 1 3adant3 A B + C + A mod B
9 8 adantr A B + C + B C A mod B
10 rpre B + B
11 10 3ad2ant2 A B + C + B
12 11 adantr A B + C + B C B
13 rpre C + C
14 13 3ad2ant3 A B + C + C
15 14 adantr A B + C + B C C
16 modlt A B + A mod B < B
17 16 3adant3 A B + C + A mod B < B
18 17 adantr A B + C + B C A mod B < B
19 simpr A B + C + B C B C
20 9 12 15 18 19 ltletrd A B + C + B C A mod B < C
21 modid A mod B C + 0 A mod B A mod B < C A mod B mod C = A mod B
22 4 7 20 21 syl12anc A B + C + B C A mod B mod C = A mod B