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.ModifyLast

5 declarations. Mathlib docs · Source

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

∀ {α : Type u_1} (motive : List α → Array α → Sort u_2) (x : List α) (x_1 : Array α) (h_1 : (x : Array α) → motive [] x)
  (h_2 : (x : α) → (acc : Array α) → motive [x] acc)
  (h_3 : (x : α) → (xs : List α) → (acc : Array α) → motive (x :: xs) acc) (x_2 : Array α),
  x = [] →
    x_1 = x_2 →
      (match x, x_1 with
        | [], x => h_1 x
        | [x], acc => h_2 x acc
        | x :: xs, acc => h_3 x xs acc) ≍
        h_1 x_2

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

∀ {α : Type u_1} (motive : List α → Array α → Sort u_2) (x : List α) (x_1 : Array α) (h_1 : (x : Array α) → motive [] x)
  (h_2 : (x : α) → (acc : Array α) → motive [x] acc)
  (h_3 : (x : α) → (xs : List α) → (acc : Array α) → motive (x :: xs) acc) (x_2 : α) (acc : Array α),
  x = [x_2] →
    x_1 = acc →
      (match x, x_1 with
        | [], x => h_1 x
        | [x], acc => h_2 x acc
        | x :: xs, acc => h_3 x xs acc) ≍
        h_2 x_2 acc

theorem List.modifyLast.go.match_1.congr_eq_3 E1 #

∀ {α : Type u_1} (motive : List α → Array α → Sort u_2) (x : List α) (x_1 : Array α) (h_1 : (x : Array α) → motive [] x)
  (h_2 : (x : α) → (acc : Array α) → motive [x] acc)
  (h_3 : (x : α) → (xs : List α) → (acc : Array α) → motive (x :: xs) acc) (x_2 : α) (xs : List α) (acc : Array α),
  x = x_2 :: xs →
    x_1 = acc →
      (xs = [] → False) →
        (match x, x_1 with
          | [], x => h_1 x
          | [x], acc => h_2 x acc
          | x :: xs, acc => h_3 x xs acc) ≍
          h_3 x_2 xs acc

theorem List.modifyLast_concat E1 #

∀ {α : Type u_1} (f : α → α) (a : α) (l : List α), List.modifyLast f (l ++ [a]) = l ++ [f a]

theorem List.modifyLast_append_of_right_ne_nil E1 #

∀ {α : Type u_1} (f : α → α) (l₁ l₂ : List α), l₂ ≠ [] → List.modifyLast f (l₁ ++ l₂) = l₁ ++ List.modifyLast f l₂