Skip to content

feat: add Decidable, Fintype, Encodable linters#10235

Closed
urkud wants to merge 323 commits intomasterfrom
YK-dec-lint
Closed

feat: add Decidable, Fintype, Encodable linters#10235
urkud wants to merge 323 commits intomasterfrom
YK-dec-lint

Conversation

@urkud
Copy link
Copy Markdown
Member

@urkud urkud commented Feb 4, 2024

This PR ports the decidableClassical, fintypeFinite and encodableCountable linters from mathlib3: all three are environment linters which flag declarations that have a hypothesis [Decidable p] etc., but do not use the underlying assumption in this type. Restructuring the code can make the statement more general.
The implementation is in fact quite general, and can easily adapt to include further types. PRs #17518 and #17519 are two examples of further such linters.


Please don't fix the failures related to HasFDerivWithinAt.pi. Finiteness assumptions in these lemmas will be completely removed during porting to TVS.

Open in Gitpod

@urkud urkud added the t-meta Tactics, attributes or user commands label Feb 4, 2024
urkud added a commit that referenced this pull request Feb 4, 2024
@ghost ghost added the blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) label Feb 4, 2024
mathlib-bors bot pushed a commit that referenced this pull request Feb 4, 2024
@ghost ghost added merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) and removed blocked-by-other-PR This PR depends on another PR (this label is automatically managed by a bot) labels Feb 5, 2024
Vierkantor pushed a commit that referenced this pull request Feb 5, 2024
@ghost ghost removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) label Feb 6, 2024
atarnoam pushed a commit that referenced this pull request Feb 9, 2024
Also rename `Presieve.extensive` to `Presieve.Extensive`
to follow the naming convention.
- don't assume `DecidableEq` in `card_edgeFinset_le_card_choose_two`;
- make `edgeFinset_deleteEdges` work with any `Fintype G.edgeSet`
  and `Fintype (G.deleteEdges s).edgeSet` instances;
- don't assume `DecidbaleEq` in theorems about `DeleteFar`.
@urkud
Copy link
Copy Markdown
Member Author

urkud commented Feb 16, 2025

Note: I'm working on HasFDerivAt.pi etc. I want to do it the right way (drop the Normed* assumptions at the same time), should be ready for review soon.

@Vierkantor
Copy link
Copy Markdown
Contributor

This PR is flagged as awaiting-author, what are you planning to do before this is ready for review? I would like to see this PR in Mathlib somewhat soon so I am willing to help out fix some of the build errors.

@mathlib4-merge-conflict-bot
Copy link
Copy Markdown
Collaborator

This pull request has conflicts, please merge master and resolve them.

@thorimur
Copy link
Copy Markdown
Contributor

I started (and finished) porting the decidableClassical linter at #31142 without knowledge of this PR; I hope that's alright! :)

One major difference is that I wrote a syntax linter instead of an environment linter, so that it runs while editing. I also tried to take some care with performance, and avoided telescopes entirely until constructing the suggestion itself (which is allowed to be expensive, since it's impermanent). I also only lint user-written declarations due to searching the infotrees instead of the environment (which goes a bit beyond isAutoDecl, if I recall), and stick to linting theorems (and lemmas, and instances of Prop-valued classes).

Let me know what you think! I'm happy to pick up the torch if that's alright.

@grunweg
Copy link
Copy Markdown
Contributor

grunweg commented Feb 15, 2026

Can this PR be closed now, or is there anything else that's missing? If so, we could track that in #35340.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-author A reviewer has asked the author a question or requested changes. awaiting-bench This PR needs to be benchmarked before merging large-import Automatically added label for PRs with a significant increase in transitive imports merge-conflict The PR has a merge conflict with master, and needs manual merging. (this label is managed by a bot) t-linter Linter t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.