Families of sets [01HD]
- November 28, 2026
- Jon Sterling
In Lecture 11, we introduced the concept of a family of subsets of a fixed set. What if we want to talk about a bunch of sets that are not necessarily related? For this we need a more general concept, the family of sets.
Definition Family of sets [01HB]
- November 28, 2026
- Jon Sterling
A family of sets is given by a set I of indices together with an assignment of a set A_i to each i:I.
A family of sets may be written in several ways; for example:
{\mathopen {}\left (A_i\right )\mathclose {}}_{i:I} \qquad {\mathopen {}\left (A_i\mid i:I\right )\mathclose {}} \qquad i:I\mapsto A_iExample Families of subsets as families of sets [01HC]
- November 28, 2026
- Jon Sterling
Any be a family of subsets {\mathopen {}\left (U_i\right )\mathclose {}}_{i:I} of a fixed set A can be viewed on its own as a family of sets, without reference to A. In particular, we map each i:I to the set U_i.
“Big” operations on sets: product and sum [01HK]
- November 28, 2026
- Jon Sterling
Because the individual sets A_i, A_j in a family of sets {\mathopen {}\left (A_i\right )\mathclose {}}_{i:I} are not necessarily related to each other, it does not make sense to speak of the big intersection \bigcap _{i:I}A_i or big union \bigcup _{i:I}A_i. These only make sense when we understand {\mathopen {}\left (A_i\right )\mathclose {}}_{i:I} to be a family of subsets of some fixed set.
We can, however, talk about the product and sum of an entire family of sets, and these will generalise binary products and binary sums in the same way that intersections and unions of families of subsets generalise binary intersections and binary unions respectively.
Axiom The product of a family of sets [01HL]
- November 28, 2026
- Jon Sterling
For any family of sets {\mathopen {}\left (A_i\right )\mathclose {}}_{i:I} we may form a set \prod _{i:I}A_i called its product whose elements consist of mappings that assign to each index i:I an element a_i:A_i of the corresponding component of the family.
These mappings may be written in a number of styles:
\lambda i:I\mathpunct {.}a_i \qquad {\mathopen {}\left (a_i\right )\mathclose {}}_{i:I} \qquad i:I\mapsto a_iIn other words:
- To construct an element of the product \prod _{i:I}A_i, you assume an arbitrary index i:I and construct under this assumption an element of A_i.
- To use an element of the product f : \prod _{i:I}A_i, you may pick a specific index k:I and then use f(k) : A_k.
Example Binary products in terms of big products [01HM]
- November 28, 2026
- Jon Sterling
Let A and B be two sets. We can express the binary product A\times B in terms of products of families of sets by considering the following family of sets i:{\mathopen {}\left [2\right ]\mathclose {}}\mapsto \begin {cases} A & \text {if } i=0\\ B & \text {if } i=1 \end {cases} indexed in the standard finite set with two elements {\mathopen {}\left [2\right ]\mathclose {}}. In particular, the big product \prod _{i:{\mathopen {}\left [2\right ]\mathclose {}}} \begin {cases} A & \text {if } i=0\\ B & \text {if } i=1 \end {cases} consists of assignments that must send 0 to an element of A and 1 to an element of B. This is, up to a change of notation, the same as an element of A\times B.
Axiom The sum of a family of sets [01HN]
- November 28, 2026
- Jon Sterling
For any family of sets {\mathopen {}\left (A_i\right )\mathclose {}}_{i:I} we may form a set \sum _{i:I}A_i called its sum whose elements consist of pairs (k,a) where k:I is a specified index and a:A_k is an element of the component of the family at that index. In other words:
- To construct an element of the sum \sum _{i:I}A_i you first choose an index k:I and then construct an element a:A_k of the corrseponding component. The resulting element of the sum is written {\mathopen {}\left (k,a\right )\mathclose {}}.
- When using an element x:\sum _{i:I}A_i, you may make use of its index \pi _1{\mathopen {}\left (x\right )\mathclose {}}:I and its value \pi _2{\mathopen {}\left (x\right )\mathclose {}} : A_{\pi _1{\mathopen {}\left (x\right )\mathclose {}}}. Equivalently, you may assume some k:I and a:A_k such that x = {\mathopen {}\left (k,a\right )\mathclose {}}.
Sometimes you may see \sum _{i:I} A_i written as \coprod _{i:I}A_i and pronounced coproduct; both notations are valid!
There is an analogue of Example [01HM] for sums:
Example Binary sums in terms of big sums [01HO]
- November 28, 2026
- Jon Sterling
Let A and B be two sets. We can express the binary sum A+B in terms of sums of families of sets by considering the following family of sets i:{\mathopen {}\left [2\right ]\mathclose {}}\mapsto \begin {cases} A & \text {if } i=0\\ B & \text {if } i=1 \end {cases} indexed in the standard finite set with two elements {\mathopen {}\left [2\right ]\mathclose {}}. In particular, the big sum \sum _{i:{\mathopen {}\left [2\right ]\mathclose {}}} \begin {cases} A & \text {if } i=0\\ B & \text {if } i=1 \end {cases} consists of pairs either of the form {\mathopen {}\left (0,a\right )\mathclose {}} with a:A or of the form {\mathopen {}\left (1,b\right )\mathclose {}} with b:B. This is, up to a change of notation, the same as an element of A+B.
There is something a little bit confusing about big sums; although we have just shown that they directly generalise binary sums, insofar as they consist of pairs there is a sense that they also generalise binary products. There is nothing wrong with that! The same concept can generalise two different concepts in different ways. But let’s see how it works:
Example Binary products in terms of big sums; the “dependent pair” notation [01HP]
- November 28, 2026
- Jon Sterling
Let A and B be two sets. We may construct from B an A-indexed family of sets whose component at every a:A is simply the same set B. We may write this as {\mathopen {}\left (B\right )\mathclose {}}_{a:A} or a:A\mapsto B. Then the sum of this family, written \sum _{a:A}B, consists of pairs {\mathopen {}\left (a,b\right )\mathclose {}} where a:A and b:B. Therefore an element of \sum _{a:A}B carries precisely the same data as an element of A\times B.
For this reason, when {\mathopen {}\left (B_a\right )\mathclose {}}_{a:A} is a family of sets, sometimes people will refer to the sum \sum _{a:A}B_a as the “dependent pair type” and may even write {\mathopen {}\left (a:A\right )\mathclose {}}\times B_a instead of \sum _{a:A}B_a.
Something analogous to Example [01HP] happens for products.
Example Function sets in terms of big products; the “dependent function” notation [01HQ]
- November 28, 2026
- Jon Sterling
Let A and B be two sets. Then the product \prod _{a:A}B of the family {\mathopen {}\left (B\right )\mathclose {}}_{a:A} that assigns to each a:A the same set B consists of mappings that assign to each a:A an element of B. These are nothing more than functions from A to B: so we may, if we like, construct the set of functions A\to B as the product \prod _{a:A}B.
For this reason, when {\mathopen {}\left (B_a\right )\mathclose {}}_{a:A} is a family of sets, some may refer to \prod _{a:A}B_a as the “dependent function type” and write {\mathopen {}\left (a:A\right )\mathclose {}}\to B_a instead of \prod _{a:A}B_a.
Example Disjoint unions and sums [01HR]
- November 28, 2026
- Jon Sterling
Let U,V are two disjoint subsets of a fixed set A. Then we may form their union U \cup V; if we view the union U\cup V as a set on its own, forgetting A, we can see that it is very much like the sum U+V. In fact, up to a change in notation, the union of two disjoint subsets is their sum; we can translate between them as follows:
\begin {aligned} U \cup V &\to U+V \\ x &\mapsto \begin {cases} \iota _1{\mathopen {}\left (x\right )\mathclose {}} & \text {if } x\in U\\ \iota _2{\mathopen {}\left (x\right )\mathclose {}} & \text {if } x\in V \end {cases} \end {aligned}Conversely:
\begin {aligned} U+V &\to U\cup V\\ {\mathopen {}\left (i,x\right )\mathclose {}} &\mapsto x \end {aligned}Dropping the index in the backward translation above is OK because it is uniquely determined by the disjointness of U and V.
The same idea works for families. In particular, let {\mathopen {}\left (U_i\right )\mathclose {}}_{i:I} be a family of subsets of a fixed set A that is pairwise disjoint in the sense that \forall i,j:I\mathpunct {.} i \not =j \implies U_i \cap U_j = \varnothing \text {,} or, equivalently, \forall x:A\mathpunct {.} \forall i,j:I\mathpunct {.} x\in U_i\cap U_j \implies i=j \text {.}
Then the big union \bigcup _{i:I}U_i amounts, as a set, to the big sum \sum _{i:I}U_i up to a back-and-forth translation:
\begin {aligned} \bigcup _{i:I}U_i &\to \sum _{i:I} U_i \\ x&\mapsto \begin {cases} {\mathopen {}\left (k,x\right )\mathclose {}} &\textbf {where } \forall i:I\mathpunct {.} {\mathopen {}\left (x\in U_i \implies i=k\right )\mathclose {}} \end {cases} \\[18pt] \sum _{i:I}U_i &\to \bigcup _{i:I}U_i\\ {\mathopen {}\left (i,x\right )\mathclose {}} &\mapsto x \end {aligned}Sometimes you will hear mathematicians speak of “disjoint unions” of unrelated sets; in these cases, you should understand them to mean “sums” instead. It is still, however, very useful to know that when you really do have a union that is disjoint, you can view it as a sum, and vice versa.
Remark Families and their products and sums in programming languages? [01HS]
- November 28, 2026
- Jon Sterling
It has been encouraging to see we can think about both binary products and binary sums in terms of OCaml language features:
Unfortunately there is no such analogue to the concept of a family of sets (A_i)_{i:I} and its product \prod _{i:I}A_i and sum \sum _{i:I}A_i in a language like OCaml. That is because families of sets correspond to dependent types, which are not yet widespread in mainstream programming languages. Nonetheless, you can try them out in more obscure languages like Lean, Rocq, Agda, and Idris. From a dependently typed programmer’s perspective, it is useful to keep in mind the following remarks: