Sheet 12 of 22
Sets and relations for reasoners
Needs sheet 10 for quantifiers.
Sets are the plainest objects in mathematics, and they turn up in almost every discipline that takes reasoning seriously: probability, databases, linguistics, the theory of voting. This page covers what a reasoner needs and stops well before the deep end, which is on sheet 20.
Definition
Set. A collection of things, considered as one object. The things are its members, and x ∈ A means x is a member of A. A set is fixed by its members alone.
That last sentence, called extensionality, has teeth. {1, 2} and {2, 1} are one set. {1, 1, 2} is that set again. And the set of even primes equals {2}, even though the descriptions differ. Sets have no order, repeats or built-in description.
Definition
Subset. A ⊆ B means every member of A is a member of B. In symbols, ∀x(x ∈ A → x ∈ B).
Counterexample
Membership and subset are different relations. Let A be {1, 2}. Then 1 ∈ A, while {1} ⊆ A. But 1 is not a subset of A, and {1} is not a member of A. Nor is the relation between a thing and its set like the relation between a part and a whole. A football team is a set of players, and the players are members. That does not make the left foot of a player a member, though it is part of something that is.
A logician’s habit: always ask whether “is” means ∈ or ⊆. “Rex is a dog” is membership, and “A dog is a mammal” is subset. And since ∈ is not transitive, the following does not work:
- Rex is a dog.
- The dog is a species.
Therefore: Rex is a species.
12.1 Operations
Each operation on sets is a connective in disguise.
| Operation | Symbol | Membership condition | Connective |
|---|---|---|---|
| Union | A ∪ B | x ∈ A ∨ x ∈ B | or |
| Intersection | A ∩ B | x ∈ A ∧ x ∈ B | and |
| Complement | Aᶜ | ¬(x ∈ A) | not |
| Difference | A \ B | x ∈ A ∧ ¬(x ∈ B) | and not |
So every law of propositional logic becomes a law of sets. De Morgan’s laws from sheet 05 turn into (A ∪ B)ᶜ = Aᶜ ∩ Bᶜ and (A ∩ B)ᶜ = Aᶜ ∪ Bᶜ. The same algebra appears over and over, which is the discovery Boole made, and sheet 22 picks that story up.
Definition
Empty set. The set with no members, written ∅. There is only one, by extensionality: two sets with no members have the same members.
The empty set is a subset of every set. That sounds odd until you unpack it. ∅ ⊆ A says “every member of ∅ is in A”, which is vacuously true for the reasons given on sheet 10. Note that ∅ differs from {∅}: the first has no members, and the second has one, and that member happens to be empty. An empty bag and a bag containing an empty bag are different bags.
12.2 Relations
A relation holds between things, in order. Formally, a relation on a set is a set of ordered pairs.
Definition
Ordered pair. (a, b) is a pair in which order matters: (a, b) differs from (b, a) unless a and b are the same.
“Is the parent of” on a domain of people is the set of pairs (x, y) with x a parent of y. This definition has no idea whether a relation is natural. {(1, 2), (2, 7)} is a perfectly good relation on the numbers. Below are three properties which, once you know them, stop a whole family of mistakes.
Definition
Reflexive. R is reflexive on a set when every x bears R to itself. “Is the same height as” is reflexive.
Definition
Symmetric. R is symmetric when xRy always gives yRx. “Is a sibling of” is symmetric.
Definition
Transitive. R is transitive when xRy and yRz always give xRz. “Is taller than” is transitive.
| Relation on people | Reflexive | Symmetric | Transitive |
|---|---|---|---|
| is the same age as | yes | yes | yes |
| is older than | no | no | yes |
| is a sibling of | no | yes | no |
| knows the name of | not always | no | no |
| is a parent of | no | no | no |
| is within one centimetre of the height of | yes | yes | no |
Sibling fails transitivity on a technicality: if Ann is Ben’s sister and Ben is Ann’s brother, then the two premises would give “Ann is her own sibling”, which is false. Half-siblings break it in a more interesting way.
The last row is the one to think about, because it is the shape of a real error.
Counterexample
“Near enough is the same” is not transitive. A is within a centimetre of B, B of C, C of D. Nothing follows about A and D. Each neighbour in a long row of paint swatches can look identical to the next, while the ends are obviously different. Tolerance relations like this are why the sorites paradox of sheet 20 is so hard to shake off.
Counterexample
“Is a friend of” is not transitive either, as anyone who has hosted a party knows. “Better than” looks as if it must be, and preference is the most interesting case of all.
12.3 A cycle of majorities
Three voters rank three options. (This table is an illustration, not data.)
| Voter | First | Second | Third |
|---|---|---|---|
| One | A | B | C |
| Two | B | C | A |
| Three | C | A | B |
A majority prefers A to B (voters one and three). A majority prefers B to C (one and two). A majority prefers C to A (two and three). So “the majority prefers” is not transitive, though each voter’s own ranking is perfectly transitive. The Marquis de Condorcet described the problem in an essay of 1785, and Kenneth Arrow’s impossibility theorem of 1951 generalised it. It means that you cannot reason about “what the group wants” as if a group were a person. Whoever sets the order of the votes can shape the outcome.
12.4 Equivalence and order
Definition
Equivalence relation. A relation that is reflexive, symmetric and transitive.
Definition
Partition. A division of a set into non-empty, non-overlapping parts that cover the whole.
Every equivalence relation creates a partition, and every partition creates an equivalence relation. “Has the same birthday as” divides people into 366 classes (counting 29 February). Any time you say “for our purposes these count as the same”, you are defining an equivalence, and you should be able to check all three properties. If transitivity fails, your groups will not hold together.
Definition
Partial order. A relation that is reflexive, transitive and antisymmetric: if xRy and yRx, then x and y are the same.
Subset is a partial order. “Partial” means that two things may be incomparable: {1} and {2} are neither of them subsets of the other. That is worth remembering when someone demands a ranking. Tasks in a schedule, job candidates and sports teams from different years often stand in a partial order. Forcing a total ranking on them means adding information that was never there.
Definition
Function. A relation in which each input is paired with exactly one output.
“The mother of” is a function on people, since each person has exactly one biological mother. “A child of” is not, since a parent may have several children and a person may have none. When a phrase starts with the, it is claiming to be a function, and it can fail either way. Bertrand Russell’s “On Denoting” (1905) turned this into a theory of definite descriptions: “The present King of France is bald” asserts that exactly one such person exists and is bald. So it is false, and it is not meaningless.
Try to break this
Here is a claimed proof that symmetry and transitivity give reflexivity. “Take any x. If xRy, then yRx by symmetry, so xRx by transitivity.” Each step is fine, and yet the result is false. Find the gap. Then find a concrete relation that is symmetric and transitive and not reflexive.
12.5 Exercises
Let
Abe {1, 2, 3} andBbe {3, 4}. ListA ∪ B,A ∩ B, andA \ B.Answer
A ∪ Bis {1, 2, 3, 4}.A ∩ Bis {3}.A \ Bis {1, 2}.True or false? (a)
∅ ∈ {1, 2}. (b)∅ ⊆ {1, 2}. (c){1} ∈ {1, 2}. (d){1} ⊆ {1, 2}.Answer
(a) False. The set has only two members and neither is
∅. (b) True, vacuously. (c) False. (d) True.Classify “is at least as tall as” on people.
Answer
Reflexive and transitive, but not symmetric, since a taller person is at least as tall as a shorter one and not the other way round. It is not antisymmetric either: two different people of equal height each bear it to the other. A relation like this is called a preorder.
Find the flaw in the claimed proof in the box above.
Answer
The proof assumes that for each x there is some y with
xRy. If x bears R to nothing, the argument never starts. Example: on {1, 2}, let R contain only (1, 1). It is symmetric and transitive, and 2 fails reflexivity.Which sets of pairs on {a, b} are symmetric but not transitive?
Answer
Exactly three. A symmetric relation on {a, b} that fails transitivity must contain (a, b) and (b, a), because those two together demand (a, a) and (b, b). So the answers are {(a, b), (b, a)} on its own, and that set with one of (a, a) or (b, b) added.
A hiring panel says “Candidate A beat B, B beat C, so A is better than C” after pairwise comparisons. What should you check?
Answer
Whether the relation is really transitive. If each comparison was made on different criteria, or by majority vote, A might lose to C when compared directly.