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

204 declarations. Mathlib docs · Source

Sorting algorithms on lists

In this file we define the sorting algorithm List.insertionSort r and prove that we have (l.insertionSort r l).Pairwise r under suitable conditions on r.

We then define List.SortedLE, List.SortedGE, List.SortedLT and List.SortedGT, predicates which are equivalent to List.Pairwise when the relation derives from a preorder (but which are defined in terms of the monotonicity predicates).

Insertion sort

Merge sort

We provide some wrapper functions around the theorems for mergeSort provided in Lean, which rather than using explicit hypotheses for transitivity and totality, use Mathlib order typeclasses instead.

The predicates List.SortedLE, List.SortedGE, List.SortedLT and List.SortedGT

These predicates are equivalent to Monotone l.get, but they are also equivalent to IsChain (· < ·) and Pairwise (· < ·). API is provided to move between these forms.

API has deliberately not been provided for decomposed lists to avoid unneeded API replication. The provided API should be used to move to and from IsChain, Pairwise or Monotone as needed.

theorem List.orderedInsert.congr_simp E1 #

∀ {α : Type u_1} (r r_1 : α → α → Prop),
  r = r_1 →
    ∀ {inst : DecidableRel r} [inst_1 : DecidableRel r_1] (a a_1 : α),
      a = a_1 → ∀ (a_2 a_3 : List α), a_2 = a_3 → List.orderedInsert r a a_2 = List.orderedInsert r_1 a_1 a_3

theorem List.insertionSort.congr_simp E1 #

∀ {α : Type u_1} (r r_1 : α → α → Prop),
  r = r_1 →
    ∀ {inst : DecidableRel r} [inst_1 : DecidableRel r_1] (a a_1 : List α),
      a = a_1 → List.insertionSort r a = List.insertionSort r_1 a_1

def List.orderedInsert E1 #

{α : Type u_1} → (r : α → α → Prop) → [DecidableRel r] → α → List α → List α

orderedInsert a l inserts a into l at such that orderedInsert a l is sorted if l is.

theorem List.orderedInsert_nil E0 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (a : α), List.orderedInsert r a [] = [a]

theorem List.orderedInsert_cons E0 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (a b : α) (l : List α),
  List.orderedInsert r a (b :: l) = if r a b then a :: b :: l else b :: List.orderedInsert r a l

theorem List.orderedInsert_cons_of_le E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] {a b : α} (l : List α),
  r a b → List.orderedInsert r a (b :: l) = a :: b :: l

theorem List.orderedInsert_of_not_le E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] {a b : α} (l : List α),
  ¬r a b → List.orderedInsert r a (b :: l) = b :: List.orderedInsert r a l

def List.insertionSort E1 #

{α : Type u_1} → (r : α → α → Prop) → [DecidableRel r] → List α → List α

insertionSort l returns l sorted using the insertion sort algorithm.

theorem List.insertionSort_nil E0 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r], List.insertionSort r [] = []

theorem List.insertionSort_cons E0 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (a : α) (l : List α),
  List.insertionSort r (a :: l) = List.orderedInsert r a (List.insertionSort r l)

theorem List.orderedInsert_length E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (L : List α) (a : α),
  (List.orderedInsert r a L).length = L.length + 1

theorem List.orderedInsert_eq_take_drop E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (a : α) (l : List α),
  List.orderedInsert r a l = List.takeWhile (fun b ↦ decide ¬r a b) l ++ a :: List.dropWhile (fun b ↦ decide ¬r a b) l

An alternative definition of orderedInsert using takeWhile and dropWhile.

theorem List.insertionSort_cons_eq_take_drop E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (a : α) (l : List α),
  List.insertionSort r (a :: l) =
    List.takeWhile (fun b ↦ decide ¬r a b) (List.insertionSort r l) ++
      a :: List.dropWhile (fun b ↦ decide ¬r a b) (List.insertionSort r l)

theorem List.mem_orderedInsert E0 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] {a b : α} {l : List α},
  a ∈ List.orderedInsert r b l ↔ a = b ∨ a ∈ l

theorem List.map_orderedInsert E0 #

∀ {α : Type u_1} {β : Type u_2} (r : α → α → Prop) (s : β → β → Prop) [inst : DecidableRel r] [inst_1 : DecidableRel s]
  (f : α → β) (l : List α) (x : α),
  (∀ a ∈ l, r x a ↔ s (f x) (f a)) → List.map f (List.orderedInsert r x l) = List.orderedInsert s (f x) (List.map f l)

theorem List.perm_orderedInsert E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (a : α) (l : List α),
  (List.orderedInsert r a l).Perm (a :: l)

theorem List.orderedInsert_count E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] [inst_1 : DecidableEq α] (L : List α) (a b : α),
  List.count a (List.orderedInsert r b L) = List.count a L + if b = a then 1 else 0

theorem List.perm_insertionSort E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (l : List α), (List.insertionSort r l).Perm l

theorem List.mem_insertionSort E0 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] {l : List α} {x : α}, x ∈ List.insertionSort r l ↔ x ∈ l

