Documentation

Mathlib.Data.Set.List

Lemmas about Lists and Set.range #

In this file we prove lemmas about range of some operations on lists.

theorem Set.range_list_map {α : Type u_1} {β : Type u_2} (f : α → β) :
range (List.map f) = {l : List β | ∀ (x : β), x ∈ l → x ∈ range f}
theorem Set.range_list_map_coe {α : Type u_1} (s : Set α) :
range (List.map Subtype.val) = {l : List α | ∀ (x : α), x ∈ l → x ∈ s}
@[simp]
theorem Set.range_list_get {α : Type u_1} (l : List α) :
range l.get = {x : α | x ∈ l}
theorem Set.range_list_getElem? {α : Type u_1} (l : List α) :
(range fun (x : ℕ) => l[x]?) = insert none (some '' {x : α | x ∈ l})
@[simp]
theorem Set.range_list_getD {α : Type u_1} (l : List α) (d : α) :
(range fun (n : ℕ) => l[n]?.getD d) = insert d {x : α | x ∈ l}
@[simp]
theorem Set.range_list_getI {α : Type u_1} [Inhabited α] (l : List α) :
instance List.canLift {α : Type u_1} {β : Type u_2} (c : β → α) (p : α → Prop) [CanLift α β c p] :
CanLift (List α) (List β) (map c) fun (l : List α) => ∀ (x : α), x ∈ l → p x

If each element of a list can be lifted to some type, then the whole list can be lifted to this type.