Metamath Proof Explorer


Theorem zexpgcd

Description: Exponentiation distributes over GCD. zgcdsq extended to nonnegative exponents. nn0expgcd extended to integer bases by symmetry. (Contributed by Steven Nguyen, 5-Apr-2023)

Ref Expression
Assertion zexpgcd A B N 0 A gcd B N = A N gcd B N

Proof

Step Hyp Ref Expression
1 gcdabs A B A gcd B = A gcd B
2 1 3adant3 A B N 0 A gcd B = A gcd B
3 2 eqcomd A B N 0 A gcd B = A gcd B
4 3 oveq1d A B N 0 A gcd B N = A gcd B N
5 nn0abscl A A 0
6 nn0abscl B B 0
7 id N 0 N 0
8 nn0expgcd A 0 B 0 N 0 A gcd B N = A N gcd B N
9 5 6 7 8 syl3an A B N 0 A gcd B N = A N gcd B N
10 zcn A A
11 10 3ad2ant1 A B N 0 A
12 simp3 A B N 0 N 0
13 11 12 absexpd A B N 0 A N = A N
14 13 eqcomd A B N 0 A N = A N
15 zcn B B
16 15 3ad2ant2 A B N 0 B
17 16 12 absexpd A B N 0 B N = B N
18 17 eqcomd A B N 0 B N = B N
19 14 18 oveq12d A B N 0 A N gcd B N = A N gcd B N
20 zexpcl A N 0 A N
21 20 3adant2 A B N 0 A N
22 zexpcl B N 0 B N
23 22 3adant1 A B N 0 B N
24 gcdabs A N B N A N gcd B N = A N gcd B N
25 21 23 24 syl2anc A B N 0 A N gcd B N = A N gcd B N
26 19 25 eqtrd A B N 0 A N gcd B N = A N gcd B N
27 4 9 26 3eqtrd A B N 0 A gcd B N = A N gcd B N