Metamath Proof Explorer


Theorem expgcd

Description: Exponentiation distributes over GCD. sqgcd extended to nonnegative exponents. (Contributed by Steven Nguyen, 4-Apr-2023)

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

Proof

Step Hyp Ref Expression
1 gcdnncl A B A gcd B
2 1 3adant3 A B N 0 A gcd B
3 simp3 A B N 0 N 0
4 2 3 nnexpcld A B N 0 A gcd B N
5 4 nncnd A B N 0 A gcd B N
6 5 mulid1d A B N 0 A gcd B N 1 = A gcd B N
7 nnexpcl A N 0 A N
8 7 3adant2 A B N 0 A N
9 8 nnzd A B N 0 A N
10 nnexpcl B N 0 B N
11 10 3adant1 A B N 0 B N
12 11 nnzd A B N 0 B N
13 simpl A B A
14 13 nnzd A B A
15 simpr A B B
16 15 nnzd A B B
17 gcddvds A B A gcd B A A gcd B B
18 14 16 17 syl2anc A B A gcd B A A gcd B B
19 18 3adant3 A B N 0 A gcd B A A gcd B B
20 19 simpld A B N 0 A gcd B A
21 2 nnzd A B N 0 A gcd B
22 simp1 A B N 0 A
23 22 nnzd A B N 0 A
24 dvdsexpim A gcd B A N 0 A gcd B A A gcd B N A N
25 21 23 3 24 syl3anc A B N 0 A gcd B A A gcd B N A N
26 20 25 mpd A B N 0 A gcd B N A N
27 19 simprd A B N 0 A gcd B B
28 simp2 A B N 0 B
29 28 nnzd A B N 0 B
30 dvdsexpim A gcd B B N 0 A gcd B B A gcd B N B N
31 21 29 3 30 syl3anc A B N 0 A gcd B B A gcd B N B N
32 27 31 mpd A B N 0 A gcd B N B N
33 gcddiv A N B N A gcd B N A gcd B N A N A gcd B N B N A N gcd B N A gcd B N = A N A gcd B N gcd B N A gcd B N
34 9 12 4 26 32 33 syl32anc A B N 0 A N gcd B N A gcd B N = A N A gcd B N gcd B N A gcd B N
35 nncn A A
36 35 3ad2ant1 A B N 0 A
37 2 nncnd A B N 0 A gcd B
38 2 nnne0d A B N 0 A gcd B 0
39 36 37 38 3 expdivd A B N 0 A A gcd B N = A N A gcd B N
40 nncn B B
41 40 3ad2ant2 A B N 0 B
42 41 37 38 3 expdivd A B N 0 B A gcd B N = B N A gcd B N
43 39 42 oveq12d A B N 0 A A gcd B N gcd B A gcd B N = A N A gcd B N gcd B N A gcd B N
44 gcddiv A B A gcd B A gcd B A A gcd B B A gcd B A gcd B = A A gcd B gcd B A gcd B
45 23 29 2 19 44 syl31anc A B N 0 A gcd B A gcd B = A A gcd B gcd B A gcd B
46 37 38 dividd A B N 0 A gcd B A gcd B = 1
47 45 46 eqtr3d A B N 0 A A gcd B gcd B A gcd B = 1
48 divgcdnn A B A A gcd B
49 22 29 48 syl2anc A B N 0 A A gcd B
50 49 nnnn0d A B N 0 A A gcd B 0
51 divgcdnnr B A B A gcd B
52 28 23 51 syl2anc A B N 0 B A gcd B
53 52 nnnn0d A B N 0 B A gcd B 0
54 nn0rppwr A A gcd B 0 B A gcd B 0 N 0 A A gcd B gcd B A gcd B = 1 A A gcd B N gcd B A gcd B N = 1
55 50 53 3 54 syl3anc A B N 0 A A gcd B gcd B A gcd B = 1 A A gcd B N gcd B A gcd B N = 1
56 47 55 mpd A B N 0 A A gcd B N gcd B A gcd B N = 1
57 34 43 56 3eqtr2d A B N 0 A N gcd B N A gcd B N = 1
58 gcdnncl A N B N A N gcd B N
59 58 nncnd A N B N A N gcd B N
60 8 11 59 syl2anc A B N 0 A N gcd B N
61 4 nnne0d A B N 0 A gcd B N 0
62 ax-1cn 1
63 divmul A N gcd B N 1 A gcd B N A gcd B N 0 A N gcd B N A gcd B N = 1 A gcd B N 1 = A N gcd B N
64 62 63 mp3an2 A N gcd B N A gcd B N A gcd B N 0 A N gcd B N A gcd B N = 1 A gcd B N 1 = A N gcd B N
65 60 5 61 64 syl12anc A B N 0 A N gcd B N A gcd B N = 1 A gcd B N 1 = A N gcd B N
66 57 65 mpbid A B N 0 A gcd B N 1 = A N gcd B N
67 6 66 eqtr3d A B N 0 A gcd B N = A N gcd B N