Metamath Proof Explorer


Theorem modxai

Description: Add exponents in a power mod calculation. (Contributed by Mario Carneiro, 21-Feb-2014) (Revised by Mario Carneiro, 5-Feb-2015)

Ref Expression
Hypotheses modxai.1 N
modxai.2 A
modxai.3 B 0
modxai.4 D
modxai.5 K 0
modxai.6 M 0
modxai.7 C 0
modxai.8 L 0
modxai.11 A B mod N = K mod N
modxai.12 A C mod N = L mod N
modxai.9 B + C = E
modxai.10 D N + M = K L
Assertion modxai A E mod N = M mod N

Proof

Step Hyp Ref Expression
1 modxai.1 N
2 modxai.2 A
3 modxai.3 B 0
4 modxai.4 D
5 modxai.5 K 0
6 modxai.6 M 0
7 modxai.7 C 0
8 modxai.8 L 0
9 modxai.11 A B mod N = K mod N
10 modxai.12 A C mod N = L mod N
11 modxai.9 B + C = E
12 modxai.10 D N + M = K L
13 11 oveq2i A B + C = A E
14 2 nncni A
15 expadd A B 0 C 0 A B + C = A B A C
16 14 3 7 15 mp3an A B + C = A B A C
17 13 16 eqtr3i A E = A B A C
18 17 oveq1i A E mod N = A B A C mod N
19 nnexpcl A B 0 A B
20 2 3 19 mp2an A B
21 20 nnzi A B
22 21 a1i A B
23 5 nn0zi K
24 23 a1i K
25 nnexpcl A C 0 A C
26 2 7 25 mp2an A C
27 26 nnzi A C
28 27 a1i A C
29 8 nn0zi L
30 29 a1i L
31 nnrp N N +
32 1 31 ax-mp N +
33 32 a1i N +
34 9 a1i A B mod N = K mod N
35 10 a1i A C mod N = L mod N
36 22 24 28 30 33 34 35 modmul12d A B A C mod N = K L mod N
37 36 mptru A B A C mod N = K L mod N
38 zcn D D
39 4 38 ax-mp D
40 1 nncni N
41 39 40 mulcli D N
42 6 nn0cni M
43 41 42 addcomi D N + M = M + D N
44 12 43 eqtr3i K L = M + D N
45 44 oveq1i K L mod N = M + D N mod N
46 37 45 eqtri A B A C mod N = M + D N mod N
47 6 nn0rei M
48 modcyc M N + D M + D N mod N = M mod N
49 47 32 4 48 mp3an M + D N mod N = M mod N
50 46 49 eqtri A B A C mod N = M mod N
51 18 50 eqtri A E mod N = M mod N