-
Notifications
You must be signed in to change notification settings - Fork 298
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
Conversation
pechersky
commented
Aug 1, 2021
•
edited by github-actions
bot
edited by github-actions
bot
- depends on: [Merged by Bors] - feat(logic/embedding): subtype_or_{embedding,equiv} #8489
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.
This reverts commit 4d8c0b0.
this prevents needing to infer an additional instance in rewrites
🎉 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! |
@[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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 🎉
bors merge
Pull request successfully merged into master. Build succeeded: |