Module

Dimension.lean

Nyll.SchemeTheory.LocalGeometry.Dimension
61 declarations indexed from sourceView source ↗

Local dimension of schemes of finite type

Affine chart dimensions, the dimension formula at a point, generic fibres and a valuation-theoretic proper model. Chart algebra structures and stalk heights use the existing sections and normalization APIs.

Imports24
Imported by4

Declarations

SchemeTheory.LocalDimension.FibreDimension.exists_ringKrullDim_eq_natCast
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section Algebra
theorem exists_ringKrullDim_eq_natCast (k : Type u) {A : Type v} [Field k] [CommRing A]
    [IsDomain A] [Algebra k A] [Algebra.FiniteType k A] : ∃ n : ℕ, ringKrullDim A = n
SchemeTheory.LocalDimension.FibreDimension.ringKrullDim_le_ringKrullDim_localization
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section Algebra
theorem ringKrullDim_le_ringKrullDim_localization (k : Type u) [Field k] {A : Type v} [CommRing A]
    [IsDomain A] [Algebra k A] [Algebra.FiniteType k A] {g : A} (hg : g ≠ 0)
    (L : Type v) [CommRing L] [Algebra A L] [IsLocalization.Away g L] :
    ringKrullDim A ≤ ringKrullDim L
SchemeTheory.LocalDimension.FibreDimension.exists_minimalPrime_ringKrullDim_le
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section Algebra
theorem exists_minimalPrime_ringKrullDim_le (k : Type u) [Field k] {A : Type v} [CommRing A]
    [IsDomain A] [Algebra k A] [Algebra.FiniteType k A] {B : Type v} [CommRing B]
    [IsNoetherianRing B] (φ : B →+* A) (P : Ideal A) [P.IsPrime] (m : Ideal B) [hm : m.IsMaximal]
    (hmP : m = P.comap φ) :
    ∃ Q : Ideal A, Q.IsPrime ∧ Q ≤ P ∧ m.map φ ≤ Q ∧
      ringKrullDim A ≤ ringKrullDim (A ⧸ Q) +
        ((m.map (Ideal.Quotient.mk (RingHom.ker φ))).height : WithBot ℕ∞)
SchemeTheory.LocalDimension.FibreDimension.topologicalKrullDim_affineOpen
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section TopologyB2
theorem topologicalKrullDim_affineOpen {X : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U) :
    topologicalKrullDim ↥U = ringKrullDim Γ(X, U)
SchemeTheory.LocalDimension.FibreDimension.topologicalKrullDim_zeroLocus
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section TopologyB2
theorem topologicalKrullDim_zeroLocus {A : Type u} [CommRing A] (I : Ideal A) :
    topologicalKrullDim (PrimeSpectrum.zeroLocus (I : Set A)) = ringKrullDim (A ⧸ I)
SchemeTheory.LocalDimension.FibreDimension.topologicalKrullDim_le_of_isEmbedding_image
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section TopologyB2
theorem topologicalKrullDim_le_of_isEmbedding_image {X Y : Type u} [TopologicalSpace X]
    [TopologicalSpace Y] {f : X → Y} (hf : IsEmbedding f) (s : Set X) (t : Set Y)
    (hst : f '' s ⊆ t) : topologicalKrullDim s ≤ topologicalKrullDim t
SchemeTheory.LocalDimension.FibreDimension.topologicalKrullDim_le_ringKrullDim
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section Integral
variable {k : Type u} [Field k]
theorem topologicalKrullDim_le_ringKrullDim {X : Scheme.{u}} (fX : X ⟶ Spec (CommRingCat.of k))
    [LocallyOfFiniteType fX] [IsIntegral X] {U : X.Opens} (hU : IsAffineOpen U)
    (hUne : (U : Set X).Nonempty) :
    topologicalKrullDim X ≤ ringKrullDim Γ(X, U)
SchemeTheory.LocalDimension.FibreDimension.main_integral
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section Integral
variable {k : Type u} [Field k]
theorem main_integral {X Y : Scheme.{u}}
    (fX : X ⟶ Spec (CommRingCat.of k)) [LocallyOfFiniteType fX] [IsIntegral X]
    (fY : Y ⟶ Spec (CommRingCat.of k)) [LocallyOfFiniteType fY]
    (o : X ⟶ Y) (_ho : o ≫ fY = fX) {y : ↥Y} (hy : IsClosed ({y} : Set ↥Y))
    {x : ↥X} (hx : o x = y) :
    ∃ Z : Set ↥X, x ∈ Z ∧ Z ⊆ o ⁻¹' {y} ∧ IsIrreducible Z ∧ IsClosed Z ∧
      topologicalKrullDim ↥X ≤
        topologicalKrullDim ↥Z + topologicalKrullDim ↥(closure (Set.range o))
SchemeTheory.LocalDimension.FibreDimension.main
Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace FibreDimension
section Reduction
open _root_.AlgebraicGeometry.Scheme.IdealSheafData
variable {k : Type u} [Field k]
theorem main {X Y : Scheme.{u}}
    (fX : X ⟶ Spec (CommRingCat.of k)) [LocallyOfFiniteType fX] [IrreducibleSpace ↥X]
    (fY : Y ⟶ Spec (CommRingCat.of k)) [LocallyOfFiniteType fY]
    (o : X ⟶ Y) (ho : o ≫ fY = fX) {y : ↥Y} (hy : IsClosed ({y} : Set ↥Y))
    {x : ↥X} (hx : o x = y) :
    ∃ Z : Set ↥X, x ∈ Z ∧ Z ⊆ o ⁻¹' {y} ∧ IsIrreducible Z ∧ IsClosed Z ∧
      topologicalKrullDim ↥X ≤
        topologicalKrullDim ↥Z + topologicalKrullDim ↥(closure (Set.range o))
