File: Mathlib/Order/Compare.lean

full_name: cmpLE
code: /-- Like `cmp`, but uses a `≤` on the type instead of `<`. Given two elements `x` and `y`, returns a
three-way comparison result `Ordering`. -/
def cmpLE {α} [LE α] [@DecidableRel α (· ≤ ·)] (x y : α) : Ordering 
goal: Ordering

full_name: cmpLE_swap
code: theorem cmpLE_swap {α} [LE α] [IsTotal α (· ≤ ·)] [@DecidableRel α (· ≤ ·)] (x y : α) :
    (cmpLE x y).swap = cmpLE y x 
goal: (cmpLE x y).swap = cmpLE y x

full_name: cmpLE_eq_cmp
code: theorem cmpLE_eq_cmp {α} [Preorder α] [IsTotal α (· ≤ ·)] [@DecidableRel α (· ≤ ·)]
    [@DecidableRel α (· < ·)] (x y : α) : cmpLE x y = cmp x y 
goal: cmpLE x y = cmp x y

full_name: Ordering.Compares
code: /-- `Compares o a b` means that `a` and `b` have the ordering relation `o` between them, assuming
that the relation `a < b` is defined. -/
-- Porting note: we have removed `@[simp]` here in favour of separate simp lemmas,
-- otherwise this definition will unfold to a match.
def Compares [LT α] : Ordering → α → α → Prop
  
goal: Ordering → α → α → Prop

full_name: Ordering.compares_lt
code: @[simp]
lemma compares_lt [LT α] (a b : α) : Compares lt a b = (a < b) 
goal: Ordering.lt.Compares a b = (a < b)

full_name: Ordering.compares_eq
code: @[simp]
lemma compares_eq [LT α] (a b : α) : Compares eq a b = (a = b) 
goal: Ordering.eq.Compares a b = (a = b)

full_name: Ordering.compares_gt
code: @[simp]
lemma compares_gt [LT α] (a b : α) : Compares gt a b = (a > b) 
goal: Ordering.gt.Compares a b = (a > b)

full_name: Ordering.compares_swap
code: theorem compares_swap [LT α] {a b : α} {o : Ordering} : o.swap.Compares a b ↔ o.Compares b a 
goal: o.swap.Compares a b ↔ o.Compares b a

