Description: If a nonnegative integer is less than twice a positive integer, the nonnegative integer modulo the positive integer equals the nonnegative integer or the nonnegative integer minus the positive integer. (Contributed by Alexander van der Vekens, 21-May-2018)
Ref | Expression | ||
---|---|---|---|
Assertion | modifeq2int | |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | nn0re | |
|
2 | nnrp | |
|
3 | 1 2 | anim12i | |
4 | 3 | 3adant3 | |
5 | nn0ge0 | |
|
6 | 5 | 3ad2ant1 | |
7 | 6 | anim1i | |
8 | 7 | ancoms | |
9 | modid | |
|
10 | 4 8 9 | syl2an2 | |
11 | iftrue | |
|
12 | 11 | eqcomd | |
13 | 12 | adantr | |
14 | 10 13 | eqtrd | |
15 | 14 | ex | |
16 | 4 | adantr | |
17 | nnre | |
|
18 | lenlt | |
|
19 | 17 1 18 | syl2anr | |
20 | 19 | 3adant3 | |
21 | 20 | biimpar | |
22 | simpl3 | |
|
23 | 2submod | |
|
24 | 16 21 22 23 | syl12anc | |
25 | iffalse | |
|
26 | 25 | adantl | |
27 | 26 | eqcomd | |
28 | 24 27 | eqtrd | |
29 | 28 | expcom | |
30 | 15 29 | pm2.61i | |