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

[Merged by Bors] - feat: demote the instance Fintype.ofIsEmpty to a def #8816

Closed
wants to merge 20 commits into from

Conversation

sgouezel
Copy link
Contributor

@sgouezel sgouezel commented Dec 4, 2023

Rationale: this instance creates (empty) data out of nothing, which may conflict with other data. If you have in the context [Fintype i] and case on whether i is empty or not, then this gave two non-defeq instances of [Fintype i] around.


Open in Gitpod

@sgouezel sgouezel added the awaiting-review The author would like community review of the PR label Dec 4, 2023
Mathlib/Data/Fintype/Basic.lean Outdated Show resolved Hide resolved
Mathlib/Data/Set/Finite.lean Outdated Show resolved Hide resolved
Mathlib/SetTheory/Cardinal/Cofinality.lean Outdated Show resolved Hide resolved
Mathlib/SetTheory/Game/Short.lean Outdated Show resolved Hide resolved
@jcommelin jcommelin added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review The author would like community review of the PR labels Dec 4, 2023
Comment on lines 225 to 230
/-- Note: this lemma is specifically about `Fintype.of_is_empty`. For a statement about
arbitrary `Fintype` instances, use `Fintype.card_eq_zero_iff`. -/
@[simp]
theorem card_of_isEmpty [IsEmpty α] : Fintype.card α = 0 :=
rfl
#align fintype.card_of_is_empty Fintype.card_of_isEmpty
Copy link
Member

Choose a reason for hiding this comment

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

We should keep this lemma, but stated using a letI := Fintype.ofIsEmpty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a particular case of card_eq_zero, so why keep it?

Copy link
Member

Choose a reason for hiding this comment

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

Because this one works with dsimp

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I've added it back.

@sgouezel sgouezel added awaiting-review The author would like community review of the PR and removed awaiting-author A reviewer has asked the author a question or requested changes labels Dec 6, 2023
@urkud
Copy link
Member

urkud commented Dec 16, 2023

Thanks! 🎉
bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Dec 16, 2023
mathlib-bors bot pushed a commit that referenced this pull request Dec 16, 2023
Rationale: this instance creates (empty) data out of nothing, which may conflict with other data. If you have in the context `[Fintype i]` and case on whether `i` is empty or not, then this gave two non-defeq instances of `[Fintype i]` around.
@mathlib-bors
Copy link

mathlib-bors bot commented Dec 17, 2023

Build failed:

@urkud
Copy link
Member

urkud commented Dec 17, 2023

Please merge master and fix the compile error.
bors r-
bors d+

@mathlib-bors
Copy link

mathlib-bors bot commented Dec 17, 2023

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

@sgouezel
Copy link
Contributor Author

bors r+

mathlib-bors bot pushed a commit that referenced this pull request Dec 18, 2023
Rationale: this instance creates (empty) data out of nothing, which may conflict with other data. If you have in the context `[Fintype i]` and case on whether `i` is empty or not, then this gave two non-defeq instances of `[Fintype i]` around.
@mathlib-bors
Copy link

mathlib-bors bot commented Dec 18, 2023

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: demote the instance Fintype.ofIsEmpty to a def [Merged by Bors] - feat: demote the instance Fintype.ofIsEmpty to a def Dec 18, 2023
@mathlib-bors mathlib-bors bot closed this Dec 18, 2023
@mathlib-bors mathlib-bors bot deleted the SG_fintype_isempty branch December 18, 2023 11:11
awueth pushed a commit that referenced this pull request Dec 19, 2023
Rationale: this instance creates (empty) data out of nothing, which may conflict with other data. If you have in the context `[Fintype i]` and case on whether `i` is empty or not, then this gave two non-defeq instances of `[Fintype i]` around.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
delegated ready-to-merge This PR has been sent to bors.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants