Module

StalkPullbacks.lean

Nyll.SchemeTheory.LocalGeometry.StalkPullbacks
47 declarations indexed from sourceView source ↗

Stalks and cotangent modules of fibre products

Tensor-product localizations identify the stalk of a fibre product. The general maximal-ideal formula at a pair of sections supplies both affine and unrestricted inclusion corollaries. The final comparison identifies the corresponding localized Kähler differentials.

Imports19
Imported by4

Declarations

AbelianVarieties.NOSProofs.StalkPullbackLocalizations.RightTensorLocalization.tensorAlgebra

The coefficient map on the right factor of a tensor product.

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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
namespace RightTensorLocalization
variable {A S R L : Type*} [CommRing A] [CommRing S] [CommRing R] [CommRing L]
  [Algebra A S] [Algebra A R] [Algebra A L] [Algebra R L] [IsScalarTower A R L]
def tensorAlgebra : Algebra (S ⊗[A] R) (S ⊗[A] L)
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.RightTensorLocalization.algebraMap_tensor_tmul
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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
namespace RightTensorLocalization
variable {A S R L : Type*} [CommRing A] [CommRing S] [CommRing R] [CommRing L]
  [Algebra A S] [Algebra A R] [Algebra A L] [Algebra R L] [IsScalarTower A R L]
attribute [local instance] tensorAlgebra
theorem algebraMap_tensor_tmul (s : S) (r : R) :
    algebraMap (S ⊗[A] R) (S ⊗[A] L) (s ⊗ₜ r) = s ⊗ₜ algebraMap R L r
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.RightTensorLocalization.isScalarTower_tensor
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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
namespace RightTensorLocalization
variable {A S R L : Type*} [CommRing A] [CommRing S] [CommRing R] [CommRing L]
  [Algebra A S] [Algebra A R] [Algebra A L] [Algebra R L] [IsScalarTower A R L]
attribute [local instance] tensorAlgebra
theorem isScalarTower_tensor : IsScalarTower S (S ⊗[A] R) (S ⊗[A] L)
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.RightTensorLocalization.isLocalization_tensor
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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
namespace RightTensorLocalization
variable {A S R L : Type*} [CommRing A] [CommRing S] [CommRing R] [CommRing L]
  [Algebra A S] [Algebra A R] [Algebra A L] [Algebra R L] [IsScalarTower A R L]
attribute [local instance] tensorAlgebra
theorem isLocalization_tensor (M : Submonoid R) [IsLocalization M L] :
    IsLocalization (M.map (Algebra.TensorProduct.includeRight (R := A) (A := S) (B := R))) (S ⊗[A]
        L)
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.RightTensorLocalization.core
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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
namespace RightTensorLocalization
variable {A S R L : Type*} [CommRing A] [CommRing S] [CommRing R] [CommRing L]
  [Algebra A S] [Algebra A R] [Algebra A L] [Algebra R L] [IsScalarTower A R L]
attribute [local instance] tensorAlgebra
theorem core (𝔭 : Ideal R) [𝔭.IsPrime] [IsLocalization.AtPrime L 𝔭]
    (𝔔 : Ideal (S ⊗[A] R)) [h𝔔 : 𝔔.IsPrime]
    (hQp : 𝔔.comap (Algebra.TensorProduct.includeRight (R := A) (A := S) (B := R)).toRingHom = 𝔭)
    (Tq : Type*) [CommRing Tq] [Algebra (S ⊗[A] R) Tq] [IsLocalization.AtPrime Tq 𝔔]
    (φ : L →+* Tq) (hφ : ∀ r : R, φ (algebraMap R L r) = algebraMap (S ⊗[A] R) Tq (1 ⊗ₜ r)) :
    ∃ (𝔮 : Ideal (S ⊗[A] L)) (_ : 𝔮.IsPrime) (e : Tq ≃+* Localization.AtPrime 𝔮),
      (∀ s : S, e (algebraMap (S ⊗[A] R) Tq (s ⊗ₜ[A] (1 : R))) =
        algebraMap (S ⊗[A] L) (Localization.AtPrime 𝔮) (s ⊗ₜ[A] 1)) ∧
      (∀ l : L, e (φ l) = algebraMap (S ⊗[A] L) (Localization.AtPrime 𝔮) ((1 : S) ⊗ₜ[A] l))
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.transport_tensor_localization