AlgebraicGeometry.exists_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton.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 v
open SchemeTheory.LocalDimension
theorem exists_isIrreducible_topologicalKrullDim_le_add_of_apply_eq_of_isClosed_singleton
    {k : Type u} [Field k] {X Y : Scheme.{u}}
    (fX : X ⟶ Spec (CommRingCat.of k)) [LocallyOfFiniteType fX] [IrreducibleSpace ↥X]
    (fY : Y ⟶ Spec (CommRingCat.of k)) [LocallyOfFiniteType fY]
    (o : X ⟶ Y) (ho : o ≫ fY = fX) {y : ↥Y} (hy : IsClosed ({y} : Set ↥Y))
    {x : ↥X} (hx : o x = y) :
    ∃ Z : Set ↥X, x ∈ Z ∧ Z ⊆ o ⁻¹' {y} ∧ IsIrreducible Z ∧ IsClosed Z ∧
      topologicalKrullDim ↥X ≤
        topologicalKrullDim ↥Z + topologicalKrullDim ↥(closure (Set.range o))
SchemeTheory.LocalDimension.AffineDimension.main
Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_topologicalKrullDim_eq_ringKrullDim_of_isAffineOpen_of_isIntegral.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace AffineDimension
open _root_.AlgebraicGeometry
open SchemeTheory.LocalDimension.FibreDimension
variable {k : Type u} [Field k]
theorem main {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of k))
    [IsIntegral X] [LocallyOfFiniteType f] {U : X.Opens} (hU : IsAffineOpen U)
    (hUne : (U : Set X).Nonempty) :
    topologicalKrullDim X = ringKrullDim Γ(X, U)
AlgebraicGeometry.topologicalKrullDim_eq_ringKrullDim_of_isAffineOpen_of_isIntegral
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_topologicalKrullDim_eq_ringKrullDim_of_isAffineOpen_of_isIntegral.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 v
open SchemeTheory.LocalDimension
theorem topologicalKrullDim_eq_ringKrullDim_of_isAffineOpen_of_isIntegral
    {k : Type u} [Field k] {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of k))
    [IsIntegral X] [LocallyOfFiniteType f] {U : X.Opens} (hU : IsAffineOpen U)
    (hUne : (U : Set X).Nonempty) :
    topologicalKrullDim X = ringKrullDim Γ(X, U)
SchemeTheory.LocalDimension.GenericFibre.chart_isNoetherianRing
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_closure_eq_preimage_closure_and_ringKrullDim_stalk_eq_of_flat.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 SchemeTheory.LocalDimension
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace GenericFibre
open _root_.AlgebraicGeometry
variable {k : Type u} [Field k]
theorem chart_isNoetherianRing {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of k))
    [LocallyOfFiniteType f] {U : X.Opens} (hU : IsAffineOpen U) :
    IsNoetherianRing Γ(X, U)
