Metamath Proof Explorer


Theorem gcdass

Description: Associative law for gcd operator. Theorem 1.4(b) in ApostolNT p. 16. (Contributed by Scott Fenton, 2-Apr-2014) (Revised by Mario Carneiro, 19-Apr-2014)

Ref Expression
Assertion gcdass N M P N gcd M gcd P = N gcd M gcd P

Proof

Step Hyp Ref Expression
1 anass N = 0 M = 0 P = 0 N = 0 M = 0 P = 0
2 anass x N x M x P x N x M x P
3 2 rabbii x | x N x M x P = x | x N x M x P
4 3 supeq1i sup x | x N x M x P < = sup x | x N x M x P <
5 1 4 ifbieq2i if N = 0 M = 0 P = 0 0 sup x | x N x M x P < = if N = 0 M = 0 P = 0 0 sup x | x N x M x P <
6 gcdcl N M N gcd M 0
7 6 3adant3 N M P N gcd M 0
8 7 nn0zd N M P N gcd M
9 simp3 N M P P
10 gcdval N gcd M P N gcd M gcd P = if N gcd M = 0 P = 0 0 sup x | x N gcd M x P <
11 8 9 10 syl2anc N M P N gcd M gcd P = if N gcd M = 0 P = 0 0 sup x | x N gcd M x P <
12 gcdeq0 N M N gcd M = 0 N = 0 M = 0
13 12 3adant3 N M P N gcd M = 0 N = 0 M = 0
14 13 anbi1d N M P N gcd M = 0 P = 0 N = 0 M = 0 P = 0
15 14 bicomd N M P N = 0 M = 0 P = 0 N gcd M = 0 P = 0
16 simpr N M P x x
17 simpl1 N M P x N
18 simpl2 N M P x M
19 dvdsgcdb x N M x N x M x N gcd M
20 16 17 18 19 syl3anc N M P x x N x M x N gcd M
21 20 anbi1d N M P x x N x M x P x N gcd M x P
22 21 rabbidva N M P x | x N x M x P = x | x N gcd M x P
23 22 supeq1d N M P sup x | x N x M x P < = sup x | x N gcd M x P <
24 15 23 ifbieq2d N M P if N = 0 M = 0 P = 0 0 sup x | x N x M x P < = if N gcd M = 0 P = 0 0 sup x | x N gcd M x P <
25 11 24 eqtr4d N M P N gcd M gcd P = if N = 0 M = 0 P = 0 0 sup x | x N x M x P <
26 simp1 N M P N
27 gcdcl M P M gcd P 0
28 27 3adant1 N M P M gcd P 0
29 28 nn0zd N M P M gcd P
30 gcdval N M gcd P N gcd M gcd P = if N = 0 M gcd P = 0 0 sup x | x N x M gcd P <
31 26 29 30 syl2anc N M P N gcd M gcd P = if N = 0 M gcd P = 0 0 sup x | x N x M gcd P <
32 gcdeq0 M P M gcd P = 0 M = 0 P = 0
33 32 3adant1 N M P M gcd P = 0 M = 0 P = 0
34 33 anbi2d N M P N = 0 M gcd P = 0 N = 0 M = 0 P = 0
35 34 bicomd N M P N = 0 M = 0 P = 0 N = 0 M gcd P = 0
36 simpl3 N M P x P
37 dvdsgcdb x M P x M x P x M gcd P
38 16 18 36 37 syl3anc N M P x x M x P x M gcd P
39 38 anbi2d N M P x x N x M x P x N x M gcd P
40 39 rabbidva N M P x | x N x M x P = x | x N x M gcd P
41 40 supeq1d N M P sup x | x N x M x P < = sup x | x N x M gcd P <
42 35 41 ifbieq2d N M P if N = 0 M = 0 P = 0 0 sup x | x N x M x P < = if N = 0 M gcd P = 0 0 sup x | x N x M gcd P <
43 31 42 eqtr4d N M P N gcd M gcd P = if N = 0 M = 0 P = 0 0 sup x | x N x M x P <
44 5 25 43 3eqtr4a N M P N gcd M gcd P = N gcd M gcd P