Metamath Proof Explorer


Theorem m1modnnsub1

Description: Minus one modulo a positive integer is equal to the integer minus one. (Contributed by AV, 14-Jul-2021)

Ref Expression
Assertion m1modnnsub1 M -1 mod M = M 1

Proof

Step Hyp Ref Expression
1 1re 1
2 nnrp M M +
3 negmod 1 M + -1 mod M = M 1 mod M
4 1 2 3 sylancr M -1 mod M = M 1 mod M
5 nnre M M
6 peano2rem M M 1
7 5 6 syl M M 1
8 nnm1ge0 M 0 M 1
9 5 ltm1d M M 1 < M
10 modid M 1 M + 0 M 1 M 1 < M M 1 mod M = M 1
11 7 2 8 9 10 syl22anc M M 1 mod M = M 1
12 4 11 eqtrd M -1 mod M = M 1