SchemeTheory.LocalDimension.GenericFibre.exists_isGenericPoint
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_closure_eq_preimage_closure_and_ringKrullDim_stalk_eq_of_flat.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 SchemeTheory.LocalDimension
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace GenericFibre
open _root_.AlgebraicGeometry
variable {k : Type u} [Field k]
section Generic
variable {G P : Scheme.{u}} (f : G ⟶ Spec (CommRingCat.of k)) (p : P ⟶ Spec (CommRingCat.of k))
theorem exists_isGenericPoint [UniversallyOpen f] [GeometricallyIrreducible f] [Flat f] (w : P) :
    ∃ ζ : ↥(pullback f p),
      IsGenericPoint ζ ((pullback.snd f p).base ⁻¹' closure ({w} : Set P)) ∧
      (pullback.snd f p).base ζ = w
SchemeTheory.LocalDimension.GenericFibre.height_eq
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_closure_eq_preimage_closure_and_ringKrullDim_stalk_eq_of_flat.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 SchemeTheory.LocalDimension
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace GenericFibre
open _root_.AlgebraicGeometry
variable {k : Type u} [Field k]
section Heights
variable {G P : Scheme.{u}} (f : G ⟶ Spec (CommRingCat.of k)) (p : P ⟶ Spec (CommRingCat.of k))
theorem height_eq [Flat f] [LocallyOfFiniteType f] [LocallyOfFiniteType p] (w : P)
    (ζ : ↥(pullback f p))
    (hζ : IsGenericPoint ζ ((pullback.snd f p).base ⁻¹' closure ({w} : Set P)))
    (hζw : (pullback.snd f p).base ζ = w)
    {V : P.Opens} (hV : IsAffineOpen V) (hwV : w ∈ V)
    {U : (pullback f p).Opens} (hU : IsAffineOpen U) (hζU : ζ ∈ U)
    (hUV : U ≤ (pullback.snd f p) ⁻¹ᵁ V) :
    (hU.primeIdealOf ⟨ζ, hζU⟩).asIdeal.height = (hV.primeIdealOf ⟨w, hwV⟩).asIdeal.height
SchemeTheory.LocalDimension.GenericFibre.main
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_closure_eq_preimage_closure_and_ringKrullDim_stalk_eq_of_flat.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 SchemeTheory.LocalDimension
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace GenericFibre
open _root_.AlgebraicGeometry
variable {k : Type u} [Field k]
theorem main {G P : Scheme.{u}} (f : G ⟶ Spec (CommRingCat.of k))
    (p : P ⟶ Spec (CommRingCat.of k))
    [GeometricallyIrreducible f] [LocallyOfFiniteType f] [LocallyOfFiniteType p] (w : P) :
    ∃ ζ : ↥(pullback f p),
      closure ({ζ} : Set ↥(pullback f p)) = (pullback.snd f p).base ⁻¹' closure ({w} : Set P) ∧
      (pullback.snd f p).base ζ = w ∧
      ringKrullDim ((pullback f p).presheaf.stalk ζ) = ringKrullDim (P.presheaf.stalk w)
AlgebraicGeometry.exists_closure_eq_preimage_closure_and_ringKrullDim_stalk_eq_of_flat
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_closure_eq_preimage_closure_and_ringKrullDim_stalk_eq_of_flat.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 v
open SchemeTheory.LocalDimension
theorem exists_closure_eq_preimage_closure_and_ringKrullDim_stalk_eq_of_flat
    {k : Type u} [Field k] {G P : Scheme.{u}} (f : G ⟶ Spec (CommRingCat.of k))
    (p : P ⟶ Spec (CommRingCat.of k))
    [GeometricallyIrreducible f] [LocallyOfFiniteType f] [LocallyOfFiniteType p] (w : P) :
    ∃ ζ : ↥(pullback f p),
      closure ({ζ} : Set ↥(pullback f p)) = (pullback.snd f p).base ⁻¹' closure ({w} : Set P) ∧
      (pullback.snd f p).base ζ = w ∧
      ringKrullDim ((pullback f p).presheaf.stalk ζ) = ringKrullDim (P.presheaf.stalk w)
SchemeTheory.LocalDimension.CodimFormula.eq_sub_of_natCast_add_eq
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace CodimFormula
open SchemeTheory.LocalDimension.FibreDimension
open _root_.AlgebraicGeometry
theorem eq_sub_of_natCast_add_eq (h n : ℕ) (d : WithBot ℕ∞)
    (hd : (h : WithBot ℕ∞) + d = n) : d = ((n - h : ℕ) : WithBot ℕ∞) ∧ h ≤ n
SchemeTheory.LocalDimension.CodimFormula.chart_numbers
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace CodimFormula
open SchemeTheory.LocalDimension.FibreDimension
open _root_.AlgebraicGeometry
section Charts
variable {k : Type u} [Field k]
theorem
 chart_numbers {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of k)) [IsIntegral X]
    [LocallyOfFiniteType f]
    {U : X.Opens} (hU : IsAffineOpen U) (x : X) (hx : x ∈ U) :
    ∃ n h : ℕ, h ≤ n ∧ topologicalKrullDim X = n ∧
      ringKrullDim (X.presheaf.stalk x) = h ∧
      topologicalKrullDim (PrimeSpectrum.zeroLocus
        (((hU.primeIdealOf ⟨x, hx⟩).asIdeal : Ideal Γ(X, U)) : Set Γ(X, U))) = ((n - h : ℕ) :
            WithBot ℕ∞)
SchemeTheory.LocalDimension.CodimFormula.fromSpec_mem_closure
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace CodimFormula
open SchemeTheory.LocalDimension.FibreDimension
open _root_.AlgebraicGeometry
section Charts
variable {k : Type u} [Field k]
theorem
 fromSpec_mem_closure {X : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U) (x : X) (hx : x ∈ U)
    (q : PrimeSpectrum Γ(X, U)) (hq : hU.primeIdealOf ⟨x, hx⟩ ≤ q) :
    hU.fromSpec q ∈ closure ({x} : Set X)
SchemeTheory.LocalDimension.CodimFormula.primeIdealOf_le_of_mem_closure
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace CodimFormula
open SchemeTheory.LocalDimension.FibreDimension
open _root_.AlgebraicGeometry
section Charts
variable {k : Type u} [Field k]
theorem
 primeIdealOf_le_of_mem_closure {X : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U) (x : X) (hx : x
    ∈ U)
    (c : X) (hcU : c ∈ U) (hc : c ∈ closure ({x} : Set X)) :
    hU.primeIdealOf ⟨x, hx⟩ ≤ hU.primeIdealOf ⟨c, hcU⟩
SchemeTheory.LocalDimension.CodimFormula.zeroLocus_le_closure
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace CodimFormula
open SchemeTheory.LocalDimension.FibreDimension
open _root_.AlgebraicGeometry
section Charts
variable {k : Type u} [Field k]
theorem
 zeroLocus_le_closure {X : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U) (x : X) (hx : x ∈ U) :
    topologicalKrullDim (PrimeSpectrum.zeroLocus
        (((hU.primeIdealOf ⟨x, hx⟩).asIdeal : Ideal Γ(X, U)) : Set Γ(X, U))) ≤
      topologicalKrullDim (closure ({x} : Set X))
SchemeTheory.LocalDimension.CodimFormula.closure_le
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace CodimFormula
open SchemeTheory.LocalDimension.FibreDimension
open _root_.AlgebraicGeometry
section Charts
variable {k : Type u} [Field k]
theorem
 closure_le {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of k)) [IsIntegral X] [LocallyOfFiniteType
    f]
    (x : X) (n h : ℕ) (hXn : topologicalKrullDim X = n)
    (hxh : ringKrullDim (X.presheaf.stalk x) = h) :
    topologicalKrullDim (closure ({x} : Set X)) ≤ ((n - h : ℕ) : WithBot ℕ∞)
SchemeTheory.LocalDimension.CodimFormula.main
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral.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 SchemeTheory.LocalDimension
universe u v
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology
open _root_.AlgebraicGeometry
namespace CodimFormula
open SchemeTheory.LocalDimension.FibreDimension
open _root_.AlgebraicGeometry
section Charts
variable {k : Type u} [Field k]
theorem
 main {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of k)) [IsIntegral X] [LocallyOfFiniteType f]
    (x : X) :
    ringKrullDim (X.presheaf.stalk x) + topologicalKrullDim ↥(closure ({x} : Set X)) =
      topologicalKrullDim X