theorem List.length_insertionSort E0 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] (l : List α), (List.insertionSort r l).length = l.length

theorem List.insertionSort_cons_of_forall_rel E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] {a : α} {l : List α},
  (∀ b ∈ l, r a b) → List.insertionSort r (a :: l) = a :: List.insertionSort r l

theorem List.map_insertionSort E0 #

∀ {α : Type u_1} {β : Type u_2} (r : α → α → Prop) (s : β → β → Prop) [inst : DecidableRel r] [inst_1 : DecidableRel s]
  (f : α → β) (l : List α),
  (∀ a ∈ l, ∀ b ∈ l, r a b ↔ s (f a) (f b)) → List.map f (List.insertionSort r l) = List.insertionSort s (List.map f l)

theorem List.Pairwise.insertionSort_eq E0 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] {l : List α}, List.Pairwise r l → List.insertionSort r l = l

If l is already List.Pairwise with respect to r, then insertionSort does not change it.

theorem List.erase_orderedInsert E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] [inst_1 : DecidableEq α] [Std.Refl r] (x : α) (xs : List α),
  (List.orderedInsert r x xs).erase x = xs

For a reflexive relation, insert then erasing is the identity.

theorem List.erase_orderedInsert_of_notMem E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] [inst_1 : DecidableEq α] {x : α} {xs : List α},
  x ∉ xs → (List.orderedInsert r x xs).erase x = xs

Inserting then erasing an element that is absent is the identity.

theorem List.orderedInsert_erase E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] [inst_1 : DecidableEq α] [Std.Antisymm r] (x : α)
  (xs : List α), x ∈ xs → List.Pairwise r xs → List.orderedInsert r x (xs.erase x) = xs

For an antisymmetric relation, erasing then inserting is the identity.

theorem List.sublist_orderedInsert E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] (x : α) (xs : List α),
  xs.Sublist (List.orderedInsert r x xs)

theorem List.cons_sublist_orderedInsert E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] {l c : List α} {a : α},
  c.Sublist l → (∀ a' ∈ c, r a a') → (a :: c).Sublist (List.orderedInsert r a l)

theorem List.Sublist.orderedInsert_sublist E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] [IsTrans α r] {as bs : List α} (x : α),
  as.Sublist bs → List.Pairwise r bs → (List.orderedInsert r x as).Sublist (List.orderedInsert r x bs)

theorem List.Pairwise.orderedInsert E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] [Std.Total r] [IsTrans α r] (a : α) (l : List α),
  List.Pairwise r l → List.Pairwise r (List.orderedInsert r a l)

theorem List.pairwise_insertionSort E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] [Std.Total r] [IsTrans α r] (l : List α),
  List.Pairwise r (List.insertionSort r l)

The list List.insertionSort r l is List.Pairwise with respect to r.

theorem List.sublist_insertionSort E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] {l c : List α},
  List.Pairwise r c → c.Sublist l → c.Sublist (List.insertionSort r l)

If c is a sorted sublist of l, then c is still a sublist of insertionSort r l.

theorem List.pair_sublist_insertionSort E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] {a b : α} {l : List α},
  r a b → [a, b].Sublist l → [a, b].Sublist (List.insertionSort r l)

Another statement of stability of insertion sort. If a pair [a, b] is a sublist of l and r a b, then [a, b] is still a sublist of insertionSort r l.

theorem List.sublist_insertionSort' E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] [Std.Antisymm r] [Std.Total r] [IsTrans α r] {l c : List α},
  List.Pairwise r c → c.Subperm l → c.Sublist (List.insertionSort r l)

A version of insertionSort_stable which only assumes c <+~ l (instead of c <+ l), but additionally requires Std.Antisymm r, Std.Total r and IsTrans α r.

theorem List.pair_sublist_insertionSort' E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] [Std.Antisymm r] [Std.Total r] [IsTrans α r] {a b : α}
  {l : List α}, r a b → [a, b].Subperm l → [a, b].Sublist (List.insertionSort r l)

Another statement of stability of insertion sort. If a pair [a, b] is a sublist of a permutation of l and a ≼ b, then [a, b] is still a sublist of insertionSort r l.

theorem List.sublist_of_subperm_of_pairwise E1 #

∀ {α : Type u_1} {r : α → α → Prop} [Std.Antisymm r] {l₁ l₂ : List α},
  l₁.Subperm l₂ → List.Pairwise r l₁ → List.Pairwise r l₂ → l₁.Sublist l₂

theorem List.Subset.antisymm_of_pairwise E1 #

∀ {α : Type u_1} {r : α → α → Prop} [Std.Antisymm r] [Std.Irrefl r] {l₁ l₂ : List α},
  List.Pairwise r l₁ → List.Pairwise r l₂ → l₁ ⊆ l₂ → l₂ ⊆ l₁ → l₁ = l₂

theorem List.Pairwise.merge E1 #

