F1
Sets, families and intersections
This unit gives you the language for one move that appears all over mathematics for AI: defining the smallest set with some property that contains a given set , as the intersection of all such sets. Linear algebra uses it for the span, optimisation for the convex hull, probability for the events generated by a random variable. Learn it once here.
Needs: nothing. Used by: LA1 Vector spaces, LA2 Span.
Full explanationWhy set theory, in a course about AI?
Most introductions define the span of vectors as “all vectors of the form ”. That works while you have finitely many vectors. Now take infinitely many, say the functions . What is “all combinations” of those? Is one of them? A vector space only tells you how to add two vectors, so an infinite sum has no meaning there, and the finite-list definition has nothing to say.
There is a cleaner definition that never mentions sums at all: the span of is the intersection of every subspace that contains . To read it you need to know what “the intersection of a family of sets” means, including the edge cases (what if the family is empty?). That is what this unit covers, and nothing more. We use naive set theory in the sense of Halmos: sets are collections, and we stay away from the corners where that intuition breaks.
Sets and membership
Section titled “Sets and membership”Definition F1.1Set, element#
A set is a collection of objects, its elements. We write for ” is an element of ” and otherwise. Two sets are equal exactly when they have the same elements.
So : order and repetition do not matter, only membership. Sets can contain sets: is a set with one element, which happens to be the empty set.
Definition F1.2Subset#
is a subset of , written , if every element of is an element of .
Theorem F1.3Equality by double inclusion#
if and only if and .
This is how almost every “these two sets are the same” proof goes, including the main theorem of LA2: show each set sits inside the other.
Definition F1.4Empty set, set-builder notation#
The empty set is the set with no elements. For a set and a property , the set contains exactly the elements of that have property .
Theorem F1.5The empty set is a subset of everything#
For every set , .
Proofof F1.5
We must show: every element of is an element of . There are no elements of , so there is nothing to check, and the statement is true. A claim of the form “every element of an empty collection has property ” is called vacuously true.
Full explanationVacuous truth, and why set-builder notation always says “x ∈ A”
Vacuous truth feels like a trick, but it is forced on us. “Every element of is in ” can only be false if some element of is not in , and there is no element to be the counterexample. Hold on to this: in the next section, the same reasoning makes the intersection of an empty family behave strangely.
Notice also that set-builder notation selects elements from an existing set . The unrestricted version is not allowed, because some properties define something that cannot be a set. Russell’s example is , the collection of all sets that are not members of themselves. Ask whether it is a member of itself: if it is, it isn’t; if it isn’t, it is. Selecting from a set you already have avoids that. It matters to us for one reason only: “the set of everything” is not a set. If some set contained everything, then would be a legal selection from , and it would be Russell’s paradoxical collection. So no such exists.
Convention F1.6Number sets used on this site#
, the integers, the rationals, the reals, the complex numbers. "" means “is defined as”.
Check Is ∅ an element of {∅}? Is ∅ a subset of {∅}? Is {∅} equal to ∅?
Yes, : it is the one element listed. Yes, , as it is a subset of every set (F1.5). No, : the left side has one element, the right side none.
Combining two sets
Section titled “Combining two sets”Definition F1.7Union, intersection, difference#
, , .
Intersections and differences are selections from , as F1.4 requires. Unions are not carved out of an existing set: that exists is a separate basic principle of set theory (the axiom of union), which we take for granted.
Definition F1.8Cartesian product#
is the set of ordered pairs with and , where exactly when and . More generally is the set of ordered -tuples.
Unlike sets, pairs care about order: . You need products for two reasons. is literally the set of -tuples of reals. And the operations of a vector space are functions of two inputs: addition takes a pair of vectors, (LA1.3).
Functions and support
Section titled “Functions and support”Definition F1.9Function#
A function assigns to every exactly one element . is the domain, the codomain. The set of all functions from to is written .
Full explanationA vector is a function
The notation is not a coincidence. A vector is exactly a function from the index set to : index goes to . So and are the same thing written two ways.
Push the idea and many objects line up:
| Object | Index set | As a function |
|---|---|---|
| vector in | ||
| matrix | ||
| greyscale image, pixels | pixel grid | pixel intensity |
| infinite sequence | ||
| real function |
In LA1 this turns into one theorem: all of these are vector spaces for the same reason.
Definition F1.10Support, finitely supported#
For a function (or into any number system with a zero), its support is . The function is finitely supported if its support is a finite set.
A finitely supported function can live on an enormous, even uncountable, domain, yet be non-zero in only finitely many places. That is exactly the bookkeeping needed for linear combinations of infinitely many vectors (LA2.2).
Families of sets
Section titled “Families of sets”Definition F1.11Family of sets#
A family of sets is a set whose elements are themselves sets. We write families with script letters, . An indexed family assigns a set to each index in an index set .
Definition F1.12Union and intersection of a family#
For a family ,
The intersection is only defined when is non-empty. For an indexed family, and mean the same with ranging over the ; the intersection requires .
Full explanationWhy the intersection needs a non-empty family
Try . Which satisfy ” for every ”? There is no to check, so the condition is vacuously true for every object whatsoever. The empty intersection would be “the set of everything”, which we saw is not a set. Halmos puts it bluntly: an empty intersection does not make sense.
The non-empty case is safe. Pick any ; every element of the intersection is in particular in , so
an honest set-builder selection from the existing set . The answer does not depend on which you pick.
When all sets in a family are subsets of one fixed ambient set , some books define the empty intersection to be itself. That is a convention, and you will rarely need it here: every intersection we take, like “all subspaces of that contain ”, has at least one member ( itself), so it is never empty.
Example F1.13Infinite intersections can be surprising#
For let and . Then
Every is non-empty, and each contains the next, yet nothing lies in all of them. If , then . If , some is smaller than (the Archimedean property of the reals), so .
Theorem F1.14The intersection is the largest common subset#
Let be a non-empty family.
- for every .
- If a set satisfies for every , then .
Proofof F1.14
(1) Take . By definition is in every member of , in particular in .
(2) Take . For each we have , so . Hence is in every member of , which means .
The smallest set containing S
Section titled “The smallest set containing S”This is the payoff of the unit. Suppose you have a kind of “nice” subset (subspaces, convex sets, closed sets) and a set that is not nice. Is there a smallest nice set containing ?
Theorem F1.15Closure under intersection gives a smallest member#
Let be a set and a family of subsets of such that
- , and
- the intersection of every non-empty subfamily of belongs to .
For define . Then , , and for every with . In words: is the smallest member of containing .
Proofof F1.15
Let . It is non-empty, because and , so the intersection is defined.
- is a non-empty subfamily of , so by assumption .
- Every member of contains , so F1.14(2), applied to the set , gives .
- If and , then , and F1.14(1) gives .
Full explanationWhat “smallest” means, and why the two conditions matter
“Smallest” means smallest for : contained in every competitor. That is stronger than “has the fewest elements” and it need not exist. Take and let be the subsets with exactly two elements. For , both and contain , but neither is inside the other, and their intersection is not in . No smallest member exists, because is not closed under intersection.
The condition is what keeps the family non-empty. Without it, there may be no member containing at all.
The same theorem, with different families , produces many objects you will meet:
| Family | is called | Used in |
|---|---|---|
| subspaces of a vector space | the span of | linear algebra, everywhere |
| convex subsets of | the convex hull | optimisation, attention outputs |
| closed subsets of | the closure | limits, approximation |
| σ-algebras on a set | the generated σ-algebra | probability: the events you can observe |
Each one needs its own check of both conditions: is closed under non-empty intersections and contains . For subspaces, that check is LA1.14.
Check Let C be the family of all finite subsets of ℕ. It is closed under intersections of non-empty subfamilies. Does every S ⊆ ℕ have a smallest finite superset?
No. The second condition holds (an intersection is inside one of its finite members, so it is finite), but the first fails: itself is not finite, so . For infinite , such as the even numbers, no finite set contains at all, so the family in F1.15 is empty and there is nothing to intersect.
Check Why is “the intersection of all subspaces of V that contain S” never an empty intersection?
Because is itself a subspace of and contains , so the family always has at least one member.
Check Is the union of two subsets in C always in C? Think of two lines through the origin in ℝ², with C the subspaces.
No. The -axis and the -axis are subspaces, but their union is not: is in neither line. Intersections preserve “niceness”; unions usually don’t. That is why the span is defined by intersecting.
Sources
Section titled “Sources”- Paul R. Halmos, Naive Set Theory (1960): sets, families, unions and intersections; the remark that an empty intersection does not make sense.
- ProofWiki, Intersection of Empty Set: how different authors handle the empty intersection.