Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

[Merged by Bors] - feat(tactic/positivity): Extension for finset.card#16637

Closed
YaelDillies wants to merge 4 commits intomasterfrom
positivity_finset_card
Closed

[Merged by Bors] - feat(tactic/positivity): Extension for finset.card#16637
YaelDillies wants to merge 4 commits intomasterfrom
positivity_finset_card

Conversation

@YaelDillies
Copy link
Copy Markdown
Collaborator

A best effort positivity extension for finset.card. This looks for an assumption of the form s.nonempty in context to prove 0 < s.card.


Open in Gitpod

@YaelDillies YaelDillies added awaiting-review The author would like community review of the PR t-meta Tactics, attributes or user commands labels Sep 25, 2022
Copy link
Copy Markdown
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it straightforward to extend this to fintype.card?

@Vierkantor
Copy link
Copy Markdown
Collaborator

Is it straightforward to extend this to fintype.card?

You mean by looking for a nonempty instance? Sounds good to me.

Copy link
Copy Markdown
Collaborator

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with Eric's suggestion.

bors d+

/-- Extension for the `positivity` tactic: `finset.card s` is positive if `s` is nonempty. -/
@[positivity]
meta def positivity_finset_card : expr → tactic strictness
| `(finset.card %%s) := do -- TODO: Partial decision procedure for `finset.nonempty`
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we discussed via PMs on Zulip last week, this TODO might be only relevant once we get access to Aesop, since this decision procedure can easily start cycling.

I do think that it's fine to make the user add finset.nonempty hypotheses before calling positivity, so this looks good to me.

@bors
Copy link
Copy Markdown

bors bot commented Sep 29, 2022

✌️ YaelDillies can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@leanprover-community-bot-assistant leanprover-community-bot-assistant added the delegated The PR author may merge after reviewing final suggestions. label Sep 29, 2022
@Vierkantor Vierkantor self-assigned this Sep 29, 2022
@leanprover-community-bot-assistant leanprover-community-bot-assistant removed the awaiting-review The author would like community review of the PR label Sep 29, 2022
@YaelDillies
Copy link
Copy Markdown
Collaborator Author

bors merge

bors bot pushed a commit that referenced this pull request Sep 29, 2022
A best effort `positivity` extension for `finset.card`. This looks for an assumption of the form `s.nonempty` in context to prove `0 < s.card`.
@bors
Copy link
Copy Markdown

bors bot commented Sep 29, 2022

Build failed:

@YaelDillies
Copy link
Copy Markdown
Collaborator Author

This is fallout from positivity_coe. There's a bug in the positive nat.cast case that didn't get caught during review. I wrote the fix in several PRs now, so I know it works and the queue is currently empty anyway so let's try merging again.

bors merge

bors bot pushed a commit that referenced this pull request Sep 30, 2022
A best effort `positivity` extension for `finset.card`. This looks for an assumption of the form `s.nonempty` in context to prove `0 < s.card`.
@bors
Copy link
Copy Markdown

bors bot commented Sep 30, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(tactic/positivity): Extension for finset.card [Merged by Bors] - feat(tactic/positivity): Extension for finset.card Sep 30, 2022
@bors bors bot closed this Sep 30, 2022
@bors bors bot deleted the positivity_finset_card branch September 30, 2022 03:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

delegated The PR author may merge after reviewing final suggestions. t-meta Tactics, attributes or user commands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants