Sign in

Libre University uses your GitHub account. Signing in is only needed to sit a final test, so the score is kept on your profile.

Sets

Every proof so far has spoken of "the even integers" or "the primes" as collections, and none has said what a collection is, when two of them are the same, or how to build new ones from old.

The previous lesson completed the stock of proof methods with induction, but the objects the proofs talk about have been informal, and this lesson makes them precise. It assumes the connectives, including the rule that a conditional with a false hypothesis is vacuously true, the quantifiers ∀ and ∃, and induction.

Membership and set builder notation

A set is a collection of objects, its elements, and it is determined by nothing except which objects those are. "x is an element of A" is written x∈A, and its negation x∉A. So 3∈ℕ and -3∉ℕ, with ℕ, ℤ, ℚ and ℝ standing as before for the natural numbers (starting at 1), the integers, the rationals and the reals.

A small set can be listed between braces: {2,3,5,7} is the set of primes below 10. A large one is described by a property, in set builder notation:

{x∈A:P(x)}

read "the set of x in A such that P(x)". Here A is a set already known and P(x) an open sentence, and the result is the set of elements of A that make P true. So {n∈ℤ:n2<10}={-3,-2,-1,0,1,2,3}, since 32=9 is below 10 and 42=16 is not. A second form puts an expression first: {2k:k∈ℤ} is the even integers.

The notation comes with one rule, and proofs use it constantly: y belongs to {x∈A:P(x)} exactly when y∈A and P(y) is true. The insistence on a surrounding set A looks like pedantry, and the last section shows that it is not.

Subsets and equality

A is a subset of B, written A⊆B, when every element of A is an element of B:

A⊆Bmeans∀x(x∈A⇒x∈B)

To prove this universal conditional, let x be an arbitrary element of A and show, using only what membership in A means, that x∈B. One element of A outside B disproves it.

Two sets are equal when they have the same elements. So {1,2,2}={2,1}: each element of either side, 1 or 2, lies in the other. Order is not an element, and writing 2 twice names the same element twice. The definition also gives the method this lesson is built round: A=B exactly when A⊆B and B⊆A, so a proof that two sets are equal is two subset proofs, called a proof by double inclusion.

Keep ∈ and ⊆ apart: 1∈{1,2} and {1}⊆{1,2}, but {1}∉{1,2}, since the set {1} is not one of the numbers 1 and 2. Yet {1}∈{{1},2}.

Example. Prove that {n∈ℤ:2∣nand3∣n}={n∈ℤ:6∣n}.

Call the sides L and R. First, L⊆R. Let n∈L. Then n is an even integer and n=3b for some integer b. If b were odd, 3b would be a product of odd numbers and so odd, contradicting n even; hence b=2c for some integer c, and n=6c. So 6∣n, and n∈R. Second, R⊆L. Let n∈R, so n=6c for some integer c. Then n=2(3c) and n=3(2c), so 2∣n and 3∣n, and n∈L. Each set is a subset of the other, so L=R.

Now you. Prove that {x∈ℝ:x2-3x+2<0}=(1,2).

Answer

Call the left side S; note x2-3x+2=(x-1)(x-2). First, S⊆(1,2). Let x∈S, so (x-1)(x-2)<0. A product of two reals is negative only when one factor is positive and the other negative, and since x-1>x-2, the positive one is x-1. So x>1 and x<2, and x∈(1,2). Second, (1,2)⊆S. Let 1<x<2. Then x-1>0 and x-2<0, so their product is negative and x∈S. Hence S=(1,2).

Union, intersection, difference and complement

Four operations build new sets from old, each a connective in disguise. x is in the union A∪B when x∈A or x∈B, with the inclusive "or"; in the intersection A∩B when x∈A and x∈B; and in the difference A∖B when x∈A and x∉B. With A={1,2,3,4} and B={3,4,5} these are {1,2,3,4,5}, {3,4} and {1,2}.

The complement of A is everything not in A, and "everything" needs a limit: a universe U, fixed in advance and containing every set under discussion, with Ac=U∖A. The universe is part of the meaning: the complement of the even integers is the odd integers when U=ℤ, but also contains 12 and π when U=ℝ.

The intersection of {1,2} and {3} has no elements at all. It is the empty set ∅, and it is a subset of every set A. The claim ∅⊆A means ∀x(x∈∅⇒x∈A). The hypothesis x∈∅ is false for every x, so the conditional is vacuously true. The same argument shows there is only one empty set, since two sets with no elements are each a subset of the other. But {∅} is not empty: it has one element.

Proving an identity by double inclusion

An identity between sets claims that two sets are equal for every choice of A, B and C. A drawing of overlapping circles shows one arrangement; double inclusion covers them all, one arbitrary element at a time.

Example. Prove that for all sets A, B and C, A∩(B∪C)=(A∩B)∪(A∩C).

First, left in right. Let x∈A∩(B∪C). Then x∈A, and x∈B or x∈C. If x∈B, then x∈A∩B; if x∈C, then x∈A∩C. Either way x is in the right side. Second, right in left. Let x∈(A∩B)∪(A∩C). If x∈A∩B, then x∈A and x∈B, so x∈A∩(B∪C); the case x∈A∩C is the same with C for B. Each side contains the other, so they are equal.

