I am studying elliptic curve cryptography and this question is related to the commutative property of point addition operation.
Point addition $P_3(x_3,y_3)$ of two points $P_1(x_1, y_1)$ and $P_2(x_2,y_2)$ is given by the following rules: $$x_3 = (\lambda^2 - x_1 - x_2) \bmod n$$ and $$y_3 = (\lambda (x_1 - x_3) - y_1) \bmod n$$ where $$\lambda = \frac{y_2-y_1}{x_2-x_1} \bmod n.$$
To prove that the point addition operation is commutative, I simply interchange $x_1$ by $x_2$, and $y_1$ by $y_2$, and what I get is:
$$x_3' = (\lambda^2 - x_2 - x_1) \bmod n$$ and $$y_3' = (\lambda (x_2 - x_3) - y_2) \bmod n.$$
Now it can be seen that $x_3 = x_3'$ but $y_3 \ne y_3'$; that is, I am not getting the same point $(x_3, y_3)$. But I have read everywhere that point addition is a commutative operation.
Please help me understand the problem.