I want to enforce $x_{i,j}=x_{k,j}\implies z_i \neq z_k$ where $k = i-1$ so I used \begin{align}z_k + 1 - (x_{i,j} - x_{k,j})) \leq z_i \leq z_k - 1 - (x_{i,j} - x_{k,j})\quad\text{for each $j$}\end{align} as $x$ is an integer variable where $x \in \{{0,1}\}$ and $z$ is an integer.
I tried this on an example but I kept getting errors for the $z$ values \begin{align} x_{1,1} = 0, &&x_{1,2} = 1,\\ x_{2,1} = 0, &&x_{2,2} = 1, \\ x_{3,1} = 1, &&x_{3,2} = 0, \\ x_{4,1} = 1, &&x_{4,2} = 0, \\ \text{and }&&1 \leq z\leq 2 \end{align} so \begin{align} z_1 + 1 - (x_{2,1} - x_{1,1})) &\leq z_2 \leq z_1 - 1 - (x_{2,1} - x_{1,1})\\ z_1 + 1 - (x_{2,2} - x_{1,2})) &\leq z_2 \leq z_1 - 1 - (x_{2,2} - x_{1,2})\\ z_2 + 1 - (x_{3,1} - x_{2,1})) &\leq z_3 \leq z_2 - 1 - (x_{3,1} - x_{2,1})\\ z_2 + 1 - (x_{3,2} - x_{2,2})) &\leq z_3 \leq z_2 - 1 - (x_{3,2} - x_{2,2})\\ z_3 + 1 - (x_{4,1} - x_{3,1})) &\leq z_4 \leq z_3 - 1 - (x_{4,1} - x_{3,1})\\ z_3 + 1 - (x_{4,2} - x_{3,2})) &\leq z_4 \leq z_3 - 1 - (x_{4,2} - x_{3,2}). \end{align}
What is the error?