feat: Decidable as subtype of Bool - #8309
Merged
Merged
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
TwoFX
reviewed
Aug 18, 2026
TwoFX
left a comment
Member
There was a problem hiding this comment.
Please also make a change to stdlib_flags.h so that CI runs the stage2 build.
This reverts commit d933ce8.
wkrozowski
reviewed
Aug 18, 2026
This reverts commit 42b8359.
TwoFX
reviewed
Aug 19, 2026
TwoFX
left a comment
Member
There was a problem hiding this comment.
I think it would be good to add a test for all the new defeqs that this change achieves, both as a regression test and a bit of documentation of intention.
Member
|
Merging master will resolve the Lake test failures (this is due to a GH Actions quirk) |
3 tasks
Member
|
!radar |
|
Benchmark results for 52a7c6a against 44a3664 are in. There are significant results. @TwoFX
Large changes (9✅, 2🟥)
Medium changes (29✅, 5🟥)
Small changes (365✅, 407🟥)
|
TwoFX
approved these changes
Aug 20, 2026
TwoFX
left a comment
Member
There was a problem hiding this comment.
This is awesome, thank you for the hard work!
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.This is 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.This is a breaking change, but in part due to
Decidable.isTrueandDecidable.isFalseremaining asmatch_patterns, surprisingly few (meta-)programs break.