Description: Calculate a GCD via Euclid's algorithm. (Contributed by Mario Carneiro, 19-Feb-2014)
Ref | Expression | ||
---|---|---|---|
Hypotheses | gcdi.1 | |
|
gcdi.2 | |
||
gcdi.3 | |
||
gcdi.5 | |
||
gcdi.4 | |
||
Assertion | gcdi | |
Step | Hyp | Ref | Expression |
---|---|---|---|
1 | gcdi.1 | |
|
2 | gcdi.2 | |
|
3 | gcdi.3 | |
|
4 | gcdi.5 | |
|
5 | gcdi.4 | |
|
6 | 1 3 | nn0mulcli | |
7 | 6 | nn0cni | |
8 | 2 | nn0cni | |
9 | 7 8 5 | addcomli | |
10 | 9 | oveq2i | |
11 | 1 | nn0zi | |
12 | 3 | nn0zi | |
13 | 2 | nn0zi | |
14 | gcdaddm | |
|
15 | 11 12 13 14 | mp3an | |
16 | 1 3 2 | numcl | |
17 | 5 16 | eqeltrri | |
18 | 17 | nn0zi | |
19 | gcdcom | |
|
20 | 18 12 19 | mp2an | |
21 | 10 15 20 | 3eqtr4i | |
22 | 21 4 | eqtr3i | |