Metamath Proof Explorer


Theorem p1modz1

Description: If a number greater than 1 divides another number, the second number increased by 1 is 1 modulo the first number. (Contributed by AV, 19-Mar-2022)

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

Proof

Step Hyp Ref Expression
1 dvdszrcl M A M A
2 0red M 1 < M 0
3 1red M 1 < M 1
4 zre M M
5 4 adantr M 1 < M M
6 2 3 5 3jca M 1 < M 0 1 M
7 0lt1 0 < 1
8 7 a1i M 0 < 1
9 8 anim1i M 1 < M 0 < 1 1 < M
10 lttr 0 1 M 0 < 1 1 < M 0 < M
11 6 9 10 sylc M 1 < M 0 < M
12 11 ex M 1 < M 0 < M
13 elnnz M M 0 < M
14 13 simplbi2 M 0 < M M
15 12 14 syld M 1 < M M
16 15 adantr M A 1 < M M
17 16 imp M A 1 < M M
18 dvdsmod0 M M A A mod M = 0
19 17 18 sylan M A 1 < M M A A mod M = 0
20 19 ex M A 1 < M M A A mod M = 0
21 oveq1 A mod M = 0 A mod M + 1 = 0 + 1
22 0p1e1 0 + 1 = 1
23 21 22 eqtrdi A mod M = 0 A mod M + 1 = 1
24 23 oveq1d A mod M = 0 A mod M + 1 mod M = 1 mod M
25 24 adantl M A 1 < M A mod M = 0 A mod M + 1 mod M = 1 mod M
26 zre A A
27 26 adantl M A A
28 27 adantr M A 1 < M A
29 1red M A 1 < M 1
30 17 nnrpd M A 1 < M M +
31 28 29 30 3jca M A 1 < M A 1 M +
32 31 adantr M A 1 < M A mod M = 0 A 1 M +
33 modaddmod A 1 M + A mod M + 1 mod M = A + 1 mod M
34 32 33 syl M A 1 < M A mod M = 0 A mod M + 1 mod M = A + 1 mod M
35 4 adantr M A M
36 1mod M 1 < M 1 mod M = 1
37 35 36 sylan M A 1 < M 1 mod M = 1
38 37 adantr M A 1 < M A mod M = 0 1 mod M = 1
39 25 34 38 3eqtr3d M A 1 < M A mod M = 0 A + 1 mod M = 1
40 39 ex M A 1 < M A mod M = 0 A + 1 mod M = 1
41 20 40 syld M A 1 < M M A A + 1 mod M = 1
42 41 ex M A 1 < M M A A + 1 mod M = 1
43 42 com23 M A M A 1 < M A + 1 mod M = 1
44 1 43 mpcom M A 1 < M A + 1 mod M = 1
45 44 imp M A 1 < M A + 1 mod M = 1