∀ {α : Type u_1} {r : α → α → Prop} [inst : DecidableRel r] [Std.Total r] [IsTrans α r] {l l' : List α},
  List.Pairwise r l → List.Pairwise r l' → List.Pairwise r (l.merge l' fun x1 x2 ↦ decide (r x1 x2))

theorem List.pairwise_mergeSort' E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] [Std.Total r] [IsTrans α r] (l : List α),
  List.Pairwise r (l.mergeSort fun x1 x2 ↦ decide (r x1 x2))

Variant of pairwise_mergeSort using relation typeclasses.

theorem List.mergeSort_eq_self E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] [Std.Total r] [IsTrans α r] [Std.Antisymm r] {l : List α},
  List.Pairwise r l → (l.mergeSort fun x1 x2 ↦ decide (r x1 x2)) = l

theorem List.mergeSort_eq_insertionSort E1 #

∀ {α : Type u_1} (r : α → α → Prop) [inst : DecidableRel r] [Std.Total r] [IsTrans α r] [Std.Antisymm r] (l : List α),
  (l.mergeSort fun x1 x2 ↦ decide (r x1 x2)) = List.insertionSort r l

def List.SortedLE E1 #

{α : Type u_1} → [Preorder α] → List α → Prop

l.SortedLE means that the list is monotonic.

def List.SortedGE E1 #

{α : Type u_1} → [Preorder α] → List α → Prop

l.SortedGE means that the list is antitonic.

def List.SortedLT E1 #

{α : Type u_1} → [Preorder α] → List α → Prop

l.SortedLT means that the list is strictly monotonic.

def List.SortedGT E1 #

{α : Type u_1} → [Preorder α] → List α → Prop

l.SortedGT means that the list is strictly antitonic.

theorem List.sortedLE_iff_monotone_get E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLE ↔ Monotone l.get

theorem List.sortedGE_iff_antitone_get E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGE ↔ Antitone l.get

theorem List.sortedLT_iff_strictMono_get E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLT ↔ StrictMono l.get

theorem List.sortedGT_iff_strictAnti_get E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGT ↔ StrictAnti l.get

theorem List.SortedLE.monotone_get E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLE → Monotone l.get

Alias of the forward direction of List.sortedLE_iff_monotone_get.

theorem Monotone.sortedLE E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], Monotone l.get → l.SortedLE

Alias of the reverse direction of List.sortedLE_iff_monotone_get.

theorem Antitone.sortedGE E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], Antitone l.get → l.SortedGE

Alias of the reverse direction of List.sortedGE_iff_antitone_get.

theorem List.SortedGE.antitone_get E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGE → Antitone l.get

Alias of the forward direction of List.sortedGE_iff_antitone_get.

theorem StrictMono.sortedLT E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], StrictMono l.get → l.SortedLT

Alias of the reverse direction of List.sortedLT_iff_strictMono_get.

theorem List.SortedLT.strictMono_get E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLT → StrictMono l.get

Alias of the forward direction of List.sortedLT_iff_strictMono_get.

theorem List.SortedGT.strictAnti_get E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGT → StrictAnti l.get

Alias of the forward direction of List.sortedGT_iff_strictAnti_get.

theorem StrictAnti.sortedGT E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], StrictAnti l.get → l.SortedGT

Alias of the reverse direction of List.sortedGT_iff_strictAnti_get.

theorem List.sortedLE_iff_pairwise E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLE ↔ List.Pairwise (fun x1 x2 ↦ x1 ≤ x2) l

theorem List.sortedGE_iff_pairwise E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGE ↔ List.Pairwise (fun x1 x2 ↦ x1 ≥ x2) l

theorem List.sortedLT_iff_pairwise E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLT ↔ List.Pairwise (fun x1 x2 ↦ x1 < x2) l

theorem List.sortedGT_iff_pairwise E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGT ↔ List.Pairwise (fun x1 x2 ↦ x1 > x2) l

theorem List.SortedLE.pairwise E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLE → List.Pairwise (fun x1 x2 ↦ x1 ≤ x2) l

Alias of the forward direction of List.sortedLE_iff_pairwise.

theorem List.Pairwise.sortedLE E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], List.Pairwise (fun x1 x2 ↦ x1 ≤ x2) l → l.SortedLE

Alias of the reverse direction of List.sortedLE_iff_pairwise.

theorem List.Pairwise.sortedGE E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], List.Pairwise (fun x1 x2 ↦ x1 ≥ x2) l → l.SortedGE

Alias of the reverse direction of List.sortedGE_iff_pairwise.

theorem List.SortedGE.pairwise E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGE → List.Pairwise (fun x1 x2 ↦ x1 ≥ x2) l

Alias of the forward direction of List.sortedGE_iff_pairwise.

theorem List.SortedLT.pairwise E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLT → List.Pairwise (fun x1 x2 ↦ x1 < x2) l

Alias of the forward direction of List.sortedLT_iff_pairwise.

theorem List.Pairwise.sortedLT E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], List.Pairwise (fun x1 x2 ↦ x1 < x2) l → l.SortedLT

Alias of the reverse direction of List.sortedLT_iff_pairwise.