Reorder the tensor factors of a local presentation, preserving both coefficient maps.

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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
lemma transport_tensor_localization {R A B C P : Type u}
    [CommRing R] [CommRing A] [CommRing B] [CommRing C] [CommRing P]
    [Algebra R A] [Algebra R B] [Algebra R C]
    (c : B ≃ₐ[R] C) (q : Ideal (C ⊗[R] A)) [q.IsPrime]
    (e : P ≃+* Localization.AtPrime q) (f : A →+* P) (g : B →+* P)
    (hf : ∀ a, e (f a) = algebraMap (C ⊗[R] A) (Localization.AtPrime q) ((1 : C) ⊗ₜ[R] a))
    (hg : ∀ b, e (g b) = algebraMap (C ⊗[R] A) (Localization.AtPrime q) (c b ⊗ₜ[R] (1 : A))) :
    ∃ (Q : Ideal (A ⊗[R] B)) (_ : Q.IsPrime) (e' : P ≃+* Localization.AtPrime Q),
      (∀ a, e' (f a) = algebraMap _ (Localization.AtPrime Q) (a ⊗ₜ[R] (1 : B))) ∧
      (∀ b, e' (g b) = algebraMap _ (Localization.AtPrime Q) ((1 : A) ⊗ₜ[R] b))
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.isoSpec_hom_sectionsAlgebra
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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
lemma isoSpec_hom_sectionsAlgebra : letI := z.sectionsAlgebra U
    hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z := by
  have h := IsAffineOpen.SpecMap_appLE_fromSpec z (isAffineOpen_top _) hU (le_top : U ≤ z ⁻¹ᵁ ⊤)
  rw [IsAffineOpen.fromSpec_top, Scheme.isoSpec_Spec_inv, ← IsAffineOpen.isoSpec_inv_ι] at h
  change hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom
    ((Scheme.ΓSpecIso (CommRingCat.of R)).inv ≫ z.appLE ⊤ U le_top).hom) = _
  rw [CommRingCat.ofHom_hom, Spec.map_comp, h, Category.assoc, Iso.hom_inv_id_assoc]
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.algebraMap_stalk_eq
Source context 10 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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
omit U hU in
lemma algebraMap_stalk_eq {Y : Scheme.{u}} (g : Y ⟶ Spec (CommRingCat.of R)) (y : Y) [Algebra R
    (Y.presheaf.stalk y)]
    (halg : Y.fromSpecStalk y ≫ g = Spec.map (CommRingCat.ofHom (algebraMap R (Y.presheaf.stalk
        y)))) (r : R) :
    algebraMap R (Y.presheaf.stalk y) r =
      Y.presheaf.germ ⊤ y trivial (g.appTop ((Scheme.ΓSpecIso (CommRingCat.of R)).inv r))
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.fe_wrapper
Source context 10 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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
omit U hU in
lemma fe_wrapper (k : Type u) [CommRing k] [Algebra R k] (g : Spec (CommRingCat.of k) ⟶ Spec
    (CommRingCat.of R))
    (hg : g = Spec.map (CommRingCat.ofHom (algebraMap R k)))
    (x : ↥(pullback f g))
    [inst : Algebra R (X.presheaf.stalk ((pullback.fst f g).base x))]
    (hinst : inst = ((X.presheaf.germ ⊤ ((pullback.fst f g).base x) trivial).hom.comp
      (f.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom)).toAlgebra) :
    ∃ (𝔮 : Ideal ((X.presheaf.stalk ((pullback.fst f g).base x)) ⊗[R] k)) (_ : 𝔮.IsPrime)
      (e : (pullback f g).presheaf.stalk x ≃+* Localization.AtPrime 𝔮),
      (∀ s : X.presheaf.stalk ((pullback.fst f g).base x),
        e (((pullback.fst f g).stalkMap x).hom s) =
          algebraMap ((X.presheaf.stalk ((pullback.fst f g).base x)) ⊗[R] k) (Localization.AtPrime
              𝔮) (s ⊗ₜ[R] 1)) ∧
      (∀ c : k,
        e ((pullback f g).presheaf.germ ⊤ x trivial ((pullback.snd f g).appTop ((Scheme.ΓSpecIso
            (CommRingCat.of k)).inv c))) =
          algebraMap ((X.presheaf.stalk ((pullback.fst f g).base x)) ⊗[R] k) (Localization.AtPrime
              𝔮) (1 ⊗ₜ[R] c))
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.φ

The structure morphism of the chosen affine chart.

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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
def φ : Spec Γ(Z, U) ⟶ Spec (CommRingCat.of R)
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.fromSpec_φ
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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
lemma fromSpec_φ : (hU.isoSpec.inv ≫ U.ι) ≫ z = φ (R := R) U
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.jmap

The pullback map induced by the affine chart inclusion.

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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
def jmap : pullback (φ (R := R) U) f ⟶ pullback z f
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.j

The same chart map after exchanging the two pullback factors.

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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
def j : pullback f (φ (R := R) U) ⟶ pullback z f
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.jmap_isOpenImmersion
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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
instance jmap_isOpenImmersion : IsOpenImmersion (jmap z f U hU hφU)
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.j_isOpenImmersion
Source context 12 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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
local instance jmap_isOpenImmersion : IsOpenImmersion (jmap z f U hU hφU) := by
  unfold jmap
  infer_instance
instance j_isOpenImmersion : IsOpenImmersion (j z f U hU hφU)
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.j_fst
Source context 13 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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
local instance jmap_isOpenImmersion : IsOpenImmersion (jmap z f U hU hφU) := by
  unfold jmap
  infer_instance
local instance j_isOpenImmersion : IsOpenImmersion (j z f U hU hφU) := by
  unfold j
  infer_instance
lemma j_fst : j z f U hU hφU ≫ pullback.fst z f = pullback.snd f (φ (R := R) U) ≫ hU.isoSpec.inv ≫
    U.ι
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.j_snd
Source context 13 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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
local instance jmap_isOpenImmersion : IsOpenImmersion (jmap z f U hU hφU) := by
  unfold jmap
  infer_instance
local instance j_isOpenImmersion : IsOpenImmersion (j z f U hU hφU) := by
  unfold j
  infer_instance
lemma j_snd : j z f U hU hφU ≫ pullback.snd z f = pullback.fst f (φ (R := R) U)
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.exists_j_eq
Source context 13 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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
local instance jmap_isOpenImmersion : IsOpenImmersion (jmap z f U hU hφU) := by
  unfold jmap
  infer_instance
local instance j_isOpenImmersion : IsOpenImmersion (j z f U hU hφU) := by
  unfold j
  infer_instance
lemma exists_j_eq (p : ↥(pullback z f)) (hpU : (pullback.fst z f).base p ∈ U) :
    ∃ q, (j z f U hU hφU).base q = p
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.chart_stalkMap_germ

Germs of sections of the affine chart commute with the pullback chart map.

Source context 13 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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
local instance jmap_isOpenImmersion : IsOpenImmersion (jmap z f U hU hφU) := by
  unfold jmap
  infer_instance
local instance j_isOpenImmersion : IsOpenImmersion (j z f U hU hφU) := by
  unfold j
  infer_instance
lemma chart_stalkMap_germ (q : ↥(pullback f (φ (R := R) U)))
    (hpU : (pullback.fst z f).base ((j z f U hU hφU).base q) ∈ U)
    (a : Γ(Z, U)) :
    (j z f U hU hφU).stalkMap q ((pullback z f).presheaf.germ
      ((pullback.fst z f) ⁻¹ᵁ U)
      ((j z f U hU hφU).base q) hpU ((pullback.fst z f).app U a)) =
      (pullback f (φ (R := R) U)).presheaf.germ ⊤ q trivial
        ((pullback.snd f (φ (R := R) U)).appTop ((Scheme.ΓSpecIso (CommRingCat.of Γ(Z, U))).inv
            a))
AbelianVarieties.NOSProofs.StalkPullbackLocalizations.AffineStalkCharts.main
Source context 14 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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
noncomputable section
namespace AffineStalkCharts
variable {R : Type u} [CommRing R] {X Z : Scheme.{u}}
  (z : Z ⟶ Spec (CommRingCat.of R)) (f : X ⟶ Spec (CommRingCat.of R)) (U : Z.Opens) (hU :
      IsAffineOpen U)
variable [Algebra R Γ(Z, U)]
  (hφU : hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom (algebraMap R Γ(Z, U))) = U.ι ≫ z)
include hφU
local instance jmap_isOpenImmersion : IsOpenImmersion (jmap z f U hU hφU) := by
  unfold jmap
  infer_instance
local instance j_isOpenImmersion : IsOpenImmersion (j z f U hU hφU) := by
  unfold j
  infer_instance
include hU in
theorem main
    (p : ↥(pullback z f))
    [Algebra R (Z.presheaf.stalk ((pullback.fst z f).base p))]
    (halgZ : Z.fromSpecStalk ((pullback.fst z f).base p) ≫ z =
      Spec.map (CommRingCat.ofHom (algebraMap R (Z.presheaf.stalk ((pullback.fst z f).base p)))))
    [Algebra R (X.presheaf.stalk ((pullback.snd z f).base p))]
    (halgX : X.fromSpecStalk ((pullback.snd z f).base p) ≫ f =
      Spec.map (CommRingCat.ofHom (algebraMap R (X.presheaf.stalk ((pullback.snd z f).base p)))))
    (hpU : (pullback.fst z f).base p ∈ U)
    (halgU : ∀ r : R, algebraMap R Γ(Z, U) r = (z.appLE ⊤ U le_top) ((Scheme.ΓSpecIso
        (CommRingCat.of R)).inv r)) :
    ∃ (𝔔 : Ideal ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
        ((pullback.snd z f).base p))))
      (_ : 𝔔.IsPrime)
      (e : (pullback z f).presheaf.stalk p ≃+* Localization.AtPrime 𝔔),
      (∀ s : Z.presheaf.stalk ((pullback.fst z f).base p),
        e (((pullback.fst z f).stalkMap p).hom s) =
          algebraMap ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
              ((pullback.snd z f).base p)))
            (Localization.AtPrime 𝔔) (s ⊗ₜ[R] (1 : X.presheaf.stalk ((pullback.snd z f).base p)))) ∧
      (∀ t : X.presheaf.stalk ((pullback.snd z f).base p),
        e (((pullback.snd z f).stalkMap p).hom t) =
          algebraMap ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
              ((pullback.snd z f).base p)))
            (Localization.AtPrime 𝔔) ((1 : Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗ₜ[R] t))
