Let $q(v) := \lfloor v + 1/2 \rfloor$ denote the operation of quantizing a real number towards the nearest integer. Fix $x_0, x_1, y_0$, and $y_1$ where $x_i \in \mathbb{Z}$ and $y_i \in \mathbb{R}$ (for $i=0,1$). Assume w.l.o.g that $x_0 < x_1$. Define $$ L(x) := (x-x_0) \frac{y_1-y_0}{x_1-x_0} + y_0 $$ to be the line that connects $(x_0, y_0)$ to $(x_1, y_1)$ on $\mathbb{R}^2$.
Set, for $i=0 ,1$, and $\hat{y}_i := q(y_i)$ and let $$ \hat{L}(x) := (x-x_0) \frac{\hat{y}_1-\hat{y}_0}{x_1-x_0} + \hat{y}_0 $$ be the line that connects $(x_0, \hat{y}_0)$ and $(x_1, \hat{y}_1)$ on $\mathbb{R}^2$.
I am trying to prove that $\forall x \in [x_0, x_1]$, or at least $\forall x \in [x_0, x_1] \cap \mathbb{Z}$, $$ q\Bigl(L(x)\Bigr) = q\Bigl(\hat{L}(x)\Bigr) $$
In other words, I would like to show that if I want to represent this line, say in a computer program, and only care about the 'integer' parts of the y-coordinates of the line at integer x-coordinates, it is sufficient to store the integer parts of the coordinates of its end-points.
This is not true. For example, with $(x_0,y_0)=(0,\frac12)$ and $(x_1,y_1)=(3,2\frac12)$, the line includes the point $(1,\frac76)$, which quantizes to $(1,1)$, whereas the quantized line from $(0,1)$ to $(3,3)$ includes the point $(1,\frac53)$, which quantizes to $(1,2)$.