In primary and secondary school we all learnt that subtraction is not commutative, as only addition and multiplication is.
However, could subtraction be commutative for all real numbers that are subtracted from itself.
E.g 5-5=0 And 5-5=0
There are an infinite number of these pairs, so could subtraction be commutative when: x=y As in x-y?
Answers will be appreciated
$\endgroup$ 25 Answers
$\begingroup$Welcome to MSE!
Subtraction is not commutative, e.g., $5-7=-2$ and $7-5=2$. But you always have $x-x=0$ in this special case.
It is also not associative, e.g., $2-(5-7) = 2-(-2)=4$ and $(2-5)-7 = -3-7=-10$.
$\endgroup$ $\begingroup$Substraction between x and y is commutative in $\forall (x,y) \in \mathbb{C},x=y$, which is fairly useless. When people mean commutativity, they mean it for reals or for all complex numbers.
$\endgroup$ $\begingroup$If $X$ is a set and $\star$ a binary operation on $X$, $\star$ is said to be commutative if $x\star y = y\star x$ for all $x,y\in X$. To be commutative is a global property of the operation, thus the subtraction is not commutative.
$\endgroup$ $\begingroup$I think if you keep the sign with its number then subtraction could be commutative. For example $5-2=3$ and $-2+5=3$. If you keep the negative with the $2$ and the positive with the $5$ then it can be commutative.
Edited: subtraction itself is not commutative eg 5-2=3 and 2-5 =-3. But if you keep the number with its sign, then the order of adding or subtracting does not matter, eg +5-2=3 and -2+5=3.
Your example ($X-Y=0$ and $Y-X=0$ when $X=Y$) does not show the commutative property. It simply shows that any number subtracted from itself is zero.
$\endgroup$ $\begingroup$There is a sort of commutative property for subtraction. Observe that for all numbers $a, b, c$: $$a-b-c = a-c-b.$$
But this is not usually what is meant by commutativity.
$\endgroup$