Are these function cases at all equivalent? For a programming assignment, I need to map integers to integers based on a factor. By knowing what the input and output should be, I was able to come up with the following function:
$g\left(f,c\right)=\begin{cases}
\left\lfloor \left( c-1\right) \div f\right\rfloor +1 & f<1\\
c & f=1\\
\dfrac{c+\mod\left(f-\mod\left(c,f\right),f\right)}{f} & f>1
\end{cases}$
where $f\in\left(0,100\right]$ is the factor  and $c>0$, in this case, stands for coordinate, and is an integer.
This appears correct with my initial testing. One thing I noticed, however, is that the $f=1$ case is actually unnecessary. Both the $f<1$ and $f>1$ cases return $c$ when $f$ is 1, so I'm wondering if, somehow, there's only one case instead of two or three, but I'm unable to see it because I'm unused to simplifying equations with the floor or mod functions.

Note that while I came up with these as part of a programming assignment, from a coding point of view, the above is sufficient. Simplifying the above function isn't part of the assignment, just my own math geek interest.

In case it helps, given a factor and an $x$- or $y$-coordinate within a resized image, the above is supposed to return the $x$- or $y$-coordinate of the original pixel that should be used in the resized image.
 A: When $a \geq 0$ and $b > 0$, the "modulo" function $\mathrm{mod}(a,b)$ 
can be implemented by
$$
\mathrm{mod}(a,b) = a - b\left\lfloor\frac ab\right\rfloor.
$$
Bearing in mind that $\lfloor n + x \rfloor = n + \lfloor x \rfloor$
when $n$ is an integer and that $\lfloor -x \rfloor = -\lceil x \rceil$,
the $f>1$ formula works as follows:
\begin{align}
f-\mathrm{mod}(c,f) &= f - c + f\left\lfloor\frac cf\right\rfloor, \\
\mathrm{mod}(f-\mathrm{mod}(c,f),f)
 &= \left(f - c + f\left\lfloor\frac cf\right\rfloor\right)
      - f \left\lfloor
            \frac{\left(f - c + f\left\lfloor\frac cf\right\rfloor\right)}{f}
            \right\rfloor \\
 &= f - c + f\left\lfloor\frac cf\right\rfloor
      - f \left\lfloor 1 - \frac cf + \left\lfloor\frac cf\right\rfloor
            \right\rfloor \\
 &= f - c + f\left\lfloor\frac cf\right\rfloor
      - f \left(1 + \left\lfloor\frac cf\right\rfloor\right)
      - f \left\lfloor -\frac cf \right\rfloor \\
 &= - c - f \left\lfloor -\frac cf \right\rfloor \\
 &= - c + f \left\lceil \frac cf \right\rceil, \\
\frac{c+\mathrm{mod}(f-\mathrm{mod}(c,f),f)}{f}
 &= \frac{c+ \left(- c + f \left\lceil \frac cf \right\rceil\right)}{f} \\
 &= \left\lceil \frac cf \right\rceil.
\end{align}
A simpler way to define $g$ is therefore
$$
g(f,c) = \begin{cases}
\left\lfloor \dfrac{c-1}{f}\right\rfloor + 1 & f<1, \\
c & f=1,\\
\left\lceil \dfrac cf \right\rceil & f>1.
\end{cases}$$
When $f = 1$, 
$\left\lceil\frac cf\right\rceil = c = \left\lfloor\frac{c-1}f\right\rfloor+1.$
The $f < 1$ formula converges to this value as $f$ approaches $1$ from below,
and the $f>1$ formula converges to this value as $f$ approaches $1$ from above,
just as we should hope would occur.
But $\left\lceil\frac cf\right\rceil$ and
$\left\lfloor\frac{c-1}f\right\rfloor+1$ are not equal everywhere.
For $f > 1$, they are close:
$\left\lceil\frac cf\right\rceil - \left\lfloor\frac{c-1}f\right\rfloor+1$
is either $0$ or $1.$
But for $f < 1$ the two formulas can give very different answers.
One could view the difference between the two functions this way:
when there is a choice of two or more possible pixels from which to
get the value of the pixel at coordinate $c$,
$\left\lceil\frac cf\right\rceil$ tends to choose one at or near the "top" of the range (the largest possible coordinate) while 
$\left\lfloor\frac{c-1}f\right\rfloor+1$
tends to choose one at or near the "bottom" of the range.
We could imagine some tricks using the floor function and/or absolute value applied to $f$ in some way to signal when to take the "top" coordinate and when to take the "bottom" coordinate, but I imagine that would make the formula much more complicated than it already is, even with the three cases.
It seems a much better idea to just combine the $f=1$ case with one of the others and have two cases in the definition of $g$.
The "rounded average" of the two formulas,
$$
\bar g(f,c) = \left\lfloor\frac12\left(\left\lceil\frac cf\right\rceil +
\left\lfloor\frac{c-1}f\right\rfloor\right)\right\rfloor+1,
$$
might be a reasonable compromise, as it would tend to choose the
"middle" of the range of coordinates that might be mapped to $c$.
