[Merged by Bors] - chore: remove unused Decidable* instances in theorem types#31831
Closed
thorimur wants to merge 5 commits intoleanprover-community:masterfrom
Closed
[Merged by Bors] - chore: remove unused Decidable* instances in theorem types#31831thorimur wants to merge 5 commits intoleanprover-community:masterfrom
Decidable* instances in theorem types#31831thorimur wants to merge 5 commits intoleanprover-community:masterfrom
Conversation
PR summary 6ff93aa9daImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
4 tasks
Contributor
|
bors merge |
mathlib-bors bot
pushed a commit
that referenced
this pull request
Nov 20, 2025
This PR removes `Decidable*` instances that are not used by the remainder of a theorem's type and so can be replaced by `classical` in the proof (found by the #31142). This allows us to turn on the `unusedDecidableInType` linter, which is done in #31747. Notes: - We rearrange the order of theorems slightly in [Mathlib/Combinatorics/SimpleGraph/Bipartite.lean](https://github.com/leanprover-community/mathlib4/pull/31747/files#diff-8acbd485d15b1e94a2afaf205ebedba12259361421342c715188192f1b0045f8) in order to put the ones that do require `DecidableRel` in a section. - [lean4#5565](leanprover/lean4#5595) forces us to change two `instance`s to `@[instance] theorem` because of a failure in `omit`. We preserve the autogenerated name here. Co-authored-by: thorimur <thomasmurrills@gmail.com>
urkud
reviewed
Nov 20, 2025
urkud
reviewed
Nov 20, 2025
Contributor
|
bors r- |
Contributor
|
Canceled. |
Contributor
|
bors r+ |
mathlib-bors bot
pushed a commit
that referenced
this pull request
Nov 20, 2025
This PR removes `Decidable*` instances that are not used by the remainder of a theorem's type and so can be replaced by `classical` in the proof (found by the #31142). This allows us to turn on the `unusedDecidableInType` linter, which is done in #31747. Notes: - We rearrange the order of theorems slightly in [Mathlib/Combinatorics/SimpleGraph/Bipartite.lean](https://github.com/leanprover-community/mathlib4/pull/31747/files#diff-8acbd485d15b1e94a2afaf205ebedba12259361421342c715188192f1b0045f8) in order to put the ones that do require `DecidableRel` in a section. - [lean4#5565](leanprover/lean4#5595) forces us to change two `instance`s to `@[instance] theorem` because of a failure in `omit`. We preserve the autogenerated name here. Co-authored-by: thorimur <thomasmurrills@gmail.com>
Contributor
|
Pull request successfully merged into master. Build succeeded: |
Decidable* instances in theorem typesDecidable* instances in theorem types
mathlib-bors bot
pushed a commit
that referenced
this pull request
Nov 29, 2025
This PR turns on the `unusedDecidableInType` syntax linter (#31142) after fixing the remaining violations in #31831, #31934, and #32153. This also imports the linter into Mathlib.Init and adds the linter to the Mathlib standard set. Given that classicality is embedded in Lean, this is probably the behavior downstream repos who use the mathlib standard set want; if they are specifically constructive repos, the linter can always be turned off in the lakefile. We exempt the entirety of [Mathlib/Data/Fintype/Quotient.lean](https://github.com/leanprover-community/mathlib4/pull/31747/files#diff-9591d2f3828bee189ea954bc33586ce451536bf00792362f7cdca4f5a8551207), [Mathlib/Order/Heyting/Regular.lean](https://github.com/leanprover-community/mathlib4/pull/31747/files#diff-af85d99e5d2f5561fe837f662f179c58f1ebe2a4ed0432a15260199883850c50), [Mathlib/Logic/Encodable/Basic.lean](https://github.com/leanprover-community/mathlib4/pull/31747/files#diff-db01c9a2d4726fe7ca0e6eb18a7cd485b5a9c6b26ba422dfbe501dcebef3cf77) and a declaration in [Mathlib/Computability/Halting.lean](https://github.com/leanprover-community/mathlib4/pull/31747/files#diff-d47323ee8b4b2321052b4be93715f8b2f3f840f76ec441d8bf75c834b8665b32) since constructivity is desired there. We also exempt `dec_em'`, which is a variant of `Decidable.em` but with the disjuncts reversed. Many prior violations have already been fixed through the use of #10235, hence the small number of violations picked up by the syntax linter. Co-authored-by: thorimur <thomasmurrills@gmail.com> Co-authored-by: Michael Rothgang <rothgang@math.uni-bonn.de>
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 removes
Decidable*instances that are not used by the remainder of a theorem's type and so can be replaced byclassicalin the proof (found by the #31142). This allows us to turn on theunusedDecidableInTypelinter, which is done in #31747.Notes:
DecidableRelin a section.instances to@[instance] theorembecause of a failure inomit. We preserve the autogenerated name here.