AlgebraicGeometry.exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk
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_AlgebraicGeometry_exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk.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.StalkPullbackLocalizations
universe u
open TensorProduct
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
theorem
    _root_.AlgebraicGeometry.exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk
    {R : Type u} [CommRing R] {X Z : Scheme.{u}}
    (f : X ⟶ Spec (CommRingCat.of R)) (z : Z ⟶ Spec (CommRingCat.of R))
    (p : ↥(pullback z f))
    [Algebra R (Z.presheaf.stalk ((pullback.fst z f).base p))]
    (halgZ : Z.fromSpecStalk ((pullback.fst z f).base p) ≫ z =
      Spec.map (CommRingCat.ofHom (algebraMap R (Z.presheaf.stalk ((pullback.fst z f).base p)))))
    [Algebra R (X.presheaf.stalk ((pullback.snd z f).base p))]
    (halgX : X.fromSpecStalk ((pullback.snd z f).base p) ≫ f =
      Spec.map (CommRingCat.ofHom (algebraMap R (X.presheaf.stalk ((pullback.snd z f).base p))))) :
    ∃ (𝔔 : Ideal ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
        ((pullback.snd z f).base p))))
      (_ : 𝔔.IsPrime)
      (e : (pullback z f).presheaf.stalk p ≃+* Localization.AtPrime 𝔔),
      (∀ s : Z.presheaf.stalk ((pullback.fst z f).base p),
        e (((pullback.fst z f).stalkMap p).hom s) =
          algebraMap ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
              ((pullback.snd z f).base p)))
            (Localization.AtPrime 𝔔) (s ⊗ₜ[R] (1 : X.presheaf.stalk ((pullback.snd z f).base p)))) ∧
      (∀ t : X.presheaf.stalk ((pullback.snd z f).base p),
        e (((pullback.snd z f).stalkMap p).hom t) =
          algebraMap ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
              ((pullback.snd z f).base p)))
            (Localization.AtPrime 𝔔) ((1 : Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗ₜ[R] t))
