Equivalences involving List-like types #
This file defines some additional constructive equivalences using Encodable and the pairing
function on ℕ.
An equivalence between α and β generates an equivalence between List α and List β.
Instances For
Explicit encoding function for List α
Instances For
Explicit decoding function for List α
Instances For
If α is encodable, then so is List α. This uses the pair and unpair functions from
Data.Nat.Pairing.
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.
Instances For
A finite type is encodable. Because the encoding is not unique, we wrap it in Trunc to
preserve computability.
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.
Instances For
If α is denumerable, then so is List α.
A list on a unique type is equivalent to ℕ by sending each list to its length.
Instances For
If α is equivalent to ℕ, then List α is equivalent to α.