Countable and uncountable types #
In this file we define a typeclass Countable
saying that a given Sort*
is countable
and a typeclass Uncountable
saying that a given Type*
is uncountable.
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 these typeclasses. More instances can be found in other files.
Definition and basic properties #
theorem
countable_iff_exists_injective
(α : Sort u)
:
Countable α ↔ ∃ (f : α → ℕ), Function.Injective f
theorem
Countable.exists_injective_nat'
{α : Sort u}
[self : Countable α]
:
∃ (f : α → ℕ), Function.Injective f
A type α
is countable if there exists an injective map α → ℕ
.
theorem
Countable.exists_injective_nat
(α : Sort u)
[Countable α]
:
∃ (f : α → ℕ), Function.Injective f
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
exists_surjective_nat
(α : Sort u)
[Nonempty α]
[Countable α]
:
∃ (f : ℕ → α), Function.Surjective f
theorem
countable_iff_exists_surjective
{α : Sort u}
[Nonempty α]
:
Countable α ↔ ∃ (f : ℕ → α), Function.Surjective f
Equations
- ⋯ = ⋯
Operations on Sort*
s #
@[instance 100]
Equations
- ⋯ = ⋯
Uncountable types #
A type α
is uncountable if it is not countable.
theorem
Function.Injective.uncountable
{α : Sort u}
{β : Sort v}
[Uncountable α]
{f : α → β}
(hf : Function.Injective f)
:
theorem
Function.Surjective.uncountable
{α : Sort u}
{β : Sort v}
[Uncountable β]
{f : α → β}
(hf : Function.Surjective f)
:
theorem
not_injective_uncountable_countable
{α : Sort u}
{β : Sort v}
[Uncountable α]
[Countable β]
(f : α → β)
:
theorem
not_surjective_countable_uncountable
{α : Sort u}
{β : Sort v}
[Countable α]
[Uncountable β]
(f : α → β)
:
theorem
uncountable_iff_forall_not_surjective
{α : Sort u}
[Nonempty α]
:
Uncountable α ↔ ∀ (f : ℕ → α), ¬Function.Surjective f
Equations
- ⋯ = ⋯
Equations
- ⋯ = ⋯
@[instance 100]
Equations
- ⋯ = ⋯