full_name: Ordering.swap_eq_iff_eq_swap
code: theorem swap_eq_iff_eq_swap {o o' : Ordering} : o.swap = o' ↔ o = o'.swap 
goal: o.swap = o' ↔ o = o'.swap

full_name: Ordering.Compares.eq_lt
code: theorem Compares.eq_lt [Preorder α] : ∀ {o} {a b : α}, Compares o a b → (o = lt ↔ a < b)
  
goal: o.Compares a b → (o = Ordering.lt ↔ a < b)

full_name: Ordering.Compares.ne_lt
code: theorem Compares.ne_lt [Preorder α] : ∀ {o} {a b : α}, Compares o a b → (o ≠ lt ↔ b ≤ a)
  
goal: o.Compares a b → (o ≠ Ordering.lt ↔ b ≤ a)

full_name: Ordering.Compares.eq_eq
code: theorem Compares.eq_eq [Preorder α] : ∀ {o} {a b : α}, Compares o a b → (o = eq ↔ a = b)
  
goal: o.Compares a b → (o = Ordering.eq ↔ a = b)

full_name: Ordering.Compares.eq_gt
code: theorem Compares.eq_gt [Preorder α] {o} {a b : α} (h : Compares o a b) : o = gt ↔ b < a 
goal: o = Ordering.gt ↔ b < a

full_name: Ordering.Compares.ne_gt
code: theorem Compares.ne_gt [Preorder α] {o} {a b : α} (h : Compares o a b) : o ≠ gt ↔ a ≤ b 
goal: o ≠ Ordering.gt ↔ a ≤ b

full_name: Ordering.Compares.le_total
code: theorem Compares.le_total [Preorder α] {a b : α} : ∀ {o}, Compares o a b → a ≤ b ∨ b ≤ a
  
goal: o.Compares a b → a ≤ b ∨ b ≤ a

full_name: Ordering.Compares.le_antisymm
code: theorem Compares.le_antisymm [Preorder α] {a b : α} : ∀ {o}, Compares o a b → a ≤ b → b ≤ a → a = b
  
goal: o.Compares a b → a ≤ b → b ≤ a → a = b

full_name: Ordering.Compares.inj
code: theorem Compares.inj [Preorder α] {o₁} :
    ∀ {o₂} {a b : α}, Compares o₁ a b → Compares o₂ a b → o₁ = o₂
  
goal: o₁.Compares a b → o₂.Compares a b → o₁ = o₂

full_name: Ordering.compares_iff_of_compares_impl
code: theorem compares_iff_of_compares_impl [LinearOrder α] [Preorder β] {a b : α} {a' b' : β}
    (h : ∀ {o}, Compares o a b → Compares o a' b') (o) : Compares o a b ↔ Compares o a' b' 
goal: o.Compares a b ↔ o.Compares a' b'

full_name: Ordering.swap_orElse
code: theorem swap_orElse (o₁ o₂) : (orElse o₁ o₂).swap = orElse o₁.swap o₂.swap 
goal: (o₁.orElse o₂).swap = o₁.swap.orElse o₂.swap

full_name: Ordering.orElse_eq_lt
code: theorem orElse_eq_lt (o₁ o₂) : orElse o₁ o₂ = lt ↔ o₁ = lt ∨ o₁ = eq ∧ o₂ = lt 
goal: o₁.orElse o₂ = Ordering.lt ↔ o₁ = Ordering.lt ∨ o₁ = Ordering.eq ∧ o₂ = Ordering.lt

full_name: toDual_compares_toDual
code: @[simp]
theorem toDual_compares_toDual [LT α] {a b : α} {o : Ordering} :
    Compares o (toDual a) (toDual b) ↔ Compares o b a 
goal: o.Compares (OrderDual.toDual a) (OrderDual.toDual b) ↔ o.Compares b a

full_name: ofDual_compares_ofDual
code: @[simp]
theorem ofDual_compares_ofDual [LT α] {a b : αᵒᵈ} {o : Ordering} :
    Compares o (ofDual a) (ofDual b) ↔ Compares o b a 
goal: o.Compares (OrderDual.ofDual a) (OrderDual.ofDual b) ↔ o.Compares b a

full_name: cmp_compares
code: theorem cmp_compares [LinearOrder α] (a b : α) : (cmp a b).Compares a b 
goal: (cmp a b).Compares a b

full_name: Ordering.Compares.cmp_eq
code: theorem Ordering.Compares.cmp_eq [LinearOrder α] {a b : α} {o : Ordering} (h : o.Compares a b) :
    cmp a b = o 
goal: cmp a b = o

full_name: cmp_swap
code: @[simp]
theorem cmp_swap [Preorder α] [@DecidableRel α (· < ·)] (a b : α) : (cmp a b).swap = cmp b a 
goal: (cmp a b).swap = cmp b a

full_name: cmpLE_toDual
code: @[simp, nolint simpNF]
theorem cmpLE_toDual [LE α] [@DecidableRel α (· ≤ ·)] (x y : α) :
    cmpLE (toDual x) (toDual y) = cmpLE y x 
goal: cmpLE (OrderDual.toDual x) (OrderDual.toDual y) = cmpLE y x

full_name: cmpLE_ofDual
code: @[simp]
theorem cmpLE_ofDual [LE α] [@DecidableRel α (· ≤ ·)] (x y : αᵒᵈ) :
    cmpLE (ofDual x) (ofDual y) = cmpLE y x 
goal: cmpLE (OrderDual.ofDual x) (OrderDual.ofDual y) = cmpLE y x

full_name: cmp_toDual
code: @[simp, nolint simpNF]
theorem cmp_toDual [LT α] [@DecidableRel α (· < ·)] (x y : α) :
    cmp (toDual x) (toDual y) = cmp y x 
goal: cmp (OrderDual.toDual x) (OrderDual.toDual y) = cmp y x

full_name: cmp_ofDual
code: @[simp]
theorem cmp_ofDual [LT α] [@DecidableRel α (· < ·)] (x y : αᵒᵈ) :
    cmp (ofDual x) (ofDual y) = cmp y x 
goal: cmp (OrderDual.ofDual x) (OrderDual.ofDual y) = cmp y x

full_name: linearOrderOfCompares
code: /-- Generate a linear order structure from a preorder and `cmp` function. -/
def linearOrderOfCompares [Preorder α] (cmp : α → α → Ordering)
    (h : ∀ a b, (cmp a b).Compares a b) : LinearOrder α 
goal: LinearOrder α

full_name: cmp_eq_lt_iff
code: @[simp]
theorem cmp_eq_lt_iff : cmp x y = Ordering.lt ↔ x < y 
goal: cmp x y = Ordering.lt ↔ x < y

full_name: cmp_eq_eq_iff
code: @[simp]
theorem cmp_eq_eq_iff : cmp x y = Ordering.eq ↔ x = y 
goal: cmp x y = Ordering.eq ↔ x = y

full_name: cmp_eq_gt_iff
code: @[simp]
theorem cmp_eq_gt_iff : cmp x y = Ordering.gt ↔ y < x 
goal: cmp x y = Ordering.gt ↔ y < x

full_name: cmp_self_eq_eq
code: @[simp]
theorem cmp_self_eq_eq : cmp x x = Ordering.eq 
goal: cmp x x = Ordering.eq

full_name: cmp_eq_cmp_symm
code: theorem cmp_eq_cmp_symm : cmp x y = cmp x' y' ↔ cmp y x = cmp y' x' 
goal: cmp x y = cmp x' y' ↔ cmp y x = cmp y' x'

full_name: lt_iff_lt_of_cmp_eq_cmp
code: theorem lt_iff_lt_of_cmp_eq_cmp (h : cmp x y = cmp x' y') : x < y ↔ x' < y' 
goal: x < y ↔ x' < y'

full_name: le_iff_le_of_cmp_eq_cmp
code: theorem le_iff_le_of_cmp_eq_cmp (h : cmp x y = cmp x' y') : x ≤ y ↔ x' ≤ y' 
goal: x ≤ y ↔ x' ≤ y'

full_name: eq_iff_eq_of_cmp_eq_cmp
code: theorem eq_iff_eq_of_cmp_eq_cmp (h : cmp x y = cmp x' y') : x = y ↔ x' = y' 
goal: x = y ↔ x' = y'

full_name: LT.lt.cmp_eq_lt
code: theorem LT.lt.cmp_eq_lt (h : x < y) : cmp x y = Ordering.lt 
goal: cmp x y = Ordering.lt

full_name: LT.lt.cmp_eq_gt
code: theorem LT.lt.cmp_eq_gt (h : x < y) : cmp y x = Ordering.gt 
goal: cmp y x = Ordering.gt

full_name: Eq.cmp_eq_eq
code: theorem Eq.cmp_eq_eq (h : x = y) : cmp x y = Ordering.eq 
goal: cmp x y = Ordering.eq

full_name: Eq.cmp_eq_eq'
code: theorem Eq.cmp_eq_eq' (h : x = y) : cmp y x = Ordering.eq 
goal: cmp y x = Ordering.eq