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/sites): Sheaves of structures #5927

Closed
wants to merge 24 commits into from

Conversation

b-mehta
Copy link
Collaborator

@b-mehta b-mehta commented Jan 27, 2021

Define sheaves on a site taking values in an arbitrary category.

Joint with @kbuzzard. cc: @jcommelin, this is a step towards condensed abelian groups.

I don't love the names here, design advice (particularly from those who'll use this) more than appreciated.

The main points are:

  • An A-valued presheaf P : C^op => A is defined to be a sheaf (for the topology J) iff for every X : A, the type-valued presheaves of sets given by sending U : C^op to Hom_{A}(X, P U) are all sheaves of sets.
  • When A = Type, this recovers the basic definition of sheaves of sets.
  • An alternate definition when C is small, has pullbacks and A has products is given by an equalizer condition is_sheaf'.
  • This is equivalent to the earlier definition.
  • When A = Type, this is definitionally equal to the equalizer condition for presieves in sheaf_of_types.lean
  • When A has limits and there is a functor s : A => Type which is faithful, reflects isomorphisms and preserves limits, then P : C^op => A is a sheaf iff the underlying presheaf of types P >>> s : C^op => Type is a sheaf. (cf https://stacks.math.columbia.edu/tag/0073, which is a weaker version of this statement (it's only over spaces, not sites) and https://stacks.math.columbia.edu/tag/00YR (a), which additionally assumes filtered colimits).

A couple of questions for reviewers:

  • We've now got a ton of equivalent ways of showing something's a sheaf, and it's not the easiest to navigate between them. Is there a nice way around this? I think it's still valuable to have all the ways, since each can be helpful in different contexts but it makes the API a bit opaque. There's also a bit of inconsistency - there's a definition yoneda_sheaf_condition which is the same as is_sheaf_for but the equalizer conditions at the bottom of sheaf_of_types aren't named, they're just some nonempty (is_limit (fork.of_ι _ (w P R))) even though they're also equivalent.
  • The name presieve.is_sheaf is stupid, I think I was just lazy with namespaces. I think presieve.family_of_elements and presieve.is_sheaf_for are still sensible, since they are relative to a presieve, but is_sheaf doesn't have any reference to presieves in its type.
  • The equalizer condition of sheaves of types is definitionally the same as the equalizer condition for sheaves of structures, so is there any point in having the former version in the library - the latter is just more general (the same doesn't apply to the actual def of sheaves of structures since that's defined in terms of sheaves of types). The main downside I can see is that it might make the proofs of equalizer_sheaf_condition a bit trickier, but that's about it

@b-mehta b-mehta added the WIP Work in progress label Jan 27, 2021
@b-mehta b-mehta added needs-documentation This PR is missing required documentation RFC Request for comment and removed WIP Work in progress labels Jan 27, 2021
@jcommelin
Copy link
Member

Thank you so much for working on this!

A couple of questions for reviewers:

  • We've now got a ton of equivalent ways of showing something's a sheaf, and it's not the easiest to navigate between them. Is there a nice way around this? I think it's still valuable to have all the ways, since each can be helpful in different contexts but it makes the API a bit opaque. There's also a bit of inconsistency - there's a definition yoneda_sheaf_condition which is the same as is_sheaf_for but the equalizer conditions at the bottom of sheaf_of_types aren't named, they're just some nonempty (is_limit (fork.of_ι _ (w P R))) even though they're also equivalent.

I think we will probably want to keep all the versions, at least for now. And gradually flesh out the API.

  • The name presieve.is_sheaf is stupid, I think I was just lazy with namespaces. I think presieve.family_of_elements and presieve.is_sheaf_for are still sensible, since they are relative to a presieve, but is_sheaf doesn't have any reference to presieves in its type.

This sounds like something that can be fixed.

  • The equalizer condition of sheaves of types is definitionally the same as the equalizer condition for sheaves of structures, so is there any point in having the former version in the library - the latter is just more general (the same doesn't apply to the actual def of sheaves of structures since that's defined in terms of sheaves of types). The main downside I can see is that it might make the proofs of equalizer_sheaf_condition a bit trickier, but that's about it

Let's keep it for now. If we find that it's rarely useful, and leads to duplication, then we can remove it later. I think the proofs in this area are already hard enough... so anything that makes it easier is welcome (-;

@jcommelin
Copy link
Member

  • An A-valued presheaf P : C^op => A is defined to be a sheaf (for the topology J) iff for every X : A, the type-valued presheaves of sets given by sending U : C^op to Hom_{A}(X, P U) are all sheaves of sets.
  • When A = Type, this recovers the basic definition of sheaves of sets.
  • An alternate definition when C is small, has pullbacks and A has products is given by an equalizer condition is_sheaf'.
  • This is equivalent to the earlier definition.
  • When A = Type, this is definitionally equal to the equalizer condition for presieves in sheaf_of_types.lean
  • When A has limits and there is a functor s : A => Type which is faithful, reflects isomorphisms and preserves limits, then P : C^op => A is a sheaf iff the underlying presheaf of types P >>> s : C^op => Type is a sheaf. (cf https://stacks.math.columbia.edu/tag/0073, which is a weaker version of this statement (it's only over spaces, not sites) and https://stacks.math.columbia.edu/tag/00YR (a), which additionally assumes filtered colimits).

These comments are useful! Please copy them to the module docstring.

@jcommelin
Copy link
Member

The code looks good. But some names might need to be tweaked a bit... like sheaf_cond3.

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.

This looks excellent. My comments are all superficial. This will enable us to do sheaves of rings in a non-ad-hoc way.

src/category_theory/sites/sheaf.lean Outdated Show resolved Hide resolved
src/category_theory/sites/sheaf.lean Outdated Show resolved Hide resolved
src/category_theory/sites/sheaf.lean Outdated Show resolved Hide resolved
src/category_theory/sites/sheaf.lean Outdated Show resolved Hide resolved
src/category_theory/sites/sheaf.lean Outdated Show resolved Hide resolved
src/category_theory/sites/sheaf.lean Outdated Show resolved Hide resolved
src/category_theory/sites/sheaf.lean Outdated Show resolved Hide resolved
src/category_theory/sites/sheaf.lean Outdated Show resolved Hide resolved
@b-mehta b-mehta added awaiting-review The author would like community review of the PR and removed RFC Request for comment awaiting-author A reviewer has asked the author a question or requested changes needs-documentation This PR is missing required documentation labels Apr 20, 2021
@b-mehta b-mehta requested a review from jcommelin April 20, 2021 16:12
@jcommelin
Copy link
Member

LGTM. But I wonder if @justus-springer has some comments, since he's been working with sheaves in mathlib lately.

Copy link
Collaborator

@justus-springer justus-springer left a comment

Choose a reason for hiding this comment

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

Just a question about the sheaf condition. Otherwise no further comments other than that I really like this!

src/category_theory/sites/sheaf.lean Show resolved Hide resolved
Copy link
Member

@jcommelin jcommelin left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

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 29, 2021
bors bot pushed a commit that referenced this pull request Apr 29, 2021
Define sheaves on a site taking values in an arbitrary category.

Joint with @kbuzzard. cc: @jcommelin, this is a step towards condensed abelian groups.

I don't love the names here, design advice (particularly from those who'll use this) more than appreciated.

The main points are:

- An `A`-valued presheaf `P : C^op => A` is defined to be a sheaf (for the topology J) iff for every `X : A`, the type-valued presheaves of sets given by sending `U : C^op` to `Hom_{A}(X, P U)` are all sheaves of sets.
- When `A = Type`, this recovers the basic definition of sheaves of sets.
- An alternate definition when `C` is small, has pullbacks and `A` has products is given by an equalizer condition `is_sheaf'`.
- This is equivalent to the earlier definition.
- When `A = Type`, this is definitionally equal to the equalizer condition for presieves in sheaf_of_types.lean
- When `A` has limits and there is a functor `s : A => Type` which is faithful, reflects isomorphisms and preserves limits, then `P : C^op => A` is a sheaf iff the underlying presheaf of types `P >>> s : C^op => Type` is a sheaf. (cf https://stacks.math.columbia.edu/tag/0073, which is a weaker version of this statement (it's only over spaces, not sites) and https://stacks.math.columbia.edu/tag/00YR (a), which additionally assumes filtered colimits).

A couple of questions for reviewers:
- We've now got a ton of equivalent ways of showing something's a sheaf, and it's not the easiest to navigate between them. Is there a nice way around this? I think it's still valuable to have all the ways, since each can be helpful in different contexts but it makes the API a bit opaque. There's also a bit of inconsistency - there's a definition `yoneda_sheaf_condition` which is the same as `is_sheaf_for` but the equalizer conditions at the bottom of sheaf_of_types aren't named, they're just some `nonempty (is_limit (fork.of_ι _ (w P R)))` even though they're also equivalent.
- The name `presieve.is_sheaf` is stupid, I think I was just lazy with namespaces. I think `presieve.family_of_elements` and `presieve.is_sheaf_for` are still sensible, since they are relative to a presieve, but `is_sheaf` doesn't have any reference to presieves in its type. 
- The equalizer condition of sheaves of types is definitionally the same as the equalizer condition for sheaves of structures, so is there any point in having the former version in the library - the latter is just more general (the same doesn't apply to the actual def of sheaves of structures since that's defined in terms of sheaves of types). The main downside I can see is that it might make the proofs of `equalizer_sheaf_condition` a bit trickier, but that's about it

Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
@bors
Copy link

bors bot commented Apr 29, 2021

Build failed (retrying...):

@eric-wieser
Copy link
Member

eric-wieser commented Apr 29, 2021

bors r-

The linter fails even before bors ran.

@bors
Copy link

bors bot commented Apr 29, 2021

Canceled.

@bryangingechen bryangingechen added awaiting-author A reviewer has asked the author a question or requested changes and removed ready-to-merge All that is left is for bors to build and merge this PR. (Remember you need to say `bors r+`.) labels Apr 30, 2021
@jcommelin
Copy link
Member

Thanks 🎉

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-author A reviewer has asked the author a question or requested changes labels Apr 30, 2021
bors bot pushed a commit that referenced this pull request Apr 30, 2021
Define sheaves on a site taking values in an arbitrary category.

Joint with @kbuzzard. cc: @jcommelin, this is a step towards condensed abelian groups.

I don't love the names here, design advice (particularly from those who'll use this) more than appreciated.

The main points are:

- An `A`-valued presheaf `P : C^op => A` is defined to be a sheaf (for the topology J) iff for every `X : A`, the type-valued presheaves of sets given by sending `U : C^op` to `Hom_{A}(X, P U)` are all sheaves of sets.
- When `A = Type`, this recovers the basic definition of sheaves of sets.
- An alternate definition when `C` is small, has pullbacks and `A` has products is given by an equalizer condition `is_sheaf'`.
- This is equivalent to the earlier definition.
- When `A = Type`, this is definitionally equal to the equalizer condition for presieves in sheaf_of_types.lean
- When `A` has limits and there is a functor `s : A => Type` which is faithful, reflects isomorphisms and preserves limits, then `P : C^op => A` is a sheaf iff the underlying presheaf of types `P >>> s : C^op => Type` is a sheaf. (cf https://stacks.math.columbia.edu/tag/0073, which is a weaker version of this statement (it's only over spaces, not sites) and https://stacks.math.columbia.edu/tag/00YR (a), which additionally assumes filtered colimits).

A couple of questions for reviewers:
- We've now got a ton of equivalent ways of showing something's a sheaf, and it's not the easiest to navigate between them. Is there a nice way around this? I think it's still valuable to have all the ways, since each can be helpful in different contexts but it makes the API a bit opaque. There's also a bit of inconsistency - there's a definition `yoneda_sheaf_condition` which is the same as `is_sheaf_for` but the equalizer conditions at the bottom of sheaf_of_types aren't named, they're just some `nonempty (is_limit (fork.of_ι _ (w P R)))` even though they're also equivalent.
- The name `presieve.is_sheaf` is stupid, I think I was just lazy with namespaces. I think `presieve.family_of_elements` and `presieve.is_sheaf_for` are still sensible, since they are relative to a presieve, but `is_sheaf` doesn't have any reference to presieves in its type. 
- The equalizer condition of sheaves of types is definitionally the same as the equalizer condition for sheaves of structures, so is there any point in having the former version in the library - the latter is just more general (the same doesn't apply to the actual def of sheaves of structures since that's defined in terms of sheaves of types). The main downside I can see is that it might make the proofs of `equalizer_sheaf_condition` a bit trickier, but that's about it

Co-authored-by: Kevin Buzzard <k.buzzard@imperial.ac.uk>
@bors
Copy link

bors bot commented Apr 30, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(category_theory/sites): Sheaves of structures [Merged by Bors] - feat(category_theory/sites): Sheaves of structures Apr 30, 2021
@bors bors bot closed this Apr 30, 2021
@bors bors bot deleted the sheaf_general_case branch April 30, 2021 14:54
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

7 participants