In constructive mathematics, an apartness relation is a constructive form of inequality, and is often taken to be more basic than equality.
An apartness relation is often written as
\#
≠
A binary relation
\#
\neg(x\#x)
x\#y \to y\#x
x\#y \to (x\#z \vee y\#z)
The complement of an apartness relation is an equivalence relation, as the above three conditions become reflexivity, symmetry, and transitivity. If this equivalence relation is in fact equality, then the apartness relation is called tight. That is,
\#
4.
\neg(x\#y) \to x=y.
The prototypical apartness relation is that of the real numbers: two real numbers are said to be apart if there exists (one can construct) a rational number between them. In other words, real numbers
x
y
z
x<z<y
y<z<x.
If there is no rational number between two real numbers, then the two real numbers are equal. Classically, then, if two real numbers are not equal, one would conclude that there exists a rational number between them. However it does not follow that one can actually construct such a number. Thus to say two real numbers are apart is a stronger statement, constructively, than to say that they are not equal, and while equality of real numbers is definable in terms of their apartness, the apartness of real numbers cannot be defined in terms of their equality. For this reason, in constructive topology especially, the apartness relation over a set is often taken as primitive, and equality is a defined relation.
A set endowed with an apartness relation is known as a constructive setoid. A function
f:A\toB
A
B
\#A
\#B
\forall(x,y\colonA).f(x) \#B f(y)\tox \#A y.