The areas / V33. Data structures and computation
Mathlib.Data.List.Triplewise
17 declarations. Mathlib docs · Source
ctor List.Triplewise.below.cons E0 #
∀ {α : Type u_1} {p : α → α → α → Prop} {motive : (a : List α) → List.Triplewise p a → Prop} {a : α} {l : List α}
(a_1 : List.Pairwise (p a) l) (a_2 : List.Triplewise p l),
List.Triplewise.below a_2 → motive l a_2 → List.Triplewise.below ⋯
ctor List.Triplewise.below.nil E0 #
∀ {α : Type u_1} {p : α → α → α → Prop} {motive : (a : List α) → List.Triplewise p a → Prop}, List.Triplewise.below ⋯
inductive List.Triplewise E1 #
{α : Type u_1} → (α → α → α → Prop) → List α → Prop
Whether a predicate holds for all ordered triples of elements of a list.
theorem List.triplewise_iff E0 #
∀ {α : Type u_1} (p : α → α → α → Prop) (a : List α),
List.Triplewise p a ↔ a = [] ∨ ∃ a_1 l, List.Pairwise (p a_1) l ∧ List.Triplewise p l ∧ a = a_1 :: l
ctor List.Triplewise.nil E0 #
∀ {α : Type u_1} {p : α → α → α → Prop}, List.Triplewise p []
ctor List.Triplewise.cons E0 #
∀ {α : Type u_1} {p : α → α → α → Prop} {a : α} {l : List α},
List.Pairwise (p a) l → List.Triplewise p l → List.Triplewise p (a :: l)
theorem List.triplewise_cons E1 #
∀ {α : Type u_1} {a : α} {l : List α} {p : α → α → α → Prop},
List.Triplewise p (a :: l) ↔ List.Pairwise (p a) l ∧ List.Triplewise p l
theorem List.triplewise_singleton E0 #
∀ {α : Type u_1} (a : α) (p : α → α → α → Prop), List.Triplewise p [a]
theorem List.triplewise_pair E0 #
∀ {α : Type u_1} (a b : α) (p : α → α → α → Prop), List.Triplewise p [a, b]
theorem List.triplewise_triple E0 #
∀ {α : Type u_1} {a b c : α} {p : α → α → α → Prop}, List.Triplewise p [a, b, c] ↔ p a b c
theorem List.Triplewise.imp E1 #
∀ {α : Type u_1} {l : List α} {p q : α → α → α → Prop},
(∀ {a b c : α}, p a b c → q a b c) → List.Triplewise p l → List.Triplewise q l
theorem List.triplewise_map E1 #
∀ {α : Type u_1} {β : Type u_2} {l : List α} {f : α → β} {p' : β → β → β → Prop},
List.Triplewise p' (List.map f l) ↔ List.Triplewise (fun a b c ↦ p' (f a) (f b) (f c)) l
theorem List.Triplewise.of_map E1 #
∀ {α : Type u_1} {β : Type u_2} {l : List α} {p : α → α → α → Prop} {f : α → β} {p' : β → β → β → Prop},
(∀ {a b c : α}, p' (f a) (f b) (f c) → p a b c) → List.Triplewise p' (List.map f l) → List.Triplewise p l
theorem List.Triplewise.map E1 #
∀ {α : Type u_1} {β : Type u_2} {l : List α} {p : α → α → α → Prop} {f : α → β} {p' : β → β → β → Prop},
(∀ {a b c : α}, p a b c → p' (f a) (f b) (f c)) → List.Triplewise p l → List.Triplewise p' (List.map f l)
theorem List.triplewise_iff_getElem E1 #
∀ {α : Type u_1} {l : List α} {p : α → α → α → Prop},
List.Triplewise p l ↔ ∀ (i j k : ℕ) (hij : i < j) (hjk : j < k) (hk : k < l.length), p l[i] l[j] l[k]
theorem List.triplewise_append E1 #
∀ {α : Type u_1} {l₁ l₂ : List α} {p : α → α → α → Prop},
List.Triplewise p (l₁ ++ l₂) ↔
List.Triplewise p l₁ ∧
List.Triplewise p l₂ ∧ (∀ a ∈ l₁, List.Pairwise (p a) l₂) ∧ ∀ a ∈ l₂, List.Pairwise (fun x y ↦ p x y a) l₁
theorem List.triplewise_reverse E1 #
∀ {α : Type u_1} {l : List α} {p : α → α → α → Prop},
List.Triplewise p l.reverse ↔ List.Triplewise (fun a b c ↦ p c b a) l