AbelianVarieties.NOSProofs.SectionStalkIdeals.fieldPoint

The unique point of the spectrum of a field, with its scheme carrier type.

Source context 5 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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
def fieldPoint (k : Type u) [Field k] : ↥(Spec (CommRingCat.of k))
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.map_maximalIdeal_of_iso
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
lemma map_maximalIdeal_of_iso {R S : CommRingCat.{u}} [IsLocalRing R] [IsLocalRing S]
    (e : R ≅ S) :
    (IsLocalRing.maximalIdeal R).map e.hom.hom = IsLocalRing.maximalIdeal S
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.map_stalk_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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
lemma map_stalk_eq {R₁ S₁ R₂ S₂ : CommRingCat.{u}} [IsLocalRing R₁] [IsLocalRing R₂]
    (u : R₁ ⟶ S₁) (v : R₂ ⟶ S₂) (eL : R₁ ≅ R₂) (eR : S₁ ≅ S₂) (h : eL.hom ≫ v ≫ eR.inv = u) :
    (IsLocalRing.maximalIdeal R₁).map u.hom =
      ((IsLocalRing.maximalIdeal R₂).map v.hom).map eR.inv.hom
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.maximalIdeal_localization_of_sup

A sum of extended ideals localizes to the corresponding sum of maximal ideals.

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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
lemma maximalIdeal_localization_of_sup {A B T : CommRingCat.{u}}
    (f₁ : A ⟶ T) (f₂ : B ⟶ T) (q : PrimeSpectrum T)
    (hq : q.asIdeal = (q.comap f₁.hom).asIdeal.map f₁.hom ⊔
      (q.comap f₂.hom).asIdeal.map f₂.hom) :
    IsLocalRing.maximalIdeal (Localization.AtPrime q.asIdeal) =
      (IsLocalRing.maximalIdeal (Localization.AtPrime (q.comap f₁.hom).asIdeal)).map
        (Localization.localRingHom (q.comap f₁.hom).asIdeal q.asIdeal f₁.hom rfl) ⊔
      (IsLocalRing.maximalIdeal (Localization.AtPrime (q.comap f₂.hom).asIdeal)).map
        (Localization.localRingHom (q.comap f₂.hom).asIdeal q.asIdeal f₂.hom rfl)
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.maximalIdeal_stalk_of_sup

Identify a maximal-ideal sum on affine stalks from the same sum in their coordinate ring.

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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
lemma maximalIdeal_stalk_of_sup {A B T : CommRingCat.{u}}
    (f₁ : A ⟶ T) (f₂ : B ⟶ T) (q : ↥(Spec T))
    (hq : q.asIdeal = (q.comap f₁.hom).asIdeal.map f₁.hom ⊔
      (q.comap f₂.hom).asIdeal.map f₂.hom) :
    IsLocalRing.maximalIdeal ((Spec T).presheaf.stalk q) =
      (IsLocalRing.maximalIdeal ((Spec A).presheaf.stalk ((Spec.map f₁) q))).map
        ((Spec.map f₁).stalkMap q).hom ⊔
      (IsLocalRing.maximalIdeal ((Spec B).presheaf.stalk ((Spec.map f₂) q))).map
        ((Spec.map f₂).stalkMap q).hom
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.map_maximalIdeal_comp_of_eq

A commuting triangle transports the image of the maximal ideal without unfolding stalks.

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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
lemma map_maximalIdeal_comp_of_eq {X Y Z : Scheme.{u}}
    (f : X ⟶ Y) (g : Y ⟶ Z) (h : X ⟶ Z) (hfg : f ≫ g = h) (x : X) :
    (IsLocalRing.maximalIdeal (Z.presheaf.stalk (g (f x)))).map
      (g.stalkMap (f x) ≫ f.stalkMap x).hom =
    (IsLocalRing.maximalIdeal (Z.presheaf.stalk (h x))).map (h.stalkMap x).hom
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.map_maximalIdeal_comp_of_isIso

