Reading preferences
Optional display controls need JavaScript. All reading content and navigation work without it.
How to use Read
Read follows the source chapter in ordinary reading order. Mathematics remains native MathML so a compatible screen reader or braille system can navigate its internal structure. Each small source link returns to the exact source line.
Relations as Sets
Definition: Binary relation
A binary relation on a set source 56 is a subset of source 56. If source 56 is a binary relation on source 57 and source 57, we sometimes write source 58 (or source 58) for source 58.
Example: Relations on the natural numbers
The set source 63 of pairs of natural numbers can be listed in a 2-dimensional matrix like this: source 65 We have put the diagonal, here, in bold, since the subset of source 78 consisting of the pairs lying on the diagonal, i.e., source 80 is the identity relation on source 83. (Since the identity relation is popular, let's define source 84 for any set source 85.) The subset of all pairs lying above the diagonal, i.e., source 87 is the less than relation, i.e., source 91 iff source 91. The subset of pairs below the diagonal, i.e., source 93 is the greater than relation, i.e., source 97 iff source 97. The union of source 98 with source 98, which we might call source 98, is the less than or equal to relation: source 99 iff source 99. Similarly, source 99 is the greater than or equal to relation. These relations source 101, source 101, source 101, and source 101 are special kinds of relations called orders. source 102 and source 102 have the property that no number bears source 102 or source 103 to itself (i.e., for all source 103, neither source 103 nor source 103). Relations with this property are called irreflexive, and, if they also happen to be orders, they are called strict orders.
Exercise: List the subset relation on a power set
List the elements of the relation source 121 on the set source 122.
Philosophical Reflections
In the Relations as Sets section, we defined relations as certain sets. We should pause and ask a quick philosophical question: what is such a definition doing? It is extremely doubtful that we should want to say that we have discovered some metaphysical identity facts; that, for example, the order relation on source 16 turned out to be the set source 17 that we defined in the Relations as Sets section. Here are three reasons why.
First: in the ordered-pair definition, we defined source 21. Consider instead the definition source 22. When source 23, we have that source 24. But we could equally have regarded source 25 as our definition of an ordered pair, rather than source 26. Both definitions would have worked equally well. So now we have two equally good candidates to “be” the order relation on the natural numbers, namely: source 29 Since source 33, by extensionality, it is clear that they cannot both be identical to the order relation on source 34. But it would just be arbitrary, and hence a bit embarrassing, to claim that source 35 rather than source 36 (or vice versa) is the ordering relation, as a matter of fact. (This is a very simple instance of an argument against set-theoretic reductionism which Benacerraf made famous in 1965. We will revisit it several times.)
Second: if we think that every relation should be identified with a set, then the relation of set-membership itself, source 42, should be a particular set. Indeed, it would have to be the set source 44. But does this set exist? Given Russell's Paradox, it is a non-trivial claim that such a set exists. In fact, it is possible to develop set theory in a rigorous way as an axiomatic theory, and that theory will indeed deny the existence of this set. So, even if some relations can be treated as sets, the relation of set-membership will have to be a special case.
Third: when we “identify” relations with sets, we said that we would allow ourselves to write source 58 for source 58. This is fine, provided that the membership relation, “source 59”, is treated as a predicate. But if we think that “source 60” stands for a certain kind of set, then the expression “source 61” just consists of three singular terms which stand for sets: “source 62”, “source 63”, and “source 63”. And such a list of names is no more capable of expressing a proposition than the nonsense string: “the cup penholder the table”. Again, even if some relations can be treated as sets, the relation of set-membership must be a special case. (This rolls together a simple version of Frege's concept horse paradox, and a famous objection that Wittgenstein once raised against Russell.)
So where does this leave us? Well, there is nothing wrong with our saying that the relations on the numbers are sets. We just have to understand the spirit in which that remark is made. We are not stating a metaphysical identity fact. We are simply noting that, in certain contexts, we can (and will) treat (certain) relations as certain sets.
Special Properties of Relations
Definition: Reflexivity
A relation source 24 is reflexive iff, for every source 24, source 25.
Definition: Transitivity
A relation source 29 is transitive iff, whenever source 29 and source 30, then also source 30.
Definition: Symmetry
A relation source 34 is symmetric iff, whenever source 35, then also source 35.
Definition: Anti-symmetry
A relation source 39 is anti-symmetric iff, whenever both source 40 and source 40, then source 40 (or, in other words: if source 40 then either source 41 or source 41).
Definition: Connectivity
A relation source 58 is connected if for all source 58, if source 59, then either source 59 or source 59.
Exercise: Compare special properties of relations
Give examples of relations that are (a) reflexive and symmetric but not transitive, (b) reflexive and anti-symmetric, (c) anti-symmetric, transitive, but not reflexive, and (d) reflexive, symmetric, and transitive. Do not use relations on numbers or sets.
Definition: Irreflexivity
A relation source 70 is called irreflexive if, for all source 70, not source 71.
Definition: Asymmetry
A relation source 75 is called asymmetric if for no pair source 75 we have both source 76 and source 76.
Note that if source 79, then no irreflexive relation on source 79 is reflexive and every asymmetric relation on source 80 is also anti-symmetric. However, there are source 81 that are not reflexive and also not irreflexive, and there are anti-symmetric relations that are not asymmetric.
Equivalence Relations
The identity relation on a set is reflexive, symmetric, and transitive. Relations source 14 that have all three of these properties are very common.
Definition: Equivalence relation
A relation source 18 that is reflexive, symmetric, and transitive is called an equivalence relation. elements source 19 and source 20 of source 20 are said to be source 20-equivalent if source 20.
Equivalence relations give rise to the notion of an equivalence class. An equivalence relation “chunks up” the domain into different partitions. Within each partition, all the objects are related to one another; and no objects from different partitions relate to one another. Sometimes, it's helpful just to talk about these partitions directly. To that end, we introduce a definition:
Definition: Equivalence classes and quotient
Let source 32 be an equivalence relation. For each source 32, the equivalence class of source 33 in source 33 is the set source 33. The quotient of source 34 under source 34 is source 35, i.e., the set of these equivalence classes.
The next result vindicates the definition of an equivalence class, in proving that the equivalence classes are indeed the partitions of source 40:
Proposition: Equality of equivalence classes
If source 43 is an equivalence relation, then source 43 iff source 44.
Proof
For the left-to-right direction, suppose source 48, and let source 48. By definition, then, source 49. Since source 49 is an equivalence relation, source 50. (Spelling this out: as source 50 and source 50 is symmetric we have source 51, and as source 51 and source 51 is transitive we have source 52.) So source 52. Generalising, source 53. But exactly similarly, source 54. So source 54, by extensionality.
For the right-to-left direction, suppose source 57. Since source 58 is reflexive, source 58, so source 58. Thus also source 59 by the assumption that source 60. So source 60.
End of proof.
Example: Congruence modulo n
A nice example of equivalence relations comes from modular arithmetic. For any source 65, source 65, and source 65, say that source 65 iff dividing source 66 by source 66 gives the same remainder as dividing source 66 by source 66. (Somewhat more symbolically: source 67 iff, for some source 67, source 68.) Now, source 68 is an equivalence relation, for any source 69. And there are exactly source 69 distinct equivalence classes generated by source 70; that is, source 70 has source 71 elements. These are: the set of numbers divisible by source 71 without remainder, i.e., source 72; the set of numbers divisible by source 73 with remainder source 73, i.e., source 73; …; and the set of numbers divisible by source 74 with remainder source 74, i.e., source 75.
Exercise: Congruence modulo n
Show that source 79 is an equivalence relation, for any source 79, and that source 80 has exactly source 80 members.
Orders
Definition: Preorder
A relation which is both reflexive and transitive is called a preorder.
Definition: Partial order
A preorder which is also anti-symmetric is called a partial order.
Definition: Linear order
A partial order which is also connected is called a total order or linear order.
Example: Hierarchy of order types
Every linear order is also a partial order, and every partial order is also a preorder, but the converses don't hold. The universal relation on source 40 is a preorder, since it is reflexive and transitive. But, if source 41 has more than one element, the universal relation is not anti-symmetric, and so not a partial order.
Example: No-longer-than preorder
Consider the no longer than relation source 46 on source 47: source 47 iff source 47. This is a preorder (reflexive and transitive), and even connected, but not a partial order, since it is not anti-symmetric. For instance, source 49 and source 50, but source 50.
Example: Subset partial order
An important partial order is the relation source 54 on a set of sets. This is not in general a linear order, since if source 55 and we consider source 56, we see that source 57 and source 57 and source 57.
Example: Divisibility as an order
The relation of divisibility without remainder gives us a partial order which isn't a linear order. For integers source 63 and source 63, we write source 64 to mean source 64 (evenly) divides source 64, i.e., iff there is some integer source 65 so that source 65. On source 65, this is a partial order, but not a linear order: for instance, source 66 and also source 66. Considered as a relation on source 67, divisibility is only a preorder since it is not anti-symmetric: source 68 and source 68 but source 69.
Example: Extension order on finite sequences
The extension relation on a set of sequences source 73 is the following: source 74 iff source 74 (the empty sequence), source 75, or source 75 and source 75. If source 76 we also say that source 77 is an initial segment of source 77. The extension relation on source 78 is a partial order but not a linear order, e.g., if source 79, then source 79 and source 79.
Definition: Strict order
A strict order is a relation which is irreflexive, asymmetric, and transitive.
Definition: Strict linear order
A strict order which is also connected is called a strict total order or strict linear order.
Example: Strict and non-strict orders
source 93 is the linear order corresponding to the strict linear order source 94. source 94 is the partial order corresponding to the strict order source 95.
Any strict order source 98 on source 98 can be turned into a partial order by adding the diagonal source 99, i.e., adding all the pairs source 99. (This is called the reflexive closure of source 100.) Conversely, starting from a partial order, one can get a strict order by removing source 102. These next two results make this precise.
Proposition: Add identity to a strict order
If source 105 is a strict order on source 105, then source 105 is a partial order. Moreover, if source 106 is a strict linear order, then source 106 is a linear order.
Proof
Suppose source 111 is a strict order, i.e., source 111 and source 111 is irreflexive, asymmetric, and transitive. Let source 112. We have to show that source 113 is reflexive, anti-symmetric, and transitive.
source 115 is clearly reflexive, since source 115 for all source 116.
To show source 118 is anti-symmetric, suppose for reductio that source 118 and source 119 but source 119. Since source 119, but source 120, we must have source 120, i.e., source 121. Similarly, source 121. But this contradicts the assumption that source 122 is asymmetric.
To establish transitivity, suppose that source 124 and source 124. If both source 125 and source 125, then source 125 since source 126 is transitive. Otherwise, either source 126, i.e., source 127, or source 127, i.e., source 127. In the first case, we have that source 128 by assumption, source 128, hence source 129. Similarly in the second case. In either case, source 129, thus, source 130 is also transitive.
Concerning the “moreover” clause, suppose that source 132 is also connected. So for all source 133, either source 133 or source 133, i.e., either source 134 or source 134. Since source 134, this remains true of source 135, so source 135 is connected as well.
End of proof.
Proposition: Remove identity from a partial order
If source 139 is a partial order on source 139, then source 139 is a strict order. Moreover, if source 140 is a linear order, then source 140 is a strict linear order.
Proof
This is left as an exercise.
End of proof.
Exercise: Removing identity from a partial order
Give a proof of the proposition turning a partial order into a strict order.
The following simple result establishes that strict linear orders satisfy an extensionality-like property:
Proposition: Strict orders determined by predecessors
If source 156 is a strict linear order on source 156, then: source 157
Proof
Suppose source 163. If source 163, then source 163, contradicting the fact that source 164 is irreflexive; so source 164. Exactly similarly, source 165. So source 165, as source 165 is connected.
End of proof.
Graphs
A graph is a diagram in which points—called “nodes” or “vertices” (plural of “vertex”)—are connected by edges. Graphs are a ubiquitous tool in discrete mathematics and in computer science. They are incredibly useful for representing, and visualizing, relationships and structures, from concrete things like networks of various kinds to abstract structures such as the possible outcomes of decisions. There are many different kinds of graphs in the literature which differ, e.g., according to whether the edges are directed or not, have labels or not, whether there can be edges from a node to the same node, multiple edges between the same nodes, etc. Directed graphs have a special connection to relations.
Definition: Directed graph
A directed graph source 25 is a set of vertices source 26 and a set of edges source 26.
Example: Directed graphs differing by an isolated vertex
The graph source 44 with source 44 and source 44 looks like this:
A directed graph with edges from 1 to itself, from 1 to 2, from 1 to 3, and from 2 to 3. Vertex 4 is isolated.
- Vertices
- 1, 2, 3, 4
- Directed edges
- 1 to 1; 1 to 2; 1 to 3; 2 to 3
- Isolated vertex
- 4
A directed graph with edges from 1 to itself, from 1 to 2, from 1 to 3, and from 2 to 3.
- Vertices
- 1, 2, 3
- Directed edges
- 1 to 1; 1 to 2; 1 to 3; 2 to 3
- Isolated vertices
- None.
Exercise: Draw the less-than-or-equal graph
Consider the less-than-or-equal-to relation source 73 on the set source 73 as a graph and draw the corresponding diagram.
Trees
A particular kind of partial order which plays an important role in all parts of logic is a tree. Finite trees occur in elementary parts of logic: for example, formulas can be understood in terms of their decomposition into a syntax tree, while derivations in many derivation systems also take the form of finite trees.
Infinite trees appear already in the proof of the completeness theorems for propositional and first-order logic, and are used throughout mathematical logic.
The set-theoretic concept of a tree is closely related to the notion of a tree in graph theory. Here is a picture of a (finite) tree:
The lowermost root r has children a and b. Node a has children c, d, and e. Nodes b, c, d, and e are leaves.
Edges: r to a; r to b; a to c; a to d; a to e.
The lowermost node source 37 is the root. Every node other than source 37 has exactly one parent node immediately below it. We can think of the relation a node source 39 stands in to a node source 39 if source 39 can be reached from source 39 by following edges upwards as source 40 being an ancestor of source 40.
The ancestor relation in a tree is a strict partial order. This motivates the set-theoretic definition. To state it we need two concepts. A least element in a set source 44 partially ordered by source 45 is an element source 45 such that for all source 45 we have that source 46. A set is well-ordered by source 46 if every one of its non-empty subsets has a least element.
Definition: Tree
A tree is a pair source 50 such that source 50 is a set and source 51 is a partial order on source 51 with a unique least element source 52 (called the root) such that for all source 52, the set source 53 is well-ordered by source 53.
Definition: Successors
Suppose source 57 is a tree. If source 58, source 58, and there is no source 58 such that source 59, then we say that source 59 is a successor of source 59.
The successors of source 62 are also called its children. If source 63 is a successor of source 63, then we call source 63 the predecessor or parent of source 64.
Proposition: A tree node has at most one predecessor
If source 67 is a tree, then every source 67 other than the root has at most one predecessor.
Proof
Suppose source 72 and source 72 and source 72. Then source 72. Since source 73 is well-ordered by source 74, its subset source 74 has a least element, which obviously must be either source 75 or source 75. So either source 76 or source 76. We assumed that source 76, so actually either source 77 or source 77. Since we assumed that source 78 and source 78, we furthermore have that either source 78 or source 79. So source 79 and source 79 cannot both be predecessors of source 80.
End of proof.
Definition: Finite and finitely branching trees
A tree source 84 is said to be infinite if source 84 is an infinite set, and finite otherwise. If source 85 is such that every source 86 has only finitely many successors, then we say that source 86 is finitely branching.
Definition: Branches
Given a tree source 91, a branch of source 91 is a maximal chain in source 92, i.e., a set source 92 such that for any source 93 either source 93 or source 93, and for any source 94 there exists source 94 such that neither source 95 nor source 95.
We use source 97 to denote the set of all branches of source 97.
Example: Infinite binary tree
A classic example of a finitely branching tree is the infinite binary tree of finite sequences of source 102s and source 102s, sometimes denoted source 103 or source 103, ordered by the extension relation source 104 (e.g., source 104). Since any binary string can always be extended by adding a source 106 or a source 106 on the end, this tree contains infinitely many elements: every element source 107 has exactly two successors, source 107 and source 107. Its root is the empty sequence source 107.
Example: Tree of finite natural-number sequences
Slightly more generally, the set of finite sequences of natural numbers source 112 with the extension relation source 112 is also a tree. It is obviously not finitely branching: every source 113 has infinitely many successors source 114, one for every source 114. Every source 114 which is closed under source 115 is a subtree of source 116. (That is, source 116 is such that if source 116 and source 117, then also source 117.) All finite trees can be represented as finite subtrees of source 118.
Proposition: König's lemma
If source 122 is a finitely branching infinite tree, then source 123 has an infinite branch.
A special case of König's lemma widely used in computability theory, known as weak König's lemma, is the following: any infinite subtree of source 128 has an infinite branch.
Operations on Relations
It is often useful to modify or combine relations. In the proposition turning a strict order into a partial order, we considered the union of relations, which is just the union of two relations considered as sets of pairs. Similarly, in the proposition turning a partial order into a strict order, we considered the relative difference of relations. Here are some other operations we can perform on relations.
Definition: Inverse, product, restriction, and application
Let source 20, source 20 be relations, and source 20 be any set.
The inverse of source 22 is source 22.
The relative product of source 25 and source 25 is source 25.
The restriction of source 28 to source 28 is source 28.
Example: Operations on the integer successor relation
Let source 36 be the successor relation on source 36, i.e., source 37, so that source 37 iff source 37.
source 39 is the predecessor relation on source 39, i.e., source 40.
Definition: Transitive closure
Let source 50 be a binary relation.
The transitive closure of source 52 is source 52, where we recursively define source 53 and source 53.
Example: Closure of the integer successor relation
Take the successor relation source 61. source 61 iff source 61, source 62 iff source 62, etc. So source 62 iff source 62 for some source 63. In other words, source 63 iff source 63, and source 63 iff source 63.
Exercise: Transitivity of the transitive closure
Show that the transitive closure of source 68 is in fact transitive.