Countable sets #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
@[protected]
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.)
Prove set.countable
from a countable
instance on the subtype.
Restate set.countable
as a countable
instance.
Restate set.countable
as a countable
instance.
noncomputable
def
set.enumerate_countable
{α : Type u}
{s : set α}
(h : s.countable)
(default : α) :
Noncomputably enumerate elements in a set. The default
value is used to extend the domain to
all of ℕ
.
Equations
- set.enumerate_countable h default = λ (n : ℕ), set.enumerate_countable._match_1 default (encodable.decode ↥s n)
- set.enumerate_countable._match_1 default (option.some y) = ↑y
- set.enumerate_countable._match_1 default option.none = default
theorem
set.subset_range_enumerate
{α : Type u}
{s : set α}
(h : s.countable)
(default : α) :
s ⊆ set.range (set.enumerate_countable h default)
Alias of the forward direction of set.countable_iff_exists_surjective
.
theorem
set.maps_to.countable_of_inj_on
{α : Type u}
{β : Type v}
{s : set α}
{t : set β}
{f : α → β}
(hf : set.maps_to f s t)
(hf' : set.inj_on f s)
(ht : t.countable) :
@[protected]
theorem
set.countable.preimage
{α : Type u}
{β : Type v}
{s : set β}
(hs : s.countable)
{f : α → β}
(hf : function.injective f) :
theorem
set.countable_of_injective_of_countable_image
{α : Type u}
{β : Type v}
{s : set α}
{f : α → β}
(hf : set.inj_on f s)
(hs : (f '' s).countable) :
@[simp]
theorem
set.countable_insert
{α : Type u}
{s : set α}
{a : α} :
(has_insert.insert a s).countable ↔ s.countable
theorem
set.countable.insert
{α : Type u}
{s : set α}
(a : α)
(h : s.countable) :
(has_insert.insert a s).countable