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(set_theory/cardinal/basic): lemmas about #(finset α) #14850

Closed
wants to merge 12 commits into from

Conversation

vihdzp
Copy link
Collaborator

@vihdzp vihdzp commented Jun 20, 2022

This PR does the following:

  • prove mk_finset_of_fintype : #(finset α) = 2 ^ℕ fintype.card α for fintype α
  • rename mk_finset_eq_mk to mk_finset_of_infinite to match the former
  • rename mk_finset to mk_coe_finset to avoid confusion with these two lemmas

Open in Gitpod

@vihdzp vihdzp added awaiting-review The author would like community review of the PR awaiting-CI The author would like to see what CI has to say before doing more work. labels Jun 20, 2022
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot added the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 20, 2022
@mathlib-dependent-issues-bot mathlib-dependent-issues-bot removed the blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. label Jun 20, 2022
@github-actions github-actions bot removed the awaiting-CI The author would like to see what CI has to say before doing more work. label Jun 21, 2022
lemma mk_finset {α : Type u} {s : finset α} : #s = ↑(finset.card s) := by simp
lemma mk_of_finset {α : Type u} {s : finset α} : #s = ↑(finset.card s) := by simp

lemma mk_finset_of_fintype [fintype α] : #(finset α) = 2 ^ℕ fintype.card α := by simp
Copy link
Member

Choose a reason for hiding this comment

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

Can you squeeze this simp, for the sake of making it clear which lemmas this uses?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This simp basically just turns #(finset α) into fintype.card (finset α), for which the lemma stating that it's equal to 2 ^ fintype.card α already exists. A few other proofs in this file, like mk_fin, mk_bool, mk_Prop, use this same technique and are not squeezed.

Should I squeeze it anyways?

Copy link
Member

Choose a reason for hiding this comment

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

I think that non-squeezed simps are OK as long as they're fast.

@urkud
Copy link
Member

urkud commented Jun 27, 2022

Thanks!
bors merge

@github-actions github-actions bot added ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) and removed awaiting-review The author would like community review of the PR labels Jun 27, 2022
bors bot pushed a commit that referenced this pull request Jun 27, 2022
This PR does the following:
- prove `mk_finset_of_fintype : #(finset α) = 2 ^ℕ fintype.card α` for `fintype α`
- rename `mk_finset_eq_mk` to `mk_finset_of_infinite` to match the former
- rename `mk_finset` to `mk_coe_finset` to avoid confusion with these two lemmas
@bors
Copy link

bors bot commented Jun 28, 2022

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(set_theory/cardinal/basic): lemmas about #(finset α) [Merged by Bors] - feat(set_theory/cardinal/basic): lemmas about #(finset α) Jun 28, 2022
@bors bors bot closed this Jun 28, 2022
@bors bors bot deleted the mk_of_finset branch June 28, 2022 00:04
awainverse pushed a commit that referenced this pull request Jun 28, 2022
This PR does the following:
- prove `mk_finset_of_fintype : #(finset α) = 2 ^ℕ fintype.card α` for `fintype α`
- rename `mk_finset_eq_mk` to `mk_finset_of_infinite` to match the former
- rename `mk_finset` to `mk_coe_finset` to avoid confusion with these two lemmas
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

4 participants