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 : αβ) :
Set.range (List.map f) = {l : List β | xl, x Set.range f}
theorem Set.range_list_map_coe {α : Type u_1} (s : Set α) :
Set.range (List.map Subtype.val) = {l : List α | xl, x s}
@[simp]
theorem Set.range_list_get {α : Type u_1} (l : List α) :
Set.range l.get = {x : α | x l}
@[deprecated Set.range_list_get]
theorem Set.range_list_nthLe {α : Type u_1} (l : List α) :
Set.range l.get = {x : α | x l}

Alias of Set.range_list_get.

theorem Set.range_list_get? {α : Type u_1} (l : List α) :
Set.range l.get? = insert none (some '' {x : α | x l})
@[simp]
theorem Set.range_list_getD {α : Type u_1} (l : List α) (d : α) :
(Set.range fun (n : ) => l[n]?.getD d) = insert d {x : α | x l}
@[simp]
theorem Set.range_list_getI {α : Type u_1} [Inhabited α] (l : List α) :
Set.range l.getI = insert default {x : α | x l}
instance List.canLift {α : Type u_1} {β : Type u_2} (c : βα) (p : αProp) [CanLift α β c p] :
CanLift (List α) (List β) (List.map c) fun (l : List α) => xl, p x

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

Equations
  • =