Let a, b, c, d, \(\displaystyle{m}\in{Z}\) such that c, \(\displaystyle{d}\ge{1}\) and m > 1.

If \(\displaystyle{a}\equiv{b}{\left(\text{mod}{m}\right)}{\quad\text{and}\quad}{c}\equiv{d}{\left(\text{mod}{m}\right)}\)

\(\displaystyle{a}^{{c}}\text{mod}{\left({m}\right)}={\left({a}\text{mod}{\left({m}\right)}\right)}^{{c}}\)

\(\displaystyle{b}^{{d}}\text{mod}{\left({m}\right)}={\left({b}\text{mod}{\left({m}\right)}\right)}^{{d}}\)

But \(\displaystyle{a}\equiv{b}{\left(\text{mod}{m}\right)}\)

So we get c = d.

Therefore the statement is true when c =d.

So take c and d are different for a counter example.

Take a = b = 2, c = 16 and d = 6

m=10

Hence \(\displaystyle{2}\equiv{2}{\left(\text{mod}{10}\right)}{\quad\text{and}\quad}{16}\equiv{6}{\left(\text{mod}{10}\right)}\)

\(\displaystyle{2}^{{16}}\neg\equiv{2}^{{6}}\text{mod}{\left({10}\right)}\)

As \(\displaystyle{2}^{{16}}={65536}{\quad\text{and}\quad}{2}^{{6}}={32}\)

65536-32 = 65504 which is not divisible by 10.

If \(\displaystyle{a}\equiv{b}{\left(\text{mod}{m}\right)}{\quad\text{and}\quad}{c}\equiv{d}{\left(\text{mod}{m}\right)}\)

\(\displaystyle{a}^{{c}}\text{mod}{\left({m}\right)}={\left({a}\text{mod}{\left({m}\right)}\right)}^{{c}}\)

\(\displaystyle{b}^{{d}}\text{mod}{\left({m}\right)}={\left({b}\text{mod}{\left({m}\right)}\right)}^{{d}}\)

But \(\displaystyle{a}\equiv{b}{\left(\text{mod}{m}\right)}\)

So we get c = d.

Therefore the statement is true when c =d.

So take c and d are different for a counter example.

Take a = b = 2, c = 16 and d = 6

m=10

Hence \(\displaystyle{2}\equiv{2}{\left(\text{mod}{10}\right)}{\quad\text{and}\quad}{16}\equiv{6}{\left(\text{mod}{10}\right)}\)

\(\displaystyle{2}^{{16}}\neg\equiv{2}^{{6}}\text{mod}{\left({10}\right)}\)

As \(\displaystyle{2}^{{16}}={65536}{\quad\text{and}\quad}{2}^{{6}}={32}\)

65536-32 = 65504 which is not divisible by 10.