Metamath Proof Explorer


Theorem nzprmdif

Description: Subtract one prime's multiples from an unequal prime's. (Contributed by Steve Rodriguez, 20-Jan-2020)

Ref Expression
Hypotheses nzprmdif.m φM
nzprmdif.n φN
nzprmdif.ne φMN
Assertion nzprmdif φMN=M M N

Proof

Step Hyp Ref Expression
1 nzprmdif.m φM
2 nzprmdif.n φN
3 nzprmdif.ne φMN
4 difin MMN=MN
5 prmz MM
6 1 5 syl φM
7 prmz NN
8 2 7 syl φN
9 6 8 nzin φMN=MlcmN
10 9 difeq2d φMMN=MMlcmN
11 4 10 eqtr3id φMN=MMlcmN
12 lcmgcd MNMlcmNMgcdN= M N
13 6 8 12 syl2anc φMlcmNMgcdN= M N
14 prmrp MNMgcdN=1MN
15 1 2 14 syl2anc φMgcdN=1MN
16 3 15 mpbird φMgcdN=1
17 16 oveq2d φMlcmNMgcdN=MlcmN1
18 lcmcl MNMlcmN0
19 6 8 18 syl2anc φMlcmN0
20 19 nn0cnd φMlcmN
21 20 mulridd φMlcmN1=MlcmN
22 17 21 eqtrd φMlcmNMgcdN=MlcmN
23 6 zred φM
24 8 zred φN
25 23 24 remulcld φ M N
26 prmnn MM
27 1 26 syl φM
28 27 nnnn0d φM0
29 28 nn0ge0d φ0M
30 prmnn NN
31 2 30 syl φN
32 31 nnnn0d φN0
33 32 nn0ge0d φ0N
34 23 24 29 33 mulge0d φ0 M N
35 25 34 absidd φ M N= M N
36 13 22 35 3eqtr3d φMlcmN= M N
37 36 sneqd φMlcmN= M N
38 37 imaeq2d φMlcmN= M N
39 38 difeq2d φMMlcmN=M M N
40 11 39 eqtrd φMN=M M N