feat: Decidable as subtype of Bool - #8309
Open
Rob23oba wants to merge 29 commits into
Open
Conversation
Rob23oba
force-pushed
the
decidable-as-bool
branch
from
May 12, 2025 22:17
91e03d3 to
3bc08d6
Compare
|
Mathlib CI status (docs):
|
Rob23oba
force-pushed
the
decidable-as-bool
branch
from
May 14, 2025 10:11
2f09103 to
9f39872
Compare
zwarich
force-pushed
the
new_codegen
branch
2 times, most recently
from
May 15, 2025 19:46
67a965f to
e827467
Compare
Rob23oba
force-pushed
the
decidable-as-bool
branch
from
May 15, 2025 19:50
d1a4f37 to
ab73b1c
Compare
zwarich
force-pushed
the
new_codegen
branch
6 times, most recently
from
May 22, 2025 20:33
a1ed0b3 to
95b6237
Compare
zwarich
force-pushed
the
new_codegen
branch
13 times, most recently
from
May 29, 2025 16:59
e5e4415 to
87f3e3e
Compare
Contributor
Author
|
!radar |
|
Benchmark results for 507f2a8 against 58a8cd7 are in. There are significant results. @Rob23oba
Large changes (11✅, 3🟥)
Medium changes (36✅, 6🟥)
Small changes (418✅, 198🟥)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes the definition of
Decidable pto a structure containing aBooland a proof of eitherpor¬p(basically the approach proposed by @kmill in #2038). Due to bugs in the old compiler, this was previously not possible; however, now that the new compiler is enabled, this works perfectly fine.Using
Boolin the definition ofDecidablehas several advantages, in particulardecidetactic no longer needs to carry proofs with it, improving performance for well-writtenDecidableinstances.LawfulBEqandDecidableEqare now compatible: When using theDecidableEqinstance provided byLawfulBEq,decide (a = b)is definitionally equivalent toa == b.Decidableno longer needs special casing in the compiler.In order to take full advantage from these changes, it is recommended to use the
decidable_of_boolanddecidable_of_ifffunctions to constructDecidableinstances.