An isomorphism on the intermediate stalk removes its maximal-ideal image from a composite.

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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
lemma map_maximalIdeal_comp_of_isIso {X Y Z : Scheme.{u}}
    (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) [IsIso (g.stalkMap (f x))] :
    (IsLocalRing.maximalIdeal (Z.presheaf.stalk ((f ≫ g) x))).map
      ((f ≫ g).stalkMap x).hom =
    (IsLocalRing.maximalIdeal (Y.presheaf.stalk (f x))).map (f.stalkMap x).hom
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.ε

The augmentation on a tensor product determined by the two sections.

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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
def ε : A ⊗[k] B →ₐ[k] k
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.εA_surjective
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
lemma εA_surjective : Function.Surjective εA
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.εB_surjective
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
lemma εB_surjective : Function.Surjective εB
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.ε_eq_comp
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
lemma ε_eq_comp : (ε εA εB : A ⊗[k] B →ₐ[k] k) =
    (Algebra.TensorProduct.lmul' k (S := k)).comp (Algebra.TensorProduct.map εA εB)
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.ker_ε
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
theorem ker_ε :
    RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k) =
      (RingHom.ker εA).map (Algebra.TensorProduct.includeLeft : A →ₐ[k] A ⊗[k] B) ⊔
        (RingHom.ker εB).map (Algebra.TensorProduct.includeRight : B →ₐ[k] A ⊗[k] B)
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.isMaximal_ker_ε
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
instance isMaximal_ker_ε : (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).IsMaximal
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.qpt

The point of the tensor-product spectrum defined by the common augmentation.

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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
local instance isMaximal_ker_ε : (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).IsMaximal :=
  RingHom.ker_isMaximal_of_surjective _ fun c ↦ ⟨algebraMap k _ c, AlgHom.commutes _ c⟩
def qpt : ↥(Spec (CommRingCat.of (A ⊗[k] B)))
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.comap_includeLeft_ker
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
local instance isMaximal_ker_ε : (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).IsMaximal :=
  RingHom.ker_isMaximal_of_surjective _ fun c ↦ ⟨algebraMap k _ c, AlgHom.commutes _ c⟩
lemma comap_includeLeft_ker :
    (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).comap
      (Algebra.TensorProduct.includeLeftRingHom : A →+* A ⊗[k] B) = RingHom.ker εA
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.comap_includeRight_ker
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
local instance isMaximal_ker_ε : (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).IsMaximal :=
  RingHom.ker_isMaximal_of_surjective _ fun c ↦ ⟨algebraMap k _ c, AlgHom.commutes _ c⟩
lemma comap_includeRight_ker :
    (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).comap
      ((Algebra.TensorProduct.includeRight : B →ₐ[k] A ⊗[k] B).toRingHom) = RingHom.ker εB
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.p₁

The first projection from the affine tensor-product model.

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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
local instance isMaximal_ker_ε : (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).IsMaximal :=
  RingHom.ker_isMaximal_of_surjective _ fun c ↦ ⟨algebraMap k _ c, AlgHom.commutes _ c⟩
abbrev p₁ : Spec (CommRingCat.of (A ⊗[k] B)) ⟶ Spec (CommRingCat.of A)
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.p₂

The second projection from the affine tensor-product model.

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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
local instance isMaximal_ker_ε : (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).IsMaximal :=
  RingHom.ker_isMaximal_of_surjective _ fun c ↦ ⟨algebraMap k _ c, AlgHom.commutes _ c⟩
abbrev p₂ : Spec (CommRingCat.of (A ⊗[k] B)) ⟶ Spec (CommRingCat.of B)
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.maximalIdeal_stalk_eq
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
local instance isMaximal_ker_ε : (RingHom.ker (ε εA εB : A ⊗[k] B →ₐ[k] k)).IsMaximal :=
  RingHom.ker_isMaximal_of_surjective _ fun c ↦ ⟨algebraMap k _ c, AlgHom.commutes _ c⟩
theorem maximalIdeal_stalk_eq :
    IsLocalRing.maximalIdeal ((Spec (CommRingCat.of (A ⊗[k] B))).presheaf.stalk (qpt εA εB)) =
      (IsLocalRing.maximalIdeal ((Spec (CommRingCat.of A)).presheaf.stalk (p₁ (k := k) (A := A) (B
          := B)
          (qpt εA εB)))).map ((p₁ (k := k) (A := A) (B := B)).stalkMap (qpt εA εB)).hom ⊔
      (IsLocalRing.maximalIdeal ((Spec (CommRingCat.of B)).presheaf.stalk (p₂ (k := k) (A := A) (B
          := B)
          (qpt εA εB)))).map ((p₂ (k := k) (A := A) (B := B)).stalkMap (qpt εA εB)).hom
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.transport
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
open CategoryTheory.Limits
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
lemma transport {P₀ S₀ X₁ X₂ : CommRingCat.{u}} [IsLocalRing P₀] [IsLocalRing S₀] [IsLocalRing X₁]
    [IsLocalRing X₂] (θ : P₀ ⟶ S₀) [IsIso θ] (u₁ : X₁ ⟶ P₀) (u₂ : X₂ ⟶ P₀)
    (h : IsLocalRing.maximalIdeal S₀ = (IsLocalRing.maximalIdeal X₁).map (u₁ ≫ θ).hom ⊔
        (IsLocalRing.maximalIdeal X₂).map (u₂ ≫ θ).hom) :
    IsLocalRing.maximalIdeal P₀ =
      (IsLocalRing.maximalIdeal X₁).map u₁.hom ⊔ (IsLocalRing.maximalIdeal X₂).map u₂.hom
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineModel.spec_case
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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineModel
open CategoryTheory.Limits
variable {k : Type u} [Field k] {A B : Type u} [CommRing A] [CommRing B] [Algebra k A] [Algebra k B]
  (εA : A →ₐ[k] k) (εB : B →ₐ[k] k)
