1

Suppose I have this:

$\frac{6^{666}}{2^{6}}$ (mod $125$)

I saw it is possible to reduce only the numerator's power modulo Euler's phi function. Can someone explain why is that possible?

It is essentially this:

$\frac{6^{666 \space (mod \phi(125))}}{2^{6}}$ (mod $125$)

Bill Dubuque
  • 272,048
  • What's the question? There's no need to reduce the exponent in $2^6$ as it is already small. – lulu Jan 28 '19 at 17:06
  • 1
    Can you clarify your question? It really isn't clear what you are asking. – lulu Jan 28 '19 at 17:23
  • My question is why it works? – Michael Munta Jan 28 '19 at 17:25
  • 1
    Why what works? – lulu Jan 28 '19 at 17:27
  • Maybe the fact that you wrote it as a fraction is confusing you. That's not a good way to write residue classes...The inverse of $2\pmod {125}$ is $63$, clearly, so your expression could be written as $6^{666}\times 63^6$. Alternatively, since $6=2\times 3$, you could write your expression as $2^{660}\times 3^{666}$. – lulu Jan 28 '19 at 17:29
  • @lulu The fraction is well-defined, so "not a good way" doesn't make much sense. – Bill Dubuque Jan 28 '19 at 17:32
  • I know how it works when there is a normal integer with an exponent, but when there is a fraction it is applied only on the numerator's power. That is what I want to understand. – Michael Munta Jan 28 '19 at 17:36
  • @BillDubuque It's my sense that the fractional notation is what is confusing the OP. Of course, I could have that wrong. – lulu Jan 28 '19 at 17:36
  • @MichaelMunta But, where is the confusion? You can use Euler to reduce the exponent in the denominator as well. Of course, it's already $6$ so reducing it $\pmod {\varphi (125)} $ won't help you in any obvious way. But the same reduction technique works for both numerator and denominator. – lulu Jan 28 '19 at 17:39
  • 1
    @MichaelMunta If, say, you had $\frac {6^{666}}{2^{501}}$ you could use Euler to write that as $\frac {6^{66}}{2^1}\pmod {125}$. – lulu Jan 28 '19 at 17:41

2 Answers2

3

It is valid to mod out arguments of a fraction - just like it is for the arguments sums and products

Lemma $ $ If $\,(B,n)= 1\,$ then $\bmod n\!:\,\ \begin{align}A&\equiv a\\ B&\equiv b\end{align}\,\Rightarrow\, \dfrac{A}B\,\equiv\, \dfrac{a}b,\:$ i.e. $\,A \color{#c00}{B^{-1}}\equiv a\color{#c00}{b^{-1}}$

Proof $\ \ $ Scaling $\: b\equiv B\:$ by $\:b^{-1}B^{-1}\Rightarrow \color{#c00}{B^{-1}\equiv b^{-1}}\,$ by CPR = Congruence Product Rule, so multiplying that by $\, A\equiv a\, $ we obtain $\, A\color{#c00}{B^{-1}}\equiv a\color{#c00}{b^{-1}}$ again by CPR. $ $ Note $b^{-1}$ exists since $\,b\equiv B\pmod{\!n}\Rightarrow (b,n) = (B,n)=1\,$ by gcd mod reduction.

Thus the answer to your question as to "why it works" is that unwinding the definition of a fraction yields a composition of a product and inverse operation - and those operations are "compatible" with modular arithmetic (by Product and Inverse Congruence Rules) hence so too is their composition (modular "division" by units = invertibles = integers $B$ coprime to the modulus).

Similarly the Polynomial Congruence Rule extends to polynomial fractions (rational "functions") or to any expression composed of sum, product, and inverse operations (where the inverses all exist) by a simple inductive proof.

See this answer for much further discussion.

Bill Dubuque
  • 272,048
  • So if $B \equiv b$ then also $B^{-1} \equiv b^{-1}$? – Michael Munta Jan 28 '19 at 19:29
  • @Michael Yes, multiply $,B\equiv b\ $ by $\ b^{-1}B^{-1}\ $ [assuming $,(B,n)=1,,$ so also $,(b,n)=(B,n)=1$] $\ \ $ – Bill Dubuque Jan 28 '19 at 20:06
  • It's important to realize, as Bill Dubuque pointed out, that you must have $\gcd(B, n) = 1$. But if so, if $B \equiv b$ then $1\equiv BB^{-1} \equiv bB^{-1}$ and $b^{-1} \equiv b^{-1}(bB^{-1}) \equiv B^{-1}$. Which isnt surprising as equivalence carries over multiplication and we are multiplying* the inverses to get $1$ – fleablood Feb 12 '19 at 18:01
0

As $2$ is relatively prime to $125$ then $2$ is invertable so there is a $[\frac 12]$ so that $2[\frac 12]\equiv 1 \pmod {125}$ (just let $[\frac 12] = 63$ but we don't actually care what $[\frac 12]$ is; just that it exists) so for any $m = 2^jb$ then $\frac m{2^j}\equiv \frac m{2^j}(2^j*[\frac 12]^j) \equiv m*[\frac 12]^j$.

So $\frac {6^{666}}{2^6} \equiv 6^{666}[\frac 12]^6 \equiv 6^{\phi (666)}[\frac 12]^6\pmod {125}$

For notation purposes it is pefectly acceptable to write $\frac 12 \equiv 63 \pmod {125}$ and to use the fraction notation. (Although it's perhaps misleading to use the $2^{-1} \equiv 63 \pmod {125}$ notation instead.)

It's just important to realize that the residuce class is not $\{\frac 12 + 125k| k \in \mathbb Z\}$ but $\{m|2m \equiv 1 \pmod 125\} = \{m|\exists k\in \mathbb Z; 2m = 1 + 125k\}=\{m|2m = 1 + 125k$ for some odd $k\} =\{\frac {1+125(2k+1)}2| k \in \mathbb Z\}=\{63+ 125k|k \in \mathbb Z\}$.

And it's important to realize that if $k$ and $n$ arent relatively prime there isn't and such $k^{-1} \mod n$ and we can't use $\frac 1k \pmod n$

fleablood
  • 124,253