Skip to content

Commit

Permalink
derive LawfulBEq
Browse files Browse the repository at this point in the history
  • Loading branch information
datokrat committed Jan 28, 2025
1 parent b05f954 commit 527b760
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/Init/Data/Ord.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,10 @@ import Init.Data.Array.Basic

inductive Ordering where
| lt | eq | gt
deriving Inhabited, BEq
deriving Inhabited, DecidableEq

namespace Ordering

deriving instance DecidableEq for Ordering

-- This becomes obsolete with https://github.com/leanprover/lean4/issues/5295
instance : LawfulBEq Ordering where
eq_of_beq {a b} := by cases a <;> cases b <;> simp <;> rfl
rfl {a} := by cases a <;> rfl

/-- Swaps less and greater ordering results -/
def swap : Ordering → Ordering
| .lt => .gt
Expand Down

0 comments on commit 527b760

Please sign in to comment.