Hey, so many people around this forum and we don't have math teachers? Can't you see we're having trouble here?
I do some tutoring in maths, I'll try to explain it.

The only problem is the division by 0, as has been said. It is not allowed to take the (a-b) part out of the equation because (a-b) has been defined as 0. Formally, when you divide both sides of an equation by an undefined variable, you should mention that the new form is only valid under the assumption that the variable does not equal 0. In fact this remark should be made every time you take out a variable by means of division.
For example, when you want to simplify xy=6x you get:
"y=6, under the assumption that x does not equal 0", and not just: "y=6x"
The reasoning of the puzzle can be summarized to:
x=0
1x=2x
1=2
The last line should include the "under the assumption that x does not equal 0"-remark. The assumption is not met, and hence the last form is not valid.
I believe the error here is in syntax (order of processes). The thought process seems to me to be erroneous because after you establish that a = b, you treat it like b != a and then you turn back to treating it like a = b. Like in a sentence, the math process here loses sense if there is not a logic succession of terms.
This is not the real problem. It's not illegal to maintain both the variables, even if the equation can be simplified by expressing one of them in terms of the other.
I hope it's more clear now.
