Countable types #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
In this file we define a typeclass saying that a given Sort*
is countable. See also encodable
for a version that singles out a specific encoding of elements of α
by natural numbers.
This file also provides a few instances of this typeclass. More instances can be found in other files.
Definition and basic properties #
@[class]
- exists_injective_nat : ∃ (f : α → ℕ), function.injective f
A type α
is countable if there exists an injective map α → ℕ
.
Instances of this typeclass
- subsingleton.to_countable
- finite.to_countable
- encodable.countable
- subtype.countable
- quot.countable
- quotient.countable
- set_coe.countable
- nat.countable
- ulift.countable
- plift.countable
- fin.countable
- punit.countable
- Prop.countable
- bool.countable
- Prop.countable'
- int.countable
- sum.countable
- option.countable
- prod.countable
- sigma.countable
- psum.countable
- pprod.countable
- psigma.countable
- pi.countable
- pnat.countable
- subgroup.opposite.countable
- add_subgroup.opposite.countable
- subgroup.zpowers.countable
- add_subgroup.zmultiples.countable
- list.countable
- multiset.countable
- vector.countable
- finset.countable
@[protected]
theorem
function.injective.countable
{α : Sort u}
{β : Sort v}
[countable β]
{f : α → β}
(hf : function.injective f) :
@[protected]
theorem
function.surjective.countable
{α : Sort u}
{β : Sort v}
[countable α]
{f : α → β}
(hf : function.surjective f) :
theorem
exists_surjective_nat
(α : Sort u)
[nonempty α]
[countable α] :
∃ (f : ℕ → α), function.surjective f
Operations on Sort*
s #
@[protected, instance]