Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tactic/lint): check if inhabited instances should be nonempty #1971

Merged
merged 17 commits into from Feb 11, 2020

Conversation

robertylewis
Copy link
Member

This was mentioned here and in #1924. In a theorem or lemma, an argument of type inhabited that isn't used in following arguments or in the type can be (constructively) weakened to nonempty.

For convenience, this PR also adds a tactic inhabit α that upgrades a nonempty α instance in the local context to inhabited α.

TO CONTRIBUTORS:

Make sure you have:

  • reviewed and applied the coding style: coding, naming
  • reviewed and applied the documentation requirements
  • for tactics:
  • make sure definitions and lemmas are put in the right files
  • make sure definitions and lemmas are not redundant

If this PR is related to a discussion on Zulip, please include a link in the discussion.

For reviewers: code review check list

@robertylewis robertylewis added the awaiting-review The author would like community review of the PR label Feb 10, 2020
@robertylewis
Copy link
Member Author

Well, that's good to know: GH Actions does build a merge commit on PR builds. I was wondering if/how to avoid the duplicate PR and branch builds, but they're apparently not duplicates.

Copy link
Member

@fpvandoorn fpvandoorn left a comment

Choose a reason for hiding this comment

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

LGTM, but there are currently some conflicts.

@fpvandoorn fpvandoorn removed the awaiting-review The author would like community review of the PR label Feb 10, 2020
@robertylewis
Copy link
Member Author

Well, that was fast, I rebased it this afternoon. Will fix tomorrow.

@robertylewis robertylewis added the ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) label Feb 11, 2020
@mergify mergify bot merged commit 176852d into master Feb 11, 2020
@mergify mergify bot deleted the nonempty_linter branch February 11, 2020 13:45
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 15, 2020
…eanprover-community#1971)

* add inhabited vs nonempty linter

* add new linter to ci

* start updating files to pass linter

* more linter fixes

* fix more linter errors

* more fixes

* fix build

* remove unnecessary instances

* nicer proof

* adjust inhabit tactic

* improve proof

* move instance to better place

* generalize instance

* fix build

* inhabited -> nonempty

* fix build
anrddh pushed a commit to anrddh/mathlib that referenced this pull request May 16, 2020
…eanprover-community#1971)

* add inhabited vs nonempty linter

* add new linter to ci

* start updating files to pass linter

* more linter fixes

* fix more linter errors

* more fixes

* fix build

* remove unnecessary instances

* nicer proof

* adjust inhabit tactic

* improve proof

* move instance to better place

* generalize instance

* fix build

* inhabited -> nonempty

* fix build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants