Equivalences involving List-like types #
This file defines some additional constructive equivalences using Encodable and the pairing
function on ℕ.
If α is encodable, then so is List α. This uses the pair and unpair functions from
Data.Nat.Pairing.
Equations
These two lemmas are not about lists, but are convenient to keep here and don't
require Finset.sort.
If α is countable, then so is Multiset α.
If α is countable, then so is Finset α.
A listable type with decidable equality is encodable.
Equations
Instances For
A finite type is encodable. Because the encoding is not unique, we wrap it in Trunc to
preserve computability.
Equations
Instances For
A noncomputable way to arbitrarily choose an ordering on a finite type.
It is not made into a global instance, since it involves an arbitrary choice.
This can be locally made into an instance with attribute [local instance] Fintype.toEncodable.
Equations
Instances For
If α is denumerable, then so is List α.
Equations
A list on a unique type is equivalent to ℕ by sending each list to its length.