Triplewise predicates on list. #
Main definitions #
List.Triplewise
says that a predicate applies to all ordered triples of elements of a list.
Whether a predicate holds for all ordered triples of elements of a list.
- nil {α : Type u_1} {p : α → α → α → Prop} : Triplewise p []
- cons {α : Type u_1} {p : α → α → α → Prop} {a : α} {l : List α} : Pairwise (p a) l → Triplewise p l → Triplewise p (a :: l)
Instances For
@[simp]
@[simp]
@[simp]
theorem
List.Triplewise.imp
{α : Type u_1}
{l : List α}
{p q : α → α → α → Prop}
(h : ∀ {a b c : α}, p a b c → q a b c)
(hl : Triplewise p l)
:
Triplewise q l
theorem
List.triplewise_map
{α : Type u_1}
{β : Type u_2}
{l : List α}
{f : α → β}
{p' : β → β → β → Prop}
:
theorem
List.Triplewise.of_map
{α : Type u_1}
{β : Type u_2}
{l : List α}
{p : α → α → α → Prop}
{f : α → β}
{p' : β → β → β → Prop}
(h : ∀ {a b c : α}, p' (f a) (f b) (f c) → p a b c)
(hl : Triplewise p' (List.map f l))
:
Triplewise p l
theorem
List.Triplewise.map
{α : Type u_1}
{β : Type u_2}
{l : List α}
{p : α → α → α → Prop}
{f : α → β}
{p' : β → β → β → Prop}
(h : ∀ {a b c : α}, p a b c → p' (f a) (f b) (f c))
(hl : Triplewise p l)
:
Triplewise p' (List.map f l)
theorem
List.triplewise_append
{α : Type u_1}
{l₁ l₂ : List α}
{p : α → α → α → Prop}
:
Triplewise p (l₁ ++ l₂) ↔ Triplewise p l₁ ∧ Triplewise p l₂ ∧ (∀ (a : α), a ∈ l₁ → Pairwise (p a) l₂) ∧ ∀ (a : α), a ∈ l₂ → Pairwise (fun (x y : α) => p x y a) l₁