Module

StalkExtensions.lean

Nyll.AbelianVarieties.NeronModels.StalkExtensions
17 declarations indexed from sourceView source ↗

Local extension comparisons at model stalks

Specializations in a fiber product, generic-fiber images, and smooth codimension-one stalks provide the local comparisons used to extend translations between models.

Imports43
Imported by9

Declarations

AbelianVarieties.NOSProofs.SpecializationSlices.SpecializationSlice.flat_SpecMap_of_field
Source context 7 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_specializes_fst_eq_snd_eq_of_specializes_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.SpecializationSlices
noncomputable section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Topology
universe u
namespace SpecializationSlice
theorem flat_SpecMap_of_field {k L : Type u} [Field k] [Field L]
    (φ : CommRingCat.of k ⟶ CommRingCat.of L) :
    Flat (Spec.map φ)
AbelianVarieties.NOSProofs.SpecializationSlices.SpecializationSlice.main
Source context 7 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_specializes_fst_eq_snd_eq_of_specializes_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.SpecializationSlices
noncomputable section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Topology
universe u
namespace SpecializationSlice
theorem main
    {R : Type u} [CommRing R] [IsLocalRing R]
    {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
    (θ : ↑(pullback f f)) (hθ : f.base ((pullback.fst f f).base θ) = IsLocalRing.closedPoint R)
    (y : X) (hy : y ⤳ (pullback.snd f f).base θ) (hys : f.base y = IsLocalRing.closedPoint R) :
    ∃ θ' : ↑(pullback f f), θ' ⤳ θ ∧ (pullback.fst f f).base θ' = (pullback.fst f f).base θ ∧
      (pullback.snd f f).base θ' = y
NeronModelInfra.exists_specializes_fst_eq_snd_eq_of_specializes_snd
Source context 8 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_specializes_fst_eq_snd_eq_of_specializes_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
noncomputable section
universe u
open CategoryTheory CategoryTheory.Limits Opposite AlgebraicGeometry Topology
open AbelianVarieties.NOSProofs.AssociativityRestriction.PartialMultiplication
  (range_specGenericFibreInclusion)
open AbelianVarieties.NOSProofs.SpecializationSlices
theorem exists_specializes_fst_eq_snd_eq_of_specializes_snd
    {R : Type u} [CommRing R] [IsLocalRing R]
    {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
    (θ : ↑(pullback f f)) (hθ : f.base ((pullback.fst f f).base θ) = IsLocalRing.closedPoint R)
    (y : X) (hy : y ⤳ (pullback.snd f f).base θ) (hys : f.base y = IsLocalRing.closedPoint R) :
    ∃ θ' : ↑(pullback f f), θ' ⤳ θ ∧ (pullback.fst f f).base θ' = (pullback.fst f f).base θ ∧
      (pullback.snd f f).base θ' = y
NeronModelInfra.isIso_stalkMap_imageInc_fst_of_fst_eq
Source context 6 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isIso_stalkMap_imageInc_fst_of_fst_eq.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
universe u
open CategoryTheory CategoryTheory.Limits Opposite AlgebraicGeometry Topology
open AbelianVarieties.NOSProofs.AssociativityRestriction.PartialMultiplication
  (range_specGenericFibreInclusion)
theorem isIso_stalkMap_imageInc_fst_of_fst_eq
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {XK : Scheme.{u}} (gK : XK ⟶ Spec (CommRingCat.of K))
    [IsSeparated gK] [LocallyOfFiniteType gK] [QuasiCompact gK]
    {Y₁ Y₂ : Scheme.{u}} (f₁ : Y₁ ⟶ Spec (CommRingCat.of R)) (f₂ : Y₂ ⟶ Spec (CommRingCat.of R))
    (hf₁ : Smooth f₁ ∧ IsSeparated f₁ ∧ LocallyOfFiniteType f₁ ∧ QuasiCompact f₁)
    (hf₂ : Smooth f₂ ∧ IsSeparated f₂ ∧ LocallyOfFiniteType f₂ ∧ QuasiCompact f₂)
    (e₁ : SchemeHomOver (pullback.snd f₁ (specGenericFibreInclusion R K)) gK)
        (_he₁ : IsOpenImmersion e₁.1)
    (e₂ : SchemeHomOver (pullback.snd f₂ (specGenericFibreInclusion R K)) gK) (he₂ : IsIso e₂.1)
    [IsIntegral Y₁]
    (ξ₁ : ↥Y₁) (hξ₁ : f₁.base ξ₁ = IsLocalRing.closedPoint R)
    (hξ₁gen : ∀ y : ↥Y₁, f₁.base y = IsLocalRing.closedPoint R → ξ₁ ⤳ y)
    (δ : pullback e₁.1 e₂.1 ⟶ pullback f₁ f₂)
    (hδ₁ : δ ≫ pullback.fst f₁ f₂ = pullback.fst e₁.1 e₂.1 ≫ pullback.fst f₁
        (specGenericFibreInclusion R K))
    (hδ₂ : δ ≫ pullback.snd f₁ f₂ = pullback.snd e₁.1 e₂.1 ≫ pullback.fst f₂
        (specGenericFibreInclusion R K))
    (η : ↥δ.image) (hη₁ : (pullback.fst f₁ f₂).base (δ.imageι.base η) = ξ₁) :
    IsIso ((δ.imageι ≫ pullback.fst f₁ f₂).stalkMap η)
NeronModelInfra.isOpenImmersion_toImage_and_range_toImage_and_range_imageInc_of_genericFibre
Source context 6 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isOpenImmersion_toImage_and_range_toImage_and_range_imageInc_of_genericFibre.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
universe u
open CategoryTheory CategoryTheory.Limits Opposite AlgebraicGeometry Topology
open AbelianVarieties.NOSProofs.AssociativityRestriction.PartialMultiplication
  (range_specGenericFibreInclusion)
theorem isOpenImmersion_toImage_and_range_toImage_and_range_imageInc_of_genericFibre
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {XK : Scheme.{u}} (gK : XK ⟶ Spec (CommRingCat.of K))
    [IsSeparated gK] [LocallyOfFiniteType gK] [QuasiCompact gK]
    {Y₁ Y₂ : Scheme.{u}} (f₁ : Y₁ ⟶ Spec (CommRingCat.of R)) (f₂ : Y₂ ⟶ Spec (CommRingCat.of R))
    (hf₁ : Smooth f₁ ∧ IsSeparated f₁ ∧ LocallyOfFiniteType f₁ ∧ QuasiCompact f₁)
    (hf₂ : Smooth f₂ ∧ IsSeparated f₂ ∧ LocallyOfFiniteType f₂ ∧ QuasiCompact f₂)
    (e₁ : SchemeHomOver (pullback.snd f₁ (specGenericFibreInclusion R K)) gK)
        (_he₁ : IsOpenImmersion e₁.1)
    (e₂ : SchemeHomOver (pullback.snd f₂ (specGenericFibreInclusion R K)) gK) (he₂ : IsIso e₂.1)
    (δ : pullback e₁.1 e₂.1 ⟶ pullback f₁ f₂)
    (hδ₁ : δ ≫ pullback.fst f₁ f₂ = pullback.fst e₁.1 e₂.1 ≫ pullback.fst f₁
        (specGenericFibreInclusion R K))
    (_hδ₂ : δ ≫ pullback.snd f₁ f₂ = pullback.snd e₁.1 e₂.1 ≫ pullback.fst f₂
        (specGenericFibreInclusion R K)) :
    IsOpenImmersion δ.toImage ∧
      Set.range δ.toImage.base =
        {d | f₁.base ((pullback.fst f₁ f₂).base (δ.imageι.base d)) ≠ IsLocalRing.closedPoint R} ∧
      Set.range δ.imageι.base = closure (Set.range δ.base)
AbelianVarieties.NOSProofs.LocalPointCoordinates.AffineCoordinates.ΓSpecIso_inv_hom_apply
Source context 6 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_algHom_comap_maximalIdeal_eq_primeIdealOf_of_apply_closedPoint_mem.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.LocalPointCoordinates
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
universe u
namespace AffineCoordinates
theorem ΓSpecIso_inv_hom_apply (R : Type u) [CommRing R] (r : R) :
    (Scheme.ΓSpecIso (CommRingCat.of R)).hom.hom ((Scheme.ΓSpecIso
        (CommRingCat.of R)).inv.hom r) = r
AbelianVarieties.NOSProofs.LocalPointCoordinates.AffineCoordinates.ΓSpecIso_nat_apply
Source context 6 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_algHom_comap_maximalIdeal_eq_primeIdealOf_of_apply_closedPoint_mem.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.LocalPointCoordinates
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
universe u
namespace AffineCoordinates
theorem ΓSpecIso_nat_apply {R S : Type u} [CommRing R] [CommRing S] (g : R →+* S) (r : Γ(Spec
    (CommRingCat.of R), ⊤)) :
    (Scheme.ΓSpecIso (CommRingCat.of S)).hom.hom ((Spec.map (CommRingCat.ofHom g)).appTop.hom r) =
      g ((Scheme.ΓSpecIso (CommRingCat.of R)).hom.hom r)
AbelianVarieties.NOSProofs.LocalPointCoordinates.AffineCoordinates.topIso_inv_map
Source context 7 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_algHom_comap_maximalIdeal_eq_primeIdealOf_of_apply_closedPoint_mem.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.LocalPointCoordinates
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
universe u
namespace AffineCoordinates
open _root_.AlgebraicGeometry.Scheme.TwoAffineOpenCover.AffineBaseChange in
theorem topIso_inv_map {X : Scheme.{u}} (U : X.Opens) (s : Γ(X, ⊤)) :
    U.topIso.inv.hom ((X.presheaf.map (homOfLE (le_top : U ≤ ⊤)).op).hom s) = U.ι.appTop.hom s
NeronModelInfra.exists_algHom_comap_maximalIdeal_eq_primeIdealOf_of_apply_closedPoint_mem
Source context 7 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_algHom_comap_maximalIdeal_eq_primeIdealOf_of_apply_closedPoint_mem.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
universe u
open CategoryTheory CategoryTheory.Limits Opposite AlgebraicGeometry Topology
open AbelianVarieties.NOSProofs.AssociativityRestriction.PartialMultiplication
  (range_specGenericFibreInclusion)
open AbelianVarieties.NOSProofs.LocalPointCoordinates.AffineCoordinates
theorem exists_algHom_comap_maximalIdeal_eq_primeIdealOf_of_apply_closedPoint_mem
    {R : Type u} [CommRing R] {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
    (R' : Type u) [CommRing R'] [IsLocalRing R'] [Algebra R R']
    (x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f)
    (U : X.Opens) (hU : IsAffineOpen U) (hxU : x.1 (IsLocalRing.closedPoint R') ∈ U) :
    let _alg : Algebra R Γ(X, U) :=
      ((X.presheaf.map (homOfLE le_top).op).hom.comp
        (f.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom)).toAlgebra
    ∃ c : Γ(X, U) →ₐ[R] R',
      (IsLocalRing.maximalIdeal R').comap c = (hU.primeIdealOf ⟨x.1
          (IsLocalRing.closedPoint R'), hxU⟩).asIdeal := by
  intro _alg
  have hpre : x.1 ⁻¹ᵁ U = ⊤ := (IsLocalRing.closedPoint_mem_iff _).mp hxU
  have hrange : Set.range x.1.base ⊆ Set.range U.ι.base := by
    rw [Scheme.Opens.range_ι]
    rintro _ ⟨p, rfl⟩
    have : p ∈ x.1 ⁻¹ᵁ U := by rw [hpre]; trivial
    exact this
  let φU : Spec (CommRingCat.of R') ⟶ (U : Scheme.{u}) := IsOpenImmersion.lift U.ι x.1 hrange
  have hφU : φU ≫ U.ι = x.1 := IsOpenImmersion.lift_fac U.ι x.1 hrange
  let c₀ : Γ(X, U) →+* R' :=
    (Scheme.ΓSpecIso (CommRingCat.of R')).hom.hom.comp (φU.appTop.hom.comp U.topIso.inv.hom)
  have hc₀ : ∀ r : R, c₀ (algebraMap R Γ(X, U) r) = algebraMap R R' r := by
    intro r
    change (Scheme.ΓSpecIso (CommRingCat.of R')).hom.hom (φU.appTop.hom (U.topIso.inv.hom
      ((X.presheaf.map (homOfLE le_top).op).hom (f.appTop.hom ((Scheme.ΓSpecIso
          (CommRingCat.of R)).inv.hom r))))) = _
    rw [topIso_inv_map]
    have h1 : ∀ t, φU.appTop.hom (U.ι.appTop.hom (f.appTop.hom t)) = ((φU ≫ U.ι) ≫
        f).appTop.hom t := fun t => by
      simp only [Scheme.Hom.comp_appTop, CommRingCat.hom_comp, RingHom.comp_apply]
    rw [h1, hφU, x.2, ΓSpecIso_nat_apply, ΓSpecIso_inv_hom_apply]
  let c : Γ(X, U) →ₐ[R] R' := AlgHom.mk c₀ hc₀
  refine ⟨c, ?_⟩
  have hSpec : Spec.map (CommRingCat.ofHom c₀) = φU ≫ U.toSpecΓ := by
    change Spec.map (CommRingCat.ofHom ((Scheme.ΓSpecIso (CommRingCat.of R')).hom.hom.comp
        (φU.appTop.hom.comp U.topIso.inv.hom))) = _
    rw [CommRingCat.ofHom_comp, CommRingCat.ofHom_comp, CommRingCat.ofHom_hom,
        CommRingCat.ofHom_hom, CommRingCat.ofHom_hom,
      Spec.map_comp, Spec.map_comp, SpecMap_ΓSpecIso_hom, Scheme.Opens.toSpecΓ,
          ← Category.assoc, ← Category.assoc,
      ← Scheme.toSpecΓ_naturality]
  have hpt : φU.base (IsLocalRing.closedPoint R') = ⟨x.1.base (IsLocalRing.closedPoint R'),
      hxU⟩ := by
    apply Subtype.ext
    change (φU ≫ U.ι).base (IsLocalRing.closedPoint R') = _
    rw [hφU]
  change Ideal.comap c₀ (IsLocalRing.maximalIdeal R') = (hU.isoSpec.hom.base ⟨x.1.base
      (IsLocalRing.closedPoint R'), hxU⟩).asIdeal
  rw [IsAffineOpen.isoSpec_hom, ← hpt]
  change _ = ((φU ≫ U.toSpecΓ).base (IsLocalRing.closedPoint R')).asIdeal
  rw [← hSpec]
  rfl
AbelianVarieties.NOSProofs.RamificationOneStalks.MinimalStalks.isRegularLocalRing_localization_of_smooth
Source context 9 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isIndexOneExtension_stalk_of_smooth_of_forall_specializes.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.RamificationOneStalks
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra
universe u
namespace MinimalStalks
open IsLocalRing
section Field
variable {k : Type u} [Field k] {B : Type u} [CommRing B] [Algebra k B]
theorem isRegularLocalRing_localization_of_smooth [Algebra.Smooth k B] (q : Ideal B)
    [hq : q.IsPrime] :
    IsRegularLocalRing (Localization.AtPrime q)
AbelianVarieties.NOSProofs.RamificationOneStalks.MinimalStalks.isField_of_isRegularLocalRing_of_ringKrullDim_eq_zero
Source context 9 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isIndexOneExtension_stalk_of_smooth_of_forall_specializes.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.RamificationOneStalks
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra
universe u
namespace MinimalStalks
open IsLocalRing
section Field
variable {k : Type u} [Field k] {B : Type u} [CommRing B] [Algebra k B]
theorem isField_of_isRegularLocalRing_of_ringKrullDim_eq_zero (S : Type u) [CommRing S]
    [IsRegularLocalRing S] (h : ringKrullDim S = 0) : IsField S
AbelianVarieties.NOSProofs.RamificationOneStalks.MinimalStalks.isField_localization_of_smooth_of_minimal
Source context 9 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isIndexOneExtension_stalk_of_smooth_of_forall_specializes.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.RamificationOneStalks
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra
universe u
namespace MinimalStalks
open IsLocalRing
section Field
variable {k : Type u} [Field k] {B : Type u} [CommRing B] [Algebra k B]
theorem isField_localization_of_smooth_of_minimal [Algebra.Smooth k B] (q : Ideal B)
    [hq : q.IsPrime]
    (hmin : q ∈ minimalPrimes B) : IsField (Localization.AtPrime q)
NeronModelInfra.isIndexOneExtension_stalk_of_smooth_of_forall_specializes
Source context 7 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isIndexOneExtension_stalk_of_smooth_of_forall_specializes.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
universe u
open CategoryTheory CategoryTheory.Limits Opposite AlgebraicGeometry Topology
open AbelianVarieties.NOSProofs.AssociativityRestriction.PartialMultiplication
  (range_specGenericFibreInclusion)
open AbelianVarieties.NOSProofs.RamificationOneStalks
theorem isIndexOneExtension_stalk_of_smooth_of_forall_specializes
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    {Z : Scheme.{u}} (z : Z ⟶ Spec (CommRingCat.of R)) [Smooth z]
    (ζ : Z) (hζ : z.base ζ = IsLocalRing.closedPoint R)
    (hgen : ∀ y : Z, y ⤳ ζ → z.base y = IsLocalRing.closedPoint R → y = ζ)
    [Algebra R (Z.presheaf.stalk ζ)]
    (halg : Z.fromSpecStalk ζ ≫ z = Spec.map (CommRingCat.ofHom (algebraMap R
        (Z.presheaf.stalk ζ)))) :
    ∃ (_ : IsDomain (Z.presheaf.stalk ζ)) (_ : IsDiscreteValuationRing (Z.presheaf.stalk ζ))
      (_ : IsLocalHom (algebraMap R (Z.presheaf.stalk ζ))),
      IsIndexOneExtension R (Z.presheaf.stalk ζ)
AbelianVarieties.NOSProofs.TranslationStalks.TranslationCharts.isOpenImmersion_opensRange_ι_comp_translate
Source context 11 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isFractionRing_stalk_of_genericFibreRestrict_comp_eq_mul_of_pullback_lift.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.TranslationStalks
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.Opposite
open _root_.AlgebraicGeometry
open _root_.NeronModelInfra
open _root_.GoodReductionJacobian
universe u
namespace TranslationCharts
theorem isOpenImmersion_opensRange_ι_comp_translate
    {R : Type u} [CommRing R] (K : Type u) [Field K] [Algebra R K]
    [IsOpenImmersion (specGenericFibreInclusion R K)]
    {XK : Scheme.{u}} {gK : XK ⟶ Spec (CommRingCat.of K)} (LXK : RelativeGroupLaw K gK)
    (X : Scheme.{u}) (f : X ⟶ Spec (CommRingCat.of R))
    (e : SchemeHomOver (pullback.snd f (specGenericFibreInclusion R K)) gK) [IsIso e.1]
    (Z : Scheme.{u}) (z : Z ⟶ Spec (CommRingCat.of R))
    (uK : SchemeHomOver (pullback.snd z (specGenericFibreInclusion R K)) gK)
    (Y : Scheme.{u}) (fY : Y ⟶ Spec (CommRingCat.of R))
    (eY : SchemeHomOver (pullback.snd fY (specGenericFibreInclusion R K)) gK) [IsOpenImmersion eY.1]
    (U₀ : (pullback z f).Opens) (τ₀ : SchemeHomOver (U₀.ι ≫ pullback.fst z f ≫ z) fY)
    (hτ₀ : (NeronModelInfra.schemeHomOverComp
              (genericFibreRestrict R K fY (U₀.ι ≫ pullback.fst z f ≫ z) τ₀) eY).1 =
            pullback.map (U₀.ι ≫ pullback.fst z f ≫ z) (specGenericFibreInclusion R K)
                (pullback.fst z f ≫ z) (specGenericFibreInclusion R K) U₀.ι (𝟙 _) (𝟙 _)
                (Category.comp_id _) ((Category.comp_id _).trans (Category.id_comp _).symm) ≫
              (LXK.mul (pullback.snd (pullback.fst z f ≫ z) (specGenericFibreInclusion R K))
                (NeronModelInfra.schemeHomOverComp
                  (genericFibreRestrict R K z (pullback.fst z f ≫ z) ⟨pullback.fst z f, rfl⟩) uK)
                (NeronModelInfra.schemeHomOverComp
                  (genericFibreRestrict R K f (pullback.fst z f ≫ z)
                    ⟨pullback.snd z f, pullback.condition.symm⟩) e)).1)
    (v : (U₀ : Scheme.{u}) ⟶ pullback z fY) (hv₁ : v ≫ pullback.fst z fY = U₀.ι ≫ pullback.fst z f)
    (hv₂ : v ≫ pullback.snd z fY = τ₀.1) :
    IsOpenImmersion
      ((pullback.fst (U₀.ι ≫ pullback.fst z f ≫ z)
          (specGenericFibreInclusion R K)).opensRange.ι ≫ v)
AbelianVarieties.NOSProofs.TranslationStalks.TranslationCharts.exists_mem_opensRange_fst_specializes
Source context 11 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isFractionRing_stalk_of_genericFibreRestrict_comp_eq_mul_of_pullback_lift.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.TranslationStalks
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.Opposite
open _root_.AlgebraicGeometry
open _root_.NeronModelInfra
open _root_.GoodReductionJacobian
universe u
namespace TranslationCharts
theorem exists_mem_opensRange_fst_specializes
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {S : Scheme.{u}} (s : S ⟶ Spec (CommRingCat.of R)) [Flat s] (x : S) :
    ∃ x' : S, x' ∈ (pullback.fst s (specGenericFibreInclusion R K)).opensRange ∧ x' ⤳ x
NeronModelInfra.isFractionRing_stalk_of_genericFibreRestrict_comp_eq_mul_of_pullback_lift
Source context 9 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_isFractionRing_stalk_of_genericFibreRestrict_comp_eq_mul_of_pullback_lift.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
universe u
open CategoryTheory CategoryTheory.Limits Opposite AlgebraicGeometry Topology
open AbelianVarieties.NOSProofs.AssociativityRestriction.PartialMultiplication
  (range_specGenericFibreInclusion)
open GoodReductionJacobian
open AbelianVarieties.NOSProofs.TranslationStalks
open TranslationCharts
theorem isFractionRing_stalk_of_genericFibreRestrict_comp_eq_mul_of_pullback_lift
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {XK : Scheme.{u}} {gK : XK ⟶ Spec (CommRingCat.of K)}
    [Smooth gK] [IsSeparated gK] [LocallyOfFiniteType gK] [QuasiCompact gK]
    (LXK : RelativeGroupLaw K gK)
    (d : ℕ) [SmoothOfRelativeDimension d gK]
    (ω : Γ(gK.topDifferentials d, ⊤))
    (X : Scheme.{u}) (f : X ⟶ Spec (CommRingCat.of R))
    (e : SchemeHomOver (pullback.snd f (specGenericFibreInclusion R K)) gK)
    [Smooth f] [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f] [IsIso e.1]
    (Z : Scheme.{u}) (z : Z ⟶ Spec (CommRingCat.of R)) [Smooth z] [QuasiCompact z]
    (uK : SchemeHomOver (pullback.snd z (specGenericFibreInclusion R K)) gK)
    (η : ↑(pullback z f))
    (T : ComponentReading R K gK d ω)
    (U₀ : (pullback z f).Opens) (hηU : η ∈ U₀) (τ₀ : SchemeHomOver (U₀.ι ≫ pullback.fst z f ≫
        z) T.f)
    (hτ₀ : (NeronModelInfra.schemeHomOverComp
              (genericFibreRestrict R K T.f (U₀.ι ≫ pullback.fst z f ≫ z) τ₀) T.e).1 =
            pullback.map (U₀.ι ≫ pullback.fst z f ≫ z) (specGenericFibreInclusion R K)
                (pullback.fst z f ≫ z) (specGenericFibreInclusion R K) U₀.ι (𝟙 _) (𝟙 _)
                (Category.comp_id _) ((Category.comp_id _).trans (Category.id_comp _).symm) ≫
              (LXK.mul (pullback.snd (pullback.fst z f ≫ z) (specGenericFibreInclusion R K))
                (NeronModelInfra.schemeHomOverComp
                  (genericFibreRestrict R K z (pullback.fst z f ≫ z) ⟨pullback.fst z f, rfl⟩) uK)
                (NeronModelInfra.schemeHomOverComp
                  (genericFibreRestrict R K f (pullback.fst z f ≫ z)
                    ⟨pullback.snd z f, pullback.condition.symm⟩) e)).1)
    (v : (U₀ : Scheme.{u}) ⟶ pullback z T.f) (hv₁ : v ≫ pullback.fst z T.f = U₀.ι ≫
        pullback.fst z f)
    (hv₂ : v ≫ pullback.snd z T.f = τ₀.1) :
    ∃ (_ : IsDomain ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩))
      (_ : IsDomain ((pullback z T.f).presheaf.stalk (v.base ⟨η, hηU⟩))),
      let _alg : Algebra ((pullback z T.f).presheaf.stalk (v.base ⟨η,
          hηU⟩)) (FractionRing ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩)) :=
        ((algebraMap ((U₀ : Scheme.{u}).presheaf.stalk ⟨η,
            hηU⟩) (FractionRing ((U₀ : Scheme.{u}).presheaf.stalk ⟨η,
            hηU⟩))).comp (v.stalkMap ⟨η, hηU⟩).hom).toAlgebra
      IsFractionRing ((pullback z T.f).presheaf.stalk (v.base ⟨η,
          hηU⟩)) (FractionRing ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩)) := by
  have hTs : Smooth T.f := T.smooth
  have hTe : IsOpenImmersion T.e.1 := T.isOpenImmersion
  have hD1 : IsDomain ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩) :=
    (AlgebraicGeometry.Smooth.isDomain_and_isIntegrallyClosed_stalk_of_isDiscreteValuationRing R
      (U₀.ι ≫ pullback.fst z f ≫ z) ⟨η, hηU⟩).1
  have hD2 : IsDomain ((pullback z T.f).presheaf.stalk (v.base ⟨η, hηU⟩)) :=
    (AlgebraicGeometry.Smooth.isDomain_and_isIntegrallyClosed_stalk_of_isDiscreteValuationRing R
      (pullback.fst z T.f ≫ z) (v.base ⟨η, hηU⟩)).1
  refine ⟨hD1, hD2, ?_⟩
  intro _alg
  obtain ⟨x', hx'U, hx'η⟩ :=
    exists_mem_opensRange_fst_specializes K (U₀.ι ≫ pullback.fst z f ≫ z) ⟨η, hηU⟩
  have : IsOpenImmersion
      ((pullback.fst (U₀.ι ≫ pullback.fst z f ≫ z)
        (specGenericFibreInclusion R K)).opensRange.ι ≫ v) :=
    isOpenImmersion_opensRange_ι_comp_translate K LXK X f e Z z uK T.Y T.f T.e U₀ τ₀ hτ₀ v hv₁ hv₂
  exact AlgebraicGeometry.isFractionRing_stalk_fractionRing_stalk_of_isOpenImmersion_restrict
    v ⟨η, hηU⟩
    (pullback.fst (U₀.ι ≫ pullback.fst z f ≫ z) (specGenericFibreInclusion R K)).opensRange ⟨x',
        hx'U, hx'η⟩
NeronModelInfra.mul_pointGenericFibre_eq_pointGenericFibre_comp_chart_of_genericFibreRestrict_comp_eq_mul
Source context 7 commands

Surrounding namespaces, section variables, and local commands at this declaration.

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_mul_pointGenericFibre_eq_pointGenericFibre_comp_chart_of_genericFibreRestrict_comp_eq_mul.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
universe u
open CategoryTheory CategoryTheory.Limits Opposite AlgebraicGeometry Topology
open AbelianVarieties.NOSProofs.AssociativityRestriction.PartialMultiplication
  (range_specGenericFibreInclusion)
open GoodReductionJacobian
theorem mul_pointGenericFibre_eq_pointGenericFibre_comp_chart_of_genericFibreRestrict_comp_eq_mul
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {XK : Scheme.{u}} {gK : XK ⟶ Spec (CommRingCat.of K)}
    [Smooth gK] [IsSeparated gK] [LocallyOfFiniteType gK] [QuasiCompact gK]
    (LXK : RelativeGroupLaw K gK)
    (d : ℕ) [SmoothOfRelativeDimension d gK]
    (ω : Γ(gK.topDifferentials d, ⊤))
    (X : Scheme.{u}) (f : X ⟶ Spec (CommRingCat.of R))
    (e : SchemeHomOver (pullback.snd f (specGenericFibreInclusion R K)) gK)
    [Smooth f] [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f] [IsIso e.1]
    (Z : Scheme.{u}) (z : Z ⟶ Spec (CommRingCat.of R)) [Smooth z] [QuasiCompact z]
    (uK : SchemeHomOver (pullback.snd z (specGenericFibreInclusion R K)) gK)
    (η : ↑(pullback z f))
    (T : ComponentReading R K gK d ω)
    (U₀ : (pullback z f).Opens) (hηU : η ∈ U₀) (τ₀ : SchemeHomOver (U₀.ι ≫ pullback.fst z f ≫
        z) T.f)
    (hτ₀ : (NeronModelInfra.schemeHomOverComp
              (genericFibreRestrict R K T.f (U₀.ι ≫ pullback.fst z f ≫ z) τ₀) T.e).1 =
            pullback.map (U₀.ι ≫ pullback.fst z f ≫ z) (specGenericFibreInclusion R K)
                (pullback.fst z f ≫ z) (specGenericFibreInclusion R K) U₀.ι (𝟙 _) (𝟙 _)
                (Category.comp_id _) ((Category.comp_id _).trans (Category.id_comp _).symm) ≫
              (LXK.mul (pullback.snd (pullback.fst z f ≫ z) (specGenericFibreInclusion R K))
                (NeronModelInfra.schemeHomOverComp
                  (genericFibreRestrict R K z (pullback.fst z f ≫ z) ⟨pullback.fst z f, rfl⟩) uK)
                (NeronModelInfra.schemeHomOverComp
                  (genericFibreRestrict R K f (pullback.fst z f ≫ z)
                    ⟨pullback.snd z f, pullback.condition.symm⟩) e)).1)
    (v : (U₀ : Scheme.{u}) ⟶ pullback z T.f) (hv₁ : v ≫ pullback.fst z T.f = U₀.ι ≫
        pullback.fst z f)
    (hv₂ : v ≫ pullback.snd z T.f = τ₀.1)
    [Algebra R (Z.presheaf.stalk ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩)))]
    (halgZ : Z.fromSpecStalk ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩)) ≫ z =
      Spec.map (CommRingCat.ofHom (algebraMap R (Z.presheaf.stalk ((pullback.fst z T.f).base
          (v.base ⟨η, hηU⟩))))))
    [Algebra R ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩)]
    (halgO : (U₀ : Scheme.{u}).fromSpecStalk ⟨η, hηU⟩ ≫ (U₀.ι ≫ pullback.fst z f ≫ z) =
      Spec.map (CommRingCat.ofHom (algebraMap R ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩))))
    [Algebra R (T.Y.presheaf.stalk ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩)))]
    (halg₁ : T.Y.fromSpecStalk ((pullback.snd z T.f).base (v.base ⟨η,
        hηU⟩)) ≫ T.f = Spec.map (CommRingCat.ofHom (algebraMap R (T.Y.presheaf.stalk
        ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩))))))
    (K' F : Type u) [Field K'] [Algebra (Z.presheaf.stalk ((pullback.fst z T.f).base (v.base ⟨η,
        hηU⟩))) K'] [IsFractionRing (Z.presheaf.stalk ((pullback.fst z T.f).base (v.base ⟨η,
        hηU⟩))) K'] [Algebra R K'] [Algebra K K']
    [IsScalarTower R (Z.presheaf.stalk ((pullback.fst z T.f).base (v.base ⟨η,
        hηU⟩))) K'] [IsScalarTower R K K']
    [Field F] [Algebra ((U₀ : Scheme.{u}).presheaf.stalk ⟨η,
        hηU⟩) F] [Algebra R F] [Algebra K F] [Algebra K' F] [Algebra (Z.presheaf.stalk
        ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩))) F]
    [IsScalarTower R ((U₀ : Scheme.{u}).presheaf.stalk ⟨η,
        hηU⟩) F] [IsScalarTower R K F] [IsScalarTower K K' F] [IsScalarTower (Z.presheaf.stalk
        ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩))) K' F]
    (hRO : (algebraMap (Z.presheaf.stalk ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩))) F) =
      (algebraMap ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩) F).comp ((v.stalkMap ⟨η,
          hηU⟩).hom.comp
        ((pullback.fst z T.f).stalkMap (v.base ⟨η, hηU⟩)).hom))
    [Algebra (T.Y.presheaf.stalk ((pullback.snd z T.f).base (v.base ⟨η,
        hηU⟩))) F] [IsScalarTower R (T.Y.presheaf.stalk ((pullback.snd z T.f).base (v.base ⟨η,
        hηU⟩))) F]
    (hτF : (algebraMap (T.Y.presheaf.stalk ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩))) F) =
      (algebraMap ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩) F).comp ((v.stalkMap ⟨η,
          hηU⟩).hom.comp
        ((pullback.snd z T.f).stalkMap (v.base ⟨η, hηU⟩)).hom)) :
    (LXK.mul (Spec.map (CommRingCat.ofHom (algebraMap K F)))
        ⟨Spec.map (CommRingCat.ofHom (algebraMap K' F)) ≫
            (NeronModelInfra.schemeHomOverComp
              (pointGenericFibre (K := K) (K' := K')
                (⟨Z.fromSpecStalk ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩)), halgZ⟩ :
                  SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R (Z.presheaf.stalk
                      ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩)))))) z)) uK).1, by
          rw [Category.assoc, (NeronModelInfra.schemeHomOverComp _ uK).2, ← Spec.map_comp,
              ← CommRingCat.ofHom_comp,
            ← IsScalarTower.algebraMap_eq]⟩
        (NeronModelInfra.schemeHomOverComp
          (pointGenericFibre (K := K) (K' := F)
            (⟨(U₀ : Scheme.{u}).fromSpecStalk ⟨η, hηU⟩, halgO⟩ :
              SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R
                  ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩)))) (U₀.ι ≫ pullback.fst z f ≫ z)))
          (NeronModelInfra.schemeHomOverComp
            (genericFibreRestrict R K f (U₀.ι ≫ pullback.fst z f ≫ z)
              ⟨U₀.ι ≫ pullback.snd z f, by rw [Category.assoc, ← pullback.condition]⟩) e))).1 =
      (NeronModelInfra.schemeHomOverComp
        (pointGenericFibre (K := K) (K' := F)
          (⟨T.Y.fromSpecStalk ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩)), halg₁⟩ :
            SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R (T.Y.presheaf.stalk
                ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩)))))) T.f))
        T.e).1 := by
  obtain ⟨x₀, hx₀⟩ : ∃ x₀ : (U₀ : Scheme.{u}), x₀ = ⟨η, hηU⟩ := ⟨_, rfl⟩
  subst hx₀
  let Pη : Spec (CommRingCat.of F) ⟶ pullback (U₀.ι ≫ pullback.fst z f ≫ z)
      (specGenericFibreInclusion R K) :=
    (pointGenericFibre (K := K) (K' := F)
      (⟨(U₀ : Scheme.{u}).fromSpecStalk ⟨η, hηU⟩, halgO⟩ :
        SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R
            ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩))))
          (U₀.ι ≫ pullback.fst z f ≫ z))).1
  have hPη₁ : Pη ≫ pullback.fst _ _ =
      Spec.map (CommRingCat.ofHom (algebraMap ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩) F)) ≫
        (U₀ : Scheme.{u}).fromSpecStalk ⟨η, hηU⟩ := pointGenericFibre_coe_comp_fst _
  have hPη₂ : Pη ≫ pullback.snd _ _ = Spec.map (CommRingCat.ofHom (algebraMap K F)) :=
    pointGenericFibre_coe_comp_snd _
  have hPη₁' : ∀ {W : Scheme.{u}} (h : (U₀ : Scheme.{u}) ⟶ W), Pη ≫ pullback.fst _ _ ≫ h =
      Spec.map (CommRingCat.ofHom (algebraMap ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩) F)) ≫
        (U₀ : Scheme.{u}).fromSpecStalk ⟨η, hηU⟩ ≫ h := fun h => by
    rw [← Category.assoc, hPη₁, Category.assoc]
  let mapU : pullback (U₀.ι ≫ pullback.fst z f ≫ z) (specGenericFibreInclusion R K) ⟶
      pullback (pullback.fst z f ≫ z) (specGenericFibreInclusion R K) :=
    pullback.map (U₀.ι ≫ pullback.fst z f ≫ z) (specGenericFibreInclusion R K)
      (pullback.fst z f ≫ z) (specGenericFibreInclusion R K) U₀.ι (𝟙 _) (𝟙 _)
      (Category.comp_id _) ((Category.comp_id _).trans (Category.id_comp _).symm)
  have hO₁ : Spec.map (CommRingCat.ofHom (algebraMap (T.Y.presheaf.stalk
      ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩))) F)) ≫
      T.Y.fromSpecStalk ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩)) =
      Spec.map (CommRingCat.ofHom (algebraMap ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩) F)) ≫
        (U₀ : Scheme.{u}).fromSpecStalk ⟨η, hηU⟩ ≫ τ₀.1 := by
    rw [hτF, CommRingCat.ofHom_comp, CommRingCat.ofHom_comp, Spec.map_comp, Spec.map_comp,
        CommRingCat.ofHom_hom,
      CommRingCat.ofHom_hom, Category.assoc, Category.assoc, Scheme.SpecMap_stalkMap_fromSpecStalk,
      Scheme.SpecMap_stalkMap_fromSpecStalk_assoc v
        (x := (⟨η, hηU⟩ : (U₀ : Scheme.{u}))), hv₂]
  have hOZ : Spec.map (CommRingCat.ofHom (algebraMap (Z.presheaf.stalk
      ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩))) F)) ≫
      Z.fromSpecStalk ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩)) =
      Spec.map (CommRingCat.ofHom (algebraMap ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩) F)) ≫
        (U₀ : Scheme.{u}).fromSpecStalk ⟨η, hηU⟩ ≫ U₀.ι ≫ pullback.fst z f := by
    rw [hRO, CommRingCat.ofHom_comp, CommRingCat.ofHom_comp, Spec.map_comp, Spec.map_comp,
        CommRingCat.ofHom_hom,
      CommRingCat.ofHom_hom, Category.assoc, Category.assoc, Scheme.SpecMap_stalkMap_fromSpecStalk,
      Scheme.SpecMap_stalkMap_fromSpecStalk_assoc v
        (x := (⟨η, hηU⟩ : (U₀ : Scheme.{u}))), hv₁]
  have h1 : Pη ≫ (NeronModelInfra.schemeHomOverComp
      (genericFibreRestrict R K T.f (U₀.ι ≫ pullback.fst z f ≫ z) τ₀) T.e).1 =
      (NeronModelInfra.schemeHomOverComp
        (pointGenericFibre (K := K) (K' := F)
          (⟨T.Y.fromSpecStalk ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩)), halg₁⟩ :
            SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R (T.Y.presheaf.stalk
                ((pullback.snd z T.f).base (v.base ⟨η, hηU⟩)))))) T.f))
        T.e).1 := by
    simp only [NeronModelInfra.schemeHomOverComp_coe, ← Category.assoc]
    congr 1
    apply pullback.hom_ext
    · rw [pointGenericFibre_coe_comp_fst, Category.assoc]
      simp only [genericFibreRestrict, pullback.lift_fst]
      rw [← Category.assoc, hPη₁, hO₁, Category.assoc]
    · rw [pointGenericFibre_coe_comp_snd, Category.assoc]
      simp only [genericFibreRestrict, pullback.lift_snd]
      exact hPη₂
  have hψ : (Pη ≫ mapU) ≫ pullback.snd (pullback.fst z f ≫ z) (specGenericFibreInclusion R K) =
      Spec.map (CommRingCat.ofHom (algebraMap K F)) := by
    simp only [Category.assoc, mapU, pullback.lift_snd, Category.comp_id, hPη₂]
  have nat := congrArg Subtype.val
    (LXK.mul_natural (pullback.snd (pullback.fst z f ≫ z) (specGenericFibreInclusion R K))
      (Spec.map (CommRingCat.ofHom (algebraMap K F))) (Pη ≫ mapU) hψ
      (NeronModelInfra.schemeHomOverComp
        (genericFibreRestrict R K z (pullback.fst z f ≫ z) ⟨pullback.fst z f, rfl⟩) uK)
      (NeronModelInfra.schemeHomOverComp
        (genericFibreRestrict R K f (pullback.fst z f ≫ z) ⟨pullback.snd z f,
            pullback.condition.symm⟩) e))
  simp only [GoodReductionJacobian.schemeHomOverComp_coe] at nat
  have hA : GoodReductionJacobian.schemeHomOverComp (Pη ≫ mapU) hψ
      (NeronModelInfra.schemeHomOverComp
        (genericFibreRestrict R K z (pullback.fst z f ≫ z) ⟨pullback.fst z f, rfl⟩) uK) =
      ⟨Spec.map (CommRingCat.ofHom (algebraMap K' F)) ≫
            (NeronModelInfra.schemeHomOverComp
              (pointGenericFibre (K := K) (K' := K')
                (⟨Z.fromSpecStalk ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩)), halgZ⟩ :
                  SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R (Z.presheaf.stalk
                      ((pullback.fst z T.f).base (v.base ⟨η, hηU⟩)))))) z)) uK).1, by
          rw [Category.assoc, (NeronModelInfra.schemeHomOverComp _ uK).2, ← Spec.map_comp,
              ← CommRingCat.ofHom_comp,
            ← IsScalarTower.algebraMap_eq]⟩ := by
    apply Subtype.ext
    simp only [GoodReductionJacobian.schemeHomOverComp_coe,
        NeronModelInfra.schemeHomOverComp_coe, ← Category.assoc]
    congr 1
    apply pullback.hom_ext
    · simp only [Category.assoc, genericFibreRestrict, pullback.lift_fst,
        pointGenericFibre_coe_comp_fst]
      conv_rhs => rw [← Category.assoc, ← Spec.map_comp, ← CommRingCat.ofHom_comp,
          ← IsScalarTower.algebraMap_eq]
      rw [hOZ]
      simp only [mapU, pullback.lift_fst_assoc, Category.assoc, hPη₁']
    · simp only [Category.assoc, genericFibreRestrict, pullback.lift_snd,
        pointGenericFibre_coe_comp_snd]
      rw [← Spec.map_comp, ← CommRingCat.ofHom_comp, ← IsScalarTower.algebraMap_eq]
      simp only [mapU, pullback.lift_snd, Category.comp_id, hPη₂]
  have hB : GoodReductionJacobian.schemeHomOverComp (Pη ≫ mapU) hψ
      (NeronModelInfra.schemeHomOverComp
        (genericFibreRestrict R K f (pullback.fst z f ≫ z) ⟨pullback.snd z f,
            pullback.condition.symm⟩) e) =
      NeronModelInfra.schemeHomOverComp
          (pointGenericFibre (K := K) (K' := F)
            (⟨(U₀ : Scheme.{u}).fromSpecStalk ⟨η, hηU⟩, halgO⟩ :
              SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R
                  ((U₀ : Scheme.{u}).presheaf.stalk ⟨η, hηU⟩)))) (U₀.ι ≫ pullback.fst z f ≫ z)))
          (NeronModelInfra.schemeHomOverComp
            (genericFibreRestrict R K f (U₀.ι ≫ pullback.fst z f ≫ z)
              ⟨U₀.ι ≫ pullback.snd z f, by rw [Category.assoc, ← pullback.condition]⟩) e) := by
    apply Subtype.ext
    simp only [GoodReductionJacobian.schemeHomOverComp_coe,
        NeronModelInfra.schemeHomOverComp_coe, Category.assoc]
    change Pη ≫ _ = Pη ≫ _
    congr 1
    simp only [← Category.assoc]
    congr 1
    apply pullback.hom_ext
    · simp only [Category.assoc, genericFibreRestrict, pullback.lift_fst, mapU,
        pullback.lift_fst_assoc]
    · simp only [Category.assoc, genericFibreRestrict, pullback.lift_snd, mapU,
        Category.comp_id]
  rw [hA, hB] at nat
  rw [← nat, Category.assoc, ← hτ₀, h1]