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/Sum): forall_sum_pi #6658

Closed
wants to merge 7 commits into from

Conversation

ChrisHughes24
Copy link
Member


Open in Gitpod

@ChrisHughes24 ChrisHughes24 added the awaiting-review The author would like community review of the PR label Aug 18, 2023
@@ -59,6 +59,20 @@ theorem «exists» {p : Sum α β → Prop} : (∃ x, p x) ↔ (∃ a, p (inl a)
| Or.inr ⟨b, h⟩ => ⟨inr b, h⟩⟩
#align sum.exists Sum.exists

theorem forall_sum_pi (p : α ⊕ β → Sort*)
(q : (∀ a, p a) → Prop) :
(∀ a, q a) ↔ (∀ a b, q (Sum.rec a b)) :=
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 add the types of a and b here for clarity?

Copy link
Member

Choose a reason for hiding this comment

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

Or at least, name them more clearly, since the a here is different from the a on the line above, and neither is of type α!

Suggested change
(∀ a, q a) ↔ (∀ a b, q (Sum.rec a b)) :=
(∀ fab, q fab) ↔ (∀ fa fb, q (Sum.rec fa fb)) :=

Copy link
Member Author

Choose a reason for hiding this comment

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

done. I also made some arguments implict and improved some other names

Comment on lines +69 to +72
theorem exists_sum_pi {γ : α ⊕ β → Sort*} (p : (∀ ab, γ ab) → Prop) :
(∃ fab, p fab) ↔ (∃ fa fb, p (Sum.rec fa fb)) := by
rw [← not_forall_not, forall_sum_pi]
simp
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious if this brings in classical logic, though I don't really care.

Copy link
Member Author

Choose a reason for hiding this comment

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

It does

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
Copy link
Member

@eric-wieser eric-wieser left a comment

Choose a reason for hiding this comment

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

bors d+

These might be worth giving docstrings.

@bors
Copy link

bors bot commented Aug 18, 2023

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

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added delegated and removed awaiting-review The author would like community review of the PR labels Aug 18, 2023
@@ -59,6 +59,18 @@ theorem «exists» {p : Sum α β → Prop} : (∃ x, p x) ↔ (∃ a, p (inl a)
| Or.inr ⟨b, h⟩ => ⟨inr b, h⟩⟩
#align sum.exists Sum.exists

theorem forall_sum_pi {γ : α ⊕ β → Sort*} (p : (∀ ab, γ ab) → Prop) :
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 we have a similar lemma for fin tuples; can you check if the naming is consistent?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I'm thinking of Fin.forall_fin_succ_pi, which I guess is consistent already.

@ChrisHughes24
Copy link
Member Author

bors r+

@github-actions github-actions bot added the ready-to-merge This PR has been sent to bors. label Aug 18, 2023
bors bot pushed a commit that referenced this pull request Aug 18, 2023
Co-authored-by: Chris Hughes <33847686+ChrisHughes24@users.noreply.github.com>
@bors
Copy link

bors bot commented Aug 18, 2023

Build failed:

@ChrisHughes24
Copy link
Member Author

bors merge

bors bot pushed a commit that referenced this pull request Aug 18, 2023
Co-authored-by: Chris Hughes <33847686+ChrisHughes24@users.noreply.github.com>
@bors
Copy link

bors bot commented Aug 18, 2023

Build failed:

@ChrisHughes24
Copy link
Member Author

bors r+

bors bot pushed a commit that referenced this pull request Aug 18, 2023
Co-authored-by: Chris Hughes <33847686+ChrisHughes24@users.noreply.github.com>
@bors
Copy link

bors bot commented Aug 18, 2023

Pull request successfully merged into master.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title feat(Data/Sum): forall_sum_pi [Merged by Bors] - feat(Data/Sum): forall_sum_pi Aug 18, 2023
@bors bors bot closed this Aug 18, 2023
@bors bors bot deleted the sumForallChris branch August 18, 2023 14:52
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

3 participants