Lean4
/-- Given `S`-schemes `X` and `Y` such that `Y` is locally of finite type and
`X` is irreducible germ-injective at `x` (e.g. when `X` is integral),
any `S`-morphism `Spec 𝒪ₓ ⟶ Y` spreads out to a partial map from `X` to `Y`.
-/
noncomputable def ofFromSpecStalk [IrreducibleSpace X] [LocallyOfFiniteType sY] {x : X} [X.IsGermInjectiveAt x]
(φ : Spec (X.presheaf.stalk x) ⟶ Y) (h : φ ≫ sY = X.fromSpecStalk x ≫ sX) : X.PartialMap Y
where
hom := (spread_out_of_isGermInjective' sX sY φ h).choose_spec.choose_spec.choose
domain := (spread_out_of_isGermInjective' sX sY φ h).choose
dense_domain :=
(spread_out_of_isGermInjective' sX sY φ h).choose.2.dense
⟨_, (spread_out_of_isGermInjective' sX sY φ h).choose_spec.choose⟩