import OAI.ArithmeticGeometry.OrdinaryLocus.Openness.SheafRestriction /-! # Tensor Functoriality -/ namespace OAI.ArithmeticGeometry.OrdinaryLocus.Openness.TensorFunctoriality.Construction noncomputable section /-! Tensor maps for sheaves, pushforward, and pullback. -/ open _root_.CategoryTheory _root_.AlgebraicGeometry MonoidalCategory universe u local instance tensorFunctorialityMonoidal (X : Scheme.{u}) : MonoidalCategory X.PresheafOfModules := PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) def sheafTensorMap {X : Scheme.{u}} {M M' N N' : X.Modules} (f : M ⟢ M') (g : N ⟢ N') : SheafTensor.Construction.sheafTensor M N ⟢ SheafTensor.Construction.sheafTensor M' N' := (PresheafOfModules.sheafification (πŸ™ X.ringCatSheaf.obj)).map (f.val βŠ—β‚˜ g.val) theorem sheafTensorMap_id {X : Scheme.{u}} (M N : X.Modules) : sheafTensorMap (πŸ™ M) (πŸ™ N) = πŸ™ (SheafTensor.Construction.sheafTensor M N) := by let F : X.PresheafOfModules β₯€ X.Modules := PresheafOfModules.sheafification (πŸ™ X.ringCatSheaf.obj) change F.map ((πŸ™ M.val) βŠ—β‚˜ (πŸ™ N.val)) = πŸ™ (F.obj (M.val βŠ— N.val)) exact (congrArg F.map (id_tensorHom_id M.val N.val)).trans (F.map_id _) theorem sheafTensorMap_comp {X : Scheme.{u}} {M M' M'' N N' N'' : X.Modules} (f : M ⟢ M') (f' : M' ⟢ M'') (g : N ⟢ N') (g' : N' ⟢ N'') : sheafTensorMap (f ≫ f') (g ≫ g') = sheafTensorMap f g ≫ sheafTensorMap f' g' := by let F : X.PresheafOfModules β₯€ X.Modules := PresheafOfModules.sheafification (πŸ™ X.ringCatSheaf.obj) change F.map ((f.val ≫ f'.val) βŠ—β‚˜ (g.val ≫ g'.val)) = F.map (f.val βŠ—β‚˜ g.val) ≫ F.map (f'.val βŠ—β‚˜ g'.val) exact (congrArg F.map (tensorHom_comp_tensorHom f.val g.val f'.val g'.val).symm).trans (F.map_comp _ _) theorem sheafTensorHomEquiv_naturality_left {X : Scheme.{u}} {M M' N N' P : X.Modules} (f : M ⟢ M') (g : N ⟢ N') (h : SheafTensor.Construction.sheafTensor M' N' ⟢ P) : SheafTensor.Construction.sheafTensorHomEquiv M N P (sheafTensorMap f g ≫ h) = (f.val βŠ—β‚˜ g.val) ≫ SheafTensor.Construction.sheafTensorHomEquiv M' N' P h := (PresheafOfModules.sheafificationAdjunction (πŸ™ X.ringCatSheaf.obj)).homEquiv_naturality_left (f.val βŠ—β‚˜ g.val) h theorem sheafTensorHomEquiv_naturality_right {X : Scheme.{u}} {M N P Q : X.Modules} (h : SheafTensor.Construction.sheafTensor M N ⟢ P) (f : P ⟢ Q) : SheafTensor.Construction.sheafTensorHomEquiv M N Q (h ≫ f) = SheafTensor.Construction.sheafTensorHomEquiv M N P h ≫ f.val := (PresheafOfModules.sheafificationAdjunction (πŸ™ X.ringCatSheaf.obj)).homEquiv_naturality_right h f theorem moduleSheafificationUnit_naturality {X : Scheme.{u}} {M N : X.PresheafOfModules} (f : M ⟢ N) : f ≫ SheafRestriction.Construction.moduleSheafificationUnit N = SheafRestriction.Construction.moduleSheafificationUnit M ≫ ((PresheafOfModules.sheafification (πŸ™ X.ringCatSheaf.obj)).map f).val := (PresheafOfModules.sheafificationAdjunction (πŸ™ X.ringCatSheaf.obj)).unit.naturality f def restrictScalarsSemilinearMap {R S : Type u} [CommRing R] [CommRing S] (Ο† : R β†’+* S) (M : ModuleCat.{u} S) : (ModuleCat.restrictScalars Ο†).obj M β†’β‚›β‚—[Ο†] M where toFun := id map_add' _ _ := rfl map_smul' _ _ := rfl /-- The tensor comparison for restriction of scalars along any ring map. -/ def restrictScalarsTensorMap {R S : Type u} [CommRing R] [CommRing S] (Ο† : R β†’+* S) (M N : ModuleCat.{u} S) : (ModuleCat.restrictScalars Ο†).obj M βŠ— (ModuleCat.restrictScalars Ο†).obj N ⟢ (ModuleCat.restrictScalars Ο†).obj (M βŠ— N) := let t := TensorProduct.map (restrictScalarsSemilinearMap Ο† M) (restrictScalarsSemilinearMap Ο† N) ModuleCat.ofHom (R := R) (X := ((ModuleCat.restrictScalars Ο†).obj M βŠ— (ModuleCat.restrictScalars Ο†).obj N : ModuleCat R)) (Y := ((ModuleCat.restrictScalars Ο†).obj (M βŠ— N) : ModuleCat R)) { toFun := t map_add' := t.map_add map_smul' r x := t.map_smulβ‚›β‚— r x } theorem restrictScalarsTensorMap_tmul {R S : Type u} [CommRing R] [CommRing S] (Ο† : R β†’+* S) (M N : ModuleCat.{u} S) (m : M) (n : N) : restrictScalarsTensorMap Ο† M N (m βŠ—β‚œ[R] n) = m βŠ—β‚œ[S] n := rfl def pushforwardModulePresheaf {X Y : Scheme.{u}} (f : X ⟢ Y) : X.PresheafOfModules β₯€ Y.PresheafOfModules := PresheafOfModules.pushforward f.toRingCatSheafHom.hom def pushforwardPresheafTensorMap {X Y : Scheme.{u}} (f : X ⟢ Y) (M N : X.PresheafOfModules) : (pushforwardModulePresheaf f).obj M βŠ— (pushforwardModulePresheaf f).obj N ⟢ (pushforwardModulePresheaf f).obj (M βŠ— N) where app U := restrictScalarsTensorMap (f.app U.unop).hom (M.obj (.op (f ⁻¹ᡁ U.unop))) (N.obj (.op (f ⁻¹ᡁ U.unop))) naturality {U V} h := by apply ModuleCat.MonoidalCategory.tensor_ext intro m n rfl theorem pushforwardPresheafTensorMap_naturality {X Y : Scheme.{u}} (f : X ⟢ Y) {M M' N N' : X.PresheafOfModules} (a : M ⟢ M') (b : N ⟢ N') : pushforwardPresheafTensorMap f M N ≫ (pushforwardModulePresheaf f).map (a βŠ—β‚˜ b) = ((pushforwardModulePresheaf f).map a βŠ—β‚˜ (pushforwardModulePresheaf f).map b) ≫ pushforwardPresheafTensorMap f M' N' := by ext1 U apply ModuleCat.MonoidalCategory.tensor_ext intro m n rfl /-- Tensoring two pushforwards maps naturally to the pushforward of their tensor product. -/ def pushforwardSheafTensorMap {X Y : Scheme.{u}} (f : X ⟢ Y) (M N : X.Modules) : SheafTensor.Construction.sheafTensor ((Scheme.Modules.pushforward f).obj M) ((Scheme.Modules.pushforward f).obj N) ⟢ (Scheme.Modules.pushforward f).obj (SheafTensor.Construction.sheafTensor M N) := (SheafTensor.Construction.sheafTensorHomEquiv _ _ _).symm (pushforwardPresheafTensorMap f M.val N.val ≫ (pushforwardModulePresheaf f).map (SheafRestriction.Construction.moduleSheafificationUnit (M.val βŠ— N.val))) theorem pushforwardSheafTensorMap_naturality {X Y : Scheme.{u}} (f : X ⟢ Y) {M M' N N' : X.Modules} (a : M ⟢ M') (b : N ⟢ N') : pushforwardSheafTensorMap f M N ≫ (Scheme.Modules.pushforward f).map (sheafTensorMap a b) = sheafTensorMap ((Scheme.Modules.pushforward f).map a) ((Scheme.Modules.pushforward f).map b) ≫ pushforwardSheafTensorMap f M' N' := by apply (SheafTensor.Construction.sheafTensorHomEquiv _ _ _).injective rw [sheafTensorHomEquiv_naturality_right, sheafTensorHomEquiv_naturality_left] simp only [pushforwardSheafTensorMap, Equiv.apply_symm_apply] let F := pushforwardModulePresheaf f let η₁ := SheafRestriction.Construction.moduleSheafificationUnit (M.val βŠ— N.val) let Ξ·β‚‚ := SheafRestriction.Construction.moduleSheafificationUnit (M'.val βŠ— N'.val) let ΞΈ := (sheafTensorMap a b).val let q₁ := pushforwardPresheafTensorMap f M.val N.val let qβ‚‚ := pushforwardPresheafTensorMap f M'.val N'.val have hΞ· : η₁ ≫ ΞΈ = (a.val βŠ—β‚˜ b.val) ≫ Ξ·β‚‚ := (moduleSheafificationUnit_naturality (a.val βŠ—β‚˜ b.val)).symm have hmap : F.map η₁ ≫ F.map ΞΈ = F.map (a.val βŠ—β‚˜ b.val) ≫ F.map Ξ·β‚‚ := (F.map_comp η₁ ΞΈ).symm.trans ((congrArg F.map hΞ·).trans (F.map_comp _ _)) have hq : q₁ ≫ F.map (a.val βŠ—β‚˜ b.val) = (F.map a.val βŠ—β‚˜ F.map b.val) ≫ qβ‚‚ := pushforwardPresheafTensorMap_naturality f a.val b.val change (q₁ ≫ F.map η₁) ≫ F.map ΞΈ = (F.map a.val βŠ—β‚˜ F.map b.val) ≫ qβ‚‚ ≫ F.map Ξ·β‚‚ exact (Category.assoc _ _ _).trans ((congrArg (fun t ↦ q₁ ≫ t) hmap).trans ((Category.assoc _ _ _).symm.trans ((congrArg (fun t ↦ t ≫ F.map Ξ·β‚‚) hq).trans (Category.assoc _ _ _)))) /-- The canonical comparison from the pullback of a tensor product to the tensor product of the pullbacks. -/ def pullbackSheafTensorMap {X Y : Scheme.{u}} (f : X ⟢ Y) (M N : Y.Modules) : (Scheme.Modules.pullback f).obj (SheafTensor.Construction.sheafTensor M N) ⟢ SheafTensor.Construction.sheafTensor ((Scheme.Modules.pullback f).obj M) ((Scheme.Modules.pullback f).obj N) := ((Scheme.Modules.pullbackPushforwardAdjunction f).homEquiv _ _).symm (sheafTensorMap ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app M) ((Scheme.Modules.pullbackPushforwardAdjunction f).unit.app N) ≫ pushforwardSheafTensorMap f ((Scheme.Modules.pullback f).obj M) ((Scheme.Modules.pullback f).obj N)) theorem pullbackSheafTensorMap_naturality {X Y : Scheme.{u}} (f : X ⟢ Y) {M M' N N' : Y.Modules} (a : M ⟢ M') (b : N ⟢ N') : (Scheme.Modules.pullback f).map (sheafTensorMap a b) ≫ pullbackSheafTensorMap f M' N' = pullbackSheafTensorMap f M N ≫ sheafTensorMap ((Scheme.Modules.pullback f).map a) ((Scheme.Modules.pullback f).map b) := by let L := Scheme.Modules.pullback f let R := Scheme.Modules.pushforward f let adj := Scheme.Modules.pullbackPushforwardAdjunction f apply adj.homEquiv_naturality_right_square change sheafTensorMap a b ≫ (sheafTensorMap (adj.unit.app M') (adj.unit.app N') ≫ pushforwardSheafTensorMap f (L.obj M') (L.obj N')) = (sheafTensorMap (adj.unit.app M) (adj.unit.app N) ≫ pushforwardSheafTensorMap f (L.obj M) (L.obj N)) ≫ R.map (sheafTensorMap (L.map a) (L.map b)) rw [Category.assoc, pushforwardSheafTensorMap_naturality, ← Category.assoc, ← sheafTensorMap_comp, ← Category.assoc, ← sheafTensorMap_comp] congr 1 exact congrArgβ‚‚ sheafTensorMap (adj.unit.naturality a) (adj.unit.naturality b) end end OAI.ArithmeticGeometry.OrdinaryLocus.Openness.TensorFunctoriality.Construction