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] - refactor: move morphisms in StructuredArrow to a lower universe #6397

Closed
wants to merge 9 commits into from

Conversation

TwoFX
Copy link
Member

@TwoFX TwoFX commented Aug 6, 2023

This PR changes the definition

abbrev fromPUnit (X : C) : Discrete PUnit.{v + 1} ⥤ C :=
  (Functor.const _).obj X

to

abbrev fromPUnit (X : C) : Discrete PUnit.{w + 1} ⥤ C :=
  (Functor.const _).obj X

and then redefines

def StructuredArrow (S : D) (T : C ⥤ D) :=
  Comma (Functor.fromPUnit S) T

to

def StructuredArrow (S : D) (T : C ⥤ D) :=
  Comma (Functor.fromPUnit.{0} S) T

The effect of this is that given {C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (S : D) (T : C ⥤ D), the morphisms of StructuredArrow S T no longer live in max v₁ v₂, but in v₁, as they should. Thus, this PR is basically a better version of #6388.

My guess for why we used to have the larger universe is that back in the day, the universes for limits were much more restricted, so stating the results of Limits/Comma.lean was not possible if the morphisms of StructuredArrow live in v₁. Luckily, by now it is possible to state everything correctly, and this PR adjusts Limits/Comma.lean and Limits/Over.lean accordingly.


Open in Gitpod

@TwoFX TwoFX added awaiting-review The author would like community review of the PR t-category-theory Category theory labels Aug 6, 2023
Copy link
Member

@kbuzzard kbuzzard left a comment

Choose a reason for hiding this comment

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

In general I think that this is probably the right approach; I think it's good to have a bit more control over exactly which universes you're allowing limits over rather than just announcing [HasLimits X].

Mathlib/CategoryTheory/PUnit.lean Outdated Show resolved Hide resolved
@TwoFX TwoFX added WIP Work in progress and removed awaiting-review The author would like community review of the PR labels Aug 13, 2023
@TwoFX TwoFX added awaiting-review The author would like community review of the PR and removed WIP Work in progress labels Aug 13, 2023
@joelriou
Copy link
Collaborator

I also believe this is a nice improvement. Thanks!

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels Aug 28, 2023
bors bot pushed a commit that referenced this pull request Aug 28, 2023
This PR changes the definition
```lean
abbrev fromPUnit (X : C) : Discrete PUnit.{v + 1} ⥤ C :=
  (Functor.const _).obj X
```
to
```lean
abbrev fromPUnit (X : C) : Discrete PUnit.{w + 1} ⥤ C :=
  (Functor.const _).obj X
```
and then redefines
```lean
def StructuredArrow (S : D) (T : C ⥤ D) :=
  Comma (Functor.fromPUnit S) T
```
to
```lean
def StructuredArrow (S : D) (T : C ⥤ D) :=
  Comma (Functor.fromPUnit.{0} S) T
```

The effect of this is that given `{C : Type u₁} [Category.{v₁} C] {D : Type u₂} [Category.{v₂} D] (S : D) (T : C ⥤ D)`, the morphisms of `StructuredArrow S T` no longer live in `max v₁ v₂`, but in `v₁`, as they should. Thus, this PR is basically a better version of #6388.

My guess for why we used to have the larger universe is that back in the day, the universes for limits were much more restricted, so stating the results of `Limits/Comma.lean` was not possible if the morphisms of `StructuredArrow` live in `v₁`. Luckily, by now it is possible to state everything correctly, and this PR adjusts `Limits/Comma.lean` and `Limits/Over.lean` accordingly.
@bors
Copy link

bors bot commented Aug 28, 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 refactor: move morphisms in StructuredArrow to a lower universe [Merged by Bors] - refactor: move morphisms in StructuredArrow to a lower universe Aug 28, 2023
@bors bors bot closed this Aug 28, 2023
@bors bors bot deleted the puniverse branch August 28, 2023 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has been sent to bors. t-category-theory Category theory
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants