Skip to content

Instantly share code, notes, and snippets.

@cppio
Created January 18, 2023 16:17
Show Gist options
  • Select an option

  • Save cppio/e265729e3cd415ec8ecff0759338b583 to your computer and use it in GitHub Desktop.

Select an option

Save cppio/e265729e3cd415ec8ecff0759338b583 to your computer and use it in GitHub Desktop.
def beq_of_eq {α : Type u} [BEq α] [LawfulBEq α] {a b : α} : a = b → a == b := (· ▸ LawfulBEq.rfl)
instance [BEq α] [LawfulBEq α] : DecidableEq α
| x, y => if h : x == y then isTrue (eq_of_beq h) else isFalse (h ∘ beq_of_eq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment