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

13 declarations. Mathlib docs · Source

theorem List.dropWhile_get_zero_not E1 #

∀ {α : Type u_1} (p : α → Bool) (l : List α) (hl : 0 < (List.dropWhile p l).length),
  ¬p ((List.dropWhile p l).get ⟨0, hl⟩) = true

theorem List.length_dropWhile_le E1 #

∀ {α : Type u_1} (p : α → Bool) (l : List α), (List.dropWhile p l).length ≤ l.length

theorem List.dropWhile_eq_nil_iff E0 #

∀ {α : Type u_1} {p : α → Bool} {l : List α}, List.dropWhile p l = [] ↔ ∀ x ∈ l, p x = true

theorem List.dropWhile_eq_self_iff E0 #

∀ {α : Type u_1} {p : α → Bool} {l : List α}, List.dropWhile p l = l ↔ ∀ (hl : 0 < l.length), ¬p l[0] = true

theorem List.takeWhile_eq_self_iff E0 #

∀ {α : Type u_1} {p : α → Bool} {l : List α}, List.takeWhile p l = l ↔ ∀ x ∈ l, p x = true

theorem List.takeWhile_eq_nil_iff E0 #

∀ {α : Type u_1} {p : α → Bool} {l : List α}, List.takeWhile p l = [] ↔ ∀ (hl : 0 < l.length), ¬p (l.get ⟨0, hl⟩) = true

theorem List.mem_takeWhile_imp E0 #

∀ {α : Type u_1} {p : α → Bool} {l : List α} {x : α}, x ∈ List.takeWhile p l → p x = true

theorem List.takeWhile_takeWhile E1 #

∀ {α : Type u_1} (p q : α → Bool) (l : List α),
  List.takeWhile p (List.takeWhile q l) = List.takeWhile (fun a ↦ decide (p a = true ∧ q a = true)) l

theorem List.takeWhile_idem E1 #

∀ {α : Type u_1} {p : α → Bool} {l : List α}, List.takeWhile p (List.takeWhile p l) = List.takeWhile p l

theorem List.find?_eq_head?_dropWhile_not E1 #

∀ {α : Type u_1} (p : α → Bool) (l : List α), List.find? p l = (List.dropWhile (fun x ↦ !p x) l).head?

theorem List.find?_not_eq_head?_dropWhile E1 #

∀ {α : Type u_1} (p : α → Bool) (l : List α), List.find? (fun x ↦ !p x) l = (List.dropWhile p l).head?

theorem List.find?_eq_head_dropWhile_not E1 #

∀ {α : Type u_1} {p : α → Bool} {l : List α} (h : ∃ x ∈ l, p x = true),
  List.find? p l = some ((List.dropWhile (fun x ↦ !p x) l).head ⋯)

theorem List.find?_not_eq_head_dropWhile E1 #

∀ {α : Type u_1} {p : α → Bool} {l : List α} (h : ∃ x ∈ l, ¬p x = true),
  List.find? (fun x ↦ !p x) l = some ((List.dropWhile p l).head ⋯)