that's not really the point because we are dealing with algebra and not the numberical values. The error is the assumption that (x-y)^2 equals (x^2-y^2), which is not the case.
Hmm, no. Look again. It's using the fact that (x^2 - y^2) = (x - y)(x + y), which is the case, and a common enough identity (“the difference of two squares“) that it's used without remark here.
The problem really is that you can't divide by zero, even in an algebraic expression.
A simpler example of this phenomenon (which blew my mind when I first encountered it) occurs with the equation x = x^2. If you divide by x, you get x = 1, which is a solution to the equation, but where did the other solution x = 0 go??
Whenever you divide an equation by an algebraic expression, you need to consider the possibility of that expression being zero and treat it as a special case. So in the case of x = x^2, you can reason as follows: maybe x = 0, in which case … what … ah yes, that's a solution! Or maybe x ≠ 0, in which case we can divide by it and get x = 1. That doesn't contradict the assumption x ≠ 0, so it's okay, and x = 1 is the other solution.
It is the case, since it was a premise that x and y are both 1. So the two things you list are both 0, so they are equal, given the premise.
So, the actual problem is dividing by zero. Your assumption that "we are dealing with algebra and not numerical values" is false because it completely ignores the "if x and y = 1" part.
The problem really is that you can't divide by zero, even in an algebraic expression.
A simpler example of this phenomenon (which blew my mind when I first encountered it) occurs with the equation x = x^2. If you divide by x, you get x = 1, which is a solution to the equation, but where did the other solution x = 0 go??
Whenever you divide an equation by an algebraic expression, you need to consider the possibility of that expression being zero and treat it as a special case. So in the case of x = x^2, you can reason as follows: maybe x = 0, in which case … what … ah yes, that's a solution! Or maybe x ≠ 0, in which case we can divide by it and get x = 1. That doesn't contradict the assumption x ≠ 0, so it's okay, and x = 1 is the other solution.