theorem spec_case
    (hx : Spec.map (CommRingCat.ofHom εA.toRingHom) ≫
        Spec.map (CommRingCat.ofHom (algebraMap k A)) = 𝟙 _)
    (hy : Spec.map (CommRingCat.ofHom εB.toRingHom) ≫
        Spec.map (CommRingCat.ofHom (algebraMap k B)) = 𝟙 _) :
    IsLocalRing.maximalIdeal ((pullback (Spec.map (CommRingCat.ofHom (algebraMap k A)))
        (Spec.map (CommRingCat.ofHom (algebraMap k B)))).presheaf.stalk
        (pullback.lift (Spec.map (CommRingCat.ofHom εA.toRingHom))
          (Spec.map (CommRingCat.ofHom εB.toRingHom)) (hx.trans hy.symm) (fieldPoint k))) =
      (IsLocalRing.maximalIdeal ((Spec (CommRingCat.of A)).presheaf.stalk
          (pullback.fst (Spec.map (CommRingCat.ofHom (algebraMap k A)))
            (Spec.map (CommRingCat.ofHom (algebraMap k B)))
            (pullback.lift (Spec.map (CommRingCat.ofHom εA.toRingHom))
              (Spec.map (CommRingCat.ofHom εB.toRingHom)) (hx.trans hy.symm)
                (fieldPoint k))))).map
        ((pullback.fst (Spec.map (CommRingCat.ofHom (algebraMap k A)))
            (Spec.map (CommRingCat.ofHom (algebraMap k B)))).stalkMap
          (pullback.lift (Spec.map (CommRingCat.ofHom εA.toRingHom))
            (Spec.map (CommRingCat.ofHom εB.toRingHom)) (hx.trans hy.symm)
              (fieldPoint k))).hom ⊔
      (IsLocalRing.maximalIdeal ((Spec (CommRingCat.of B)).presheaf.stalk
          (pullback.snd (Spec.map (CommRingCat.ofHom (algebraMap k A)))
            (Spec.map (CommRingCat.ofHom (algebraMap k B)))
            (pullback.lift (Spec.map (CommRingCat.ofHom εA.toRingHom))
              (Spec.map (CommRingCat.ofHom εB.toRingHom)) (hx.trans hy.symm)
                (fieldPoint k))))).map
        ((pullback.snd (Spec.map (CommRingCat.ofHom (algebraMap k A)))
            (Spec.map (CommRingCat.ofHom (algebraMap k B)))).stalkMap
          (pullback.lift (Spec.map (CommRingCat.ofHom εA.toRingHom))
            (Spec.map (CommRingCat.ofHom εB.toRingHom)) (hx.trans hy.symm)
              (fieldPoint k))).hom
AbelianVarieties.NOSProofs.SectionStalkIdeals.AffineDescent.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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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.SectionStalkIdeals
universe u
open CategoryTheory AlgebraicGeometry TensorProduct
namespace AffineDescent
open CategoryTheory.Limits AffineModel
theorem main {k : Type u} [Field k] {X Y : Scheme.{u}}
    (fX : X ⟶ Spec (CommRingCat.of k)) (fY : Y ⟶ Spec (CommRingCat.of k))
    (x : Spec (CommRingCat.of k) ⟶ X) (hx : x ≫ fX = 𝟙 _)
    (y : Spec (CommRingCat.of k) ⟶ Y) (hy : y ≫ fY = 𝟙 _) :
    IsLocalRing.maximalIdeal ((pullback fX fY).presheaf.stalk
        (pullback.lift x y (hx.trans hy.symm) (fieldPoint k))) =
      (IsLocalRing.maximalIdeal (X.presheaf.stalk
          (pullback.fst fX fY (pullback.lift x y (hx.trans hy.symm) (fieldPoint k))))).map
        ((pullback.fst fX fY).stalkMap
          (pullback.lift x y (hx.trans hy.symm) (fieldPoint k))).hom ⊔
      (IsLocalRing.maximalIdeal (Y.presheaf.stalk
          (pullback.snd fX fY (pullback.lift x y (hx.trans hy.symm) (fieldPoint k))))).map
        ((pullback.snd fX fY).stalkMap
          (pullback.lift x y (hx.trans hy.symm) (fieldPoint k))).hom