theorem List.Pairwise.sortedGT E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], List.Pairwise (fun x1 x2 ↦ x1 > x2) l → l.SortedGT

Alias of the reverse direction of List.sortedGT_iff_pairwise.

theorem List.SortedGT.pairwise E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGT → List.Pairwise (fun x1 x2 ↦ x1 > x2) l

Alias of the forward direction of List.sortedGT_iff_pairwise.

theorem List.sortedLE_iff_isChain E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLE ↔ List.IsChain (fun x1 x2 ↦ x1 ≤ x2) l

theorem List.sortedGE_iff_isChain E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGE ↔ List.IsChain (fun x1 x2 ↦ x1 ≥ x2) l

theorem List.sortedLT_iff_isChain E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLT ↔ List.IsChain (fun x1 x2 ↦ x1 < x2) l

theorem List.sortedGT_iff_isChain E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGT ↔ List.IsChain (fun x1 x2 ↦ x1 > x2) l

theorem List.IsChain.sortedLE E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], List.IsChain (fun x1 x2 ↦ x1 ≤ x2) l → l.SortedLE

Alias of the reverse direction of List.sortedLE_iff_isChain.

theorem List.SortedLE.isChain E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLE → List.IsChain (fun x1 x2 ↦ x1 ≤ x2) l

Alias of the forward direction of List.sortedLE_iff_isChain.

theorem List.SortedGE.isChain E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGE → List.IsChain (fun x1 x2 ↦ x1 ≥ x2) l

Alias of the forward direction of List.sortedGE_iff_isChain.

theorem List.IsChain.sortedGE E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], List.IsChain (fun x1 x2 ↦ x1 ≥ x2) l → l.SortedGE

Alias of the reverse direction of List.sortedGE_iff_isChain.

theorem List.SortedLT.isChain E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLT → List.IsChain (fun x1 x2 ↦ x1 < x2) l

Alias of the forward direction of List.sortedLT_iff_isChain.

theorem List.IsChain.sortedLT E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], List.IsChain (fun x1 x2 ↦ x1 < x2) l → l.SortedLT

Alias of the reverse direction of List.sortedLT_iff_isChain.

theorem List.IsChain.sortedGT E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], List.IsChain (fun x1 x2 ↦ x1 > x2) l → l.SortedGT

Alias of the reverse direction of List.sortedGT_iff_isChain.

theorem List.SortedGT.isChain E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGT → List.IsChain (fun x1 x2 ↦ x1 > x2) l

Alias of the forward direction of List.sortedGT_iff_isChain.

instance List.decidableSortedLE E0 #

{α : Type u_1} → [inst : Preorder α] → [DecidableLE α] → DecidablePred List.SortedLE

instance List.decidableSortedGE E0 #

{α : Type u_1} → [inst : Preorder α] → [DecidableLE α] → DecidablePred List.SortedGE

instance List.decidableSortedLT E0 #

{α : Type u_1} → [inst : Preorder α] → [DecidableLT α] → DecidablePred List.SortedLT

instance List.decidableSortedGT E0 #

{α : Type u_1} → [inst : Preorder α] → [DecidableLT α] → DecidablePred List.SortedGT

theorem List.sortedLE_iff_getElem_le_getElem_of_le E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  l.SortedLE ↔ ∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, i ≤ j → l[i] ≤ l[j]

theorem List.sortedGE_iff_getElem_ge_getElem_of_le E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  l.SortedGE ↔ ∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, j ≤ i → l[i] ≤ l[j]

theorem List.sortedLT_iff_getElem_lt_getElem_of_lt E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  l.SortedLT ↔ ∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, i < j → l[i] < l[j]

theorem List.sortedGT_iff_getElem_gt_getElem_of_lt E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  l.SortedGT ↔ ∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, j < i → l[i] < l[j]

theorem List.sortedLE_of_getElem_le_getElem_of_le E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  (∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, i ≤ j → l[i] ≤ l[j]) → l.SortedLE

Alias of the reverse direction of List.sortedLE_iff_getElem_le_getElem_of_le.

theorem List.SortedLE.getElem_le_getElem_of_le E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  l.SortedLE → ∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, i ≤ j → l[i] ≤ l[j]

Alias of the forward direction of List.sortedLE_iff_getElem_le_getElem_of_le.

theorem List.sortedGE_of_getElem_ge_getElem_of_le E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  (∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, j ≤ i → l[i] ≤ l[j]) → l.SortedGE

Alias of the reverse direction of List.sortedGE_iff_getElem_ge_getElem_of_le.

theorem List.SortedGE.getElem_ge_getElem_of_le E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  l.SortedGE → ∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, j ≤ i → l[i] ≤ l[j]

Alias of the forward direction of List.sortedGE_iff_getElem_ge_getElem_of_le.

theorem List.sortedLT_of_getElem_lt_getElem_of_lt E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  (∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, i < j → l[i] < l[j]) → l.SortedLT

Alias of the reverse direction of List.sortedLT_iff_getElem_lt_getElem_of_lt.

