File: .lake/packages/lean4/src/lean/lake/Lake/Util/Compare.lean

full_name: Lake.EqOfCmp
code: /--
Proof that the equality of a compare function corresponds
to propositional equality.
-/
class EqOfCmp (α : Type u) (cmp : α → α → Ordering) where
  eq_of_cmp {a a' : α} : cmp a a' = .eq → a = a'
goal: Type

full_name: Lake.EqOfCmp.eq_of_cmp
code: /--
Proof that the equality of a compare function corresponds
to propositional equality.
-/
class EqOfCmp (α : Type u) (cmp : α → α → Ordering) where
  eq_of_cmp {a a' : α} : cmp a a' = .eq → a = a'
goal: cmp a a' = Ordering.eq → a = a'

full_name: Lake.LawfulCmpEq.cmp_rfl
code: /--
Proof that the equality of a compare function corresponds
to propositional equality and vice versa.
-/
class LawfulCmpEq (α : Type u) (cmp : α → α → Ordering) extends EqOfCmp α cmp where
  cmp_rfl {a : α} : cmp a a = .eq
goal: cmp a a = Ordering.eq

full_name: Lake.LawfulCmpEq
code: /--
Proof that the equality of a compare function corresponds
to propositional equality and vice versa.
-/
class LawfulCmpEq (α : Type u) (cmp : α → α → Ordering) extends EqOfCmp α cmp where
  cmp_rfl {a : α} : cmp a a = .eq
goal: Type

full_name: Lake.cmp_iff_eq
code: @[simp] theorem cmp_iff_eq [LawfulCmpEq α cmp] : cmp a a' = .eq ↔ a = a' 
goal: cmp a a' = Ordering.eq ↔ a = a'

full_name: Lake.EqOfCmpWrt.eq_of_cmp_wrt
code: /--
Proof that the equality of a compare function corresponds
to propositional equality with respect to a given function.
-/
class EqOfCmpWrt (α : Type u) {β : Type v} (f : α → β) (cmp : α → α → Ordering) where
  eq_of_cmp_wrt {a a' : α} : cmp a a' = .eq → f a = f a'
goal: cmp a a' = Ordering.eq → f a = f a'

full_name: Lake.EqOfCmpWrt
code: /--
Proof that the equality of a compare function corresponds
to propositional equality with respect to a given function.
-/
class EqOfCmpWrt (α : Type u) {β : Type v} (f : α → β) (cmp : α → α → Ordering) where
  eq_of_cmp_wrt {a a' : α} : cmp a a' = .eq → f a = f a'
goal: Type

full_name: Lake.instEqOfCmpWrt
code: instance : EqOfCmpWrt α (fun _ => α) cmp 
goal: Lake.EqOfCmpWrt α (fun x => α) cmp

full_name: Lake.instEqOfCmpWrtOfEqOfCmp
code: instance [EqOfCmp α cmp] : EqOfCmpWrt α f cmp 
goal: {β : Type u_2} → {f : α → β} → [inst : Lake.EqOfCmp α cmp] → Lake.EqOfCmpWrt α f cmp

full_name: Lake.instEqOfCmpOfEqOfCmpWrt
code: instance [EqOfCmpWrt α (fun a => a) cmp] : EqOfCmp α cmp 
goal: Lake.EqOfCmp α cmp

full_name: Lake.eq_of_compareOfLessAndEq
code: theorem eq_of_compareOfLessAndEq [LT α] [DecidableEq α] {a a' : α}
[Decidable (a < a')] (h : compareOfLessAndEq a a' = .eq) : a = a' 
goal: a = a'

full_name: Lake.compareOfLessAndEq_rfl
code: theorem compareOfLessAndEq_rfl [LT α] [DecidableEq α] {a : α}
[Decidable (a < a)] (lt_irrefl : ¬ a < a) : compareOfLessAndEq a a = .eq 
goal: compareOfLessAndEq a a = Ordering.eq

full_name: Lake.instLawfulCmpEqNatCompare
code: instance : LawfulCmpEq Nat compare 
goal: Lake.LawfulCmpEq Nat compare

full_name: Lake.Fin.eq_of_compare
code: theorem Fin.eq_of_compare {n n' : Fin m} (h : compare n n' = .eq) : n = n' 
goal: n = n'

full_name: Lake.instLawfulCmpEqFinCompare
code: instance : LawfulCmpEq (Fin n) compare 
goal: Lake.LawfulCmpEq (Fin n) compare

full_name: Lake.instLawfulCmpEqUInt64Compare
code: instance : LawfulCmpEq UInt64 compare 
goal: Lake.LawfulCmpEq UInt64 compare

full_name: Lake.List.lt_irrefl
code: theorem List.lt_irrefl [LT α] (irrefl_α : ∀ a : α, ¬ a < a)
: (a : List α) → ¬ a < a

goal: ¬a < a

full_name: Lake.String.lt_irrefl
code: @[simp] theorem String.lt_irrefl (s : String) : ¬ s < s 
goal: ¬s < s

full_name: Lake.instLawfulCmpEqStringCompare
code: instance : LawfulCmpEq String compare 
goal: Lake.LawfulCmpEq String compare

full_name: Lake.Option.compareWith
code: @[macro_inline]
def Option.compareWith (cmp : α → α → Ordering) : Option α → Option α → Ordering

goal: Option α → Option α → Ordering

full_name: Lake.instEqOfCmpOptionCompareWith
code: instance [EqOfCmp α cmp] : EqOfCmp (Option α) (Option.compareWith cmp) 
goal: Lake.EqOfCmp (Option α) (Lake.Option.compareWith cmp)

full_name: Lake.instLawfulCmpEqOptionCompareWith
code: instance [LawfulCmpEq α cmp] : LawfulCmpEq (Option α) (Option.compareWith cmp) 
goal: Lake.LawfulCmpEq (Option α) (Lake.Option.compareWith cmp)

full_name: Lake.Prod.compareWith
code: def Prod.compareWith
(cmpA : α → α → Ordering) (cmpB : β → β → Ordering)
: (α × β) → (α × β) → Ordering 
goal: α × β → α × β → Ordering

full_name: Lake.instEqOfCmpProdCompareWith
code: instance [EqOfCmp α cmpA] [EqOfCmp β cmpB]
: EqOfCmp (α × β) (Prod.compareWith cmpA cmpB) 
goal: Lake.EqOfCmp (α × β) (Lake.Prod.compareWith cmpA cmpB)

full_name: Lake.instLawfulCmpEqProdCompareWith
code: instance [LawfulCmpEq α cmpA] [LawfulCmpEq β cmpB]
: LawfulCmpEq (α × β) (Prod.compareWith cmpA cmpB) 
goal: Lake.LawfulCmpEq (α × β) (Lake.Prod.compareWith cmpA cmpB)