import OAI.NumberTheory.PiExponent.Polynomials.FrameCoefficients namespace OAI namespace PiExponentSeshadri.Geometry noncomputable section open CategoryTheory AlgebraicGeometry TopologicalSpace MonoidalCategory open scoped AlgebraicGeometry open PiExponentSeshadri.Frames variable {X : Scheme} lemma tensor_unit_end {C : Type*} [Category C] [MonoidalCategory C] (f g : šŸ™_ C ⟶ šŸ™_ C) : (f āŠ—ā‚˜ g) ≫ (Ī»_ (šŸ™_ C)).hom = (Ī»_ (šŸ™_ C)).hom ≫ (f ≫ g) := by rw [MonoidalCategory.tensorHom_def, Category.assoc, leftUnitor_naturality, ← Category.assoc, unitors_equal, rightUnitor_naturality, Category.assoc] lemma moduleTensorUnit_scalar (f g : structureSheaf X ⟶ structureSheaf X) : moduleTensorMap f g ≫ (moduleTensorUnit (structureSheaf X)).hom = (moduleTensorUnit (structureSheaf X)).hom ≫ (f ≫ g) := by let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) let F : PresheafOfModules X.ringCatSheaf.obj ℤ X.Modules := PresheafOfModules.sheafification (šŸ™ X.ringCatSheaf.obj) let G : X.Modules ℤ PresheafOfModules X.ringCatSheaf.obj := SheafOfModules.forget X.ringCatSheaf ā‹™ PresheafOfModules.restrictScalars (šŸ™ X.ringCatSheaf.obj) let ε : G ā‹™ F ⟶ šŸ­ X.Modules := (PresheafOfModules.sheafificationAdjunction (šŸ™ X.ringCatSheaf.obj)).counit have h : (f.val āŠ—ā‚˜ g.val) ≫ (Ī»_ (structureSheaf X).val).hom = (Ī»_ (structureSheaf X).val).hom ≫ (f ≫ g).val := by let fā‚€ : šŸ™_ (PresheafOfModules X.ringCatSheaf.obj) ⟶ šŸ™_ (PresheafOfModules X.ringCatSheaf.obj) := f.val let gā‚€ : šŸ™_ (PresheafOfModules X.ringCatSheaf.obj) ⟶ šŸ™_ (PresheafOfModules X.ringCatSheaf.obj) := g.val exact tensor_unit_end fā‚€ gā‚€ change F.map (f.val āŠ—ā‚˜ g.val) ≫ (F.map (Ī»_ (structureSheaf X).val).hom ≫ ε.app (structureSheaf X)) = (F.map (Ī»_ (structureSheaf X).val).hom ≫ ε.app (structureSheaf X)) ≫ (f ≫ g) erw [← Category.assoc, ← F.map_comp, h, F.map_comp, Category.assoc, Category.assoc] congr 1 exact ε.naturality (f ≫ g) def endPower (f : structureSheaf X ⟶ structureSheaf X) : ā„• → (structureSheaf X ⟶ structureSheaf X) | 0 => šŸ™ _ | n + 1 => f ≫ endPower f n lemma endValue_endPower (f : structureSheaf X ⟶ structureSheaf X) (n : ā„•) : endValue (endPower f n) = endValue f ^ n := by induction n with | zero => change (1 : Ī“(X, ⊤)) = endValue f ^ 0 exact (pow_zero _).symm | succ n hn => calc endValue (endPower f (n + 1)) = endValue f * endValue (endPower f n) := endValue_comp f (endPower f n) _ = endValue f * endValue f ^ n := congrArg (endValue f * Ā·) hn _ = _ := (pow_succ' _ _).symm lemma moduleTensorUnit_natural {M N : X.Modules} (g : M ⟶ N) : moduleTensorMap (šŸ™ (structureSheaf X)) g ≫ (moduleTensorUnit N).hom = (moduleTensorUnit M).hom ≫ g := by let : MonoidalCategory (PresheafOfModules X.ringCatSheaf.obj) := PresheafOfModulesOfCommRing.monoidalCategory (R := X.presheaf) let F : PresheafOfModules X.ringCatSheaf.obj ℤ X.Modules := PresheafOfModules.sheafification (šŸ™ X.ringCatSheaf.obj) let G : X.Modules ℤ PresheafOfModules X.ringCatSheaf.obj := SheafOfModules.forget X.ringCatSheaf ā‹™ PresheafOfModules.restrictScalars (šŸ™ X.ringCatSheaf.obj) let ε : G ā‹™ F ⟶ šŸ­ X.Modules := (PresheafOfModules.sheafificationAdjunction (šŸ™ X.ringCatSheaf.obj)).counit change F.map ((šŸ™ (structureSheaf X).val) āŠ—ā‚˜ g.val) ≫ (F.map (Ī»_ N.val).hom ≫ ε.app N) = (F.map (Ī»_ M.val).hom ≫ ε.app M) ≫ g have h : ((šŸ™ (structureSheaf X).val) āŠ—ā‚˜ g.val) ≫ (Ī»_ N.val).hom = (Ī»_ M.val).hom ≫ g.val := by rw [id_tensorHom] exact leftUnitor_naturality g.val have hF : F.map (šŸ™ (structureSheaf X).val āŠ—ā‚˜ g.val) ≫ F.map (Ī»_ N.val).hom = F.map (Ī»_ M.val).hom ≫ F.map g.val := (F.map_comp _ _).symm.trans ((congrArg F.map h).trans (F.map_comp _ _)) refine (Category.assoc _ _ _).symm.trans ?_ refine (congrArg (Ā· ≫ ε.app N) hF).trans ?_ refine (Category.assoc _ _ _).trans ?_ refine (congrArg (F.map (Ī»_ M.val).hom ≫ Ā·) (ε.naturality g)).trans ?_ exact (Category.assoc _ _ _).symm lemma modulePowMap_unitPower (f : structureSheaf X ⟶ structureSheaf X) (n : ā„•) : modulePowMap f n ≫ (unitPowerIso n).hom = (unitPowerIso n).hom ≫ endPower f n := by induction n with | zero => change šŸ™ (structureSheaf X) ≫ šŸ™ (structureSheaf X) = šŸ™ (structureSheaf X) ≫ šŸ™ (structureSheaf X) rfl | succ n hn => change moduleTensorMap f (modulePowMap f n) ≫ ((moduleTensorUnit _).hom ≫ (unitPowerIso n).hom) = ((moduleTensorUnit _).hom ≫ (unitPowerIso n).hom) ≫ (f ≫ endPower f n) calc _ = moduleTensorMap f (modulePowMap f n) ≫ moduleTensorMap (šŸ™ (structureSheaf X)) (unitPowerIso n).hom ≫ (moduleTensorUnit (structureSheaf X)).hom := by rw [moduleTensorUnit_natural] _ = moduleTensorMap f ((unitPowerIso n).hom ≫ endPower f n) ≫ (moduleTensorUnit (structureSheaf X)).hom := by rw [← Category.assoc, ← moduleTensorMap_comp, Category.comp_id, hn] _ = moduleTensorMap (šŸ™ (structureSheaf X)) (unitPowerIso n).hom ≫ moduleTensorMap f (endPower f n) ≫ (moduleTensorUnit (structureSheaf X)).hom := by rw [← Category.assoc, ← moduleTensorMap_comp, Category.id_comp] _ = (moduleTensorUnit (modulePow X (structureSheaf X) n)).hom ≫ (unitPowerIso n).hom ≫ (f ≫ endPower f n) := by rw [moduleTensorUnit_scalar, ← Category.assoc, moduleTensorUnit_natural, Category.assoc] _ = _ := by simp only [Category.assoc] def globalPowerFrame {M : X.Modules} (e : M ≅ structureSheaf X) (n : ā„•) : modulePow X M n ≅ structureSheaf X := (modulePowFunctor n).mapIso e ≪≫ unitPowerIso n lemma powerSection_coefficient {M : X.Modules} (e : M ≅ structureSheaf X) (s : structureSheaf X ⟶ M) (n : ā„•) : coefficient (globalPowerFrame e n) (powerSection s n) = coefficient e s ^ n := by change endValue ((unitPowerIso n).inv ≫ modulePowMap s n ≫ (modulePowMap e.hom n ≫ (unitPowerIso n).hom)) = _ erw [← Category.assoc (modulePowMap s n), ← modulePowMap_comp, modulePowMap_unitPower, Iso.inv_hom_id_assoc, endValue_endPower] rfl lemma frameChange_globalPowerFrame {M : X.Modules} (e f : M ≅ structureSheaf X) (n : ā„•) : (frameChange (globalPowerFrame e n) (globalPowerFrame f n) : Ī“(X,⊤)) = (frameChange e f : Ī“(X,⊤)) ^ n := by have h := powerSection_coefficient f e.inv n exact h end end PiExponentSeshadri.Geometry end OAI