The definition of equality that I've been given is that it 'asserts that two expressions have the same value'. This is adequate with well-defined expressions like $2+1=3$ or $2^2=4,$ but for expressions with variables it seems strange to assert that they have the same value when they don't necessarily have a value until we start exploring the valid assignments of the variable.
For example, if I have $x+1=2$ by itself, $x+1$ has no specific value until I say, "let $x=1.$" In this case, $x+1$ has a value of $2$ and the assertion is true.
Is there a better definition that explains equalities like $x^2=x+2$ where they are conditional?
Is the value of an expression something that can only be discussed under an assignment? Is there a definition of it where asserting that expressions have the same value makes sense when we aren't exploring a possible assignment on $x$?