Countable sets #
A set is countable if there exists an encoding of the set into the natural numbers.
An encoding is an injection with a partial inverse, which can be viewed as a
constructive analogue of countability. (For the most part, theorems about
Countable will be classical and Encodable will be constructive.)
Equations
- Set.Countable s = Nonempty (Encodable ↑s)
Instances For
Prove Set.Countable from a Countable instance on the subtype.
Restate Set.Countable as a Countable instance.
Restate Set.Countable as a Countable instance.
A set s : Set α is countable if and only if there exists a function α → ℕ injective
on s.
Convert Set.Countable s to Encodable s (noncomputable).
Equations
- Set.Countable.toEncodable = Classical.choice
Instances For
Noncomputably enumerate elements in a set. The default value is used to extend the domain to
all of ℕ.
Equations
- Set.enumerateCountable h default n = match Encodable.decode n with | some y => ↑y | none => default
Instances For
A non-empty set is countable iff there exists a surjection from the natural numbers onto the subtype induced by the set.
Alias of the forward direction of Set.countable_iff_exists_surjective.
A non-empty set is countable iff there exists a surjection from the natural numbers onto the subtype induced by the set.
If s : Set α is a nonempty countable set, then there exists a map
f : ℕ → α such that s = range f.
Alias of the reverse direction of Set.Countable.biUnion_iff.
Alias of the reverse direction of Set.Countable.sUnion_iff.
The set of finite subsets of a countable set is countable.
If a family of disjoint sets is included in a countable set, then only countably many of them are nonempty.