Metamath Proof Explorer


Theorem gcdcom

Description: The gcd operator is commutative. Theorem 1.4(a) in ApostolNT p. 16. (Contributed by Paul Chapman, 21-Mar-2011)

Ref Expression
Assertion gcdcom MNMgcdN=NgcdM

Proof

Step Hyp Ref Expression
1 ancom M=0N=0N=0M=0
2 ancom nMnNnNnM
3 2 rabbii n|nMnN=n|nNnM
4 3 supeq1i supn|nMnN<=supn|nNnM<
5 1 4 ifbieq2i ifM=0N=00supn|nMnN<=ifN=0M=00supn|nNnM<
6 gcdval MNMgcdN=ifM=0N=00supn|nMnN<
7 gcdval NMNgcdM=ifN=0M=00supn|nNnM<
8 7 ancoms MNNgcdM=ifN=0M=00supn|nNnM<
9 5 6 8 3eqtr4a MNMgcdN=NgcdM