Definition:Subtraction

Natural Numbers
Let $$\N$$ be the set of natural numbers.

Let $$m, n \in \N$$ such that $$m \le n$$.

Then we define the symbol "$$-$$" thus:


 * $$n - m = p \ \stackrel {\mathbf {def}} {=\!=} \ m + p = n$$

This is a translation of the definition Unique Minus in the naturally ordered semigroup.

Integers
The subtraction operation in the domain of integers $$\Z$$ is written "$$-$$".

As the set of integers is the Inverse Completion of Natural Numbers, it follows that elements of $$\Z$$ are the isomorphic images of the elements of equivalence classes of $$\N \times \N$$ where two tuples are equivalent if the Unique Minus between the two elements of each tuple is the same.

Thus subtraction can be formally defined on $$\mathbb{Z}$$ as the operation induced on those equivalence classes as specified in the definition of integers.

That is, the integers being defined as all the Unique Minus congruence classes, integer multiplication can be defined directly as the operation induced by natural number multiplication on these congruence classes.

It follows that:


 * $$\forall a, b, c, d \in \N: \left[\!\left[{\left({a, b}\right)}\right]\!\right]_\boxminus - \left[\!\left[{\left({c, d}\right)}\right]\!\right]_\boxminus = \left[\!\left[{\left({a, b}\right)}\right]\!\right]_\boxminus + \left({- \left[\!\left[{\left({c, d}\right)}\right]\!\right]_\boxminus}\right) = \left[\!\left[{\left({a, b}\right)}\right]\!\right]_\boxminus + \left[\!\left[{\left({d, c}\right)}\right]\!\right]_\boxminus$$

Thus integer subtraction is defined between all pairs of integers, such that:


 * $$\forall x, y \in \Z: x - y = x + \left({-y}\right)$$

Difference
The value $$a - b$$ (for any of the above definitions) is often called the difference between $$a$$ and $$b$$.

In this context, whether $$a - b$$ or $$b - a$$ is being referred to is often irrelevant, but it pays to be careful.