Metamath Proof Explorer


Theorem mod0mul

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

Ref Expression
Assertion mod0mul A N A mod N = 0 x A = x N

Proof

Step Hyp Ref Expression
1 zre A A
2 nnrp N N +
3 mod0 A N + A mod N = 0 A N
4 1 2 3 syl2an A N A mod N = 0 A N
5 simpr A N A N A N
6 oveq1 x = A N x N = A N N
7 6 eqeq2d x = A N A = x N A = A N N
8 7 adantl A N A N x = A N A = x N A = A N N
9 zcn A A
10 9 adantr A N A
11 nncn N N
12 11 adantl A N N
13 nnne0 N N 0
14 13 adantl A N N 0
15 10 12 14 divcan1d A N A N N = A
16 15 adantr A N A N A N N = A
17 16 eqcomd A N A N A = A N N
18 5 8 17 rspcedvd A N A N x A = x N
19 18 ex A N A N x A = x N
20 4 19 sylbid A N A mod N = 0 x A = x N