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(topology/sheaves): Induced map on stalks #7092

Closed
wants to merge 21 commits into from

Conversation

justus-springer
Copy link
Collaborator

@justus-springer justus-springer commented Apr 7, 2021

This PR defines stalk maps for morphisms of presheaves. We prove that a morphism of type-valued sheaves is an isomorphism if and only if all the stalk maps are isomorphisms.

A few more lemmas about unique gluing are also added, as well as docstrings.


Zulip:
https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/induced.20map.20on.20stalks

Some of this can obviously be extended or stated in greater generality. For example, we might want a Lemma saying that a morphism of sheaves is mono/epi if and only if all stalk maps are mono/epi (this should even hold in more general categories than Type I think). This wasn't necessary for the goal I had in mind, but I'm happy to continue working on stuff like this and I'm grateful for any feedback.

Also, this about doubled the size of the file stalks.lean, so I took the liberty to add myself to the authors list. I hope this is okay.

Open in Gitpod

@justus-springer justus-springer added the awaiting-review The author would like community review of the PR label Apr 7, 2021
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.

Only quickly skimmed it. But at first sight this looks great!

src/topology/sheaves/stalks.lean Outdated Show resolved Hide resolved
justus-springer and others added 3 commits April 8, 2021 06:47
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
Co-authored-by: Johan Commelin <johan@commelin.net>
Co-authored-by: Eric <37984851+ericrbg@users.noreply.github.com>
@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 9, 2021
@justus-springer justus-springer added the awaiting-review The author would like community review of the PR label Apr 9, 2021
@semorrison
Copy link
Collaborator

semorrison commented Apr 10, 2021

There are still some names to fix up here. There are many appearances of stalk_maps, which probably should all be stalk_functor_map.

Otherwise, this is looking really good!

@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 10, 2021
@justus-springer
Copy link
Collaborator Author

Okay, fixed the names. I also reordered things in the file a little. I think it makes more sense that way and now it lines up with the module docstring.

@justus-springer justus-springer 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 10, 2021
Comment on lines +47 to +50
@[simp] lemma res_π_apply (i : ι) (s : F.obj (op (supr U))) :
limit.π (discrete.functor (λ i : ι, F.obj (op (U i)))) i (res F U s) =
F.map (opens.le_supr U i).op s :=
congr_fun (res_π F U i) s
Copy link
Collaborator

Choose a reason for hiding this comment

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

You should be able to get this lemma automatically now by just putting @[elementwise] on res_π.

Comment on lines +161 to +164
@[simp] lemma stalk_functor_map_germ_apply (U : opens X) (x : U) {F G : X.presheaf (Type v)}
(f : F ⟶ G) (s : F.obj (op U)) :
(stalk_functor (Type v) x.1).map f (germ F x s) = germ G x (f.app (op U) s) :=
congr_fun (stalk_functor_map_germ U x f) s
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similarly this can also be by @[elementwise].

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried this, unfortunately the generated simp lemmas don't fire where I would like them to. There seems to be some issue with the coercions coe_fn, not even erw worked. The only way I found was through some pretty annoying unfolding of definitions, before I could rewrite, like this:

lemma app_injective_of_stalk_functor_map_injective {F : sheaf (Type v) X} {G : presheaf (Type v) X}
  (f : F.presheaf ⟶ G) (h : ∀ x : X, injective ((stalk_functor (Type v) x).map f)) (U : opens X) :
  injective (f.app (op U)) := λ s t hst,
begin
  apply section_ext,
  intro x,
  apply h x.1,
  have := stalk_functor_map_germ_apply U x f s,
  -- here, I need to explicitly unfold the coercions before I can rewrite...
  dsimp [coe_fn, concrete_category.has_coe_to_fun, forget, concrete_category.forget] at this,
  erw this,
  sorry
end

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we can try to solve this in a separate PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good!

@semorrison
Copy link
Collaborator

Once you've fixed up the @[elementwise] things, you can ask bors to merge.

bors d+

@bors
Copy link

bors bot commented Apr 11, 2021

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

@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 14, 2021
bors bot pushed a commit that referenced this pull request Apr 14, 2021
This PR defines stalk maps for morphisms of presheaves. We prove that a morphism of type-valued sheaves is an isomorphism if and only if all the stalk maps are isomorphisms.

A few more lemmas about unique gluing are also added, as well as docstrings.
@bors
Copy link

bors bot commented Apr 14, 2021

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Apr 14, 2021
This PR defines stalk maps for morphisms of presheaves. We prove that a morphism of type-valued sheaves is an isomorphism if and only if all the stalk maps are isomorphisms.

A few more lemmas about unique gluing are also added, as well as docstrings.
bors bot pushed a commit that referenced this pull request Apr 14, 2021
This PR defines stalk maps for morphisms of presheaves. We prove that a morphism of type-valued sheaves is an isomorphism if and only if all the stalk maps are isomorphisms.

A few more lemmas about unique gluing are also added, as well as docstrings.
@bors
Copy link

bors bot commented Apr 14, 2021

Pull request successfully merged into master.

Build succeeded:

@bors bors bot changed the title feat(topology/sheaves): Induced map on stalks [Merged by Bors] - feat(topology/sheaves): Induced map on stalks Apr 14, 2021
@bors bors bot closed this Apr 14, 2021
@bors bors bot deleted the stalk_map branch April 14, 2021 23:14
bors bot pushed a commit that referenced this pull request Apr 21, 2021
These fixes, while an improvement, still don't fix the problem @justus-springer observed in #7092.

Really we should generate a second copy of the `_apply` lemma, with the category specialized to `Type u`, and in that one remove all the coercions. Maybe later.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
bors bot pushed a commit that referenced this pull request Jun 22, 2021
…8000)

Refactoring and speeding up some of my code on stalk maps from #7092.
bors bot pushed a commit that referenced this pull request Jun 22, 2021
…8000)

Refactoring and speeding up some of my code on stalk maps from #7092.
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

4 participants