AlgebraicGeometry.ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral.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 v
open SchemeTheory.LocalDimension
theorem ringKrullDim_stalk_add_topologicalKrullDim_closure_of_isIntegral
    {k : Type u} [Field k] {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of k))
    [IsIntegral X] [LocallyOfFiniteType f] (x : X) :
    ringKrullDim (X.presheaf.stalk x) + topologicalKrullDim ↥(closure ({x} : Set X)) =
      topologicalKrullDim X
AlgebraicGeometry.topologicalKrullDim_eq_of_iso_opens
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_topologicalKrullDim_eq_of_iso_opens.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 v
open SchemeTheory.LocalDimension
theorem topologicalKrullDim_eq_of_iso_opens
    {k : Type u} [Field k] {X Y : Scheme.{u}} (fX : X ⟶ Spec (.of k)) (fY : Y ⟶ Spec (.of k))
    [LocallyOfFiniteType fX] [LocallyOfFiniteType fY] [IsIntegral X] [IsIntegral Y]
    (U : X.Opens) (U' : Y.Opens) (hU : (U : Set X).Nonempty) (e : (U : Scheme.{u}) ≅ (U' :
        Scheme.{u})) :
    topologicalKrullDim ↥X = topologicalKrullDim ↥Y
SchemeTheory.LocalDimension.ResidueDimension.chart_top
Source context 13 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_toENat_trdeg_residueField_eq_topologicalKrullDim_closure.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 SchemeTheory.LocalDimension
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace
universe u
namespace ResidueDimension
open Topology
theorem chart_top {X : Scheme.{u}} {x : X} {U : X.Opens} (hU : IsAffineOpen U) (hxU : x ∈ U) :
    ∃ g : PrimeSpectrum (Γ(X, U) ⧸ (hU.primeIdealOf ⟨x, hxU⟩).asIdeal) → ↥(closure ({x} : Set X)),
      IsOpenEmbedding g ∧ ∀ z : ↥(closure ({x} : Set X)), z.1 ∈ (U : Set X) → z ∈ Set.range g
SchemeTheory.LocalDimension.ResidueDimension.resAlgebra

