# mathlibdocumentation

data.equiv.list

def encodable.encode_list {α : Type u_1} [encodable α] :
list α
Equations
def encodable.decode_list {α : Type u_1} [encodable α] :
option (list α)
Equations
• = encodable.decode_list._match_1 v (λ (v₁ v₂ : ) (h : (v₁, v₂).snd v) (this : v₂ < v.succ), v.unpair _
• encodable.decode_list._match_1 v _f_1 (v₁, v₂) h = have this : v₂ < v.succ, from _, (λ (_x : α) (_y : list α), _x :: _y) <$> encodable.decode α v₁ <*> _f_1 v₁ v₂ h this @[protected, instance] def encodable.list {α : Type u_1} [encodable α] : Equations @[simp] theorem encodable.encode_list_nil {α : Type u_1} [encodable α] : @[simp] theorem encodable.encode_list_cons {α : Type u_1} [encodable α] (a : α) (l : list α) : @[simp] theorem encodable.decode_list_zero {α : Type u_1} [encodable α] : @[simp] theorem encodable.decode_list_succ {α : Type u_1} [encodable α] (v : ) : v.succ = (λ (_x : α) (_y : list α), _x :: _y) <$> <*> v.unpair.snd
theorem encodable.length_le_encode {α : Type u_1} [encodable α] (l : list α) :
def encodable.encode_multiset {α : Type u_1} [encodable α] (s : multiset α) :
Equations
def encodable.decode_multiset {α : Type u_1} [encodable α] (n : ) :
Equations
@[protected, instance]
def encodable.multiset {α : Type u_1} [encodable α] :
Equations
def encodable.encodable_of_list {α : Type u_1} [decidable_eq α] (l : list α) (H : ∀ (x : α), x l) :
Equations
Equations
def encodable.fintype.encodable (α : Type u_1) [fintype α] :

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 local attribute [instance] fintype.encodable.

Equations
@[protected, instance]
def encodable.vector {α : Type u_1} [encodable α] {n : } :
Equations
@[protected, instance]
def encodable.fin_arrow {α : Type u_1} [encodable α] {n : } :
encodable (fin n → α)
Equations
@[protected, instance]
def encodable.fin_pi (n : ) (π : fin nType u_1) [Π (i : fin n), encodable («π» i)] :
encodable (Π (i : fin n), «π» i)
Equations
@[protected, instance]
def encodable.array {α : Type u_1} [encodable α] {n : } :
Equations
@[protected, instance]
def encodable.finset {α : Type u_1} [encodable α] :
Equations
def encodable.fintype_arrow (α : Type u_1) (β : Type u_2) [decidable_eq α] [fintype α] [encodable β] :
trunc (encodable (α → β))
Equations
def encodable.fintype_pi (α : Type u_1) (π : α → Type u_2) [decidable_eq α] [fintype α] [Π (a : α), encodable («π» a)] :
trunc (encodable (Π (a : α), «π» a))
Equations
def encodable.sorted_univ (α : Type u_1) [fintype α] [encodable α] :
list α

The elements of a fintype as a sorted list.

Equations
theorem encodable.mem_sorted_univ {α : Type u_1} [fintype α] [encodable α] (x : α) :
theorem encodable.length_sorted_univ {α : Type u_1} [fintype α] [encodable α] :
theorem encodable.sorted_univ_nodup {α : Type u_1} [fintype α] [encodable α] :
def encodable.fintype_equiv_fin {α : Type u_1} [fintype α] [encodable α] :

An encodable fintype is equivalent a fin.

Equations
@[protected, instance]
def encodable.fintype_arrow_of_encodable {α : Type u_1} {β : Type u_2} [encodable α] [fintype α] [encodable β] :
encodable (α → β)
Equations
theorem denumerable.denumerable_list_aux {α : Type u_1} [denumerable α] (n : ) :
∃ (a : list α) (H : ,
@[protected, instance]
def denumerable.denumerable_list {α : Type u_1} [denumerable α] :
Equations
@[simp]
theorem denumerable.list_of_nat_zero {α : Type u_1} [denumerable α] :
@[simp]
theorem denumerable.list_of_nat_succ {α : Type u_1} [denumerable α] (v : ) :
def denumerable.lower  :
Equations
def denumerable.raise  :
Equations
theorem denumerable.lower_raise (l : list ) (n : ) :
= l
theorem denumerable.raise_lower {l : list } {n : } :
(n :: l) = l
theorem denumerable.raise_chain (l : list ) (n : ) :
n)
theorem denumerable.raise_sorted (l : list ) (n : ) :
@[protected, instance]
def denumerable.multiset {α : Type u_1} [denumerable α] :
Equations
def denumerable.lower'  :
Equations
def denumerable.raise'  :
Equations
theorem denumerable.lower_raise' (l : list ) (n : ) :
= l
theorem denumerable.raise_lower' {l : list } {n : } :
(∀ (m : ), m ln m) = l
theorem denumerable.raise'_chain (l : list ) {m n : } :
m < n
theorem denumerable.raise'_sorted (l : list ) (n : ) :
def denumerable.raise'_finset (l : list ) (n : ) :
Equations
@[protected, instance]
def denumerable.finset {α : Type u_1} [denumerable α] :
Equations

The type lists on unit is canonically equivalent to the natural numbers.

Equations
Equations
def equiv.list_equiv_self_of_equiv_nat {α : Type} (e : α ) :
list α α
Equations