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(category_theory/types): add explicit pullbacks in Type u #6973

Closed
wants to merge 18 commits into from

Conversation

gnprice
Copy link
Collaborator

@gnprice gnprice commented Mar 31, 2021

Add an explicit construction of binary pullbacks in the
category of types.

Zulip discussion:
https://leanprover.zulipchat.com/#narrow/stream/217875-Is-there.20code.20for.20X.3F/topic/pullbacks.20in.20Type.20u


The construction of the is_limit feels messy to me -- that's an area where I'd be especially glad for suggestions on how to write it better, though really I'm happy to hear feedback anywhere.

I don't love these names, partly because I don't feel like they particularly signal the distinction between these explicit pullbacks and the general ones provided by the has_pullbacks instance through category_theory.limits.pullback, category_theory.limits.pullback.fst, and so on. I'm not sure what would be the best names to use instead, though. Perhaps the most reasonable way to express that distinction is just the difference in namespace -- category_theory.limits.foo vs. category_theory.limits.types.foo? In that case perhaps most of these should just go under the pullback sub-namespace: so category_theory.limits.types.pullback.fst and so on.

In the module docstring at the top of the file, it seemed like a couple of existing features were missing from the inventory, so I added those along with this one. I think a couple of other parts of that module docstring need updates for refactors that have happened -- I don't see limit_data or types_has_terminal mentioned in the code -- but I'm not sure what the right story is for each of those, so those updates may be easier to get right for someone more familiar with the history of this file.

Open in Gitpod

@semorrison
Copy link
Collaborator

I'll suggest an alternative approach on zulip!

@bryangingechen bryangingechen added the awaiting-author A reviewer has asked the author a question or requested changes label Mar 31, 2021
@bryangingechen
Copy link
Collaborator

(For future reference: Scott's Zulip thread is here.)

@gnprice
Copy link
Collaborator Author

gnprice commented Apr 1, 2021

Thanks @semorrison for the review!

I've pushed a new version which I believe addresses all your comments (here and on Zulip.) See also my reply about @[pattern] above at #6973 (comment) .

@gnprice gnprice 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 Apr 4, 2021
Comment on lines 284 to 285
@[simp] lemma pullback_fst'
: (pullback_iso_pullback f g).hom ≫ (λ p, (p : X × Y).fst) = pullback.fst :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
@[simp] lemma pullback_fst'
: (pullback_iso_pullback f g).hom ≫ (λ p, (p : X × Y).fst) = pullback.fst :=
@[simp] lemma pullback_fst' :
(pullback_iso_pullback f g).hom ≫ (λ p, (p : X × Y).fst) = pullback.fst :=

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not convinced these simp lemmas will ever actually fire -- it seems unlikely the left hand side would ever appear as stated. I wonder if the elementwise version of these lemmas would be more useful.

On the other hand, the lemmas for (pullback_iso_pullback f g).inv should be stated, and seem fine as simp lemmas.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure. I added simp lemmas for (pullback_iso_pullback f g).inv, and replaced these with elementwise versions.

The elementwise versions I came up with feel a bit messy to me -- but take a look and see what you think.

@semorrison semorrison 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 Apr 5, 2021
@gnprice
Copy link
Collaborator Author

gnprice commented Apr 6, 2021

Thanks! New version pushed.

@gnprice gnprice 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 Apr 6, 2021
@semorrison
Copy link
Collaborator

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 Apr 6, 2021
bors bot pushed a commit that referenced this pull request Apr 6, 2021
@bors
Copy link

bors bot commented Apr 7, 2021

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Apr 7, 2021
@bors
Copy link

bors bot commented Apr 7, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(category_theory/types): add explicit pullbacks in Type u [Merged by Bors] - feat(category_theory/types): add explicit pullbacks in Type u Apr 7, 2021
@bors bors bot closed this Apr 7, 2021
@bors bors bot deleted the gnprice/types-pullbacks branch April 7, 2021 10:30
@gnprice
Copy link
Collaborator Author

gnprice commented Apr 8, 2021

Thanks for all the reviews!

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