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 ANAmodN0xy1..^NA=x N+y

Proof

Step Hyp Ref Expression
1 zre AA
2 1 adantr ANA
3 nnre NN
4 3 adantl ANN
5 nnne0 NN0
6 5 adantl ANN0
7 2 4 6 redivcld ANAN
8 7 flcld ANAN
9 8 adantr ANAmodN0AN
10 zmodfzo ANAmodN0..^N
11 10 anim1i ANAmodN0AmodN0..^NAmodN0
12 fzo1fzo0n0 AmodN1..^NAmodN0..^NAmodN0
13 11 12 sylibr ANAmodN0AmodN1..^N
14 nnrp NN+
15 1 14 anim12i ANAN+
16 15 adantr ANAmodN0AN+
17 flpmodeq AN+AN N+AmodN=A
18 16 17 syl ANAmodN0AN N+AmodN=A
19 18 eqcomd ANAmodN0A=AN N+AmodN
20 oveq1 x=ANx N=AN N
21 20 oveq1d x=ANx N+y=AN N+y
22 21 eqeq2d x=ANA=x N+yA=AN N+y
23 oveq2 y=AmodNAN N+y=AN N+AmodN
24 23 eqeq2d y=AmodNA=AN N+yA=AN N+AmodN
25 22 24 rspc2ev ANAmodN1..^NA=AN N+AmodNxy1..^NA=x N+y
26 9 13 19 25 syl3anc ANAmodN0xy1..^NA=x N+y
27 26 ex ANAmodN0xy1..^NA=x N+y