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 #
A type α
is countable if there exists an injective map α → ℕ
.
A type
α
is countable if there exists an injective mapα → ℕ
.
Instances
- Bool.countable
- ENat.instCountable
- Encodable.List.Vector.countable
- Encodable.countable
- Finite.to_countable
- Finset.countable
- List.countable
- Multiset.countable
- Nat.Partrec.Code.instCountableSubtypeForallComputable
- Nat.Partrec.Code.instCountableSubtypePFunPartrec
- Option.instCountable
- Prop.countable
- Prop.countable'
- Quotient.countable
- SetCoe.countable
- Subsingleton.to_countable
- Subtype.countable
- WithBot.instCountable
- WithTop.instCountable
- instCountableFin
- instCountableForallOfFinite
- instCountableInt
- instCountableNat
- instCountablePLift
- instCountablePNat
- instCountablePProd
- instCountablePSigma
- instCountablePSum
- instCountablePUnit
- instCountableProd
- instCountableQuotient
- instCountableSigma
- instCountableSum
- instCountableULift
theorem
Function.Surjective.countable
{α : Sort u}
{β : Sort v}
[Countable α]
{f : α → β}
(hf : Surjective f)
:
Operations on Sort*
s #
Uncountable types #
A type α
is uncountable if it is not countable.
A type
α
is uncountable if it is not countable.
theorem
Function.Injective.uncountable
{α : Sort u}
{β : Sort v}
[Uncountable α]
{f : α → β}
(hf : Injective f)
:
theorem
Function.Surjective.uncountable
{α : Sort u}
{β : Sort v}
[Uncountable β]
{f : α → β}
(hf : 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 : α → β)
: