Metamath Proof Explorer


Theorem modn0mul

Description: If an integer is not 0 modulo a positive integer, this integer must be the sum of the product of another integer and the modulus and a positive integer less than the modulus. (Contributed by AV, 7-Jun-2020)

Ref Expression
Assertion modn0mul A N A mod N 0 x y 1 ..^ N A = x N + y

Proof

Step Hyp Ref Expression
1 zre A A
2 1 adantr A N A
3 nnre N N
4 3 adantl A N N
5 nnne0 N N 0
6 5 adantl A N N 0
7 2 4 6 redivcld A N A N
8 7 flcld A N A N
9 8 adantr A N A mod N 0 A N
10 zmodfzo A N A mod N 0 ..^ N
11 10 anim1i A N A mod N 0 A mod N 0 ..^ N A mod N 0
12 fzo1fzo0n0 A mod N 1 ..^ N A mod N 0 ..^ N A mod N 0
13 11 12 sylibr A N A mod N 0 A mod N 1 ..^ N
14 nnrp N N +
15 1 14 anim12i A N A N +
16 15 adantr A N A mod N 0 A N +
17 flpmodeq A N + A N N + A mod N = A
18 16 17 syl A N A mod N 0 A N N + A mod N = A
19 18 eqcomd A N A mod N 0 A = A N N + A mod N
20 oveq1 x = A N x N = A N N
21 20 oveq1d x = A N x N + y = A N N + y
22 21 eqeq2d x = A N A = x N + y A = A N N + y
23 oveq2 y = A mod N A N N + y = A N N + A mod N
24 23 eqeq2d y = A mod N A = A N N + y A = A N N + A mod N
25 22 24 rspc2ev A N A mod N 1 ..^ N A = A N N + A mod N x y 1 ..^ N A = x N + y
26 9 13 19 25 syl3anc A N A mod N 0 x y 1 ..^ N A = x N + y
27 26 ex A N A mod N 0 x y 1 ..^ N A = x N + y