An "or" in the hypothesis became a proof by cases, and an "or" in the conclusion needed only one of its parts. That is the pattern of most identity proofs.

Now you. Prove that for all sets A, B and C, A∪(B∩C)=(A∪B)∩(A∪C).

Answer

First, left in right. Let x∈A∪(B∩C). If x∈A, or if x is in both B and C, then x is in A∪B and in A∪C, so in the right side. Second, right in left. Let x∈(A∪B)∩(A∪C). If x∈A, it is in the left side. If not, then x∈A∪B forces x∈B and x∈A∪C forces x∈C, so x∈B∩C, and again x is in the left side. The sets are equal.

De Morgan's laws for sets

Augustus De Morgan's laws for statements, from 1847, say that ¬(P∨Q) is equivalent to ¬P∧¬Q, and ¬(P∧Q) to ¬P∨¬Q. Since union is "or", intersection "and" and complement "not", the same laws hold for subsets of a universe U:

(A∪B)c=Ac∩Bc(A∩B)c=Ac∪Bc

Example. Prove that (A∪B)c=Ac∩Bc for all subsets A and B of U.

First, left in right. Let x∈(A∪B)c, so x∈U and x∉A∪B. If x were in A, it would be in A∪B, so x∉A; likewise x∉B. Hence x∈Ac and x∈Bc, so x∈Ac∩Bc. Second, right in left. Let x∈Ac∩Bc, so x∈U, x∉A and x∉B. Then "x∈A or x∈B" is false, so x∉A∪B and x∈(A∪B)c. The sets are equal.

The middle of each half is De Morgan's law for statements, applied to x∈A and x∈B. Every identity here is an equivalence of statements with "x∈" written in front.

Now you. Prove that (A∩B)c=Ac∪Bc for all subsets A and B of U.

Answer

First, left in right. Let x∈(A∩B)c, so x∈U and x∉A∩B. Then "x∈A and x∈B" is false, so x∉A or x∉B, that is, x∈Ac or x∈Bc, and x∈Ac∪Bc. Second, right in left. Let x∈Ac∪Bc. If x∈Ac, then x∉A, so x∉A∩B; if x∈Bc, the same holds with B. Either way x∈(A∩B)c. The sets are equal.

Power sets and products

The power set P(A) is the set of all subsets of A. For A={1,2,3} it has eight elements: ∅, three one-element sets, three pairs, and A itself. Writing |A| for the number of elements of a finite set, the pattern is general: if |A|=n, then |P(A)|=2n.

The proof is by induction on n≥0. When n=0, A=∅, whose only subset is ∅, and 1=20. Suppose every set of n elements has 2n subsets, and let |A|=n+1. Choose a∈A and let A′=A∖{a}, which has n elements. A subset of A either omits a, and is then a subset of A′, or contains a, and is then S∪{a} for exactly one subset S of A′. There are 2n of each kind and none of both, so A has 2n+2n=2n+1 subsets.

An ordered pair (a,b) differs from the set {a,b}: (a,b)=(c,d) exactly when a=c and b=d. The Cartesian product A×B is the set of all pairs (a,b) with a∈A and b∈B, named after Descartes because ℝ×ℝ is the coordinate plane. For finite sets |A×B|=|A||B|: sort the pairs by first coordinate, and each of the |A| choices of a gives a row of exactly |B| pairs, with no pair in two rows. So {1,2,3}×{x,y} has 3×2=6 elements.

Unions and intersections of many sets

A family of sets A1,A2,A3,…, one for each n∈ℕ, has a union and an intersection defined by the quantifiers:

x∈A1∪A2∪⋯⟺∃n(x∈An)x∈A1∩A2∩⋯⟺∀n(x∈An)

Take An=(0,1n). The intersection of A1 to AN is (0,1N), never empty, yet the intersection over all n∈ℕ is ∅. Suppose x lies in every An. Then x>0, so some natural number n exceeds 1x (a property of the reals proved in a later lesson), and for it 1n<x, so x∉An, a contradiction. What holds at every finite stage can fail for the whole family.

Russell's paradox

Georg Cantor, who founded the theory, defined a set in 1895 as any collection of definite, distinct objects into a whole. Read literally, that allows {x:P(x)} for any property P, with no surrounding set. In 1901 Bertrand Russell took the property x∉x and formed

R={x:x∉x}

By the membership rule, R∈R exactly when R∉R, and no statement can be equivalent to its own negation. Russell's letter of June 1902 reached Gottlob Frege as the second volume of his foundations of arithmetic, built on exactly this kind of set, went to press.

The repair, due to Ernst Zermelo in 1908, is the rule this lesson has used throughout: a property may only carve a subset out of a set already known, as {x∈A:P(x)}. Run Russell's argument on RA={x∈A:x∉x}. If RA were in A, then RA∈RA exactly when RA∉RA, so RA∉A. The paradox becomes a theorem: no set contains every set, which is why a complement needs a universe.

Sets now have a precise language and a method of proof, but a set on its own does nothing. Mathematics is mostly about processes that turn one thing into another, a number into its square or a point into its reflection, and the next lesson makes those processes precise as functions.