Skip to content

Commit

Permalink
chore: adjust DecidableRel instance for leOfOrd
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-em committed Sep 30, 2024
1 parent 4f2c4c7 commit b84049d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Init/Data/Ord.lean
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,15 @@ def lexOrd [Ord α] [Ord β] : Ord (α × β) where
def ltOfOrd [Ord α] : LT α where
lt a b := compare a b = Ordering.lt

instance [Ord α] : DecidableRel (@LT.lt α ltOfOrd) :=
attribute [local instance] ltOfOrd in
instance [Ord α] : DecidableRel ((· : α) < ·) :=
inferInstanceAs (DecidableRel (fun a b => compare a b = Ordering.lt))

def leOfOrd [Ord α] : LE α where
le a b := (compare a b).isLE

instance [Ord α] : DecidableRel (@LE.le α leOfOrd) :=
attribute [local instance] leOfOrd in
instance [Ord α] : DecidableRel ((· : α) ≤ ·) :=
inferInstanceAs (DecidableRel (fun a b => (compare a b).isLE))

namespace Ord
Expand Down

0 comments on commit b84049d

Please sign in to comment.