import Mathlib.AlgebraicGeometry.ResidueField noncomputable section universe u open CategoryTheory CategoryTheory.Limits AlgebraicGeometry namespace AlgebraicGeometry def schemeFibreEndo {S X : Scheme.{u}} (f : X ⟶ S) (h : X ⟶ X) (hcomm : h ≫ f = f) (s : S) : Limits.pullback f (S.fromSpecResidueField s) ⟶ Limits.pullback f (S.fromSpecResidueField s) := Limits.pullback.lift (Limits.pullback.fst _ _ ≫ h) (Limits.pullback.snd _ _) (by rw [Category.assoc, hcomm, Limits.pullback.condition]) @[simp] theorem schemeFibreEndo_fst {S X : Scheme.{u}} (f : X ⟶ S) (h : X ⟶ X) (hcomm : h ≫ f = f) (s : S) : schemeFibreEndo f h hcomm s ≫ Limits.pullback.fst _ _ = Limits.pullback.fst _ _ ≫ h := Limits.pullback.lift_fst _ _ _ @[simp] theorem schemeFibreEndo_snd {S X : Scheme.{u}} (f : X ⟶ S) (h : X ⟶ X) (hcomm : h ≫ f = f) (s : S) : schemeFibreEndo f h hcomm s ≫ Limits.pullback.snd _ _ = Limits.pullback.snd _ _ := Limits.pullback.lift_snd _ _ _ end AlgebraicGeometry