The residue-field algebra induced by the structure morphism.

Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_toENat_trdeg_residueField_eq_topologicalKrullDim_closure.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 SchemeTheory.LocalDimension
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace
universe u
namespace ResidueDimension
open Topology
section Chart
variable {k : Type u} [Field k] {X : Scheme.{u}} (f : X ⟶ Spec (.of k))
abbrev resAlgebra (x : X) : Algebra k (X.residueField x)
SchemeTheory.LocalDimension.ResidueDimension.chart_alg
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_toENat_trdeg_residueField_eq_topologicalKrullDim_closure.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 SchemeTheory.LocalDimension
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace
universe u
namespace ResidueDimension
open Topology
section Chart
variable {k : Type u} [Field k] {X : Scheme.{u}} (f : X ⟶ Spec (.of k))
theorem chart_alg [LocallyOfFiniteType f] {x : X} {U : X.Opens} (hU : IsAffineOpen U)
    (hxU : x ∈ U) :
    letI := resAlgebra f x
    ringKrullDim (Γ(X, U) ⧸ (hU.primeIdealOf ⟨x, hxU⟩).asIdeal) =
      (Cardinal.toENat (Algebra.trdeg k (X.residueField x)) : WithBot ℕ∞) := by
  let : Algebra k (X.residueField x) := resAlgebra f x
  let : Algebra k Γ(X, U) := f.sectionsAlgebra U
  have : Algebra.FiniteType k Γ(X, U) := chart_finiteType f hU
  let algSt : Algebra Γ(X, U) (X.presheaf.stalk x) :=
    TopCat.Presheaf.algebra_section_stalk X.presheaf ⟨x, hxU⟩
  have hloc : IsLocalization.AtPrime (X.presheaf.stalk x) (hU.primeIdealOf ⟨x, hxU⟩).asIdeal :=
    hU.isLocalization_stalk ⟨x, hxU⟩
  have hev : ∀ a : k, (X.evaluation U x hxU).hom (algebraMap k Γ(X, U) a) = algebraMap k
      (X.residueField x) a := by
    intro a
    exact congrArg (fun z : X.presheaf.stalk x => X.residue x z)
      (X.presheaf.germ_res_apply (homOfLE (le_top : U ≤ ⊤)) x hxU
        (f.appTop ((Scheme.ΓSpecIso (.of k)).inv a)))
  have hker : RingHom.ker (X.evaluation U x hxU).hom = (hU.primeIdealOf ⟨x, hxU⟩).asIdeal := by
    ext a
    rw [RingHom.mem_ker]
    change (X.residue x).hom ((X.presheaf.germ U x hxU).hom a) = 0 ↔ _
    exact (IsLocalRing.residue_eq_zero_iff _).trans
      (IsLocalization.AtPrime.to_map_mem_maximal_iff (X.presheaf.stalk x)
        (hU.primeIdealOf ⟨x, hxU⟩).asIdeal a)
  rw [← hker]
  have hprime : (RingHom.ker (X.evaluation U x hxU).hom).IsPrime := RingHom.ker_isPrime _
  let algQ : Algebra (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x hxU).hom) (X.residueField x) :=
    (RingHom.kerLift (X.evaluation U x hxU).hom).toAlgebra
  have : IsScalarTower k (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x hxU).hom) (X.residueField x) := by
    refine IsScalarTower.of_algebraMap_eq fun a => ?_
    rw [← Ideal.Quotient.mk_algebraMap,
      RingHom.algebraMap_toAlgebra (RingHom.kerLift (X.evaluation U x hxU).hom), RingHom.kerLift_mk]
    exact (hev a).symm
  have : FaithfulSMul (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x hxU).hom) (X.residueField x) :=
    (faithfulSMul_iff_algebraMap_injective _ _).mpr (RingHom.kerLift_injective _)
  have : FaithfulSMul k (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x hxU).hom) :=
    (faithfulSMul_iff_algebraMap_injective _ _).mpr (algebraMap k _).injective
  have : Algebra.IsAlgebraic (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x hxU).hom) (X.residueField x)
      := by
    refine ⟨fun z => ?_⟩
    obtain ⟨s, rfl⟩ := X.residue_surjective x z
    obtain ⟨⟨a, t⟩, hat⟩ := IsLocalization.surj (hU.primeIdealOf ⟨x, hxU⟩).asIdeal.primeCompl s
    have ht : (X.evaluation U x hxU).hom t ≠ 0 := by
      intro h0
      have : (t : Γ(X, U)) ∈ RingHom.ker (X.evaluation U x hxU).hom := h0
      rw [hker] at this
      exact t.2 this
    have hz : (X.residue x).hom s * (X.evaluation U x hxU).hom t = (X.evaluation U x hxU).hom a
        := by
      change (X.residue x).hom s * (X.residue x).hom ((X.presheaf.germ U x hxU).hom t) =
        (X.residue x).hom ((X.presheaf.germ U x hxU).hom a)
      rw [← map_mul]
      exact congrArg _ hat
    have hz' : (X.residue x).hom s =
        algebraMap (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x hxU).hom) (X.residueField x)
            (Ideal.Quotient.mk _ a) *
          (algebraMap (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x hxU).hom) (X.residueField x)
              (Ideal.Quotient.mk _ t))⁻¹ := by
      rw [RingHom.algebraMap_toAlgebra, RingHom.kerLift_mk, RingHom.kerLift_mk,
        eq_mul_inv_iff_mul_eq₀ ht, hz]
    rw [hz']
    exact (isAlgebraic_algebraMap _).mul (isAlgebraic_algebraMap _).inv
  obtain ⟨s, hs⟩ := exists_isTranscendenceBasis k (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x hxU).hom)
  have hs' := hs.algebraMap_comp (A := X.residueField x)
  rw [Algebra.ringKrullDim_eq_toENat_trdeg_of_finiteType k (Γ(X, U) ⧸ RingHom.ker (X.evaluation U x
      hxU).hom),
    ← hs.cardinalMk_eq_trdeg, ← hs'.cardinalMk_eq_trdeg]
SchemeTheory.LocalDimension.ResidueDimension.main
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_toENat_trdeg_residueField_eq_topologicalKrullDim_closure.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 SchemeTheory.LocalDimension
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace
universe u
namespace ResidueDimension
open Topology
section Chart
variable {k : Type u} [Field k] {X : Scheme.{u}} (f : X ⟶ Spec (.of k))
theorem main [LocallyOfFiniteType f] (x : X) :
    letI := resAlgebra f x
    (Cardinal.toENat (Algebra.trdeg k (X.residueField x)) : WithBot ℕ∞) =
      topologicalKrullDim ↥(closure ({x} : Set X)) := by
  let : Algebra k (X.residueField x) := resAlgebra f x
  have : QuasiSober ↥(closure ({x} : Set X)) :=
    (isClosed_closure.isClosedEmbedding_subtypeVal).quasiSober
  apply le_antisymm
  · obtain ⟨U, hU, hxU, -⟩ :=
      exists_isAffineOpen_mem_and_subset (X := X) (x := x) (U := ⊤) trivial
    obtain ⟨g, hg, -⟩ := chart_top hU hxU
    rw [← chart_alg f hU hxU, ← PrimeSpectrum.topologicalKrullDim_eq_ringKrullDim]
    exact Topology.IsInducing.topologicalKrullDim_le hg.isEmbedding.isInducing
  · refine topologicalKrullDim_le_of_forall_exists_isOpenEmbedding _ fun z => ?_
    obtain ⟨U, hU, hzU, -⟩ :=
      exists_isAffineOpen_mem_and_subset (X := X) (x := z.1) (U := ⊤) trivial
    have hxU : x ∈ U := by
      obtain ⟨y, hyU, hyx⟩ := mem_closure_iff.mp z.2 U U.isOpen hzU
      rw [Set.mem_singleton_iff] at hyx
      exact hyx ▸ hyU
    obtain ⟨g, hg, hrg⟩ := chart_top hU hxU
    refine ⟨_, inferInstance, g, hg, hrg z hzU, ?_⟩
    rw [PrimeSpectrum.topologicalKrullDim_eq_ringKrullDim, chart_alg f hU hxU]
AlgebraicGeometry.toENat_trdeg_residueField_eq_topologicalKrullDim_closure
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_toENat_trdeg_residueField_eq_topologicalKrullDim_closure.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 v
open SchemeTheory.LocalDimension
theorem toENat_trdeg_residueField_eq_topologicalKrullDim_closure
    {k : Type u} [Field k] {X : Scheme.{u}} (f : X ⟶ Spec (.of k)) [LocallyOfFiniteType f] (x : X) :
    letI : Algebra k (X.residueField x) :=
      ((Scheme.ΓSpecIso (.of k)).inv ≫ f.appTop ≫ X.presheaf.germ ⊤ x trivial ≫ X.residue
          x).hom.toAlgebra
    (Cardinal.toENat (Algebra.trdeg k (X.residueField x)) : WithBot ℕ∞) =
      topologicalKrullDim ↥(closure ({x} : Set X)) :=
  ResidueDimension.main f x
SchemeTheory.LocalDimension.ValuationModel.ev

Evaluation on a chart through a morphism from an affine scheme.

Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Eval
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
def ev (u : Spec R ⟶ Z) (V : Z.Opens) (h : (⊤ : (Spec R).Opens) ≤ u ⁻¹ᵁ V) : Γ(Z, V) →+* R
SchemeTheory.LocalDimension.ValuationModel.ev_apply
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Eval
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
lemma ev_apply (u : Spec R ⟶ Z) (V : Z.Opens) (h : (⊤ : (Spec R).Opens) ≤ u ⁻¹ᵁ V) (x : Γ(Z, V)) :
    ev u V h x = (Scheme.ΓSpecIso R).hom (u.appLE V ⊤ h x)
SchemeTheory.LocalDimension.ValuationModel.ev_map
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Eval
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
lemma ev_map (u : Spec R ⟶ Z) {V V' : Z.Opens} (i : V ≤ V') (h : (⊤ : (Spec R).Opens) ≤ u ⁻¹ᵁ V)
    (h' : (⊤ : (Spec R).Opens) ≤ u ⁻¹ᵁ V') (x : Γ(Z, V')) :
    ev u V h (Z.presheaf.map (homOfLE i).op x) = ev u V' h' x
SchemeTheory.LocalDimension.ValuationModel.appLE_congr_hom
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Eval
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
lemma appLE_congr_hom {X Y : Scheme.{u}} {u u' : X ⟶ Y} (e : u = u') (V : Y.Opens) (W : X.Opens)
    (h : W ≤ u ⁻¹ᵁ V) : u.appLE V W h = u'.appLE V W (e ▸ h)
SchemeTheory.LocalDimension.ValuationModel.ev_comp
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Eval
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
lemma ev_comp {Z' : Scheme.{u}} (v : Spec R ⟶ Z') (w : Z' ⟶ Z) (V : Z.Opens)
    (h : (⊤ : (Spec R).Opens) ≤ (v ≫ w) ⁻¹ᵁ V) (x : Γ(Z, V)) :
    ev (v ≫ w) V h x = ev v (w ⁻¹ᵁ V) h (w.app V x)
SchemeTheory.LocalDimension.ValuationModel.ev_specMap_top
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Eval
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
lemma ev_specMap_top {A : CommRingCat.{u}} (φ : A ⟶ R) (a : A) :
    ev (Spec.map φ) ⊤ le_top ((Scheme.ΓSpecIso A).inv a) = φ a
SchemeTheory.LocalDimension.ValuationModel.primeIdealOf_eq_comap_ev
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Eval
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
lemma primeIdealOf_eq_comap_ev [IsLocalRing R] (u : Spec R ⟶ Z) {V : Z.Opens} (hV : IsAffineOpen V)
    (h : (⊤ : (Spec R).Opens) ≤ u ⁻¹ᵁ V) :
    (hV.primeIdealOf ⟨u (closedPoint R), h (Opens.mem_top _)⟩).asIdeal =
      Ideal.comap (ev u V h) (maximalIdeal R)
SchemeTheory.LocalDimension.ValuationModel.top_le_of_closedPoint_mem
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Eval
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
lemma top_le_of_closedPoint_mem [IsLocalRing R] (u : Spec R ⟶ Z) (V : Z.Opens)
    (h : u (closedPoint R) ∈ V) : (⊤ : (Spec R).Opens) ≤ u ⁻¹ᵁ V
SchemeTheory.LocalDimension.ValuationModel.exists_affine_sections
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Sections
variable {P : Scheme.{u}} [IsIntegral P]
lemma exists_affine_sections {d : ℕ} (f : Fin d → P.functionField) :
    ∃ (U : P.Opens) (_hU : IsAffineOpen U) (hη : genericPoint P ∈ U) (g : Fin d → Γ(P, U)),
      ∀ i, P.presheaf.germ U (genericPoint P) hη (g i) = f i
SchemeTheory.LocalDimension.ValuationModel.grading

The standard grading defining the projective space used for compactification.

Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
abbrev grading
SchemeTheory.LocalDimension.ValuationModel.PP

The projective space of the prescribed dimension.

Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
abbrev PP : Scheme.{u}
SchemeTheory.LocalDimension.ValuationModel.Ad

The distinguished standard affine chart of projective space.

Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
abbrev Ad : Type u
SchemeTheory.LocalDimension.ValuationModel.awayι₀

The inclusion of the distinguished projective chart.

Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
abbrev awayι₀ : Spec (.of (Ad k d)) ⟶ PP k d
SchemeTheory.LocalDimension.ValuationModel.πP

The structure morphism of the chosen projective space.

Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
abbrev πP : PP k d ⟶ Spec (.of k)
SchemeTheory.LocalDimension.ValuationModel.φk

The canonical map of constants into local sections.

Source context 26 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
variable {k d}
variable {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k))
def φk (U : P.Opens) : CommRingCat.of k ⟶ Γ(P, U)
SchemeTheory.LocalDimension.ValuationModel.ι_comp_eq
Source context 26 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
variable {k d}
variable {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k))
lemma ι_comp_eq (U : P.Opens) (hU : IsAffineOpen U) :
    U.ι ≫ p = hU.isoSpec.hom ≫ Spec.map (φk p U)
SchemeTheory.LocalDimension.ValuationModel.chartMor

The projective morphism defined by an algebra map on the affine chart.

Source context 26 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
variable {k d}
variable {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k))
def chartMor (U : P.Opens) (hU : IsAffineOpen U)
    (φ : letI := p.sectionsAlgebra U; Ad k d →ₐ[k] Γ(P, U)) : (U : Scheme.{u}) ⟶ PP k d :=
  letI := p.sectionsAlgebra U
  hU.isoSpec.hom ≫ Spec.map (CommRingCat.ofHom φ.toRingHom) ≫ awayι₀ k d
SchemeTheory.LocalDimension.ValuationModel.chartMor_comp_π
Source context 26 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Chart
variable (k : Type u) [Field k] (d : ℕ)
variable {k d}
variable {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k))
lemma chartMor_comp_π (U : P.Opens) (hU : IsAffineOpen U)
    (φ : letI := p.sectionsAlgebra U; Ad k d →ₐ[k] Γ(P, U)) :
    chartMor p U hU φ ≫ πP k d = U.ι ≫ p := by
  let : Algebra k Γ(P, U) := p.sectionsAlgebra U
  rw [chartMor, Category.assoc, Category.assoc, ProjSpace.awayι_comp_π, ← Spec.map_comp, ι_comp_eq p
      U hU]
  congr 2
  ext x
  change φ.toRingHom (algebraMap k (Ad k d) x) = (φk p U) x
  rw [AlgHom.toRingHom_eq_coe, RingHom.coe_coe, AlgHom.commutes]
  rfl
