I have CS background, and I'm trying to teach fundamentals of programming to students. They seem to have difficulties in understanding the difference between x=5 and x==5. However, trying to explain, made me wonder what the meaning of $x = 5$ is in mathematics.
Is there a concept of assignment in mathematics? Or is this an equation/binding/statement/something else? What is its proper name? And does the use of the $=$ operator differ from its use in the function below?
$$f(x) = \begin{cases} \displaystyle 1 \quad \text{if } x \bmod 2 = 0\\ \displaystyle 0 \quad \text{if } x \bmod 2 = 1\\ \end{cases}$$
Is there a classification of the uses of equality operator in math? Or is it the same in every case, and I just fail to see it?
In mathematics, the $=$ sign can be used as a simple statement of fact in a specific case ($x = 5$), to create definitions (let $x=3$), conditional statements (if $x = 2$, then …), or to express an universal equivalence: $$(x^2+2x+1 )= (x+1)^2$$
When used in computer programming, the $==$ is a relational operator testing for equality unlike the $=$ reserved for assignments (w. r. t C programming).
For more, you can see here.