Metamath Proof Explorer


Theorem pcgcd

Description: The prime count of a GCD is the minimum of the prime counts of the arguments. (Contributed by Mario Carneiro, 3-Oct-2014)

Ref Expression
Assertion pcgcd P A B P pCnt A gcd B = if P pCnt A P pCnt B P pCnt A P pCnt B

Proof

Step Hyp Ref Expression
1 pcgcd1 P A B P pCnt A P pCnt B P pCnt A gcd B = P pCnt A
2 iftrue P pCnt A P pCnt B if P pCnt A P pCnt B P pCnt A P pCnt B = P pCnt A
3 2 adantl P A B P pCnt A P pCnt B if P pCnt A P pCnt B P pCnt A P pCnt B = P pCnt A
4 1 3 eqtr4d P A B P pCnt A P pCnt B P pCnt A gcd B = if P pCnt A P pCnt B P pCnt A P pCnt B
5 gcdcom A B A gcd B = B gcd A
6 5 3adant1 P A B A gcd B = B gcd A
7 6 adantr P A B ¬ P pCnt A P pCnt B A gcd B = B gcd A
8 7 oveq2d P A B ¬ P pCnt A P pCnt B P pCnt A gcd B = P pCnt B gcd A
9 iffalse ¬ P pCnt A P pCnt B if P pCnt A P pCnt B P pCnt A P pCnt B = P pCnt B
10 9 adantl P A B ¬ P pCnt A P pCnt B if P pCnt A P pCnt B P pCnt A P pCnt B = P pCnt B
11 zq A A
12 pcxcl P A P pCnt A *
13 11 12 sylan2 P A P pCnt A *
14 13 3adant3 P A B P pCnt A *
15 zq B B
16 pcxcl P B P pCnt B *
17 15 16 sylan2 P B P pCnt B *
18 xrletri P pCnt A * P pCnt B * P pCnt A P pCnt B P pCnt B P pCnt A
19 14 17 18 3imp3i2an P A B P pCnt A P pCnt B P pCnt B P pCnt A
20 19 orcanai P A B ¬ P pCnt A P pCnt B P pCnt B P pCnt A
21 3ancomb P A B P B A
22 pcgcd1 P B A P pCnt B P pCnt A P pCnt B gcd A = P pCnt B
23 21 22 sylanb P A B P pCnt B P pCnt A P pCnt B gcd A = P pCnt B
24 20 23 syldan P A B ¬ P pCnt A P pCnt B P pCnt B gcd A = P pCnt B
25 10 24 eqtr4d P A B ¬ P pCnt A P pCnt B if P pCnt A P pCnt B P pCnt A P pCnt B = P pCnt B gcd A
26 8 25 eqtr4d P A B ¬ P pCnt A P pCnt B P pCnt A gcd B = if P pCnt A P pCnt B P pCnt A P pCnt B
27 4 26 pm2.61dan P A B P pCnt A gcd B = if P pCnt A P pCnt B P pCnt A P pCnt B