Lesson 3
Naive Sets
Taught
Sets
In the last chapter, we introduced predicates, quantifiers, and (most importantly) sets, attempting to characterise our mathematical discourse around them as well-defined; although we now possess the necessary tools to work with them directly, we will still set out a formal framework: a system of axioms for sets, just as we established for logic in Chapter 1. The result will be a somewhat overcomplete collection of axioms (a style not typically used when teaching set theory); some of these axioms can be used to deduce others.
Axioms
The previous definition of the set as nothing more than a collection of objects, although circular as collection is merely a set under a different name, is useful and intuitive enough that to form a collection of object is to abstract from the intrinsic nature of the items themselves.
The logicians have in any case turned this into a method by asking where an object sits rather than what it is. A set, in this picture, is a “primary” box holding other “secondary” boxes, its elements, which may contain further boxes in their turn, and so on as far down as one cares to follow; the composition of the box never matters, only the arrangement of which box lies within which, so that two boxes with the same contents are the same box. The picture asks two things of us:
There exists a set with no elements, : called the empty or null set, written as or .
If is a set, then is also an object. In particular, a box is itself an object and an object may go inside a box , and therefore it is meaningful to ask whether is also an element of .
Remark.
Georg Cantor built set theory on that move somewhere between 1870 and 1890, taking the totality of objects sharing a given property to be one new object. The subject so founded divides into two: a first-order study of the sets themselves, and a higher-order study that turns upon the first to ask how far such knowledge can reach, where it shades into metamathematics, (we wont study this far). The creation itself irritated his contemporaries, for such an object might be infinite, and to enclose an infinity within a single box was more than most would grant.
Using our picture, we summarise the two relations used to build up set theory. The first, introduced last chapter, is the membership relation : if is an object and is a set, then is either true or false (it is well defined, which we come to in a second); note that if is not a set then does not make sense, like saying . The second is the equality relation : and name the same object, and its negation is written or . The equality relation obeys the three laws one expects: reflexivity, ; symmetry, if then ; and transitivity, if and then . The two relations, and , obey axioms we will state as we need them; when the objects named are sets, the axiom of extension below tells us how to recognise that sameness.
Remark (Substitution).
Given any two objects and with , the statements and are equivalent for every property depending on . This is customarily taken as the axiom of substitution, but we are not assuming anything new: a predicate had its truth value fixed by the objects assigned to its variables rather than by the terms naming them, and says those two terms name one object, so and are the same assignment twice over.
If two sets and , have the exact same elements then they are equal,
From the axiom we know that sets are unordered, as the biconditional shows, and that repetition does not count, as the box picture makes plain. There is no point in dropping two secondary boxes and into when, opened all the way down, they hold the same contents; they are not distinct objects, however distinct they may look.
The sets and are equal.
From these axioms we prove that the equality extensionality gives us for sets obeys them too.
Theorem 3.5 (Equality of sets is an equivalence relation).
Let , and be sets. Then ; if then ; and if and then .
Since is the statement , we prove it just as proving universal claims taught us to prove any universally quantified biconditional: take an arbitrary , and show that and stand or fall together.
Discussion.
Every one of the three claims has the same form once extensionality is applied: We first note that the biconditional splits into its two constituents, , so each law fixes an arbitrary object , proves two implications about its membership. For reflexivity, , or ; there is no hypothesis to argue from, so we read the implication through the defining equivalence of the conditional as , which Complement makes , and a conjunction of two such is again. For symmetry we assume , or, ; by Commutativity of , gives us which is . For transitivity we assume and , which give four implications between three memberships: is the chain of with by hypothetical syllogism, and is the chain of the other two the same way.
Proof (element style).
Let be an object.
For reflexivity, we must show that lies in exactly when it lies in . If then , and if then , so the two memberships stand or fall together whichever way falls. As was arbitrary, Axiom 3.3 gives .
For symmetry, suppose . Then by substitution. If then that biconditional puts in , and if it puts in , so . As was arbitrary, Axiom 3.3 gives .
For transitivity, suppose and . Then and by substitution. If , the first carries it into and the second into ; if , the second carries it back into and the first into . So , and as was arbitrary, Axiom 3.3 gives .
The axiom of extensionality also tells us that the empty set is unique.
Proposition 3.6 (Uniqueness of the empty set).
There is exactly one set with no elements.
Discussion.
By Axiom 3.1 , we know there is at least one set with no elements, so uniqueness is the claim that any two such sets are equal. Suppose is a different set that doesnt have any elements. By definition must equal , which by Axiom 3.3 , is the statement , for an arbitrary object . Neither set , and has elements, so both of its sides are , and is by biconditional.
Proof.
Let and both be sets with no elements, and let be an object. Since has no elements, , and since has no elements, ; both and are therefore . By the biconditional, is , so . As was arbitrary, Axiom 3.3 gives . Any two sets with no elements are equal, so there is only one, and we are entitled to speak of the empty set.
If a set is not equal to the empty set we call it non-empty. The following is a small statement, but one we will lean on often.
Proposition 3.7 (Single choice).
Let be a non-empty set. Then there exists an object such that .
Discussion.
The statement is existential, and proving existential claims asks for a witness, which the hypothesis does not name. We prove it by contradiction: denying the conclusion makes false for every object , and is false by Axiom 3.1 , so is by the biconditional and Axiom 3.3 gives , against the hypothesis.
Proof.
Suppose, for contradiction, that no object satisfies . Let be an object. Then , and by the axiom of existence . Both memberships are false, and as was arbitrary, (by Axiom 3.3 as is true), contradicting being non-empty, so some object satisfies .
Remark.
Firstly The emptyset is not the same thing as the number 0. One is a set; and the other a number. Secondly Proposition 3.7 is what licenses the word “choose”: given a non-empty we may pick out an element of it and give that element a name, and it is the hypothesis that earns us the right to do so. Taking one element from each of finitely many non-empty sets at once is a further step, and we will take it when we need it. Taking one from each of infinitely many is a different matter again: nothing we have assumed so far reaches that far, and it takes an axiom of its own, the axiom of choice, which we will keep running into.
Let and be sets. Show that if and only if there is an object belonging to one of them and not to the other.
Set-Builder Notation
We go back to last chapter, where we combined sets with predicates. To describe a set by a defining characteristic, or by carving a condition into a larger set, we use set-builder notation; a set so described takes the form
read ” is the set of all such that is true”, with "" meaning such that (note that some people use "" over ”|”) and a predicate.
This right now sounds like the well-defined set we spoke of earlier, but it isnt. As written the notation is unrestricted, and Russell’s paradox is what that costs us. Define
We can ask a few questions, like what the elements of are. Any of the sets we have discussed so far would be one: the empty set contains no elements, so it certainly does not have itself as an element, and . But what about itself?
- Suppose . The defining property of tells us that each of its elements is a set which does not have itself as an element, so .
- Suppose . Then is a set which does not have itself as an element, and that is the defining property, so .
Each assumption gives us its own negation, so . Nothing behaves this way, and the fault is not with but with the notation that produced it: we let the predicate range over everything at once.
Is a paradoxical set? Say why or why not; (b) does it have any elements?
So currently written our set-builder notation isnt safe. The axiom below is what makes it safe, and it carves into a set we already have.
For every set and every predicate there exists a set whose elements are exactly the elements of for which holds, .
The predicate no longer ranges over everything; it ranges over the elements of a set we are holding already, so Russell’s is never formed. What we may write down instead is , which is a perfectly ordinary set, and asking whether it belongs to itself gets an ordinary answer.
Proposition 3.9 (The carved set is unique).
Let be a set and a predicate. There is exactly one set such that if and only if and .
Discussion.
Axiom 3.8 supplies at least one such , so uniqueness is the claim that any two are equal. We prove this directly: We assume there is a second set satisfying the same membership condition. By Axiom 3.3 , is the statement , and the work is that one biconditional at an arbitrary object . Both sets carry the same membership criterion, so each side of it is equivalent to , and the two sides are joined through that.
Proof.
Let and both satisfy the criterion, and let be an object. Then and , so by the transitivity of equivalence. As was arbitrary, Axiom 3.3 gives .
Since there is only one such set, we may name it.
Definition 3.10 (Set-builder notation).
Let be a set and a predicate. The unique set such that if and only if and is written .
The criterion settles membership one object at a time: given any object , whether holds is decided by whether and do, and both of those have a truth value already.
Definition 3.11 (Well-defined set).
A set is well defined when has a truth value for every object .
We note that every set Axiom 3.8 builds is well defined, since is a predicate and a predicate has a truth value once its variable is assigned.
Let and be sets. Show that the set of objects lying in and not in exists.
We said at the outset that our collection of axioms would be somewhat overcomplete, and here is one instance of it: Axiom 3.1 asks for a set with no elements, but comprehension will produce one from any set at all.
Proposition 3.12 (Existence from comprehension).
Suppose some set exists. Then there is a set with no elements.
Discussion.
The hypothesis names a set but says nothing about its elements, so we can neither point at an object in it nor rule one out. What Axiom 3.8 lets us do is carve that set by any predicate we please, so we pick one no object can satisfy: fails for every object by the reflexivity of equality, and the set it carves out is then empty whatever we started from.
Proof.
Let be a set. By Axiom 3.8 , is a set, and for every object . Since for every object, is , and . As was arbitrary, has no elements.
The gain from restricting the notation is a set theory that does not fall over. What we give up is the set of everything.
Proposition 3.13 (No set of all sets).
There is no set such that every set is an element of , that is, , with ranging over sets.
Discussion.
The claim is a negative existence statement, so we prove it by contradiction: we assume such a exists and use it to build a set that cannot exist. Axiom 3.8 applied to and the predicate ” is not an element of itself” produces , which is where Russell’s argument runs again, this time inside the axiom rather than outside it. The question is whether , and the membership criterion is a biconditional, , so either answer forces the other.
Proof.
Suppose is a set containing every set. By Axiom 3.8 , is a set, and since contains every set, . If , then by the membership criterion satisfies the defining predicate, so ; if , then and both hold, which is the criterion, so . Each alternative gives its own negation, so no such exists.
Pairs
Were these the only axioms we had, set theory would be a paper thin subject: Axiom 3.1 gives us the empty set, and Axiom 3.8 only ever carves into a set we are already holding, so every set we could name would be empty. The axioms below build.
For any two objects there is a set containing exactly those two, .
Definition 3.15 (Pair and singleton).
Let and be objects. The set given by pairing them is written , and we write for , the singleton of .
Remark.
The axiom asserts that such a set exists; that there is only one comes from Axiom 3.3 , by the argument of Proposition 3.9 . Two sets answering to the same membership criterion agree on every object, so they are equal; the same holds for every set we name from here on.
Since is an abbreviation rather than a further axiom, no separate axiom for singletons is needed: pairing an object with itself produces one.
Remark.
From here on there are two natural styles for writing such a proof. The first chases the element through in prose, spelling out what each membership means as it goes; the second works directly on the predicates, transforming "" into "" by the laws tabulated in the first chapter. Both are correct, and tastes differ; I prefer the logical style, but I will give both throughout for completeness, and you should be able to read each.
Proposition 3.16 (Pairs are unordered and absorb repetition).
Let and be objects. Then , and if and only if , for every object .
Discussion.
The first claim is an equality of sets, so by Axiom 3.3 it is a biconditional at an arbitrary object , and the membership criterion of Axiom 3.14 rewrites each side as a disjunction: on the one side and on the other, which the axiom of Commutativity exchanges. The second claim is not an equality of sets, since is by Definition 3.15 another name for ; what has to be shown is that the pair criterion collapses, reducing to by Idempotence, so that the singleton holds the one object and nothing else.
Proof (element style).
Let be an object and suppose . By Axiom 3.14 , or . In the first case is the second of the two objects paired to form , and in the second case it is the first, so either way. Interchanging and throughout carries an element of back to . As was arbitrary, Axiom 3.3 gives . For the singleton, is . If , then by Axiom 3.14 or , and both alternatives say the same thing, so . Conversely, if then the first alternative holds, so , which is .
Proof (logical style).
The empty set is a set, hence an object by Axiom 3.2 , so pairing it with itself gives the singleton . That in turn is an object, so we may form , and pairing the first two gives .
Show that , , and are four different sets.
Every set we can build so far holds at most two elements; to grow them we take a set whose members are themselves sets and pool everything they contain.
Given any set of sets, there is a set containing precisely those objects which are members of some set in the collection, .
Definition 3.19 (Union of a system of sets).
Let be a set. The unique set such that if and only if for some is written .
Definition 3.20 (Union of two sets).
Let and be sets. Then denotes the set .
Two axioms are at work in that second definition: pairing gathers and into one collection, and union pools what they hold. Membership in the result reads as a disjunction.
Proposition 3.21 (Membership in a union).
Let and be sets. For every object , .
Discussion.
is , so Axiom 3.18 reads its membership as , an existential claim about which member of the collection holds . The collection has only two members, since Axiom 3.14 gives , so the witness can only be or and the existential claim collapses into the disjunction of those two cases.
Proof (element style).
Let be an object and suppose , which is to say . By Axiom 3.18 some set has and , and by Axiom 3.14 that is either or . In the first case and in the second , so or .
Conversely, suppose or . If , take to be : then , and by Axiom 3.14 , so is a witness and . If instead , take to be and argue the same way. Either way .
Proof (logical style).
Let be an object.
The fifth step is the distribution of an existential over a disjunction from the last chapter, and the last discharges each witness by substitution, since a with may be replaced by throughout.
The “or” is the disjunction of the first chapter, inclusive as always, so an object lying in both sets lies in the union too.
Proposition 3.22 (Union is well defined).
Let , and be sets with . Then .
Discussion.
An operation on sets should not depend on how we happened to name its arguments, and the criterion of Proposition 3.21 is what secures that here: membership in is decided by membership in and in , and makes membership in and in the same question. So the two unions meet the same criterion at every object, and Axiom 3.3 does the rest.
Proof (element style).
Let be an object and suppose . By Proposition 3.21 , or . If , then by substitution, since ; if , there is nothing to change. Either way or , so by Proposition 3.21 .
For the converse, by the symmetry of equality established in Theorem 3.5 , so the same argument run with in place of carries an element of into . As was arbitrary, Axiom 3.3 gives .
Proof (logical style).
With membership in a union settled, the basic properties of the operation follow from the corresponding properties of .
Proposition 3.23 (Basic properties of unions).
Let and be objects and let , and be sets. Then
- ;
- ;
- ;
- .
Discussion.
Every claim is an equality of sets, so by Axiom 3.3 each is a biconditional at an arbitrary object , and Proposition 3.21 turns each side into a disjunction of memberships. What is left is a propositional identity in each case: Commutativity of for the second claim, Associativity for the third, and for the fourth, Idempotence for together with the axiom of Identity for the two involving , since is by Axiom 3.1 . The first claim is the one that reaches back further: Axiom 3.14 gives on the left, and Proposition 3.16 reads each singleton on the right as a single equation, so the two sides meet at the same disjunction.
Proof (element style).
Let be an object.
For the first claim, suppose . By Axiom 3.14 , or . In the first case by Proposition 3.16 , and in the second , so either way by Proposition 3.21 . Conversely, if then or , so or , and .
For the second, suppose . Then or , which is to say or , so . The same argument with and interchanged gives the reverse.
For the third, suppose . Then or . If , then , and so . If instead , then or ; in the first case at once, and in the second and hence . So every element of lies in , and a similar argument gives the reverse.
For the fourth, says or , which says . And says or , where the second alternative is impossible by Axiom 3.1 , so it says ; the same holds for .
In each case was arbitrary, so Axiom 3.3 gives the four equalities.
Proof (logical style).
Let be an object, and write , , for the propositions , , .
We note that goes the same way after Commutativity. In each case was arbitrary, so Axiom 3.3 gives the equalities.
Because of associativity, we do not need to use the brackets: names one set regardless of how we group it ( or , both mean the same thing), and likewise for and longer strings.
Definition 3.24 (Triples and longer).
Let , , be objects. We write for , and for , and so on for any string of objects written out in full.
The set holds those objects lying in , or in , or in both, which are , and . So .
The phrase “and so on” is doing work we cannot yet justify. Writing a set of objects for an unspecified means iterating the construction times, and we have not said what iterating a construction a given number of times amounts to; a set of infinitely many objects is further out of reach still. Later axioms will build sets that large.
Let be a set. Show that .
Subset
Comparing sets, we can see that some sit inside others, and we say the smaller one is a subset of the bigger. We write for this throughout, whether or not the two sets happen to be equal.
Let and be sets. We say is a subset of , written , if every element of is an element of . If moreover , we call a proper subset of and write .
In logical language this is a universally quantified implication between predicates,
and this reading will drive every subset proof we write: to prove we take an arbitrary , assume , and reach .
The empty set is a subset of every set . The implication has a hypothesis no object can satisfy, and an implication with a false hypothesis holds automatically; a promise never invoked is never broken. So , vacuously.
The definition uses nothing but and , and both obey substitution, so the subset relation does too: if and , then .
Proposition 3.28 (Subsets are transitive).
Let , and be sets. If and , then .
Discussion.
The conclusion is itself a universally quantified implication, so we assume for an arbitrary object and must reach . The definition of subset is the only tool needed: trades membership in for membership in , and trades membership in for membership in , so the element walks through .
Proof (element style).
Let . By the definition of subset, gives , and gives . As was arbitrary, .
Proof (logical style).
For any object ,
so holds for every , which is .
Mutual inclusion is the other way of saying two sets are equal, which is what we should expect: the obvious way to define equality of sets is to say they contain exactly the same elements, and that is two implications rather than one.
Proposition 3.29 (Mutual inclusion is equality).
Let and be sets. If and , then .
Discussion.
By Axiom 3.3 the conclusion is a biconditional at an arbitrary object , and by the defining equivalence of the biconditional that biconditional is the conjunction of two implications. Those two implications are exactly what the two inclusions say, so the hypotheses deliver the conclusion once we have unfolded both sides into their logical form.
Proof.
Let be an object. By the definition of subset, gives , and gives . The two together say that lies in exactly when it lies in , so . As was arbitrary, Axiom 3.3 gives .
Proposition 3.30 (Proper subsets are transitive).
Let , and be sets. If and , then .
Discussion.
A proper inclusion is two claims, so the conclusion is two claims. The inclusion is Proposition 3.28 applied to the two inclusions we are given, which leaves . For that we need an object separating them, and supplies one: were every element of in we would have , and with that makes by Proposition 3.29 , against . That object lies in but not in , so it cannot lie in either.
Proof.
From and we get by Proposition 3.28 , so it remains to show . Since , some object lies in but not in : otherwise every element of would be an element of , giving , and with that would make by Proposition 3.29 . Now suppose . Then by substitution, and gives , contradicting . So , and with this is .
Is for every set ?
Let . Which of , and are true?
More Set Operations
Swapping the “or” for an “and” gives the intersection, whose members must belong to both sets at once.
Definition 3.31 (Intersection).
Let and be sets. The intersection is the set , so that for every object ,
The intersection needs no new axiom: Axiom 3.8 carves it out of , a set we are already holding. And since it is defined from and alone, both of which obey substitution, so does the intersection. The same remark applies to the definitions that follow, and we will not mention it again.
Proposition 3.32 (Inclusions for union and intersection).
Let and be sets. Then and , while and .
Discussion.
Each of the four is a universally quantified implication, so each takes an arbitrary , assumes the left membership and reaches the right. The two for the intersection unfold into a conjunction on the left, and Simplification extracts either conjunct. The two for the union unfold into a disjunction on the right, and Addition weakens a known truth to a disjunction.
Proof.
Let be an object. If , then and ; Simplification gives from that conjunction, and equally . As was arbitrary, and .
If instead , then Addition gives or , which is by Proposition 3.21 . As was arbitrary, , and the argument for is the same.
Two sets and are disjoint if .
Remark.
Being disjoint is not the same as being distinct. The sets and are distinct, since each holds an element the other does not, but they are not disjoint, since their intersection holds and . Meanwhile and are disjoint but not distinct.
Let be a set. What is ?
Theorem 3.34 (Characterising the empty set).
Let be a set. The following are equivalent.
- for every set ;
- for every set ;
- has no elements;
- for every set .
Discussion.
Four statements would ordinarily need twelve implications, but a loop is enough: we prove the chain , and every statement then reaches every other by going round. Step is an equality of sets, so it is two inclusions, one of which we already have from Proposition 3.32 . Step has no object to point at, so it goes by contradiction, and the case is what collapses it. Step is again two inclusions, and the work is splitting the “or” in , where the second alternative is ruled out by the hypothesis. Step is a single inclusion, read off Proposition 3.32 and the hypothesis.
Proof.
. Assume . We have by Proposition 3.32 . For the reverse inclusion take ; then since , so and , which is . Hence , and Proposition 3.29 gives .
. Suppose, to the contrary, that has an element . Taking in the second statement gives . But nothing belongs to , since anything in it would lie in and Axiom 3.1 forbids that, so has no elements and has none either. This contradicts .
. Assume has no elements. We have by Proposition 3.32 . For the reverse inclusion take ; by Proposition 3.21 either or , and the second is impossible, so . Hence , and Proposition 3.29 gives .
. Let be a set. We have by Proposition 3.32 , and by the fourth statement, so by substitution.
Complements of Sets
If , the complement of in is the set of all elements of that are not in .
Let . The complement of in is the set
so that for ranging over , .
Other texts write , but we will stick with . Notice that a complement means nothing until the ambient set is understood.
The complement removes one set from another only when the first lies inside the second. Dropping that assumption gives the difference of two arbitrary sets.
Definition 3.36 (Set difference).
For sets and , the difference is the set of elements of that are not in ,
with membership . The complement is the difference in the case .
. The set being removed need not sit inside the set it is removed from; the elements the two do not share are simply ignored.
With complements taken in , what are , and ? Name the logic law behind the last one.
Complements breed negative statements like , and the standard tool for proving those is proof by contradiction: to show a statement true, assume its negation and derive a contradiction; the contradiction cannot stand, so the assumption was false and the statement we wanted holds.
Proposition 3.38 (Complements reverse inclusion).
Let . If , then .
Discussion.
The conclusion is a universally quantified implication, so we take and must reach . Both memberships are negative statements by the definition of the complement, so what has to be shown is from , and that is the contrapositive of the implication hands us. Elementwise the same step is a contradiction: assume , push it through to , and collide with .
Proof (element style).
Let , so and . Suppose . Then gives , contradicting , so . Since , this is . As was arbitrary, .
Proof (logical style).
For any in ,
so for every in , which is .
Let , with complements taken in . Prove that and .
Remark (The dictionary).
By now a dictionary has emerged: complement is , intersection is , union is , subset is , and equality is . Any equivalence built from , and alone translates through it into an identity of sets, so the table of laws in the first chapter doubles as a table of set identities.
Before taking complements of combinations we should check they may be taken at all. If and are subsets of , then so are and : an element of lies in or in and so in either way, and by Proposition 3.32 and Proposition 3.28 . Complements of both are therefore defined in .
Feeding De Morgan’s laws through the dictionary produces their set-theoretic form: the complement bar breaks over and , swapping one for the other.
Theorem 3.39 (De Morgan's laws for sets).
Let and be subsets of an ambient set. Then
Discussion.
We prove the first; the second is identical work with the roles exchanged. Equality of sets is two inclusions by Proposition 3.29 , and both read the same way through the dictionary. For in the ambient set, membership in is the negation of the disjunction ; the disjunctive De Morgan law rewrites that negation as the conjunction , which by the definitions of complement and intersection is membership in . Each inclusion is one half of this biconditional, and the logical proof writes the whole equivalence down at once.
Proof (element style).
For the first inclusion, assume , so by the definition of the complement: it is not true that or . By De Morgan’s laws this means and , that is, and . Belonging to both, belongs to their intersection, so and .
For the second inclusion, assume , so and , meaning and . By De Morgan’s laws again, ” or ” is false, so by Proposition 3.21 , and hence . Thus , and the two inclusions give the equality.
Proof (logical style).
The set law is the logic law read through the dictionary, and the logical proof is barely more than the act of reading it.
The Distributive Laws
De Morgan’s laws show union and intersection entangled through the complement; they also interact directly, one applied to the output of the other. The pattern is distribution, as with numbers, though sets are more even-handed about it: multiplication distributes over addition but not the other way round, while here each operation distributes over the other.
Theorem 3.40 (Distributive laws for sets).
Let , and be sets. Then
Discussion.
We prove the first. It is an equality of sets, so two inclusions. For we assume ; a union assumption is an “or”, so we split into the cases and , and in each we must put in both and . For the reverse inclusion we assume , which hands us two “or” statements at once; the clean way through is to split on whether , since if not, each “or” is forced to its other option. The logical proof needs only the axiom of Distributivity applied to the membership predicates.
Proof (element style).
For the first inclusion, assume , so or . If , then and , so lies in their intersection. If instead , then and ; the first puts in , the second puts in , and again lies in the intersection. Either case gives , so .
For the second inclusion, assume , so and ; that is, or , and at the same time or . If , then and we are done. If , then the first “or” forces and the second forces , so and again . Either way , and with both inclusions the sets are equal.
Proof (logical style).
The comparison is a habit by now: the elementwise proof of the second inclusion needed a small idea, splitting on whether , while the logical proof needed no ideas at all, only the table.
Theorem 3.41 (The algebra of intersection).
Let , and be sets. Then
- ;
- ;
- ;
- and ;
- if and only if if and only if .
Discussion.
The union halves of the first three are Proposition 3.23 , and these are the same rows of the table read with in place of : idempotence, commutativity and associativity are the logic laws of those names, and each is one chain of equivalences. The fourth mixes the two operations, and is absorption. The fifth is different in kind, since it is not an identity but a comparison: the equivalences and each say exactly that implies , so we check it elementwise, with two inclusions inside each of the two biconditionals.
Proof (logical style).
Let be an object and write , , for the propositions , , .
Each chain is a biconditional for every , so Axiom 3.3 gives the corresponding equalities.
Proof (element style).
For the fifth part, suppose first that . Since by Proposition 3.32 , we get . Conversely, suppose . We have by Proposition 3.32 , and if then , so ; hence , and Proposition 3.29 gives .
For the other equivalence, suppose . Then by Proposition 3.32 and substitution. Conversely, suppose . We have by Proposition 3.32 , and if then or , and in either case ; hence , and Proposition 3.29 gives . Both equivalences hold, so the three statements are equivalent.
Remark.
These identities, together with the complement laws, are what it means to say that the subsets of a fixed ambient set form a boolean algebra: the same structure the connectives , and were shown to have in the first chapter, met a second time with sets in place of propositions.
Power Sets
Sets collect objects, and nothing forbids those objects from being sets themselves: here we collect all the subsets of one set into a single set, a construction we will meet far more often than its modest definition suggests.
Collecting the subsets of is not a case of comprehension, since it does not carve out of a set already in hand: the subsets of are not among the elements of , and there is no larger set on the table to cut them from. So the set has to be supplied.
For every set there exists a set whose elements are exactly the subsets of : for all sets , .
Let be a set. The power set of , written , is the unique set whose elements are exactly the subsets of : for every set , . We also write it .
Remark.
That last notation is the unrestricted form we rejected earlier, and it is safe here only because the axiom has already produced the set. The braces are naming a set we hold; writing with no axiom behind it would lead us back to Russell.
Let with . Then . The elements of are sets, so we write because , while is simply false.
Proposition 3.45 (Power set of the empty set).
.
Discussion.
The claim is an equality of sets, so Proposition 3.29 lets us prove the two inclusions. For it is enough to check that is a member of the power set, which Definition 3.43 reduces to . For the reverse inclusion we take an arbitrary ; the same definition converts that membership into , and since the empty set is a subset of every set we have as well, so mutual inclusion forces . The logical proof collapses the same chain into biconditionals: membership in the power set is the subset relation, which against is equality with , which is membership in .
Proof (element style).
() Since , Definition 3.43 gives , and hence .
() Conversely, let . Then , and since as well, Proposition 3.29 gives , so . Thus , and the two inclusions give the equality.
Proof (logical style).
Theorem 3.46 (Power-set laws).
Let and be sets. Then
- ;
- if and only if ;
- ;
- .
Discussion.
Every claim reduces to Definition 3.43 : a set belongs to a power set exactly when it is a subset of the set in question. The first is immediate from and . The second is a biconditional, so it splits: forwards, an has and , and Proposition 3.28 chains them; backwards, the first part puts itself into , so an inclusion of power sets hands us , which is read back through the definition. The third is one inclusion only, since a subset of or of is a subset of either way, and the reverse fails in general, as the example after the proof shows. The fourth is an equality, so both inclusions, and it holds because being a subset of both and is the same thing as being a subset of .
Proof.
For the first claim, and , so and by Definition 3.43 , and therefore .
For the second, suppose and take . Then , and with this gives by Proposition 3.28 , so . Hence . Conversely, suppose . The first claim gives , so and therefore .
For the third, let , so or by Proposition 3.21 . If then , and every element of then lies in and so in ; if the same argument runs through . Either case gives , that is, .
For the fourth, let . Then and , so every element of lies in and in , hence in . Thus and . Conversely, let . Every element of lies in and so lies in , and equally in , giving and . Hence belongs to both and , and therefore to their intersection.
The inclusion in the third claim really can be strict. Let and with . Then , so , but is a subset of neither nor and so lies in neither nor .
Let be a set and let be an object with . Describe in terms of .
Can ever be the power set of some set? Prove your answer.
Find a necessary and sufficient condition on and for , and prove that your condition works in both directions.
Replacement
Everything we have built so far either cuts a set down or pools sets together. Nothing we have assumed lets us take a set and change what is in it. Suppose we hold and want the set holding one more than each of those, : comprehension carves out of a set we are holding, and none of , , lies in , so there is nothing to carve them from. The axiom below closes that gap by letting a statement pair each element with its replacement.
Let be a set, and let be a statement about an object and an object such that for each there is at most one making true. Then there exists a set whose elements are exactly those partners: for any object ,
The condition that each have at most one partner is what keeps the axiom honest. A statement free to pair one with many could sweep in everything in sight, and we would be back with the unrestricted notation and its paradox; tying each element to a single partner means every object in the new set is the partner of something in , so nothing enters that did not put there.
Take and let be the statement . Each in has exactly one partner, so the axiom applies, and the set it hands back is .
Take again, and let be the statement . Each in still has exactly one partner, but it is the same partner every time, so the set produced is . The axiom may return something smaller than what we started with, since nothing forces distinct elements to have distinct partners.
Axiom 3.3 makes that unique, so we may name it, and we write it . As with the power set, those braces carry no carving set and are safe for the same reason: the axiom produced the set before the notation named it. When the partner of is written we abbreviate further, to or .
We promised at the outset that our axioms would be overcomplete.
Proposition 3.51 (Comprehension from replacement).
Let be a set and a predicate. Then replacement alone produces a set whose elements are exactly the elements of for which holds.
Discussion.
Replacement builds a set by transforming elements, while comprehension builds one by selecting them, so the work is to make a transformation do the selecting. We transform each element into itself, and only when holds of it: the statement saying ” and ” pairs an element satisfying with itself and leaves an element failing with no partner at all. The at-most-one condition is then met for a reason worth noticing, since some elements have no partner rather than one, and the set of partners is exactly the set of elements we wanted to keep.
Proof.
Let be the statement ” and ”, and let . If holds, the only with is itself; if fails, no satisfies . Either way there is at most one such , so Axiom 3.48 applies and produces a set with exactly when holds for some .
Suppose . Then some has and , so by substitution, and likewise. Conversely, if and , then is itself a witness, so . Hence for every object , which is the criterion of .
So Axiom 3.8 could have been left out. We keep it anyway, and that is an editorial choice rather than anything the proposition settles: the discussion of Russell’s paradox turned on carving into a set we already hold, and it is the axiom we reach for constantly. The two also combine, so to build we first form by comprehension and then apply replacement to it.
Remark.
Replacement is a schema, as comprehension is: one axiom for each statement , not a single statement quantifying over all of them.
Regularity (Optional)
Our set-builder notation was rejected for producing a set that could not exist. The damage runs further than that one set: unrestricted, the notation also hands us the collection of every object at once, and since sets are objects by Axiom 3.2 , such a collection would contain itself. A box holding itself is not something the picture we started from can draw.
The intuition that keeps this from happening is that objects come in stages. At the bottom sit the objects that are not sets at all, such as the number . Above them sit the sets built only from those, like and . Above those sit the sets built from everything so far, like , and so on upward. A box at any stage holds only boxes opened at earlier stages, so no box ever ends up inside itself.
Writing that hierarchy down properly is a good deal of work, and we will not do it. We take instead the one consequence of it we need.
If is a non-empty set, then at least one element of is either not a set, or is disjoint from .
Read against the hierarchy, the axiom says that some element of sits low enough to hold none of the others. It asks this of one element only, not of all of them.
Let . Its first element holds neither of the elements of , since neither nor lies in , so it is disjoint from and the axiom is satisfied. The second element sits a stage higher and does hold an element of , namely , which the axiom permits.
Show that the unrestricted notation of the set-builder section, had we assumed it rather than rejected it, would imply Axiom 3.8 , Axiom 3.14 , Axiom 3.18 , Axiom 3.42 and Axiom 3.48 , and would therefore have spared us most of this chapter.
Use regularity, together with Axiom 3.14 , to show that for every set . Show further that for any two sets and , either or , or both.
Show, assuming the other axioms, that the unrestricted notation is equivalent to postulating a set containing every object: if the notation is permitted then such an exists, and if such an exists then the notation is legitimate.
The second problem is worth a second look once it is done. It says that for any set there is always an object outside , namely itself, so we may always add one more element and form the larger set . It also gives a second route to Proposition 3.13 , since a set holding every object would hold itself, which regularity forbids. We proved that proposition from comprehension alone, so the two arguments lean on nothing in common.
Remark.
One may fairly ask whether we need this axiom, since it is less intuitive than the others. For analysis we do not: the sets we meet are all low in the hierarchy, sets of ordinary objects or sets of those, and nothing later in these notes depends on regularity. It matters for set theory pursued for its own sake, and we state it here so the list is complete.
Exercises
Answers are checked in your browser, as often as you like. Nothing is sent anywhere and
nothing is kept but your own work. A formula may be written with the symbols themselves or
with ~ & | -> <-> ^, and \and, \or, \to expand as you type.
Each construction below is licensed by exactly one axiom. Name it.
From two objects and , the set .
From a set and a predicate , the set of those elements of satisfying .
That and are one and the same set.
From a set whose elements are sets, the set of every object belonging to one of them.
Set-builder notation, and the restriction that makes it safe.
The statement says exactly:
The set is:
Let be any set and put , which comprehension makes a set. Running Russell’s argument on now establishes:
Let and , with complements taken in .
is:
is:
is:
Write , and for the statements , and , with ranging over an ambient set containing all three. Give the membership condition of each set below.
, written with and nothing else.
An identity of sets fails as soon as one object falls on different sides of it, so a counterexample is a choice of which of the sets that object lies in. Write , , for , , , and place one in each case.
against .
against .
Power sets, counted.
For distinct , , , the set has how many elements?
is:
And has how many elements?
Replacement, and the condition it imposes.
Take and let be the statement . The set replacement returns is:
Which of these statements does replacement refuse?
For sets and , the symmetric difference is
the set of objects belonging to exactly one of the two.
An object lies in exactly when it belongs to:
Write that condition in , , . Spelling the four cases out with , and counts, and so does the short answer, which uses and one pair of brackets and nothing else. Then try the other bracketing of that short answer, and say what the two verdicts together tell you about .
Each condition below holds for some pairs of sets and not others. Say for which.
:
:
:
Exercises in Lean
The proofs below are checked in your browser. Nothing is sent anywhere, and nothing is
stored but your own work. Type \to for →,
\and for ∧, \< and
\> for ⟨ ⟩.
The last two sheets were about statements. This one is about objects, and about the sets that hold them.
The editor has one type, Obj, and its terms are the objects of this chapter. Sets are objects too by Axiom 3.2 , so a set and its elements are terms of that same type, and x ∈ A is a statement about any two of them. Nothing marks off the objects that are sets from those that are not, and every exercise below is about sets.
The notation is typed with the backslash abbreviations: \in for ∈, \nin for ∉, \sub for ⊆, \cup for ∪, \cap for ∩, \emptyset for ∅ and \powerset for 𝒫. The difference A \ B is a plain backslash.
Inclusion
An inclusion is not a new kind of statement. A ⊆ B is ∀ x, x ∈ A → x ∈ B written short, so it is proved the way an implication is, by intro, and used the way an implication is, by applying it: with h : A ⊆ B and hx : x ∈ A, the term h x hx proves x ∈ B. A goal ∀ x, p x behaves the same way, intro x fixing an arbitrary x and leaving p x.
Example.
An inclusion applied to an object and to a proof that the object lies in the smaller set.
The operations are nothing more than their membership criteria. x ∈ A ∪ B is the disjunction x ∈ A ∨ x ∈ B, not merely equivalent to it, so left, right and rcases work on a membership in a union as they do on any disjunction. x ∈ A ∩ B is the conjunction x ∈ A ∧ x ∈ B, so ⟨_, _⟩ builds one and .left and .right take one apart.
Example.
The first intro fixes the object, the second assumes it lies in .
Example.
Half of a conjunction, reached through the criterion for the intersection.
Both criteria at once: take the conjunction apart, then choose a side of the disjunction.
Subsets are transitive.
A set containing both and contains their union.
And a set contained in both is contained in their intersection.
Equality
Two sets are equal when they have the same elements, and Set.ext is that axiom: handed ∀ x, x ∈ A ↔ x ∈ B it returns A = B. So apply Set.ext turns a goal A = B into that biconditional, intro x fixes the object, and constructor splits the biconditional into its two directions.
Example.
Idempotence of the intersection, which is idempotence of underneath.
Mutual inclusion says the same thing, and Set.subset_antisymm is Proposition 3.29 . Applying it leaves the two inclusions as separate goals, which is often the shorter road, since neither of them mentions the biconditional.
Example.
Absorption. The harder inclusion splits on the union; the other one is a line.
have
A proof that needs a step of its own records it with have. Writing have h : p := … adds h : p to the context, and what follows := is either a term or by with a block indented under it.
Example.
The intermediate membership is named, and then taken apart.
The order of a union carries no information.
The distributive law left unproved in Theorem 3.40 .
Difference
x ∈ A \ B is x ∈ A ∧ ¬(x ∈ B), a conjunction whose right half is a negation, which is to say a function into False.
Example.
The negative half, taken out of the conjunction.
And x ∈ ∅ is False itself. There is nothing to do with such a hypothesis but close the branch, which h.elim does, proving whatever the goal happens to be.
Example.
Nothing lies in the empty set, so this branch never arises.
Taking out of first costs the union nothing.
De Morgan’s second law, with the complement written as a difference.
Its companion.
Symmetric difference
For sets and , the symmetric difference is , the set of objects belonging to exactly one of the two. The editor has no notation for it, so the statements below carry it written out.
An equation between sets is used with rw: from h : A = B, rw [h] replaces by in the goal, and rw [h] at k does it inside the hypothesis k.
Example.
Substitution, which is what an equation is for.
.
.
.
If is empty then and are the same set.
Power sets
X ∈ 𝒫 A is X ⊆ A, which is a ∀ again, so a membership in a power set opens with intro like any other inclusion.
Example.
Every set is a subset of itself, and so an element of its own power set.
Half of Theorem 3.46 , part two.
And part four of it.
Since is , this is the inclusion .
What the checker understands
Tactics
| intro h | assume the hypothesis of an implication, naming it h |
| exact e | give the proof outright |
| apply f | reduce the goal to the hypotheses of f |
| assumption | close the goal with a hypothesis already present |
| trivial | close the goal True |
| exfalso | replace the goal with False |
| by_contra h | assume the negation of the goal |
| constructor | split ∧ into both halves, or ↔ into both directions |
| left / right | choose which half of a ∨ to prove |
| rcases h with a | b | argue by cases on a disjunction |
| obtain ⟨a, b⟩ := h | take a conjunction or an existential apart |
| cases h | as above, keeping the name |
| refine e | give the proof with holes left in it |
| have h : p := … | record an intermediate result |
| show p | restate the goal in an equal form |
| use w | give a witness for ∃ |
| specialize h a | instantiate a ∀ hypothesis |
| rw [h] | rewrite with an equation, ← to go backwards |
| rfl | both sides compute to the same thing |
| decide / norm_num | settle a closed computation |
Results you may cite
| Classical.em | ∀ (a : Prop), a ∨ ¬a — the law of excluded middle |
| Classical.byContradiction | ∀ {a : Prop}, (¬a → False) → a — proof by contradiction; the tactic by_contra does this for you |
| Classical.byCases | ∀ {a b : Prop}, (a → b) → (¬a → b) → b — split on whether a holds |
| not_not | ∀ {a : Prop}, ¬¬a ↔ a — double negation |
| not_and_or | ∀ {a b : Prop}, ¬(a ∧ b) ↔ ¬a ∨ ¬b — De Morgan |
| not_or | ∀ {a b : Prop}, ¬(a ∨ b) ↔ ¬a ∧ ¬b — De Morgan |
| not_imp | ∀ {a b : Prop}, ¬(a → b) ↔ a ∧ ¬b |
| and_comm | ∀ {a b : Prop}, a ∧ b ↔ b ∧ a |
| or_comm | ∀ {a b : Prop}, a ∨ b ↔ b ∨ a |
| Set.ext | ∀ {A B : Obj}, (∀ x : Obj, x ∈ A ↔ x ∈ B) → A = B — extensionality: sets with the same elements are equal |
| Set.ext_iff | ∀ {A B : Obj}, A = B ↔ (∀ x : Obj, x ∈ A ↔ x ∈ B) — extensionality and substitution, in one biconditional |
| Set.subset_antisymm | ∀ {A B : Obj}, A ⊆ B → B ⊆ A → A = B — mutual inclusion is equality |
| Set.empty_subset | ∀ {A : Obj}, ∅ ⊆ A — the empty set is a subset of every set |
From the logical core
| And.intro | ∀ {a b : Prop}, a → b → a ∧ b |
| And.left | ∀ {a b : Prop}, a ∧ b → a |
| And.right | ∀ {a b : Prop}, a ∧ b → b |
| And.symm | ∀ {a b : Prop}, a ∧ b → b ∧ a |
| Or.inl | ∀ {a b : Prop}, a → a ∨ b |
| Or.inr | ∀ {a b : Prop}, b → a ∨ b |
| Or.elim | ∀ {a b c : Prop}, a ∨ b → (a → c) → (b → c) → c |
| Or.symm | ∀ {a b : Prop}, a ∨ b → b ∨ a |
| Iff.intro | ∀ {a b : Prop}, (a → b) → (b → a) → (a ↔ b) |
| Iff.mp | ∀ {a b : Prop}, (a ↔ b) → a → b |
| Iff.mpr | ∀ {a b : Prop}, (a ↔ b) → b → a |
| Iff.symm | ∀ {a b : Prop}, (a ↔ b) → (b ↔ a) |
| Iff.rfl | ∀ {a : Prop}, a ↔ a |
| Iff.trans | ∀ {a b c : Prop}, (a ↔ b) → (b ↔ c) → (a ↔ c) |
| True.intro | True |
| False.elim | ∀ {a : Prop}, False → a |
| absurd | ∀ {a b : Prop}, a → ¬a → b |
| id | ∀ {a : Prop}, a → a |
| mt | ∀ {a b : Prop}, (a → b) → ¬b → ¬a |
| Eq.refl | ∀ {α : Type} (a : α), a = a |
| Eq.symm | ∀ {α : Type} {a b : α}, a = b → b = a |
| Eq.trans | ∀ {α : Type} {a b c : α}, a = b → b = c → a = c |
| congrArg | ∀ {α : Type} {β : Type} {a b : α} (f : α → β), a = b → f a = f b |
| Exists.intro | ∀ {α : Type} {p : α → Prop} (w : α), p w → ∃ x : α, p x |
| Exists.elim | ∀ {α : Type} {p : α → Prop} {b : Prop}, (∃ x : α, p x) → (∀ y : α, p y → b) → b |