SchemeTheory.LocalDimension.ValuationModel.κ

The generic point factored through a nonempty affine chart.

Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section KPoint
variable {P : Scheme.{u}} [IsIntegral P]
def κ (U : P.Opens) (hU : IsAffineOpen U) (hη : genericPoint P ∈ U) :
    Spec P.functionField ⟶ (U : Scheme.{u})
SchemeTheory.LocalDimension.ValuationModel.κ_ι
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section KPoint
variable {P : Scheme.{u}} [IsIntegral P]
lemma κ_ι (U : P.Opens) (hU : IsAffineOpen U) (hη : genericPoint P ∈ U) :
    κ U hU hη ≫ U.ι = P.fromSpecStalk (genericPoint P)
SchemeTheory.LocalDimension.ValuationModel.κ_isoSpec_hom
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section KPoint
variable {P : Scheme.{u}} [IsIntegral P]
lemma κ_isoSpec_hom (U : P.Opens) (hU : IsAffineOpen U) (hη : genericPoint P ∈ U) :
    κ U hU hη ≫ hU.isoSpec.hom = Spec.map (P.presheaf.germ U (genericPoint P) hη)
SchemeTheory.LocalDimension.ValuationModel.algebraMap_ev_ℓ₀
Source context 26 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section KPoint
variable {P : Scheme.{u}} [IsIntegral P]
variable (O : ValuationSubring P.functionField)
  (ℓ₀ : Spec (CommRingCat.of O) ⟶ P)
  (hℓ₀ : Spec.map (CommRingCat.ofHom (algebraMap O P.functionField)) ≫ ℓ₀ =
    P.fromSpecStalk (genericPoint P))
