Pairwise relations on a list #
This file provides basic results about List.Pairwise and List.pwFilter (definitions are in
Data.List.Defs).
Pairwise R [a 0, ..., a (n - 1)] means ∀ i j, i < j → R (a i) (a j). For example,
Pairwise (≠) l means that all elements of l are distinct, and Pairwise (<) l means that l
is strictly increasing.
pwFilter R l is the list obtained by iteratively adding each element of l that doesn't break
the pairwise property of the list we have so far. It thus yields l' as a maximal sublist of l
such that Pairwise R l'.
Tags #
sorted, nodup
Pairwise #
Alias of the forward direction of List.pairwise_reverse.
Alias of the reverse direction of List.pairwise_reverse.
Pairwise filtering #
Alias of the reverse direction of List.pwFilter_eq_self.
theorem List.Pairwise.decide {α : Type u_1} {R : α → α → Prop} [DecidableRel R] (l : List α) (h : Pairwise R l) :
Pairwise (fun (a b : α) => Decidable.decide (R a b) = true) l