theorem List.SortedLT.getElem_lt_getElem_of_lt E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  l.SortedLT → ∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, i < j → l[i] < l[j]

Alias of the forward direction of List.sortedLT_iff_getElem_lt_getElem_of_lt.

theorem List.SortedGT.getElem_gt_getElem_of_lt E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  l.SortedGT → ∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, j < i → l[i] < l[j]

Alias of the forward direction of List.sortedGT_iff_getElem_gt_getElem_of_lt.

theorem List.sortedGT_of_getElem_gt_getElem_of_lt E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α],
  (∀ ⦃i j : ℕ⦄ ⦃hi : i < l.length⦄ ⦃hj : j < l.length⦄, j < i → l[i] < l[j]) → l.SortedGT

Alias of the reverse direction of List.sortedGT_iff_getElem_gt_getElem_of_lt.

theorem List.SortedLT.sortedLE E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, l.SortedLT → l.SortedLE

theorem List.SortedGT.sortedGE E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, l.SortedGT → l.SortedGE

theorem List.SortedLT.nodup E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLT → l.Nodup

theorem List.SortedGT.nodup E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGT → l.Nodup

theorem List.sortedLE_replicate E1 #

∀ {α : Type u_1} [inst : Preorder α] {a : α} (n : ℕ), (List.replicate n a).SortedLE

theorem List.sortedLT_finRange E1 #

∀ (n : ℕ), (List.finRange n).SortedLT

theorem List.sortedLT_range E1 #

∀ (n : ℕ), (List.range n).SortedLT

theorem List.sortedLT_range' E1 #

∀ (a b : ℕ) {s : ℕ}, s ≠ 0 → (List.range' a b s).SortedLT

theorem List.sortedLE_range' E1 #

∀ (a b s : ℕ), (List.range' a b s).SortedLE

theorem List.sortedLE_ofFn_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, (List.ofFn f).SortedLE ↔ Monotone f

The list List.ofFn f is sorted with respect to (· ≤ ·) if and only if f is monotone.

theorem List.sortedGE_ofFn_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, (List.ofFn f).SortedGE ↔ Antitone f

The list List.ofFn f is sorted with respect to (· ≥ ·) if and only if f is antitone.

theorem List.sortedLT_ofFn_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, (List.ofFn f).SortedLT ↔ StrictMono f

The list List.ofFn f is strictly sorted with respect to (· ≤ ·) if and only if f is strictly monotone.

theorem List.sortedGT_ofFn_iff E0 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, (List.ofFn f).SortedGT ↔ StrictAnti f

The list List.ofFn f is strictly sorted with respect to (· ≥ ·) if and only if f is strictly antitone.

theorem Monotone.sortedLE_ofFn E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, Monotone f → (List.ofFn f).SortedLE

The list obtained from a monotone tuple is sorted.

theorem List.SortedLE.monotone E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, (List.ofFn f).SortedLE → Monotone f

The list obtained from a monotone tuple is sorted.

theorem Antitone.sortedGE_ofFn E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, Antitone f → (List.ofFn f).SortedGE

The list obtained from an antitone tuple is sorted.

theorem List.SortedGE.antitone E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, (List.ofFn f).SortedGE → Antitone f

The list obtained from an antitone tuple is sorted.

theorem StrictMono.sortedLT_ofFn E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, StrictMono f → (List.ofFn f).SortedLT

The list obtained from a strictly monotone tuple is sorted.

theorem List.SortedLT.strictMono E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, (List.ofFn f).SortedLT → StrictMono f

The list obtained from a strictly monotone tuple is sorted.

theorem List.SortedGT.strictAnti E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, (List.ofFn f).SortedGT → StrictAnti f

The list obtained from a strictly antitone tuple is sorted.

theorem StrictAnti.sortedGT_ofFn E1 #

∀ {α : Type u_1} [inst : Preorder α] {n : ℕ} {f : Fin n → α}, StrictAnti f → (List.ofFn f).SortedGT

The list obtained from a strictly antitone tuple is sorted.

theorem List.sortedLT_nil E1 #

∀ {α : Type u_1} [inst : Preorder α], [].SortedLT

theorem List.sortedGT_nil E1 #

∀ {α : Type u_1} [inst : Preorder α], [].SortedGT

theorem List.sortedLE_nil E1 #

∀ {α : Type u_1} [inst : Preorder α], [].SortedLE

theorem List.sortedGE_nil E1 #

∀ {α : Type u_1} [inst : Preorder α], [].SortedGE

theorem List.sortedLE_reverse E0 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.reverse.SortedLE ↔ l.SortedGE

theorem List.sortedGE_reverse E0 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.reverse.SortedGE ↔ l.SortedLE

theorem List.sortedLT_reverse E0 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.reverse.SortedLT ↔ l.SortedGT

theorem List.sortedGT_reverse E0 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.reverse.SortedGT ↔ l.SortedLT

theorem List.SortedGE.reverse E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGE → l.reverse.SortedLE

Alias of the reverse direction of List.sortedLE_reverse.

theorem List.SortedLE.of_reverse E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.reverse.SortedLE → l.SortedGE

Alias of the forward direction of List.sortedLE_reverse.

theorem List.SortedGE.of_reverse E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.reverse.SortedGE → l.SortedLE

Alias of the forward direction of List.sortedGE_reverse.

theorem List.SortedLE.reverse E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLE → l.reverse.SortedGE

Alias of the reverse direction of List.sortedGE_reverse.

theorem List.SortedLT.of_reverse E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.reverse.SortedLT → l.SortedGT

Alias of the forward direction of List.sortedLT_reverse.

theorem List.SortedGT.reverse E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedGT → l.reverse.SortedLT

Alias of the reverse direction of List.sortedLT_reverse.

theorem List.SortedLT.reverse E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.SortedLT → l.reverse.SortedGT

Alias of the reverse direction of List.sortedGT_reverse.

theorem List.SortedGT.of_reverse E1 #

∀ {α : Type u_1} {l : List α} [inst : Preorder α], l.reverse.SortedGT → l.SortedLT

Alias of the forward direction of List.sortedGT_reverse.

theorem List.sortedLE_map_ofDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.ofDual) l).SortedLE ↔ l.SortedGE

