Metamath Proof Explorer


Theorem mulp1mod1

Description: The product of an integer and an integer greater than 1 increased by 1 is 1 modulo the integer greater than 1. (Contributed by AV, 15-Jul-2021)

Ref Expression
Assertion mulp1mod1 A N 2 N A + 1 mod N = 1

Proof

Step Hyp Ref Expression
1 eluzelcn N 2 N
2 1 adantl A N 2 N
3 zcn A A
4 3 adantr A N 2 A
5 2 4 mulcomd A N 2 N A = A N
6 5 oveq1d A N 2 N A mod N = A N mod N
7 eluz2nn N 2 N
8 7 nnrpd N 2 N +
9 mulmod0 A N + A N mod N = 0
10 8 9 sylan2 A N 2 A N mod N = 0
11 6 10 eqtrd A N 2 N A mod N = 0
12 11 oveq1d A N 2 N A mod N + 1 = 0 + 1
13 0p1e1 0 + 1 = 1
14 12 13 eqtrdi A N 2 N A mod N + 1 = 1
15 14 oveq1d A N 2 N A mod N + 1 mod N = 1 mod N
16 eluzelre N 2 N
17 16 adantl A N 2 N
18 zre A A
19 18 adantr A N 2 A
20 17 19 remulcld A N 2 N A
21 1red A N 2 1
22 8 adantl A N 2 N +
23 modaddmod N A 1 N + N A mod N + 1 mod N = N A + 1 mod N
24 20 21 22 23 syl3anc A N 2 N A mod N + 1 mod N = N A + 1 mod N
25 eluz2gt1 N 2 1 < N
26 16 25 jca N 2 N 1 < N
27 26 adantl A N 2 N 1 < N
28 1mod N 1 < N 1 mod N = 1
29 27 28 syl A N 2 1 mod N = 1
30 15 24 29 3eqtr3d A N 2 N A + 1 mod N = 1