0

I'm interested in what the difference is (in meaning) between having $1+2$ or $2+1$? Are they semantically the same, simply represented differently or is there a semantic difference between having a number before the addition operator vs after the addition operator? Is it purely a syntactic choice or is there a difference based on your choice of where each argument goes.

Do we define a particular position as having a particular meaning?

1 Answers1

0

$+$ is a function taking two variables (which we write on both sides of the operator, but we could write $+(1,2)$ and $+(2,1)$ as well). $1+2$ and $2+1$ are the outputs of the function for two different inputs. The properties of addition imply that both those numbers are equal.

Showing that they are equal may not be completely trivial. For example, the addition can be defined inductively in terms of the successor operation $s$ (which is such that $s(0) = 1$, $s(1) =2$ etc.) by the following : \begin{align} \forall n \in \mathbb N, &n+0 = n \\ \forall n,m \in \mathbb N,& n+s(m) = s(n+m) \end{align} Using those, we have : \begin{align} 1+2 &=s(0) + s(s(0)) \\ &= s(s(0) + s(0)) \\ &= s(s(s(0) + 0)\\ &= s(s(s(0))) \\ &= 3 \end{align} and \begin{align} 2+1 &= s(s(0)) + s(0)\\ &= s(s(s(0)) + 0 ) \\ &= s(s(s(0)))\\ &= 3 \end{align} so both are equal. Showing that $n+m = m+n$ for all integers $n,m$ is done by induction. (So the proof is not completely trivial)

Edit In other words, there is a syntactic different between $a+b$ and $b+a$, but the axioms we use for $+$ imply that there is no semantic difference.

Sums of more than two terms are usually defined in term of the binary operation. In this case, parentheses are mandatory if we want to be really precise at the syntactic level ie, we should write $a+(b+c)$ for $+(a, +(b,c))$ and $(a+b)+c$ for $+(+(a,b),c)$.

Here again, the axioms for $+$ implies that it is associative, ie the two expression above are always the same semantically. Therefore, when syntax is not the main focus, we often neglect the parentheses and write $a+b+c$.

SolubleFish
  • 7,908
  • based on using + as being like a function $f$ we can then determine that for + having the number before the operator is the equivalent of having it in the first argument position? so $a+b=+(a,b)$ and hence if I had $b+a=+(b,a)$ but the actual argument position is essentially the same even if I have different variables as the actual arguments? So there are two argument positions defined for the addition, so there is a little semantic difference because technically the input tuple is slightly different moving the position? –  Apr 22 '22 at 11:20
  • is there a defined notation? e.g if the addition function takes a tuple $x=(x_1,x_2,x_3)$ how do we know whether our result would be $x_1+x_2+x_3$ or $x_2+x_3+x_1$ for example? –  Apr 22 '22 at 11:23
  • There is no semantic difference even though we switch the terms? Surely switch the terms means we have a different input for the function? Or for you is that just a syntax thing, and the meaning 'the sum of x and y' is the same, which is fair if that's your interpretation. –  Apr 22 '22 at 12:01
  • Semantically, $1+2$ is not a function, it is a number. In that sense, $1+2$ and $2+1$ are equal, they are the same number, even though they are not defined/computed in the same way. – SolubleFish Apr 22 '22 at 15:18
  • Of course, but the 'name' has meaning in that it tells us about an operation and how it was done. and in this way they do differ –  Apr 22 '22 at 18:49
  • "The name" is syntax. Semantics is the result of you interpreting the formal expression to obtain a number (or more generally a mathematical object). Syntactically, $1+2$ and $2+1$ are different, semantically they are the same (In other words $1+2 = 2+1$ is a theorem) – SolubleFish Apr 23 '22 at 08:57
  • Ok, I see, in the same way if you gave most early students 1+2=a+b the would conclude a=1 and b=2 when many other values can be true? –  Apr 23 '22 at 09:26
  • Thank you for the help anyway. –  Apr 23 '22 at 09:38