Definition 0.3.26: Sets A and B have the same cardinality when there exists a
bijection f : A → B. The cardinality |A| is the equivalence class of all sets with
the same cardinality as A.
Equations
- sameCardinality A B = Nonempty (A ≃ B)
Instances For
The book's notion of equal cardinalities matches mathlib's equality of cardinals.
The cardinality class of a set A is the collection of all sets bijective to A.
Equations
- cardinalityClass A = {B : Type ?u.7 | sameCardinality A B}
Instances For
The book's cardinality |A| corresponds to the mathlib cardinal Cardinal.mk A.
Equations
- cardinality A = Cardinal.mk A
Instances For
Definition 0.3.27: A set has cardinality n when it is in bijection with
{1, 2, …, n} (or is empty when n = 0); such sets are called finite. A set is
infinite if it is not finite.
Instances For
The book's notion of a finite set: it has the same cardinality as some {1, …, n}.
Equations
- finiteElementCollection A = ∃ (n : ℕ), elementCollectionCardEq A n
Instances For
The book's finite sets correspond to mathlib's Set.Finite.
The book's infinite sets are those that are not finite.
Equations
Instances For
The book's infinite sets correspond to mathlib's Set.Infinite.
Definition 0.3.28: We write |A| ≤ |B| if there is an injection from A to B;
|A| = |B| when the two have the same cardinality; |A| < |B| when |A| ≤ |B| but the
cardinalities are not equal.
Equations
- cardinalLe A B = ∃ (f : A → B), Function.Injective f
Instances For
The book's |A| ≤ |B| corresponds to the cardinal inequality of Cardinal.mk.
The book's strict cardinal inequality |A| < |B| means |A| ≤ |B| but not equal.
Equations
- cardinalLt A B = (cardinalLe A B ∧ ¬sameCardinality A B)
Instances For
The book's |A| < |B| matches the strict inequality of cardinals.
Definition 0.3.29: A set is countably infinite if its cardinality equals that of the natural numbers; it is countable if it is finite or countably infinite; otherwise it is uncountable.
Instances For
Equations
Instances For
Equations
Instances For
The map n ↦ 2n is a bijection from ℕ onto the even naturals.
An explicit equivalence between ℕ and the even naturals.
Example 0.3.30 (continued).
Example 0.3.31: The Cartesian product ℕ × ℕ is countably infinite, for example via
the diagonal enumeration (1,1), (1,2), (2,1), (1,3), (2,2), (3,1), ….
Example 0.3.32: The set of rational numbers is countable (in fact countably
infinite), e.g., by enumerating positive fractions in a grid and then inserting 0
and their negatives.
Definition 0.3.33: The power set 𝒫(A) of a set A is the set of all subsets of
A.
Equations
Instances For
The book's power set of A is mathlib's 𝒫 A.
Membership in the power set means being a subset.
Theorem 0.3.34 (Cantor). For any set A, the cardinality of A is strictly less
than the cardinality of its power set 𝒫 A; in particular there is no surjection
from A onto 𝒫 A.