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(AlgebraicGeometry/GammaSpecAdjunction): a missing lemma #13412

Closed
wants to merge 17 commits into from

Conversation

jjaassoonn
Copy link
Collaborator

@jjaassoonn jjaassoonn commented May 31, 2024

Added the following lemma:

Let $X$ be a locally ringed space, $R$ a ring and $U \subseteq \mathrm{Spec} R$ an open set.
Then for any $f : R \to \Gamma(\mathcal O_X, X)$, if we denote $F$ as the corresponding morphism $X \to \mathrm{Spec} R$ under the gamma spec adjunction we have that
the composition $res^{\mathrm{X}}_{F^{-1}U} \circ f$ is equal to the composition $(R \to \mathcal{O}_{\mathrm{Spec} R}(U)\circ F(U)$

lemma toOpen_comp_locallyRingedSpaceAdjunction_homEquiv_app
    {X : LocallyRingedSpace} {R : Type u} [CommRing R]
    (f : LocallyRingedSpace.Γ.rightOp.obj X ⟶ op (CommRingCat.of R)) (U) :
    StructureSheaf.toOpen R U.unop ≫
      (locallyRingedSpaceAdjunction.homEquiv X (op <| CommRingCat.of R) f).1.c.app U =
    f.unop ≫ X.presheaf.map (homOfLE le_top).op := by

found usefuly by Andrew during #12371

Co-authored-by: Andrew Yang [email protected]


Open in Gitpod

@jjaassoonn jjaassoonn added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels May 31, 2024
@jjaassoonn jjaassoonn added awaiting-review and removed awaiting-author A reviewer has asked the author a question or requested changes labels May 31, 2024
@jjaassoonn
Copy link
Collaborator Author

This is a fun error:

Error: ././././Mathlib/AlgebraicGeometry/GammaSpecAdjunction.lean:371:9: error: AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction_homEquiv_apply.{u_1} Left-hand side simplifies from
  (AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.homEquiv X R) f
to
  (AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.homEquiv X R) f

They look the same to me.

@erdOne
Copy link
Member

erdOne commented May 31, 2024

Looking at the lemmas used, I think some implicit types involved were dsimped.
This is a mwe. Not sure what to do here. Maybe we shouldn't tag the _obj lemmas as simp, or make them scoped instead.

import Mathlib.Logic.Equiv.Defs

def A := Unit
@[simp] def B := A
def e : B ≃ Unit := Equiv.refl _

@[simp] lemma e_apply (x) : e x = x := rfl

example (x) : e x = x := by simp -- fails because `B` gets rewritten to `A` first.

#lint only simpNF

@erdOne
Copy link
Member

erdOne commented May 31, 2024

Maybe either raise its priority or don't tag it as simp.

@jjaassoonn
Copy link
Collaborator Author

Maybe either raise its priority or don't tag it as simp.

Raising priority to high doesn't seem to be working, so I deleted the simp attribute

@jjaassoonn jjaassoonn added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels May 31, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jjaassoonn jjaassoonn added awaiting-review awaiting-CI and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jun 4, 2024
@jjaassoonn jjaassoonn added awaiting-review awaiting-CI and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jun 7, 2024
Copy link

github-actions bot commented Jun 7, 2024

PR summary

Import changes

No significant changes to the import graph


Declarations diff

+ Spec.locallyRingedSpaceObj_presheaf'
+ Spec.locallyRingedSpaceObj_presheaf_map
+ Spec.locallyRingedSpaceObj_presheaf_map'
+ Spec.locallyRingedSpaceObj_sheaf
+ Spec.locallyRingedSpaceObj_sheaf'
+ locallyRingedSpaceAdjunction_counit_app
+ locallyRingedSpaceAdjunction_counit_app'
+ locallyRingedSpaceAdjunction_homEquiv_apply
+ locallyRingedSpaceAdjunction_homEquiv_apply'
+ rightOp_map_unop
+ toOpen_comp_locallyRingedSpaceAdjunction_homEquiv_app

You can run this locally as follows
## summary with just the declaration names:
./scripts/no_lost_declarations.sh short <optional_commit>

## more verbose report:
./scripts/no_lost_declarations.sh <optional_commit>

@joelriou joelriou added awaiting-author A reviewer has asked the author a question or requested changes and removed awaiting-review labels Jun 9, 2024
@jjaassoonn jjaassoonn added awaiting-review awaiting-CI and removed awaiting-author A reviewer has asked the author a question or requested changes labels Jun 10, 2024
@joelriou
Copy link
Collaborator

Thanks!

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review labels Jun 10, 2024
mathlib-bors bot pushed a commit that referenced this pull request Jun 10, 2024
Added the following lemma:

Let $X$ be a locally ringed space, $R$ a ring and $U \subseteq \mathrm{Spec} R$ an open set.
Then for any $f : R \to \Gamma(\mathcal O_X, X)$, if we denote $F$ as the corresponding morphism $X \to \mathrm{Spec} R$ under the gamma spec adjunction  we have that 
the composition $res^{\mathrm{X}}\_{F^{-1}U} \circ f$ is equal to the composition $(R \to \mathcal{O}_{\mathrm{Spec} R}(U)\circ F(U)$
 
```lean
lemma toOpen_comp_locallyRingedSpaceAdjunction_homEquiv_app
    {X : LocallyRingedSpace} {R : Type u} [CommRing R]
    (f : LocallyRingedSpace.Γ.rightOp.obj X ⟶ op (CommRingCat.of R)) (U) :
    StructureSheaf.toOpen R U.unop ≫
      (locallyRingedSpaceAdjunction.homEquiv X (op <| CommRingCat.of R) f).1.c.app U =
    f.unop ≫ X.presheaf.map (homOfLE le_top).op := by
```

found usefuly by Andrew during #12371

Co-authored-by: Andrew Yang <[email protected]>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented Jun 10, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat(AlgebraicGeometry/GammaSpecAdjunction): a missing lemma [Merged by Bors] - feat(AlgebraicGeometry/GammaSpecAdjunction): a missing lemma Jun 10, 2024
@mathlib-bors mathlib-bors bot closed this Jun 10, 2024
@mathlib-bors mathlib-bors bot deleted the zjj/GammaSpecAdj_missing_lemmas branch June 10, 2024 11:34
AntoineChambert-Loir pushed a commit that referenced this pull request Jun 20, 2024
Added the following lemma:

Let $X$ be a locally ringed space, $R$ a ring and $U \subseteq \mathrm{Spec} R$ an open set.
Then for any $f : R \to \Gamma(\mathcal O_X, X)$, if we denote $F$ as the corresponding morphism $X \to \mathrm{Spec} R$ under the gamma spec adjunction  we have that 
the composition $res^{\mathrm{X}}\_{F^{-1}U} \circ f$ is equal to the composition $(R \to \mathcal{O}_{\mathrm{Spec} R}(U)\circ F(U)$
 
```lean
lemma toOpen_comp_locallyRingedSpaceAdjunction_homEquiv_app
    {X : LocallyRingedSpace} {R : Type u} [CommRing R]
    (f : LocallyRingedSpace.Γ.rightOp.obj X ⟶ op (CommRingCat.of R)) (U) :
    StructureSheaf.toOpen R U.unop ≫
      (locallyRingedSpaceAdjunction.homEquiv X (op <| CommRingCat.of R) f).1.c.app U =
    f.unop ≫ X.presheaf.map (homOfLE le_top).op := by
```

found usefuly by Andrew during #12371

Co-authored-by: Andrew Yang <[email protected]>
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-algebraic-geometry Algebraic geometry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants