Let $a,b,a_i,b_i,i=1,2,\ldots,k$, and $m$ be integers with $k \ge 1$ and $m \ne 0$.
Show that: If $a_i \equiv b_i \pmod m, i=1,2,\ldots,k$, then $a_1\cdots a_k \equiv b_1\cdots b_k \pmod m$. In particular, if $a \equiv b \pmod m$, then $a^k \equiv b^k \pmod m$ for all $k$.
Attempt:
Fact. For any integers $a,b,c,d,$ and $m$ with $m \ne 0$, if $a \equiv b \pmod m$ and $c \equiv d \pmod m$, then $ac \equiv bd \pmod m$.
Proof of Fact: Let $a,b,c,d,$ and $m$ be integers with $m \ne 0$. Since $a \equiv b \pmod m$, then $a-b=ms$ for some integer $s$. Similarly, since $c \equiv d \pmod m$, then $c-d=mt$ for some integer $t$. Now, notice that $$ac-bd=ac-bc+bc-cd=c(ms)+c(mt)=m(cs+ct)m.$$ Hence, $m \mid (ac-bd)$. Thus, $ac \equiv bd \pmod m. \quad \Box$.
Proof by induction for the first part:
- Base step: for $k=1$, if $a_1 \equiv b_1 \pmod m$, then $a_1 \equiv b_1 \pmod m$.
- Inductive step: Assume that for $k=n$, the statement is true, i.e., if $a_i \equiv b_i \pmod m,i=1,2,\ldots,n$, then $a_1\cdots a_n \equiv b_1\cdots b_n$. We'll show that the statement is also true for $k=n+1$, i.e., if $a_i \equiv b_i \pmod m,i=1,2,\ldots,n+1$, then $a_1\cdots a_{n+1} \equiv b_1\cdots b_{n+1} \pmod m$. Notice, by assumption, that $a_{n+1} \equiv b_{n+1} \pmod m$. By induction hypothesis, $a_1\cdots a_n \equiv b_1\cdots b_n \pmod m$. Hence, by the above fact, the result follows immediately.
Thus, we conclude, by mathematical induction, that if $a_i \equiv b_i \pmod m,i=1,2,\ldots,k$, then $a_1\cdots a_k \equiv b_1\cdots b_k \pmod m$.
For the second part, let $a \equiv b \pmod m$. Let $k$ be arbitrary positive integer. We'll show that $a^k \equiv b^k \pmod m$. To this end, choose $a_i=a$ and $b_i=b$ for all $i=1,\ldots,k$ and apply to the first part. We obtain that if $a \equiv b \pmod m$, then $a\cdots a (\text{$k$ times}) \equiv b\cdots b(\text{$k$ times})$, which is $a^k \equiv b^k \pmod m$. Hence, proved. Q.E.D.
Does the above approach correct? Any helps would be appreciated. Thanks in advanced.