include hℓ₀ in
lemma algebraMap_ev_ℓ₀ (V : P.Opens) (h : (⊤ : (Spec (CommRingCat.of O)).Opens) ≤ ℓ₀ ⁻¹ᵁ V)
    (hηV : genericPoint P ∈ V) (x : Γ(P, V)) :
    algebraMap O P.functionField (ev ℓ₀ V h x) = P.presheaf.germ V (genericPoint P) hηV x
SchemeTheory.LocalDimension.ValuationModel.θ

The base field embedded into the function field.

Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Constants
variable {k : Type u} [Field k] {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k)) [IsIntegral P]
def θ : k →+* P.functionField
SchemeTheory.LocalDimension.ValuationModel.θ_mem
Source context 26 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Constants
variable {k : Type u} [Field k] {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k)) [IsIntegral P]
variable (O : ValuationSubring P.functionField) {d : ℕ} (f : Fin d → P.functionField)
  (hind : ∀ Q : MvPolynomial (Fin d) k,
    O.valuation (Q.eval₂ ((P.presheaf.germ ⊤ (genericPoint P) trivial).hom.comp
      (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of k)).inv.hom)) f) < 1 → Q = 0)
include hind in
lemma θ_mem (c : k) : θ p c ∈ O
SchemeTheory.LocalDimension.ValuationModel.θO

The constants regarded as elements of the chosen valuation subring.

Source context 25 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Constants
variable {k : Type u} [Field k] {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k)) [IsIntegral P]
variable (O : ValuationSubring P.functionField) {d : ℕ} (f : Fin d → P.functionField)
  (hind : ∀ Q : MvPolynomial (Fin d) k,
    O.valuation (Q.eval₂ ((P.presheaf.germ ⊤ (genericPoint P) trivial).hom.comp
      (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of k)).inv.hom)) f) < 1 → Q = 0)
def θO : k →+* O
SchemeTheory.LocalDimension.ValuationModel.algebraMap_θO
Source context 25 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Constants
variable {k : Type u} [Field k] {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k)) [IsIntegral P]
variable (O : ValuationSubring P.functionField) {d : ℕ} (f : Fin d → P.functionField)
  (hind : ∀ Q : MvPolynomial (Fin d) k,
    O.valuation (Q.eval₂ ((P.presheaf.germ ⊤ (genericPoint P) trivial).hom.comp
      (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of k)).inv.hom)) f) < 1 → Q = 0)
lemma algebraMap_θO (c : k) : algebraMap O P.functionField (θO p O f hind c) = θ p c
SchemeTheory.LocalDimension.ValuationModel.ev_congr
Source context 24 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Aux
variable {R : CommRingCat.{u}} {Z : Scheme.{u}}
lemma ev_congr {u u' : Spec R ⟶ Z} (e : u = u') (V : Z.Opens) (h : (⊤ : (Spec R).Opens) ≤ u ⁻¹ᵁ V)
    (x : Γ(Z, V)) : ev u V h x = ev u' V (e ▸ h) x