AlgebraicGeometry.maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section
Source context 5 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_AlgebraicGeometry_maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section.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 AlgebraicGeometry
universe u
open CategoryTheory CategoryTheory.Limits
theorem maximalIdeal_stalk_pullback_eq_map_stalkMap_fst_sup_map_stalkMap_snd_of_section
    {k : Type u} [Field k] {X Y : Scheme.{u}}
    (fX : X ⟶ Spec (CommRingCat.of k)) (fY : Y ⟶ Spec (CommRingCat.of k))
    (x : Spec (CommRingCat.of k) ⟶ X) (hx : x ≫ fX = 𝟙 _)
    (y : Spec (CommRingCat.of k) ⟶ Y) (hy : y ≫ fY = 𝟙 _) :
    IsLocalRing.maximalIdeal ((Limits.pullback fX fY).presheaf.stalk
        (Limits.pullback.lift x y (hx.trans hy.symm) (IsLocalRing.closedPoint k))) =
      (IsLocalRing.maximalIdeal (X.presheaf.stalk
          (Limits.pullback.fst fX fY (Limits.pullback.lift x y (hx.trans hy.symm)
            (IsLocalRing.closedPoint k))))).map
        ((Limits.pullback.fst fX fY).stalkMap
          (Limits.pullback.lift x y (hx.trans hy.symm) (IsLocalRing.closedPoint k))).hom ⊔
      (IsLocalRing.maximalIdeal (Y.presheaf.stalk
          (Limits.pullback.snd fX fY (Limits.pullback.lift x y (hx.trans hy.symm)
            (IsLocalRing.closedPoint k))))).map
        ((Limits.pullback.snd fX fY).stalkMap
          (Limits.pullback.lift x y (hx.trans hy.symm) (IsLocalRing.closedPoint k))).hom
AlgebraicGeometry.maximalIdeal_stalk_pullback_le_of_sections_of_isAffine
Source context 4 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_AlgebraicGeometry_maximalIdeal_stalk_pullback_le_of_sections_of_isAffine.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.
-/
universe u
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry IsLocalRing
theorem _root_.AlgebraicGeometry.maximalIdeal_stalk_pullback_le_of_sections_of_isAffine
    {k : Type u} [Field k] {Y Z : Scheme.{u}} [IsAffine Y] [IsAffine Z]
    (pY : Y ⟶ Spec (.of k)) (pZ : Z ⟶ Spec (.of k))
    (y : Spec (.of k) ⟶ Y) (hy : y ≫ pY = 𝟙 _) (z : Spec (.of k) ⟶ Z) (hz : z ≫ pZ = 𝟙 _)
    (w : ↑(pullback pY pZ)) (hw : w = (pullback.lift y z (hy.trans hz.symm)) (closedPoint k)) :
    maximalIdeal ((pullback pY pZ).presheaf.stalk w) ≤
      (maximalIdeal _).map ((pullback.fst pY pZ).stalkMap w).hom ⊔
        (maximalIdeal _).map ((pullback.snd pY pZ).stalkMap w).hom
