How do I eliminate mod from an expression?

If I have an expression such as $$x = ((a \bmod b) - s) \bmod t, \quad 0 < a < b$$ And I want to step to $$x = (a - s) \bmod t$$

Is acceptable to jump straight from the first expression to the second? Is there a law or rule I should site when eliminating the mod?

• Think about what mod means, especially what $a$ mod $b$ means when $0<a<b$ Jun 12, 2014 at 2:59
• I know it's redundant.. I want a valid way to show that knowledge in a proof.
– jsj
Jun 12, 2014 at 3:00

The usual way the mod function is computed gives a result in $[0,b)$. Since $a$ is already in that range, $a \mod b=a$. You should write "$a \mod b=a$ since $0<a<b$".
• Maybe my question is unclear. I understand that $a \bmod b = a$ if $0 <= a <b$. My question is whether it is okay to just remove the $\bmod$ operation in the proof, without any text or anything explaining why I removed it?
• You should write "$a \mod b=a$ since $0<a<b$" as justification for this step. Jun 12, 2014 at 3:05
Let us use the definition $r = a \bmod b$ is the remainder when $a$ is divided by $b$ (so $0 \leq r < b$ (without the loss of generality we can assume that $b>0$)). Then $$a=bq+r \qquad \text{with } 0 \leq r < b.$$
In your expression let $w= a \bmod b$, then $a=bq+w$. Since we are given that $0 < a <b$, therefore $q=0$, which implies $w=a$. Thus $$x= ((a \bmod b)-s )\bmod t= (w-s )\bmod t=(a-s) \bmod t.$$