Zulip Chat Archive

Stream: mathlib4

Topic: decide vs Decidable.to_bool


Chris B (Oct 29 2021 at 21:16):

Is the motivation for having a separate Decidable.to_bool in addition to the prelude's Decide.decide something to do with the @[inlineIfReduce, nospecialize] attributes in core? Which one should users favor when writing lemmas and why?

Chris B (Oct 29 2021 at 21:34):

Also is there a downside to making decide_eq_true_iff and decide_eq_false_iff_not simp lemmas?

David Renshaw (Oct 29 2021 at 22:06):

It looks like I was the one who added Decidable.to_bool, in https://github.com/leanprover-community/mathlib4/pull/34

David Renshaw (Oct 29 2021 at 22:07):

The idea was to mechanically copy things over from the Lean3 prelude.

David Renshaw (Oct 29 2021 at 22:08):

https://github.com/leanprover-community/lean/blob/234e981cebe77b51f8dc8ffce281dd2819695243/library/init/logic.lean#L597

Chris B (Oct 29 2021 at 22:24):

I see. Do you know whether the plan is to eventually harmonize with changes in Lean 4 core (like removing to_bool in favor of the prelude's decide) or is that going to be subordinate to the desire to not have to change mathlib3 stuff?

Mario Carneiro (Oct 29 2021 at 22:37):

If there is a defeq matching, we should align to the lean 4 definition when possible

Mario Carneiro (Oct 29 2021 at 22:38):

which means that translated files will sometimes have some items omitted

Chris B (Oct 30 2021 at 00:11):

Ok thanks, I made a PR.


Last updated: Dec 20 2023 at 11:08 UTC