Metamath Proof Explorer


Theorem modm1div

Description: An integer greater than one divides another integer minus one iff the second integer modulo the first integer is one. (Contributed by AV, 30-May-2023)

Ref Expression
Assertion modm1div N 2 A A mod N = 1 N A 1

Proof

Step Hyp Ref Expression
1 eluzelre N 2 N
2 eluz2gt1 N 2 1 < N
3 2 adantr N 2 A 1 < N
4 1mod N 1 < N 1 mod N = 1
5 4 eqcomd N 1 < N 1 = 1 mod N
6 1 3 5 syl2an2r N 2 A 1 = 1 mod N
7 6 eqeq2d N 2 A A mod N = 1 A mod N = 1 mod N
8 eluz2nn N 2 N
9 8 adantr N 2 A N
10 simpr N 2 A A
11 1zzd N 2 A 1
12 moddvds N A 1 A mod N = 1 mod N N A 1
13 9 10 11 12 syl3anc N 2 A A mod N = 1 mod N N A 1
14 7 13 bitrd N 2 A A mod N = 1 N A 1