SchemeTheory.LocalDimension.ValuationModel.ev_ℓ₀_p
Source context 26 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k))
  [IsIntegral P] [LocallyOfFiniteType p]
  (O : ValuationSubring P.functionField) (hO : O ≠ ⊤)
  (ℓ₀ : Spec (CommRingCat.of O) ⟶ P)
  (hℓ₀ : Spec.map (CommRingCat.ofHom (algebraMap O P.functionField)) ≫ ℓ₀ =
    P.fromSpecStalk (genericPoint P))
  (d : ℕ) (hd : ((d + 1 : ℕ) : WithBot ℕ∞) = topologicalKrullDim P)
  (f : Fin d → P.functionField) (hf : ∀ i, f i ∈ O)
  (hind : ∀ Q : MvPolynomial (Fin d) k,
    O.valuation (Q.eval₂ ((P.presheaf.germ ⊤ (genericPoint P) trivial).hom.comp
      (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of k)).inv.hom)) f) < 1 → Q = 0)
omit [LocallyOfFiniteType p] in
include hℓ₀ in
lemma ev_ℓ₀_p (h : (⊤ : (Spec (CommRingCat.of O)).Opens) ≤ (ℓ₀ ≫ p) ⁻¹ᵁ ⊤) (c : k) :
    ev (ℓ₀ ≫ p) ⊤ h ((Scheme.ΓSpecIso (CommRingCat.of k)).inv c) = θO p O f hind c
SchemeTheory.LocalDimension.ValuationModel.main
Source context 25 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 SchemeTheory.LocalDimension
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
open _root_.IsLocalRing
open _root_.HomogeneousLocalization
universe u
noncomputable section
open _root_.AlgebraicGeometry
namespace ValuationModel
attribute [local instance] MvPolynomial.gradedAlgebra
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k))
  [IsIntegral P] [LocallyOfFiniteType p]
  (O : ValuationSubring P.functionField) (hO : O ≠ ⊤)
  (ℓ₀ : Spec (CommRingCat.of O) ⟶ P)
  (hℓ₀ : Spec.map (CommRingCat.ofHom (algebraMap O P.functionField)) ≫ ℓ₀ =
    P.fromSpecStalk (genericPoint P))
  (d : ℕ) (hd : ((d + 1 : ℕ) : WithBot ℕ∞) = topologicalKrullDim P)
  (f : Fin d → P.functionField) (hf : ∀ i, f i ∈ O)
  (hind : ∀ Q : MvPolynomial (Fin d) k,
    O.valuation (Q.eval₂ ((P.presheaf.germ ⊤ (genericPoint P) trivial).hom.comp
      (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of k)).inv.hom)) f) < 1 → Q = 0)
include hO hℓ₀ hd hf hind in
theorem main :
    ∃ (P' : Scheme.{u}) (β : P' ⟶ P) (U : P.Opens) (s : (U : Scheme.{u}) ⟶ P')
      (ℓ : Spec (CommRingCat.of O) ⟶ P') (y' : P'),
      IsIntegral P' ∧ IsProper β ∧ (U : Set P).Nonempty ∧ IsOpenImmersion s ∧ s ≫ β = U.ι ∧
      Set.range s.base = β.base ⁻¹' (U : Set P) ∧
      ℓ ≫ β = ℓ₀ ∧ ℓ.base (IsLocalRing.closedPoint O) = y' ∧
      ringKrullDim (P'.presheaf.stalk y') = 1
AlgebraicGeometry.exists_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology AlgebraicGeometry
open AlgebraicCurves.Foundations.CommutativeAlgebra.Proofs
open Ideal_height_add_ringKrullDim_quotient_eq_ringKrullDim_of_finiteType.P2mDimFormula
  (height_eq_ringKrullDim_of_isMaximal)
open AlgebraicCurves.Geometry.Schemes.Proofs
open SmoothOfRelativeDimension_topologicalKrullDim_le.P2mSmoothOfRelativeDimensionKrullDim
  (topologicalKrullDim_le_of_forall_exists_isOpenEmbedding)
open AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety
  (chart_finiteType primeIdealOf_fromSpec ringKrullDim_stalk_eq_height)
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_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField.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 v
open SchemeTheory.LocalDimension
theorem exists_isProper_ringKrullDim_stalk_eq_one_of_valuationSubring_functionField
    (k : Type u) [Field k] {P : Scheme.{u}} (p : P ⟶ Spec (CommRingCat.of k))
    [IsIntegral P] [LocallyOfFiniteType p]
    (O : ValuationSubring P.functionField) (hO : O ≠ ⊤)
    (ℓ₀ : Spec (CommRingCat.of O) ⟶ P)
    (hℓ₀ : Spec.map (CommRingCat.ofHom (algebraMap O P.functionField)) ≫ ℓ₀ =
      P.fromSpecStalk (genericPoint P))
    (d : ℕ) (hd : ((d + 1 : ℕ) : WithBot ℕ∞) = topologicalKrullDim P)
    (f : Fin d → P.functionField) (hf : ∀ i, f i ∈ O)
    (hind : ∀ Q : MvPolynomial (Fin d) k,
      O.valuation (Q.eval₂ ((P.presheaf.germ ⊤ (genericPoint P) trivial).hom.comp
        (p.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of k)).inv.hom)) f) < 1 → Q = 0) :
    ∃ (P' : Scheme.{u}) (β : P' ⟶ P) (U : P.Opens) (s : (U : Scheme.{u}) ⟶ P')
      (ℓ : Spec (CommRingCat.of O) ⟶ P') (y' : P'),
      IsIntegral P' ∧ IsProper β ∧ (U : Set P).Nonempty ∧ IsOpenImmersion s ∧ s ≫ β = U.ι ∧
      Set.range s.base = β.base ⁻¹' (U : Set P) ∧
      ℓ ≫ β = ℓ₀ ∧ ℓ.base (IsLocalRing.closedPoint O) = y' ∧
      ringKrullDim (P'.presheaf.stalk y') = 1