4 ms·
> Definition and equality are really the same thing. A definition is just an introduction of a term/variable, and an equality giving it a value. So the only dif
by theoh 9y ago
> Definition and equality are really the same thing. A definition is just an introduction of a term/variable, and an equality giving it a value. So the only difference is if a term in the equation hasn't been introduced yet.
In CS we talk about l-values and r-values. Only an l-value can be assigned to, but you can compare r-values for equality. So there is a solid distinction there between types of expression which is upheld in programming languages.
- contravariant 9y agoThe main difference between math and programming languages is that it's perfectly fine in math to define l-values. For example i^2 = -1 is the generally accepted definition of the imaginary unit.
- theoh 9y agoIt's r-values that cannot be assigned to. What's really missing from most conventional math, I think, is the notion of conditional expressions based on equality testing. "=" is usually only used in a declarative way, to declare that two expressions are equal. See n+k patterns in Haskell for a programming exception to the rule you mention.
- theoh 9y agoActually, though, set-builder notation can use the equals sign to express a condition. e.g. the examples here https://en.wikipedia.org/wiki/Set-builder_notation https://en.wikipedia.org/wiki/Set-builder_notation. Maybe there are other examples in math.