Documentation

Mathlib.Data.List.Lex

Lexicographic ordering of lists. #

The lexicographic order on List α is defined by L < M iff

See also #

Related files are:

lexicographic ordering #

theorem List.Lex.cons_iff {α : Type u} {r : ααProp} [IsIrrefl α r] {a : α} {l₁ l₂ : List α} :
List.Lex r (a :: l₁) (a :: l₂) List.Lex r l₁ l₂
@[deprecated List.not_lex_nil (since := "2024-12-21")]
theorem List.Lex.not_nil_right {α✝ : Type u_1} {r : α✝α✝Prop} {l : List α✝} :
¬List.Lex r l []

Alias of List.not_lex_nil.

theorem List.Lex.nil_left_or_eq_nil {α : Type u} {r : ααProp} (l : List α) :
List.Lex r [] l l = []
@[simp]
theorem List.Lex.singleton_iff {α : Type u} {r : ααProp} (a b : α) :
List.Lex r [a] [b] r a b
instance List.Lex.isOrderConnected {α : Type u} (r : ααProp) [IsOrderConnected α r] [IsTrichotomous α r] :
theorem List.Lex.isOrderConnected.aux {α : Type u} (r : ααProp) [IsOrderConnected α r] [IsTrichotomous α r] (x✝ x✝¹ x✝² : List α) :
List.Lex r x✝ x✝²List.Lex r x✝ x✝¹ List.Lex r x✝¹ x✝²
instance List.Lex.isTrichotomous {α : Type u} (r : ααProp) [IsTrichotomous α r] :
theorem List.Lex.isTrichotomous.aux {α : Type u} (r : ααProp) [IsTrichotomous α r] (x✝ x✝¹ : List α) :
List.Lex r x✝ x✝¹ x✝ = x✝¹ List.Lex r x✝¹ x✝
instance List.Lex.isAsymm {α : Type u} (r : ααProp) [IsAsymm α r] :
theorem List.Lex.isAsymm.aux {α : Type u} (r : ααProp) [IsAsymm α r] (x✝ x✝¹ : List α) :
List.Lex r x✝ x✝¹List.Lex r x✝¹ x✝False
@[deprecated "No deprecation message was provided." (since := "2024-07-30")]
instance List.Lex.isStrictTotalOrder {α : Type u} (r : ααProp) [IsStrictTotalOrder α r] :
instance List.Lex.decidableRel {α : Type u} [DecidableEq α] (r : ααProp) [DecidableRel r] :
Equations
theorem List.Lex.append_right {α : Type u} (r : ααProp) {s₁ s₂ : List α} (t : List α) :
List.Lex r s₁ s₂List.Lex r s₁ (s₂ ++ t)
theorem List.Lex.append_left {α : Type u} (R : ααProp) {t₁ t₂ : List α} (h : List.Lex R t₁ t₂) (s : List α) :
List.Lex R (s ++ t₁) (s ++ t₂)
theorem List.Lex.imp {α : Type u} {r s : ααProp} (H : ∀ (a b : α), r a bs a b) (l₁ l₂ : List α) :
List.Lex r l₁ l₂List.Lex s l₁ l₂
theorem List.Lex.to_ne {α : Type u} {l₁ l₂ : List α} :
List.Lex (fun (x1 x2 : α) => x1 x2) l₁ l₂l₁ l₂
theorem Decidable.List.Lex.ne_iff {α : Type u} [DecidableEq α] {l₁ l₂ : List α} (H : l₁.length l₂.length) :
List.Lex (fun (x1 x2 : α) => x1 x2) l₁ l₂ l₁ l₂
theorem List.Lex.ne_iff {α : Type u} {l₁ l₂ : List α} (H : l₁.length l₂.length) :
List.Lex (fun (x1 x2 : α) => x1 x2) l₁ l₂ l₁ l₂
instance List.LT' {α : Type u} [LT α] :
LT (List α)
Equations
Equations
instance List.LE' {α : Type u} [LinearOrder α] :
LE (List α)
Equations
theorem List.lt_iff_lex_lt {α : Type u} [LinearOrder α] (l l' : List α) :
l.lt l' List.Lex (fun (x1 x2 : α) => x1 < x2) l l'
theorem List.head_le_of_lt {α : Type u} [Preorder α] {a a' : α} {l l' : List α} (h : a' :: l' < a :: l) :
a' a
theorem List.head!_le_of_lt {α : Type u} [Preorder α] [Inhabited α] (l l' : List α) (h : l' < l) (hl' : l' []) :
l'.head! l.head!
theorem List.cons_le_cons {α : Type u} [LinearOrder α] (a : α) {l l' : List α} (h : l' l) :
a :: l' a :: l