theorem List.sortedGE_map_ofDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.ofDual) l).SortedGE ↔ l.SortedLE

theorem List.sortedLT_map_ofDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.ofDual) l).SortedLT ↔ l.SortedGT

theorem List.sortedGT_map_ofDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.ofDual) l).SortedGT ↔ l.SortedLT

theorem List.SortedLE.map_ofDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.ofDual) l).SortedLE → l.SortedGE

Alias of the forward direction of List.sortedLE_map_ofDual.

theorem List.SortedGE.of_map_ofDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, l.SortedGE → (List.map (⇑OrderDual.ofDual) l).SortedLE

Alias of the reverse direction of List.sortedLE_map_ofDual.

theorem List.SortedGE.map_ofDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.ofDual) l).SortedGE → l.SortedLE

Alias of the forward direction of List.sortedGE_map_ofDual.

theorem List.SortedLE.of_map_ofDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, l.SortedLE → (List.map (⇑OrderDual.ofDual) l).SortedGE

Alias of the reverse direction of List.sortedGE_map_ofDual.

theorem List.SortedGT.of_map_ofDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, l.SortedGT → (List.map (⇑OrderDual.ofDual) l).SortedLT

Alias of the reverse direction of List.sortedLT_map_ofDual.

theorem List.SortedLT.map_ofDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.ofDual) l).SortedLT → l.SortedGT

Alias of the forward direction of List.sortedLT_map_ofDual.

theorem List.SortedLT.of_map_ofDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, l.SortedLT → (List.map (⇑OrderDual.ofDual) l).SortedGT

Alias of the reverse direction of List.sortedGT_map_ofDual.

theorem List.SortedGT.map_ofDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.ofDual) l).SortedGT → l.SortedLT

Alias of the forward direction of List.sortedGT_map_ofDual.

theorem List.sortedLE_map_toDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, (List.map (⇑OrderDual.toDual) l).SortedLE ↔ l.SortedGE

theorem List.sortedGE_map_toDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, (List.map (⇑OrderDual.toDual) l).SortedGE ↔ l.SortedLE

theorem List.sortedLT_map_toDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, (List.map (⇑OrderDual.toDual) l).SortedLT ↔ l.SortedGT

theorem List.sortedGT_map_toDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.toDual) l).SortedGT ↔ l.SortedLT

theorem List.SortedLE.map_toDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, (List.map (⇑OrderDual.toDual) l).SortedLE → l.SortedGE

Alias of the forward direction of List.sortedLE_map_toDual.

theorem List.SortedGE.of_map_toDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, l.SortedGE → (List.map (⇑OrderDual.toDual) l).SortedLE

Alias of the reverse direction of List.sortedLE_map_toDual.

theorem List.SortedGE.map_toDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, (List.map (⇑OrderDual.toDual) l).SortedGE → l.SortedLE

Alias of the forward direction of List.sortedGE_map_toDual.

theorem List.SortedLE.of_map_toDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, l.SortedLE → (List.map (⇑OrderDual.toDual) l).SortedGE

Alias of the reverse direction of List.sortedGE_map_toDual.

theorem List.SortedLT.map_toDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, (List.map (⇑OrderDual.toDual) l).SortedLT → l.SortedGT

Alias of the forward direction of List.sortedLT_map_toDual.

theorem List.SortedGT.of_map_toDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List α}, l.SortedGT → (List.map (⇑OrderDual.toDual) l).SortedLT

Alias of the reverse direction of List.sortedLT_map_toDual.

theorem List.SortedGT.map_toDual E0 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, (List.map (⇑OrderDual.toDual) l).SortedGT → l.SortedLT

Alias of the forward direction of List.sortedGT_map_toDual.

theorem List.SortedLT.of_map_toDual E1 #

∀ {α : Type u_1} [inst : Preorder α] {l : List αᵒᵈ}, l.SortedLT → (List.map (⇑OrderDual.toDual) l).SortedGT

