append
length
@[simp]
map
bind
mem
list subset
@[protected, instance]
Equations
- list.has_subset = {subset := list.subset α}
@[simp]
theorem
list.length_take
{α : Type u}
(i : ℕ)
(l : list α) :
(list.take i l).length = linear_order.min i l.length
@[simp]
theorem
list.partition_eq_filter_filter
{α : Type u}
(p : α → Prop)
[decidable_pred p]
(l : list α) :
list.partition p l = (list.filter p l, list.filter (not ∘ p) l)
sublists
filter
@[simp]
@[simp]
theorem
list.filter_cons_of_pos
{α : Type u}
{p : α → Prop}
[h : decidable_pred p]
{a : α}
(l : list α) :
p a → list.filter p (a :: l) = a :: list.filter p l
@[simp]
theorem
list.filter_cons_of_neg
{α : Type u}
{p : α → Prop}
[h : decidable_pred p]
{a : α}
(l : list α) :
¬p a → list.filter p (a :: l) = list.filter p l
@[simp]
theorem
list.filter_append
{α : Type u}
{p : α → Prop}
[h : decidable_pred p]
(l₁ l₂ : list α) :
list.filter p (l₁ ++ l₂) = list.filter p l₁ ++ list.filter p l₂
@[simp]
theorem
list.filter_sublist
{α : Type u}
{p : α → Prop}
[h : decidable_pred p]
(l : list α) :
list.filter p l <+ l
map_accumr
def
list.map_accumr₂
{α : Type u}
{β : Type v}
{φ : Type w₁}
{σ : Type w₂}
(f : α → β → σ → σ × φ) :
Equations
- list.map_accumr₂ f (x :: xr) (y :: yr) c = let r : σ × list φ := list.map_accumr₂ f xr yr c, q : σ × φ := f x y r.fst in (q.fst, q.snd :: r.snd)
- list.map_accumr₂ f (hd :: tl) list.nil c = (c, list.nil φ)
- list.map_accumr₂ f list.nil (hd :: tl) c = (c, list.nil φ)
- list.map_accumr₂ f list.nil list.nil c = (c, list.nil φ)