Metamath Proof Explorer


Theorem dvdseq

Description: If two nonnegative integers divide each other, they must be equal. (Contributed by Mario Carneiro, 30-May-2014) (Proof shortened by AV, 7-Aug-2021)

Ref Expression
Assertion dvdseq M 0 N 0 M N N M M = N

Proof

Step Hyp Ref Expression
1 dvdsabseq M N N M M = N
2 nn0re M 0 M
3 nn0ge0 M 0 0 M
4 2 3 absidd M 0 M = M
5 4 adantr M 0 N 0 M = M
6 5 eqcomd M 0 N 0 M = M
7 6 adantr M 0 N 0 M = N M = M
8 simpr M 0 N 0 M = N M = N
9 nn0re N 0 N
10 nn0ge0 N 0 0 N
11 9 10 absidd N 0 N = N
12 11 ad2antlr M 0 N 0 M = N N = N
13 7 8 12 3eqtrd M 0 N 0 M = N M = N
14 1 13 sylan2 M 0 N 0 M N N M M = N