Metamath Proof Explorer


Theorem addmodne

Description: The sum of a nonnegative integer and a positive integer modulo a number greater than both integers is not equal to the nonnegative integer. (Contributed by AV, 27-Aug-2025) (Proof shortened by AV, 6-Sep-2025)

Ref Expression
Assertion addmodne M A 0 A < M B B < M A + B mod M A

Proof

Step Hyp Ref Expression
1 2z 2
2 1 a1i M B B < M 2
3 nnz M M
4 3 adantr M B B < M M
5 1red M B B < M 1
6 nnre B B
7 6 ad2antrl M B B < M B
8 nnre M M
9 8 adantr M B B < M M
10 nnge1 B 1 B
11 10 ad2antrl M B B < M 1 B
12 simprr M B B < M B < M
13 5 7 9 11 12 lelttrd M B B < M 1 < M
14 1zzd B B < M 1
15 zltp1le 1 M 1 < M 1 + 1 M
16 14 3 15 syl2anr M B B < M 1 < M 1 + 1 M
17 1p1e2 1 + 1 = 2
18 17 breq1i 1 + 1 M 2 M
19 16 18 bitrdi M B B < M 1 < M 2 M
20 13 19 mpbid M B B < M 2 M
21 2 4 20 3jca M B B < M 2 M 2 M
22 21 3adant2 M A 0 A < M B B < M 2 M 2 M
23 eluz2 M 2 2 M 2 M
24 22 23 sylibr M A 0 A < M B B < M M 2
25 nn0z A 0 A
26 25 adantr A 0 A < M A
27 26 3ad2ant2 M A 0 A < M B B < M A
28 simprl M B B < M B
29 simpl M B B < M M
30 28 29 12 3jca M B B < M B M B < M
31 30 3adant2 M A 0 A < M B B < M B M B < M
32 elfzo1 B 1 ..^ M B M B < M
33 31 32 sylibr M A 0 A < M B B < M B 1 ..^ M
34 zplusmodne M 2 A B 1 ..^ M A + B mod M A mod M
35 24 27 33 34 syl3anc M A 0 A < M B B < M A + B mod M A mod M
36 nnrp M M +
37 nn0re A 0 A
38 37 adantr A 0 A < M A
39 36 38 anim12ci M A 0 A < M A M +
40 39 3adant3 M A 0 A < M B B < M A M +
41 nn0ge0 A 0 0 A
42 41 anim1i A 0 A < M 0 A A < M
43 42 3ad2ant2 M A 0 A < M B B < M 0 A A < M
44 modid A M + 0 A A < M A mod M = A
45 40 43 44 syl2anc M A 0 A < M B B < M A mod M = A
46 35 45 neeqtrd M A 0 A < M B B < M A + B mod M A