1.2.8: Summary
A relation \(R\) on a set \(A\) is a way of relating elements of \(A\) . We write \(Rxy\) if the relation holds between \(x\) and \(y\) . Formally, we can consider \(R\) as the sets of pairs \(\tuple{x,y} \in A^2\) such that \(Rxy\) . Being less than, greater than, equal to, evenly dividing, being the same length as, a subset of, and the same size as are all important examples of relations (on sets of numbers, strings, or of sets). Graphs are a general way of visually representing relations. But a graph can also be seen as a binary relation (the edge relation) together with the underlying set of vertices .
Some relations share certain features which makes them especially interesting or useful. A relation \(R\) is reflexive if everything is \(R\) -related to itself; symmetric , if with \(Rxy\) also \(Ryx\) holds for any \(x\) and \(y\) ; and transitive if \(Rxy\) and \(Ryz\) guarantees \(Rxz\) . Relations that have all three of these properties are equivalence relations . A relation is anti-symmetric if \(Rxy\) and \(Ryx\) guarantees \(x=y\) . Partial orders are those relations that are reflexive, anti-symmetric, and transitive. A linear order is any partial order which satisfies that for any \(x\) and \(y\) , either \(Rxy\) or \(x=y\) or \(Ryx\) . (Generally, a relation with this property is connected ).
Since relations are sets (of pairs), they can be operated on as sets (e.g., we can form the union and intersection of relations). We can also chain them together ( relative product \(R \mid S\) ). If we form the relative product of \(R\) with itself arbitrarily many times we get the transitive closure \(R^+\) of \(R\) .