0

I was studying discrete mathematics and I came across the assignment operator ":=" so I made a quick search and found both of these questions:
What does := mean?
What's the difference among the logical relations :=, =, and ≡?

I scrolled for answers but didn't find one including the information to satisfy my curiosity knowing the fundamental difference.

Simply what I understood was that ":="(assignment operator) defines what is on the left-hand side to be equal to the statement on the right-hand side, while "="(equality operator) states that the left-hand equals the right-hand.

So my question here what is the fundamental difference between stating that l.h.s equals r.h.s and defining the l.h.s to be equal r.h.s?

  • 1
    := means we are defining the left-hand side to be the right-hand side. The other kind of equality is mostly used to make an assertion (that asserts an equation between two things whose meaning has been given beforehand). – user43208 Apr 08 '24 at 20:55
  • 2
    Any hard-and-fast definition you come across for these operators needs to be considered in the context in which you find the statements being made. – DanDan面 Apr 08 '24 at 20:57
  • 3
    Usually (at least in sources which make the distinction at all, which is by no means universal), $:=$ is used when you're introducing a new variable, while $=$ is used when you're asserting equality of two expressions in terms of preexisting variables (and it could happen that the left hand side expression is just a single variable). – Daniel Schepler Apr 08 '24 at 20:57
  • As per answer to the post linked, usually $:=$ stand for "definitional" equality while $=$ is (usual) mathematical equality: the two symbolic expressions at the left and the right of the symbol are two ways to denote the same objects. Consider $1+1=2$: if we compute the LHS we get as result the RHS. – Mauro ALLEGRANZA Apr 09 '24 at 05:55
  • See here for the $:=$ symbol, mainly used "for naming a mathematical object, abbreviation of the phrase 'let $x:=E$', where $E$ is an expression and $x$ is a variable. This is similar to the concept of assignment in computer science." It is a modern "evolution" of $x=_{\text{Df}}E$ or $x=E \text { Df}$ (see PM notation) more suitable for coding. – Mauro ALLEGRANZA Apr 09 '24 at 10:00
  • A definition "legislates" about a term (name, symbol) while an assertion in math is either an axiom or a theorem. The definition "2 is the successor of 1" introduces a new symbol that we will use to name the number that is the successor of 1, while the formula $1+1=2$ states a fact about numbers, and we prove it. – Mauro ALLEGRANZA Apr 11 '24 at 10:44

3 Answers3

4

As I asume you are searching for a more "logical" answer, I'd say $y:=x$ is the definition of $y$, something that can't be proven or disproven, and $y=x$ is a proposition, something that could be either false or true, something that involves two "known" elements.

1

I regularly use $:=$ (\coloneq) in order to state an assignment by my own definition, it is more than a mere equivalence relation since it also suggests that we will take advantage of it by invoking the first term rather than the second one (e.g., the description of Figure 1 here uses the $:=$ symbol to indicate that $C(3,k)$ is a cleaner way to indicate the lattice $\{0,1,2\}^k$).

Marco Ripà
  • 1,292
1

You will find that "$:=$" defines the left-hand side to be syntactically the same as the right-hand side. Note that this can be temporal, since assignment can be repeated with inequivalent right-hand sides. For instance, it is valid to have "$a := 1$" and (without intervening redefinitions of "$a$" or "$1$") later "$a := a+1$" -- where the "$a$" on the right-hand side is bound to "$1$" and the "$a$" on the left-hand side (and subsequent "$a$"s until re-assignment) are bound to "$1+1$".

In many contexts, "$=$" is overloaded to mean both assignment and equality. This is common in math, and uncommon in programming. For example, most/many C-like languages have "=" for assignment and "==" for equality.

In a context where assignment is not signified with "$=$", an equality is a (logical) statement that the values of the left-hand and right-hand sides are the same. Continuing the example above, $a = 2$ would be a true statement, since $1+1$ and $2$ have equivalent values (and we assume the expressions and symbols are evaluated in the whole/natural/integer numbers since no alternative setting has been announced).

Eric Towers
  • 70,953