[Merged by Bors] - refactor: weaken HasPullbacks to HasPullback in Over.Pullback#29795
[Merged by Bors] - refactor: weaken HasPullbacks to HasPullback in Over.Pullback#29795Jlh18 wants to merge 11 commits intoleanprover-community:masterfrom
Conversation
PR summary 1f467e3c77
|
| File | Base Count | Head Count | Change |
|---|---|---|---|
| Mathlib.CategoryTheory.Comma.Over.Pullback | 496 | 498 | +2 (+0.40%) |
Import changes for all files
| Files | Import difference |
|---|---|
Mathlib.CategoryTheory.Comma.Over.Pullback |
2 |
Declarations diff
+ HasPullbacksAlong
+ HasPushoutsAlong
You can run this locally as follows
## summary with just the declaration names:
./scripts/declarations_diff.sh <optional_commit>
## more verbose report:
./scripts/declarations_diff.sh long <optional_commit>The doc-module for script/declarations_diff.sh contains some details about this script.
No changes to technical debt.
You can run this locally as
./scripts/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
chrisflav
left a comment
There was a problem hiding this comment.
Thanks for this PR! I think this is a good change, but we should check how this affects performance.
| by pulling back a morphism along `f`. -/ | ||
| @[simps! +simpRhs obj_left obj_hom map_left] | ||
| def pullback {X Y : C} (f : X ⟶ Y) : Over Y ⥤ Over X where | ||
| def pullback : Over Y ⥤ Over X where |
There was a problem hiding this comment.
In my opinion this is a regression in readability. I would repeat the f argument (and the HasPullback assumption) in the signature.
Similarly below.
There was a problem hiding this comment.
(In lemmas, relying on the section variables is fine.)
|
|
||
| section HasBinaryProducts | ||
| variable [HasBinaryProducts C] | ||
| variable [HasBinaryProducts C] (X) |
There was a problem hiding this comment.
This variable implicitness change is unrelated to the rest of this PR if I understand correctly. I would suggest to do this in a separate PR, because this change probably needs some further discussion. For example, if we change explicitness here, we should probably also change Over.post.
There was a problem hiding this comment.
This was just because X was explicit before, then became implicit due to my variable declaration at the top of the file. It is removed now
|
!bench |
|
-awaiting-author |
| section | ||
|
|
||
| variable [HasPullbacks C] | ||
|
|
There was a problem hiding this comment.
Instead of making a section, I would just move the [HasPullbacks C] in the signature of the statement.
|
Here are the benchmark results for commit 2c45ee1. |
|
|
-awaiting-author |
|
I am now wondering if we should make a class to make these statements a little tidier? |
|
Is there a context for this PR (and I suppose this new class)? |
I am happy to go with that convention. Changed it now |
peabrainiac
left a comment
There was a problem hiding this comment.
Added a comment on one more thing I previously missed. Other than that this looks good to me though, thanks!
| /-- `HasPullbacksAlong f` represents a choice of pullback | ||
| for each morphism into the codomain of `f : X ⟶ Z`. -/ |
There was a problem hiding this comment.
| /-- `HasPullbacksAlong f` represents a choice of pullback | |
| for each morphism into the codomain of `f : X ⟶ Z`. -/ | |
| /-- `HasPullbacksAlong f` states that all pullbacks of morphisms into `Y` along `f : X ⟶ Y` exist. -/ |
This is just a proposition, it doesn't actually carry any choices of pullbacks as data. Same thing for pushouts.
There was a problem hiding this comment.
I was following the style of doc-strings for HasPullback and HasPullbacks. Should I change them too?
There was a problem hiding this comment.
Oh right, those are outdated. They should definitely be updated at some point, but so should the docstrings for HasEqualizer, HasEqualizers, HasWideEqualizer, HasWideEqualizers, HasCoequalizer etc... maybe that is enough to warrant a separate PR. Let's just change the docstrings introduced in this PR for now.
There was a problem hiding this comment.
Got it - fixed now. Thanks a lot for the review!
|
This pull request has conflicts, please merge |
…eanprover-community#30145) Update the docstrings of `HasPullbacks`, `HasEqualizers` etc. to reflect that those declarations are propositions and no longer carry any choices of limits as data. This came up in leanprover-community#29795. Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
|
Thanks! bors merge |
Add an abbreviation `HasPullbackAlong f` to mean that all maps into the codomain of `f` have pullbacks along `f`. As discussed in zulip [#mathlib4 > Hom.HasPullback](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Hom.2EHasPullback/with/541055666) The `HasPullbacks` instance on a category `C` for defining the pullback functor along a map `f : X -> Y` between their over categories can be weakened to just a `HasPullbackAlong` condition on `f`. Dually, for `HasPushout` and undercategories. Co-authored-by: jlh18 <josephhua73@yahoo.com>
|
Pull request successfully merged into master. Build succeeded: |
…eanprover-community#30145) Update the docstrings of `HasPullbacks`, `HasEqualizers` etc. to reflect that those declarations are propositions and no longer carry any choices of limits as data. This came up in leanprover-community#29795. Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
…over-community#29795) Add an abbreviation `HasPullbackAlong f` to mean that all maps into the codomain of `f` have pullbacks along `f`. As discussed in zulip [#mathlib4 > Hom.HasPullback](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Hom.2EHasPullback/with/541055666) The `HasPullbacks` instance on a category `C` for defining the pullback functor along a map `f : X -> Y` between their over categories can be weakened to just a `HasPullbackAlong` condition on `f`. Dually, for `HasPushout` and undercategories. Co-authored-by: jlh18 <josephhua73@yahoo.com>
…Adjuction (#29810) This PR replaces the global assumption of `HasPullback T` with the weaker assumption that pullbacks exist along the morphism only. For the sake of readability I also moved the variable `(f : X -> Y)` into the statement of each theorem. As instructed in #29795 (comment) - [ ] depends on: #29795 - [ ] depends on: #29812 Co-authored-by: jlh18 <josephhua73@yahoo.com>
…Adjuction (leanprover-community#29810) This PR replaces the global assumption of `HasPullback T` with the weaker assumption that pullbacks exist along the morphism only. For the sake of readability I also moved the variable `(f : X -> Y)` into the statement of each theorem. As instructed in leanprover-community#29795 (comment) - [ ] depends on: leanprover-community#29795 - [ ] depends on: leanprover-community#29812 Co-authored-by: jlh18 <josephhua73@yahoo.com>
…eanprover-community#30145) Update the docstrings of `HasPullbacks`, `HasEqualizers` etc. to reflect that those declarations are propositions and no longer carry any choices of limits as data. This came up in leanprover-community#29795. Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
…over-community#29795) Add an abbreviation `HasPullbackAlong f` to mean that all maps into the codomain of `f` have pullbacks along `f`. As discussed in zulip [#mathlib4 > Hom.HasPullback](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/Hom.2EHasPullback/with/541055666) The `HasPullbacks` instance on a category `C` for defining the pullback functor along a map `f : X -> Y` between their over categories can be weakened to just a `HasPullbackAlong` condition on `f`. Dually, for `HasPushout` and undercategories. Co-authored-by: jlh18 <josephhua73@yahoo.com>
…ts (leanprover-community#29812) The `HasPullbacks` instance on a category `C` for defining the `baseChange` / pullback functor along a map `f : X -> Y` between their over categories can be weakened to just a `HasPullback` condition on `f`. - [ ] depends on: leanprover-community#29795 Co-authored-by: jlh18 <josephhua73@yahoo.com>
…Adjuction (leanprover-community#29810) This PR replaces the global assumption of `HasPullback T` with the weaker assumption that pullbacks exist along the morphism only. For the sake of readability I also moved the variable `(f : X -> Y)` into the statement of each theorem. As instructed in leanprover-community#29795 (comment) - [ ] depends on: leanprover-community#29795 - [ ] depends on: leanprover-community#29812 Co-authored-by: jlh18 <josephhua73@yahoo.com>
Add an abbreviation
HasPullbackAlong fto mean that all maps into the codomain offhave pullbacks alongf. As discussed in zulip #mathlib4 > Hom.HasPullbackThe
HasPullbacksinstance on a categoryCfor defining the pullback functor along a mapf : X -> Ybetween their over categories can be weakened to just aHasPullbackAlongcondition onf.Dually, for
HasPushoutand undercategories.