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(data/fintype/basic): card_sum, card_subtype_or #8490

Closed
wants to merge 18 commits into from

Conversation

pechersky
Copy link
Collaborator

@pechersky pechersky commented Aug 1, 2021

Provide explicit embedding from a subtype of a disjuction into a sum type.
If the disjunction is disjoint, upgrade to an equiv.
Additionally, provide `subtype.imp_embedding`, lowering a subtype
along an implication.
@pechersky pechersky added the awaiting-review The author would like community review of the PR label Aug 1, 2021
@github-actions github-actions 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 Aug 1, 2021
@github-actions github-actions bot added merge-conflict Please `git merge origin/master` then a bot will remove this label. and removed blocked-by-other-PR This PR depends on another PR which is still in the queue. A bot manages this label via PR comment. labels Aug 6, 2021
@github-actions
Copy link

github-actions bot commented Aug 6, 2021

🎉 Great news! Looks like all the dependencies have been resolved:

💡 To add or remove a dependency please update this issue/PR description.

Brought to you by Dependent Issues (:robot: ). Happy coding!

@github-actions github-actions bot removed the merge-conflict Please `git merge origin/master` then a bot will remove this label. label Aug 6, 2021
Comment on lines +863 to +874
@[simp] theorem fintype.card_sum [fintype α] [fintype β] :
fintype.card (α ⊕ β) = fintype.card α + fintype.card β :=
begin
classical,
rw [←finset.card_univ, univ_sum_type, finset.card_union_eq],
{ simp [finset.card_univ] },
{ intros x hx,
suffices : (∃ (a : α), sum.inl a = x) ∧ ∃ (b : β), sum.inr b = x,
{ obtain ⟨⟨a, rfl⟩, ⟨b, hb⟩⟩ := this,
simpa using hb },
simpa using hx }
end
Copy link
Member

Choose a reason for hiding this comment

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

Does the old proof not work here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it doesn't, because the lemmas about the card over sigma types are expressed using big operator notation, which is later than this file.

Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

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 Aug 16, 2021
@bors
Copy link

bors bot commented Aug 16, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(data/fintype/basic): card_sum, card_subtype_or [Merged by Bors] - feat(data/fintype/basic): card_sum, card_subtype_or Aug 16, 2021
@bors bors bot closed this Aug 16, 2021
@bors bors bot deleted the pechersky/fintype-card-sum branch August 16, 2021 18:56
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