The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V33. Data structures and computation

Mathlib.Data.List.Lookmap

14 declarations. Mathlib docs · Source

theorem List.lookmap.go.match_1.congr_eq_2 E1 #

∀ {α : Type u_1} (motive : Option α → Sort u_2) (x : Option α) (h_1 : (b : α) → motive (some b))
  (h_2 : Unit → motive none),
  x = none →
    (match x with
      | some b => h_1 b
      | none => h_2 ()) ≍
      h_2 ()

theorem List.lookmap.go.match_1.congr_eq_1 E1 #

∀ {α : Type u_1} (motive : Option α → Sort u_2) (x : Option α) (h_1 : (b : α) → motive (some b))
  (h_2 : Unit → motive none) (b : α),
  x = some b →
    (match x with
      | some b => h_1 b
      | none => h_2 ()) ≍
      h_1 b

theorem List.lookmap_nil E0 #

∀ {α : Type u_1} (f : α → Option α), List.lookmap f [] = []

theorem List.lookmap_cons_none E0 #

∀ {α : Type u_1} (f : α → Option α) {a : α} (l : List α), f a = none → List.lookmap f (a :: l) = a :: List.lookmap f l

theorem List.lookmap_cons_some E0 #

∀ {α : Type u_1} (f : α → Option α) {a b : α} (l : List α), f a = some b → List.lookmap f (a :: l) = b :: l

theorem List.lookmap_cons E1 #

∀ {α : Type u_1} (f : α → Option α) {a : α} {l : List α},
  List.lookmap f (a :: l) =
    match f a with
    | none => a :: List.lookmap f l
    | some b => b :: l

theorem List.lookmap_some E1 #

∀ {α : Type u_1} (l : List α), List.lookmap some l = l

theorem List.lookmap_none E1 #

∀ {α : Type u_1} (l : List α), List.lookmap (fun x ↦ none) l = l

theorem List.lookmap_congr E1 #

∀ {α : Type u_1} {f g : α → Option α} {l : List α}, (∀ a ∈ l, f a = g a) → List.lookmap f l = List.lookmap g l

theorem List.lookmap_of_forall_not E1 #

∀ {α : Type u_1} (f : α → Option α) {l : List α}, (∀ a ∈ l, f a = none) → List.lookmap f l = l

theorem List.lookmap_map_eq E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → Option α) (g : α → β),
  (∀ (a b : α), b ∈ f a → g a = g b) → ∀ (l : List α), List.map g (List.lookmap f l) = List.map g l

theorem List.lookmap_id' E1 #

∀ {α : Type u_1} (f : α → Option α), (∀ (a b : α), b ∈ f a → a = b) → ∀ (l : List α), List.lookmap f l = l

theorem List.length_lookmap E0 #

∀ {α : Type u_1} (f : α → Option α) (l : List α), (List.lookmap f l).length = l.length

theorem List.perm_lookmap E1 #

∀ {α : Type u_1} (f : α → Option α) {l₁ l₂ : List α},
  List.Pairwise (fun a b ↦ ∀ c ∈ f a, ∀ d ∈ f b, a = b ∧ c = d) l₁ →
    l₁.Perm l₂ → (List.lookmap f l₁).Perm (List.lookmap f l₂)