Zulip Chat Archive

Stream: lean4

Topic: resolve match trivially to one arm


Bhakti Shah (Jul 05 2023 at 17:53):

I have a goal like

(none !=
    match h == h with
    | true => some h
    | false => sorry =
  true

h : α where there is a BEq instance for α. How do i resolve the match statement to just some h? Thanks!

James Gallicchio (Jul 05 2023 at 17:56):

This is only true if it's LawfulBEq I think. Once that's in context the simp lemmas should clean it up?

Bhakti Shah (Jul 05 2023 at 17:57):

James Gallicchio said:

This is only true if it's LawfulBEq I think. Once that's in context the simp lemmas should clean it up?

Ahh i don't have that instance, that makes sense. Thanks :)

James Gallicchio (Jul 05 2023 at 18:50):

btw, you might find it more ergonomic to just use DecidableEq instead of BEq. You can usually auto-derive DecidableEq for new types.

Bhakti Shah (Jul 05 2023 at 18:55):

That is what I decided to do! Unfortunately I can't autoderive, I need to use my own definition and I think that's where most of my problems are stemming from (even with the BEq stuff)


Last updated: Dec 20 2023 at 11:08 UTC