Countable types #
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 #
- exists_injective_nat' : ∃ f, Function.Injective f
A type
αis countable if there exists an injective mapα → ℕ.
A type α is countable if there exists an injective map α → ℕ.
Instances
theorem
Function.Injective.countable
{α : Sort u}
{β : Sort v}
[Countable β]
{f : α → β}
(hf : Function.Injective f)
:
theorem
Function.Surjective.countable
{α : Sort u}
{β : Sort v}
[Countable α]
{f : α → β}
(hf : Function.Surjective f)
:
theorem
countable_iff_exists_surjective
{α : Sort u}
[Nonempty α]
:
Countable α ↔ ∃ f, Function.Surjective f