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 ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( 𝐴 gcd 𝐵 ) ↑ 𝑁 ) = ( ( 𝐴𝑁 ) gcd ( 𝐵𝑁 ) ) )

Proof

Step Hyp Ref Expression
1 gcdabs ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ) → ( ( abs ‘ 𝐴 ) gcd ( abs ‘ 𝐵 ) ) = ( 𝐴 gcd 𝐵 ) )
2 1 3adant3 ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( abs ‘ 𝐴 ) gcd ( abs ‘ 𝐵 ) ) = ( 𝐴 gcd 𝐵 ) )
3 2 eqcomd ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( 𝐴 gcd 𝐵 ) = ( ( abs ‘ 𝐴 ) gcd ( abs ‘ 𝐵 ) ) )
4 3 oveq1d ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( 𝐴 gcd 𝐵 ) ↑ 𝑁 ) = ( ( ( abs ‘ 𝐴 ) gcd ( abs ‘ 𝐵 ) ) ↑ 𝑁 ) )
5 nn0abscl ( 𝐴 ∈ ℤ → ( abs ‘ 𝐴 ) ∈ ℕ0 )
6 nn0abscl ( 𝐵 ∈ ℤ → ( abs ‘ 𝐵 ) ∈ ℕ0 )
7 id ( 𝑁 ∈ ℕ0𝑁 ∈ ℕ0 )
8 nn0expgcd ( ( ( abs ‘ 𝐴 ) ∈ ℕ0 ∧ ( abs ‘ 𝐵 ) ∈ ℕ0𝑁 ∈ ℕ0 ) → ( ( ( abs ‘ 𝐴 ) gcd ( abs ‘ 𝐵 ) ) ↑ 𝑁 ) = ( ( ( abs ‘ 𝐴 ) ↑ 𝑁 ) gcd ( ( abs ‘ 𝐵 ) ↑ 𝑁 ) ) )
9 5 6 7 8 syl3an ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( ( abs ‘ 𝐴 ) gcd ( abs ‘ 𝐵 ) ) ↑ 𝑁 ) = ( ( ( abs ‘ 𝐴 ) ↑ 𝑁 ) gcd ( ( abs ‘ 𝐵 ) ↑ 𝑁 ) ) )
10 zcn ( 𝐴 ∈ ℤ → 𝐴 ∈ ℂ )
11 10 3ad2ant1 ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → 𝐴 ∈ ℂ )
12 simp3 ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → 𝑁 ∈ ℕ0 )
13 11 12 absexpd ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( abs ‘ ( 𝐴𝑁 ) ) = ( ( abs ‘ 𝐴 ) ↑ 𝑁 ) )
14 13 eqcomd ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( abs ‘ 𝐴 ) ↑ 𝑁 ) = ( abs ‘ ( 𝐴𝑁 ) ) )
15 zcn ( 𝐵 ∈ ℤ → 𝐵 ∈ ℂ )
16 15 3ad2ant2 ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → 𝐵 ∈ ℂ )
17 16 12 absexpd ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( abs ‘ ( 𝐵𝑁 ) ) = ( ( abs ‘ 𝐵 ) ↑ 𝑁 ) )
18 17 eqcomd ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( abs ‘ 𝐵 ) ↑ 𝑁 ) = ( abs ‘ ( 𝐵𝑁 ) ) )
19 14 18 oveq12d ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( ( abs ‘ 𝐴 ) ↑ 𝑁 ) gcd ( ( abs ‘ 𝐵 ) ↑ 𝑁 ) ) = ( ( abs ‘ ( 𝐴𝑁 ) ) gcd ( abs ‘ ( 𝐵𝑁 ) ) ) )
20 zexpcl ( ( 𝐴 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( 𝐴𝑁 ) ∈ ℤ )
21 20 3adant2 ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( 𝐴𝑁 ) ∈ ℤ )
22 zexpcl ( ( 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( 𝐵𝑁 ) ∈ ℤ )
23 22 3adant1 ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( 𝐵𝑁 ) ∈ ℤ )
24 gcdabs ( ( ( 𝐴𝑁 ) ∈ ℤ ∧ ( 𝐵𝑁 ) ∈ ℤ ) → ( ( abs ‘ ( 𝐴𝑁 ) ) gcd ( abs ‘ ( 𝐵𝑁 ) ) ) = ( ( 𝐴𝑁 ) gcd ( 𝐵𝑁 ) ) )
25 21 23 24 syl2anc ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( abs ‘ ( 𝐴𝑁 ) ) gcd ( abs ‘ ( 𝐵𝑁 ) ) ) = ( ( 𝐴𝑁 ) gcd ( 𝐵𝑁 ) ) )
26 19 25 eqtrd ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( ( abs ‘ 𝐴 ) ↑ 𝑁 ) gcd ( ( abs ‘ 𝐵 ) ↑ 𝑁 ) ) = ( ( 𝐴𝑁 ) gcd ( 𝐵𝑁 ) ) )
27 4 9 26 3eqtrd ( ( 𝐴 ∈ ℤ ∧ 𝐵 ∈ ℤ ∧ 𝑁 ∈ ℕ0 ) → ( ( 𝐴 gcd 𝐵 ) ↑ 𝑁 ) = ( ( 𝐴𝑁 ) gcd ( 𝐵𝑁 ) ) )