AlgebraicGeometry.bijective_kaehlerDifferential_map_comp_mapBaseChange_stalk_pullback
Source context 5 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_AlgebraicGeometry_bijective_kaehlerDifferential_map_comp_mapBaseChange_stalk_pullback.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.StalkDifferentialBaseChange
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TensorProduct
universe u
theorem _root_.AlgebraicGeometry.bijective_kaehlerDifferential_map_comp_mapBaseChange_stalk_pullback
    {R : Type u} [CommRing R] {X Z : Scheme.{u}}
    (f : X ⟶ Spec (CommRingCat.of R)) (z : Z ⟶ Spec (CommRingCat.of R))
    (p : ↥(pullback z f))
    [Algebra R (Z.presheaf.stalk ((pullback.fst z f).base p))]
    (halgZ : Z.fromSpecStalk ((pullback.fst z f).base p) ≫ z =
      Spec.map (CommRingCat.ofHom (algebraMap R (Z.presheaf.stalk ((pullback.fst z f).base p)))))
    [Algebra R (X.presheaf.stalk ((pullback.snd z f).base p))]
    (halgX : X.fromSpecStalk ((pullback.snd z f).base p) ≫ f =
      Spec.map (CommRingCat.ofHom (algebraMap R (X.presheaf.stalk ((pullback.snd z f).base p)))))
    [Algebra R ((pullback z f).presheaf.stalk p)] :
    let : Algebra (Z.presheaf.stalk ((pullback.fst z f).base p)) ((pullback z f).presheaf.stalk
        p) :=
      ((pullback.fst z f).stalkMap p).hom.toAlgebra
    let : Algebra (X.presheaf.stalk ((pullback.snd z f).base p)) ((pullback z f).presheaf.stalk
        p) :=
      ((pullback.snd z f).stalkMap p).hom.toAlgebra
    ∀ [IsScalarTower R (Z.presheaf.stalk ((pullback.fst z f).base p)) ((pullback z
        f).presheaf.stalk p)]
      [IsScalarTower R (X.presheaf.stalk ((pullback.snd z f).base p)) ((pullback z
          f).presheaf.stalk p)],
      Function.Bijective
        ((KaehlerDifferential.map R (Z.presheaf.stalk ((pullback.fst z f).base p))
              ((pullback z f).presheaf.stalk p) ((pullback z f).presheaf.stalk p)).restrictScalars
            ((pullback z f).presheaf.stalk p) ∘ₗ
          KaehlerDifferential.mapBaseChange R (X.presheaf.stalk ((pullback.snd z f).base p))
            ((pullback z f).presheaf.stalk p)) := by
  intro algA algB hTA hTB
  obtain ⟨𝔔, h𝔔, e, he₁, he₂⟩ :=
      AlgebraicGeometry.exists_ringEquiv_stalk_pullback_localization_tensorProduct_stalk_stalk f z
      p halgZ halgX
  have : 𝔔.IsPrime := h𝔔
  let algT : Algebra ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
      ((pullback.snd z f).base p))) ((pullback z f).presheaf.stalk p) :=
    (e.symm.toRingHom.comp (algebraMap ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R]
        (X.presheaf.stalk ((pullback.snd z f).base p))) (Localization.AtPrime 𝔔))).toAlgebra
  let eT : Localization.AtPrime 𝔔 ≃ₐ[((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R]
      (X.presheaf.stalk ((pullback.snd z f).base p)))] ((pullback z f).presheaf.stalk p) :=
    AlgEquiv.ofRingEquiv (f := e.symm) (fun _ => rfl)
  have : IsLocalization 𝔔.primeCompl ((pullback z f).presheaf.stalk p) :=
    IsLocalization.isLocalization_of_algEquiv 𝔔.primeCompl eT
  have : IsScalarTower (Z.presheaf.stalk ((pullback.fst z f).base p)) ((Z.presheaf.stalk
      ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk ((pullback.snd z f).base p))) ((pullback
      z f).presheaf.stalk p) :=
    IsScalarTower.of_algebraMap_eq (R := (Z.presheaf.stalk ((pullback.fst z f).base p))) (S :=
        ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk ((pullback.snd z
        f).base p)))) (A := ((pullback z f).presheaf.stalk p)) fun s => by
    change ((pullback.fst z f).stalkMap p).hom s =
      e.symm (algebraMap ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
          ((pullback.snd z f).base p))) (Localization.AtPrime 𝔔) (algebraMap (Z.presheaf.stalk
          ((pullback.fst z f).base p)) ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R]
          (X.presheaf.stalk ((pullback.snd z f).base p))) s))
    rw [Algebra.TensorProduct.algebraMap_apply, Algebra.algebraMap_self, RingHom.id_apply, ← he₁,
      RingEquiv.symm_apply_apply]
  have hB : (algebraMap ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R] (X.presheaf.stalk
      ((pullback.snd z f).base p))) ((pullback z f).presheaf.stalk p)).comp
      (Algebra.TensorProduct.includeRight (R := R) (A := (Z.presheaf.stalk ((pullback.fst z
          f).base p))) (B := (X.presheaf.stalk ((pullback.snd z f).base p)))).toRingHom =
      algebraMap (X.presheaf.stalk ((pullback.snd z f).base p)) ((pullback z f).presheaf.stalk p)
          := by
    refine RingHom.ext fun t => ?_
    change e.symm (algebraMap ((Z.presheaf.stalk ((pullback.fst z f).base p)) ⊗[R]
        (X.presheaf.stalk ((pullback.snd z f).base p))) (Localization.AtPrime 𝔔)
        (Algebra.TensorProduct.includeRight t)) =
      ((pullback.snd z f).stalkMap p).hom t
    rw [Algebra.TensorProduct.includeRight_apply, ← he₂, RingEquiv.symm_apply_apply]
  have : IsLocalization (⊥ : Submonoid (Z.presheaf.stalk ((pullback.fst z f).base p)))
      (Z.presheaf.stalk ((pullback.fst z f).base p)) := IsLocalization.self bot_le
  exact KaehlerDifferential.bijective_map_comp_mapBaseChange_of_isLocalization_tensorProduct R
      (Z.presheaf.stalk ((pullback.fst z f).base p)) (Z.presheaf.stalk ((pullback.fst z f).base
      p)) (X.presheaf.stalk ((pullback.snd z f).base p)) ((pullback z f).presheaf.stalk p)
    (⊥ : Submonoid (Z.presheaf.stalk ((pullback.fst z f).base p))) hB 𝔔.primeCompl
AlgebraicGeometry.maximalIdeal_stalk_pullback_le_of_sections
Source context 4 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_AlgebraicGeometry_maximalIdeal_stalk_pullback_le_of_sections.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.
-/
universe u
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry IsLocalRing
theorem _root_.AlgebraicGeometry.maximalIdeal_stalk_pullback_le_of_sections
    {k : Type u} [Field k] {Y Z : Scheme.{u}} (pY : Y ⟶ Spec (.of k)) (pZ : Z ⟶ Spec (.of k))
    (y : Spec (.of k) ⟶ Y) (hy : y ≫ pY = 𝟙 _) (z : Spec (.of k) ⟶ Z) (hz : z ≫ pZ = 𝟙 _)
    (w : ↑(pullback pY pZ)) (hw : w = (pullback.lift y z (hy.trans hz.symm)) (closedPoint k)) :
    maximalIdeal ((pullback pY pZ).presheaf.stalk w) ≤
      (maximalIdeal _).map ((pullback.fst pY pZ).stalkMap w).hom ⊔
        (maximalIdeal _).map ((pullback.snd pY pZ).stalkMap w).hom