Alias of the reverse direction of List.sortedGT_map_toDual.

theorem List.SortedLE.sortedLT_of_nodup E1 #

∀ {α : Type u_1} [inst : PartialOrder α] {l : List α}, l.SortedLE → l.Nodup → l.SortedLT

theorem List.SortedGE.sortedGT_of_nodup E1 #

∀ {α : Type u_1} [inst : PartialOrder α] {l : List α}, l.SortedGE → l.Nodup → l.SortedGT

theorem List.sortedLT_iff_nodup_and_sortedLE E1 #

∀ {α : Type u_1} {l : List α} [inst : PartialOrder α], l.SortedLT ↔ l.Nodup ∧ l.SortedLE

theorem List.sortedGT_iff_nodup_and_sortedGE E1 #

∀ {α : Type u_1} {l : List α} [inst : PartialOrder α], l.SortedGT ↔ l.Nodup ∧ l.SortedGE

theorem List.Subset.antisymm_of_sortedLT E1 #

∀ {α : Type u_1} [inst : PartialOrder α] {l₁ l₂ : List α}, l₁ ⊆ l₂ → l₂ ⊆ l₁ → l₁.SortedLT → l₂.SortedLT → l₁ = l₂

theorem List.Subset.antisymm_of_sortedGT E1 #

∀ {α : Type u_1} [inst : PartialOrder α] {l₁ l₂ : List α}, l₁ ⊆ l₂ → l₂ ⊆ l₁ → l₁.SortedGT → l₂.SortedGT → l₁ = l₂

theorem List.sublist_of_subperm_of_sortedLE E1 #

∀ {α : Type u_1} [inst : PartialOrder α] {l₁ l₂ : List α}, l₁.Subperm l₂ → l₁.SortedLE → l₂.SortedLE → l₁.Sublist l₂

theorem List.sublist_of_subperm_of_sortedGE E1 #

∀ {α : Type u_1} [inst : PartialOrder α] {l₁ l₂ : List α}, l₁.Subperm l₂ → l₁.SortedGE → l₂.SortedGE → l₁.Sublist l₂

theorem List.sortedLE_mergeSort E1 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α], (l.mergeSort fun x1 x2 ↦ decide (x1 ≤ x2)).SortedLE

theorem List.sortedGE_mergeSort E1 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α], (l.mergeSort fun x1 x2 ↦ decide (x1 ≥ x2)).SortedGE

theorem List.sortedLE_insertionSort E1 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α], (List.insertionSort (fun x1 x2 ↦ x1 ≤ x2) l).SortedLE

theorem List.sortedGE_insertionSort E1 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α], (List.insertionSort (fun x1 x2 ↦ x1 ≥ x2) l).SortedGE

theorem List.sortedLE_append E1 #

∀ {α : Type u_1} [inst : LinearOrder α] {l₁ l₂ : List α},
  (l₁ ++ l₂).SortedLE ↔ l₁.SortedLE ∧ l₂.SortedLE ∧ ∀ a ∈ l₁, ∀ b ∈ l₂, a ≤ b

theorem List.sortedGE_append E1 #

∀ {α : Type u_1} [inst : LinearOrder α] {l₁ l₂ : List α},
  (l₁ ++ l₂).SortedGE ↔ l₁.SortedGE ∧ l₂.SortedGE ∧ ∀ a ∈ l₁, ∀ b ∈ l₂, b ≤ a

theorem List.sortedLT_append E1 #

∀ {α : Type u_1} [inst : LinearOrder α] {l₁ l₂ : List α},
  (l₁ ++ l₂).SortedLT ↔ l₁.SortedLT ∧ l₂.SortedLT ∧ ∀ a ∈ l₁, ∀ b ∈ l₂, a < b

theorem List.sortedGT_append E1 #

∀ {α : Type u_1} [inst : LinearOrder α] {l₁ l₂ : List α},
  (l₁ ++ l₂).SortedGT ↔ l₁.SortedGT ∧ l₂.SortedGT ∧ ∀ a ∈ l₁, ∀ b ∈ l₂, b < a

theorem List.sortedLE_cons E0 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α] {a : α}, (a :: l).SortedLE ↔ (∀ b ∈ l, a ≤ b) ∧ l.SortedLE

theorem List.sortedGE_cons E0 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α] {a : α}, (a :: l).SortedGE ↔ (∀ b ∈ l, b ≤ a) ∧ l.SortedGE

theorem List.sortedLT_cons E0 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α] {a : α}, (a :: l).SortedLT ↔ (∀ b ∈ l, a < b) ∧ l.SortedLT

theorem List.sortedGT_cons E0 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α] {a : α}, (a :: l).SortedGT ↔ (∀ b ∈ l, b < a) ∧ l.SortedGT

theorem List.sortedLE_concat E1 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α] {a : α}, (l.concat a).SortedLE ↔ (∀ b ∈ l, b ≤ a) ∧ l.SortedLE

theorem List.sortedGE_concat E1 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α] {a : α}, (l.concat a).SortedGE ↔ (∀ b ∈ l, a ≤ b) ∧ l.SortedGE

