Module docstring
{"# Encodable types
This file defines encodable (constructively countable) types as a typeclass.
This is used to provide explicit encode/decode functions from and to ℕ, with the information that
those functions are inverses of each other.
The difference with Denumerable is that finite types are encodable. For infinite types,
Encodable and Denumerable agree.
Main declarations
Encodable α: States that there exists an explicit encoding functionencode : α → ℕwith a partial inversedecode : ℕ → Option α.decode₂: Version ofdecodethat is equal tononeoutside of the range ofencode. Useful as we do not require this in the definition ofdecode.ULower α: Any encodable type has an equivalent type living in the lowest universe, namely a subtype ofℕ.ULower αfinds it.
Implementation notes
The point of asking for an explicit partial inverse decode : ℕ → Option α to encode : α → ℕ is
to make the range of encode decidable even when the finiteness of α is not.
"}