Skip to content

Commit 1531e8c

Browse files
committed
feat(AlgebraicGeometry/Modules): compatibilities of Over and restriction along open immersions (leanprover-community#40935)
We construct natural isomorphisms relating `Scheme.Modules.overEquiv` with `Scheme.Modules.restrictFunctor`.
1 parent 2a63917 commit 1531e8c

7 files changed

Lines changed: 160 additions & 3 deletions

File tree

Mathlib/Algebra/Category/ModuleCat/Basic.lean

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,33 @@ def homMk : M ⟶ N where
585585
lemma forget₂_map_homMk :
586586
(forget₂ (ModuleCat R) AddCommGrpCat).map (homMk φ hφ) = φ := rfl
587587

588+
/-- Constructor for isomorphisms in `ModuleCat R` taking an isomorphism in `AddCommGrpCat`
589+
and a compatibility condition. -/
590+
def isoMk (φ : (forget₂ (ModuleCat R) Ab).obj M ≅ (forget₂ _ _).obj N)
591+
(hφ : ∀ r, φ.hom ≫ N.smul r = M.smul r ≫ φ.hom) :
592+
M ≅ N :=
593+
LinearEquiv.toModuleIso
594+
{ __ := φ.addCommGroupIsoToAddEquiv
595+
map_smul' r x := congr($(hφ r) x).symm }
596+
597+
@[simp]
598+
lemma isoMk_hom (φ : (forget₂ (ModuleCat R) Ab).obj M ≅ (forget₂ _ _).obj N)
599+
(hφ : ∀ r, φ.hom ≫ N.smul r = M.smul r ≫ φ.hom) :
600+
(isoMk φ hφ).hom = homMk φ.hom hφ :=
601+
rfl
602+
603+
@[simp]
604+
lemma isoMk_inv (φ : (forget₂ (ModuleCat R) Ab).obj M ≅ (forget₂ _ _).obj N)
605+
(hφ : ∀ r, φ.hom ≫ N.smul r = M.smul r ≫ φ.hom) :
606+
(isoMk φ hφ).inv = homMk φ.inv (ModuleCat.smul_naturality (isoMk φ hφ).inv) :=
607+
rfl
608+
609+
@[simp]
610+
lemma isoMk_symm (φ : (forget₂ (ModuleCat R) Ab).obj M ≅ (forget₂ _ _).obj N)
611+
(hφ : ∀ r, φ.hom ≫ N.smul r = M.smul r ≫ φ.hom) :
612+
(isoMk φ hφ).symm = isoMk φ.symm (ModuleCat.smul_naturality (isoMk φ hφ).inv) :=
613+
rfl
614+
588615
end
589616

590617
instance : (forget (ModuleCat.{v} R)).ReflectsIsomorphisms where

Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,17 @@ def restrictScalars {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →
8787
obj := RestrictScalars.obj' f
8888
map := RestrictScalars.map' f
8989

90+
@[simp]
91+
lemma smul_restrictScalars {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) (r : R)
92+
(M : ModuleCat S) :
93+
dsimp% ((ModuleCat.restrictScalars f).obj M).smul r = M.smul (f r) :=
94+
rfl
95+
96+
lemma forget₂_map_restrictScalars {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
97+
{M N : ModuleCat S} (g : M ⟶ N) :
98+
(forget₂ _ Ab).map ((ModuleCat.restrictScalars f).map g) = (forget₂ _ Ab).map g :=
99+
rfl
100+
90101
instance {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S) :
91102
(restrictScalars.{v} f).Faithful where
92103
map_injective h := by

Mathlib/Algebra/Category/ModuleCat/Presheaf.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@ lemma presheaf_obj_coe (X : Cᵒᵖ) :
140140
lemma presheaf_map_apply_coe {X Y : Cᵒᵖ} (f : X ⟶ Y) (x : M.obj X) :
141141
DFunLike.coe (α := M.obj X) (β := fun _ ↦ M.obj Y) (M.presheaf.map f).hom x = M.map f x := rfl
142142

143+
@[reassoc]
144+
lemma smul_map {U V : Cᵒᵖ} (f : U ⟶ V) (r : R.obj U) :
145+
dsimp% ModuleCat.smul _ r ≫ M.presheaf.map f =
146+
M.presheaf.map f ≫ ModuleCat.smul _ (R.map f r) := by
147+
ext x
148+
exact (M.map f).hom.map_smul r x
149+
143150
instance (M : PresheafOfModules R) (X : Cᵒᵖ) :
144151
Module (R.obj X) (M.presheaf.obj X) :=
145152
inferInstanceAs (Module (R.obj X) (M.obj X))

Mathlib/Algebra/Category/ModuleCat/Presheaf/Pushforward.lean

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ a morphism of presheaves of rings `S ⟶ F.op ⋙ R`. -/
8989
noncomputable def pushforward : PresheafOfModules.{v} R ⥤ PresheafOfModules.{v} S :=
9090
pushforward₀ F R ⋙ restrictScalars φ
9191

92+
lemma forget₂_map_pushforward_obj_map {U V : Cᵒᵖ} (f : U ⟶ V) (M : PresheafOfModules R) :
93+
(forget₂ _ Ab).map (((PresheafOfModules.pushforward φ).obj M).map f) =
94+
M.presheaf.map (F.map f.unop).op :=
95+
rfl
96+
97+
lemma forget₂_map_pushforward_map_app {U : Cᵒᵖ} {M N : PresheafOfModules _} (g : M ⟶ N) :
98+
(forget₂ _ Ab).map (((pushforward φ).map g).app U) = (forget₂ _ Ab).map (g.app _) :=
99+
rfl
100+
92101
/-- The pushforward of presheaves of modules commutes with the forgetful functor
93102
to presheaves of abelian groups. -/
94103
noncomputable def pushforwardCompToPresheaf :

Mathlib/Algebra/Category/ModuleCat/Sheaf/PushforwardContinuous.lean

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ noncomputable def pushforward : SheafOfModules.{v} R ⥤ SheafOfModules.{v} S wh
4848
map f :=
4949
{ val := (PresheafOfModules.pushforward φ.hom).map f.val }
5050

51+
lemma forget₂_map_pushforward_obj_val_map {U V : Cᵒᵖ} (f : U ⟶ V) (M) :
52+
(forget₂ _ Ab).map (((pushforward.{v} φ).obj M).val.map f) =
53+
M.val.presheaf.map (F.map f.unop).op :=
54+
rfl
55+
5156
variable (R) in
5257
/-- The restriction functor from sheaves of `R`-modules to sheaves of `R.over X`-modules
5358
for some `X : D`. -/
@@ -128,12 +133,13 @@ section
128133

129134
variable {K' : GrothendieckTopology D'} {K'' : GrothendieckTopology D''}
130135
{G : D ⥤ D'} {R' : Sheaf K' RingCat.{u}}
131-
[Functor.IsContinuous G K K'] [Functor.IsContinuous (F ⋙ G) J K']
136+
[Functor.IsContinuous G K K']
132137
(ψ : R ⟶ (G.sheafPushforwardContinuous RingCat.{u} K K').obj R')
133138

134139
/-- The composition of two pushforward functors on categories of sheaves of modules
135140
identify to the pushforward for the composition. -/
136141
noncomputable def pushforwardComp :
142+
haveI : Functor.IsContinuous (F ⋙ G) J K' := Functor.isContinuous_comp _ _ _ K _
137143
pushforward.{v} ψ ⋙ pushforward.{v} φ ≅
138144
pushforward.{v} (F := F ⋙ G) (φ ≫ (F.sheafPushforwardContinuous RingCat.{u} J K).map ψ) :=
139145
Iso.refl _
@@ -149,8 +155,7 @@ lemma pushforwardComp_inv_app_val_app (M U x) :
149155
variable {G' : D' ⥤ D''} {R'' : Sheaf K'' RingCat.{u}}
150156
[Functor.IsContinuous G' K' K'']
151157
[Functor.IsContinuous (G ⋙ G') K K'']
152-
[Functor.IsContinuous ((F ⋙ G) ⋙ G') J K'']
153-
[Functor.IsContinuous (F ⋙ G ⋙ G') J K'']
158+
[(F ⋙ G).IsContinuous J K']
154159
(ψ' : R' ⟶ (G'.sheafPushforwardContinuous RingCat.{u} K' K'').obj R'')
155160

156161
lemma pushforward_assoc :
@@ -240,6 +245,14 @@ noncomputable def pushforwardNatIso (α : F ≅ G) :
240245
simp only [← Functor.map_comp, ← op_comp,
241246
Iso.hom_inv_id_app, op_id, CategoryTheory.Functor.map_id]
242247

248+
/-- More flexible variant of `SheafOfModules.pushforwardNatIso`. -/
249+
@[simps!]
250+
noncomputable
251+
def pushforwardCongr₂ {ψ : T ⟶ (F.sheafPushforwardContinuous RingCat J K).obj S} (e : F ≅ G)
252+
(he : φ ≫ (Functor.sheafPushforwardContinuousNatTrans e.hom _ _ _).app S = ψ) :
253+
pushforward.{v} φ ≅ pushforward.{v} ψ :=
254+
pushforwardNatIso _ e ≪≫ pushforwardCongr he
255+
243256
end NatTrans
244257

245258
section Adjunction

Mathlib/AlgebraicGeometry/Modules/Sheaf.lean

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ public import Mathlib.Algebra.Category.ModuleCat.Sheaf.Colimits
1010
public import Mathlib.Algebra.Category.ModuleCat.Sheaf.PullbackContinuous
1111
public import Mathlib.AlgebraicGeometry.Modules.Presheaf
1212
public import Mathlib.AlgebraicGeometry.OpenImmersion
13+
public import Mathlib.AlgebraicGeometry.AffineScheme
1314
public import Mathlib.CategoryTheory.Bicategory.Adjunction.Adj
1415
public import Mathlib.CategoryTheory.Bicategory.Adjunction.Cat
1516
public import Mathlib.CategoryTheory.Bicategory.Functor.LocallyDiscrete
17+
public import Mathlib.Topology.Sheaves.Module
1618

1719
/-!
1820
# The category of sheaves of modules over a scheme
@@ -381,6 +383,23 @@ instead. -/
381383
lemma restrict_map (M : Y.Modules) (f : X ⟶ Y) [IsOpenImmersion f] {U V} (i : U ⟶ V) :
382384
(M.restrict f).presheaf.map i.op = M.presheaf.map (f.opensFunctor.map i).op := rfl
383385

386+
/-- `Scheme.Modules.restrict` along an open immersion `X ⟶ Y` sends `𝒪_Y` to `𝒪_X`. -/
387+
def restrictUnitIso (f : X ⟶ Y) [IsOpenImmersion f] :
388+
restrict (.unit <| Y.ringCatSheaf) f ≅ .unit X.ringCatSheaf := by
389+
refine (fullyFaithfulForget _).preimageIso <| PresheafOfModules.isoMk (fun U ↦ ?_) ?_
390+
· refine ModuleCat.isoMk
391+
((forget₂ CommRingCat RingCat ⋙ forget₂ _ Ab).mapIso (f.appIso U.unop)) ?_
392+
intro (r : Γ(X, U.unop))
393+
ext (x : Γ(Y, f ''ᵁ U.unop))
394+
change r * (f.appIso U.unop).hom x = (f.appIso U.unop).hom ((f.appIso U.unop).inv r * x)
395+
simp
396+
· intro U V g
397+
have : Y.presheaf.map (homOfLE (by grw [leOfHom g.unop])).op ≫
398+
(f.appIso _).hom = (f.appIso U.unop).hom ≫ X.presheaf.map g := by
399+
simp [Hom.appIso_hom']
400+
ext x
401+
exact congr($(this) x)
402+
384403
/-- The restriction of a module along an open immersion. -/
385404
def restrictFunctorAdjCounitIso : pushforward f ⋙ restrictFunctor f ≅ 𝟭 _ :=
386405
letI := CategoryTheory.Functor.isContinuous_comp.{u} f.opensFunctor (Opens.map f.base)
@@ -521,4 +540,62 @@ noncomputable def sheafComposePushforwardComp {R S : CommRingCat.{u}} (φ : R
521540
· cat_disch
522541
· cat_disch
523542

543+
/-- Sheaves of modules on `𝒪_X` restricted to `U` are equivalent to sheaves of `𝒪_U`-modules. -/
544+
noncomputable
545+
def overEquiv {X : Scheme.{u}} (U : X.Opens) :
546+
SheafOfModules (X.ringCatSheaf.over U) ≌ (U : Scheme.{u}).Modules :=
547+
TopologicalSpace.Opens.sheafOfModulesEquivOver _ _
548+
549+
set_option backward.isDefEq.respectTransparency false in
550+
/-- Up to `Scheme.Modules.overEquiv`, `SheafOfModules.overMap` is isomorphic to
551+
`Scheme.Modules.restrictFunctor`. -/
552+
noncomputable
553+
def overMapCompOverEquiv {X : Scheme.{u}} {U V : X.Opens} (f : V ⟶ U) :
554+
overMap X.ringCatSheaf f ⋙ (overEquiv V).functor ≅
555+
(overEquiv U).functor ⋙ restrictFunctor (X.homOfLE <| leOfHom f) := by
556+
haveI : (Hom.opensFunctor (X.homOfLE <| leOfHom f)).IsContinuous
557+
(Opens.grothendieckTopology V.toScheme) (Opens.grothendieckTopology U.carrier) :=
558+
inferInstanceAs <|
559+
(Hom.opensFunctor (X.homOfLE <| leOfHom f)).IsContinuous _
560+
(Opens.grothendieckTopology U.toScheme)
561+
haveI := U.instIsDenseSubsiteSubtypeMemOverGrothendieckTopologyOverInverseOverEquivalence
562+
haveI : (Hom.opensFunctor (X.homOfLE <| leOfHom f)).IsContinuous
563+
(Opens.grothendieckTopology ↥V) (Opens.grothendieckTopology U.toScheme) :=
564+
inferInstanceAs <| (X.homOfLE <| leOfHom f).opensFunctor.IsContinuous
565+
(Opens.grothendieckTopology V.toScheme) (Opens.grothendieckTopology U.toScheme)
566+
haveI : ((Opens.overEquivalence V).symm.functor ⋙ Over.map f).IsContinuous
567+
(Opens.grothendieckTopology ↥V) ((Opens.grothendieckTopology X).over U) :=
568+
Functor.isContinuous_comp _ _ _ (.over (Opens.grothendieckTopology _) _) _
569+
haveI : (Opens.overEquivalence U).symm.functor.IsContinuous (Opens.grothendieckTopology U)
570+
((Opens.grothendieckTopology X).over U) :=
571+
inferInstanceAs <| U.overEquivalence.inverse.IsContinuous (Opens.grothendieckTopology U.carrier)
572+
((Opens.grothendieckTopology X).over U)
573+
haveI : ((X.homOfLE (leOfHom f)).opensFunctor ⋙
574+
(Opens.overEquivalence U).symm.functor).IsContinuous (Opens.grothendieckTopology ↥V)
575+
((Opens.grothendieckTopology ↥X).over U) :=
576+
Functor.isContinuous_comp _ _ _ (Opens.grothendieckTopology _) _
577+
refine (SheafOfModules.pushforwardComp _ _) ≪≫ ?_ ≪≫ (SheafOfModules.pushforwardComp _ _).symm
578+
refine SheafOfModules.pushforwardCongr₂ _ ?_ ?_
579+
· refine NatIso.ofComponents (fun W ↦ Over.isoMk (eqToIso ?_) ?_) ?_
580+
· suffices U.ι ''ᵁ ((X.homOfLE (leOfHom f)) ''ᵁ W) = V.ι ''ᵁ W by simpa
581+
simp [← Scheme.Hom.comp_image]
582+
· cat_disch
583+
· cat_disch
584+
· ext W x
585+
suffices X.presheaf.map _ x = ((X.homOfLE <| leOfHom f).appIso _).inv x by simpa
586+
rw [Scheme.Hom.appIso_homOfLE_inv]
587+
rfl
588+
589+
/-- Up to `Scheme.Modules.overEquiv`, `SheafOfModules.overFunctor` is isomorphic to
590+
`Scheme.Modules.restrictFunctor`. -/
591+
noncomputable
592+
def overFunctorEquiv {X : Scheme.{u}} (U : X.Opens) :
593+
overFunctor X.ringCatSheaf U ⋙ (overEquiv U).functor ≅ restrictFunctor U.ι := by
594+
have : ((Opens.overEquivalence U).symm.functor ⋙ Over.forget U).IsContinuous
595+
(Opens.grothendieckTopology ↥U) (Opens.grothendieckTopology ↥X) :=
596+
Functor.isContinuous_comp _ _ _ (.over (Opens.grothendieckTopology _) U) _
597+
refine SheafOfModules.pushforwardComp _ _ ≪≫ SheafOfModules.pushforwardCongr ?_
598+
simp only [CategoryTheory.Functor.map_id, Opposite.op_unop, Opens.ι_appIso, Iso.refl_inv]
599+
rfl
600+
524601
end AlgebraicGeometry.Scheme.Modules

Mathlib/AlgebraicGeometry/Restrict.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,19 @@ instance (X : Scheme.{u}) {U V : X.Opens} (e : U ≤ V) : IsOpenImmersion (X.hom
307307
delta Scheme.homOfLE
308308
infer_instance
309309

310+
set_option backward.isDefEq.respectTransparency false in
311+
lemma Scheme.Hom.appIso_homOfLE_inv {X : Scheme.{u}} {U V : X.Opens} (h : U ≤ V)
312+
(W : (U : Scheme.{u}).Opens) :
313+
((X.homOfLE h).appIso W).inv =
314+
X.presheaf.map (.op <| homOfLE <| by
315+
suffices V.ι ''ᵁ _ ≤ U.ι ''ᵁ W by simpa
316+
simp [← Scheme.Hom.comp_image]) := by
317+
rw [eq_comm, ← Iso.hom_comp_eq_id]
318+
dsimp
319+
simp only [appIso_hom, homOfLE_app, homOfLE_leOfHom, eqToHom_op, Opens.toScheme_presheaf_map,
320+
eqToHom_unop, ← X.presheaf.map_comp, Category.assoc, ← X.presheaf.map_id]
321+
rfl
322+
310323
@[simp]
311324
lemma Scheme.opensRange_homOfLE {U V : X.Opens} (e : U ≤ V) :
312325
(X.homOfLE e).opensRange = V.ι ⁻¹ᵁ U :=

0 commit comments

Comments
 (0)