theorem List.sortedLT_concat E1 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α] {a : α}, (l.concat a).SortedLT ↔ (∀ b ∈ l, b < a) ∧ l.SortedLT

theorem List.sortedGT_concat E1 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α] {a : α}, (l.concat a).SortedGT ↔ (∀ b ∈ l, a < b) ∧ l.SortedGT

theorem List.SortedLT.getElem_le_getElem_iff E0 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α],
  l.SortedLT → ∀ {i j : ℕ} {hi : i < l.length} {hj : j < l.length}, l[i] ≤ l[j] ↔ i ≤ j

theorem List.SortedGT.getElem_le_getElem_iff E0 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α],
  l.SortedGT → ∀ {i j : ℕ} {hi : i < l.length} {hj : j < l.length}, l[i] ≤ l[j] ↔ j ≤ i

theorem List.SortedLT.getElem_lt_getElem_iff E0 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α],
  l.SortedLT → ∀ {i j : ℕ} {hi : i < l.length} {hj : j < l.length}, l[i] < l[j] ↔ i < j

theorem List.SortedGT.getElem_lt_getElem_iff E0 #

∀ {α : Type u_1} {l : List α} [inst : LinearOrder α],
  l.SortedGT → ∀ {i j : ℕ} {hi : i < l.length} {hj : j < l.length}, l[i] < l[j] ↔ j < i

theorem RelEmbedding.pairwise_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} {ra : α → α → Prop} {rb : β → β → Prop} (e : ra ↪r rb) {l : List α},
  List.Pairwise rb (List.map (⇑e) l) ↔ List.Pairwise ra l

theorem RelEmbedding.pairwise_swap_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} {ra : α → α → Prop} {rb : β → β → Prop} (e : ra ↪r rb) {l : List α},
  List.Pairwise (Function.swap rb) (List.map (⇑e) l) ↔ List.Pairwise (Function.swap ra) l

theorem RelIso.pairwise_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} {ra : α → α → Prop} {rb : β → β → Prop} (e : ra ≃r rb) {l : List α},
  List.Pairwise rb (List.map (⇑e) l) ↔ List.Pairwise ra l

theorem RelIso.pairwise_swap_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} {ra : α → α → Prop} {rb : β → β → Prop} (e : ra ≃r rb) {l : List α},
  List.Pairwise (Function.swap rb) (List.map (⇑e) l) ↔ List.Pairwise (Function.swap ra) l

theorem OrderEmbedding.sortedLE_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] (e : α ↪o β) {l : List α},
  (List.map (⇑e) l).SortedLE ↔ l.SortedLE

theorem OrderEmbedding.sortedLT_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] (e : α ↪o β) {l : List α},
  (List.map (⇑e) l).SortedLT ↔ l.SortedLT

theorem OrderEmbedding.sortedGE_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] (e : α ↪o β) {l : List α},
  (List.map (⇑e) l).SortedGE ↔ l.SortedGE

theorem OrderEmbedding.sortedGT_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] (e : α ↪o β) {l : List α},
  (List.map (⇑e) l).SortedGT ↔ l.SortedGT

theorem OrderIso.sortedLT_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] (e : α ≃o β) {l : List α},
  (List.map (⇑e) l).SortedLT ↔ l.SortedLT

theorem OrderIso.sortedGT_listMap E0 #

∀ {α : Type u_1} {β : Type u_2} [inst : Preorder α] [inst_1 : Preorder β] (e : α ≃o β) {l : List α},
  (List.map (⇑e) l).SortedGT ↔ l.SortedGT

theorem StrictMono.sortedLE_listMap E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β} {l : List α},
  StrictMono f → ((List.map f l).SortedLE ↔ l.SortedLE)

theorem StrictMono.sortedGE_listMap E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β} {l : List α},
  StrictMono f → ((List.map f l).SortedGE ↔ l.SortedGE)

theorem StrictMono.sortedLT_listMap E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β} {l : List α},
  StrictMono f → ((List.map f l).SortedLT ↔ l.SortedLT)

theorem StrictMono.sortedGT_listMap E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β} {l : List α},
  StrictMono f → ((List.map f l).SortedGT ↔ l.SortedGT)

theorem StrictAnti.sortedLE_listMap E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β} {l : List α},
  StrictAnti f → ((List.map f l).SortedLE ↔ l.SortedGE)

theorem StrictAnti.sortedGE_listMap E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β} {l : List α},
  StrictAnti f → ((List.map f l).SortedGE ↔ l.SortedLE)

theorem StrictAnti.sortedLT_listMap E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β} {l : List α},
  StrictAnti f → ((List.map f l).SortedLT ↔ l.SortedGT)

theorem StrictAnti.sortedGT_listMap E1 #

∀ {α : Type u_1} {β : Type u_2} [inst : LinearOrder α] [inst_1 : Preorder β] {f : α → β} {l : List α},
  StrictAnti f → ((List.map f l).SortedGT ↔ l.SortedLT)