Module

AffineCompactification.lean

Nyll.SchemeTheory.Morphisms.AffineCompactification
72 declarations indexed from sourceView source ↗

Affine compactification and normalization

Finite affine charts give a proper birational cover and a compactification. Graph closures extend maps to proper targets, and normalization gives finite integral models with normal stalks while preserving the locus where the original model is already normal.

Imports25
Imported by4

Declarations

AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.reduced_image
Source context 8 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
theorem reduced_image {X Y : Scheme.{u}} [IsReduced X]
    (f : X ⟶ Y) [QuasiCompact f] : IsReduced f.image
abbrev

Vu

L89 ↗
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.Vu

The inverse image of the common affine open under the proper cover.

Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
abbrev Vu : D.X'.Opens
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.range_ψ'_subset_Vu
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
omit [IsNoetherianRing A] [IsIntegral X] [IsSeparated f]
    [LocallyOfFiniteType f] [QuasiCompact f] in
lemma range_ψ'_subset_Vu : Set.range D.ψ' ⊆ Set.range D.Vu.ι
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.ψu

The chart morphism restricted to the inverse image of the common affine open.

Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
def ψu : (D.Uo : Scheme.{u}) ⟶ (D.Vu : Scheme.{u})
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.ψu_ι
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
omit [IsNoetherianRing A] [IsIntegral X] [IsSeparated f]
    [LocallyOfFiniteType f] [QuasiCompact f] in
lemma ψu_ι : D.ψu ≫ D.Vu.ι = D.ψ'
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
instance : IsOpenImmersion D.ψu
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.ψu_restrict
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
omit [IsNoetherianRing A] [IsIntegral X] [IsSeparated f]
    [LocallyOfFiniteType f] [QuasiCompact f] in
lemma ψu_restrict : D.ψu ≫ (D.π ∣_ D.Uo) = 𝟙 _
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
instance : IsClosedImmersion D.ψu
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.nonempty_Vu
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
instance nonempty_Vu : Nonempty (D.Vu : Scheme.{u})
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.isIso_ψu
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
instance isIso_ψu : IsIso D.ψu
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.isIso_restrict_Uo
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
omit [IsSeparated f] in
theorem isIso_restrict_Uo : IsIso (D.π ∣_ D.Uo)
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.Uo_ne_bot
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
omit [IsNoetherianRing A] [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f] in
lemma Uo_ne_bot : D.Uo ≠ ⊥
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.isReduced_P
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
instance isReduced_P : IsReduced D.ιι.image
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.irreducibleSpace_P
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
instance irreducibleSpace_P : IrreducibleSpace D.ιι.image
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.isIntegral_P
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
instance isIntegral_P : IsIntegral D.ιι.image
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData.chow_bir
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
namespace ChartData
variable {A : Type u} [CommRing A] [IsNoetherianRing A] {X : Scheme.{u}} [IsIntegral X]
  {f : X ⟶ Spec (CommRingCat.of A)} [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f]
  (D : ChartData f)
include D in
theorem chow_bir :
    ∃ (X' P : Scheme.{u}) (π : X' ⟶ X) (j : X' ⟶ P) (q : P ⟶ Spec (CommRingCat.of A)),
    IsProper π ∧ Surjective π ∧ IsOpenImmersion j ∧ IsProper q ∧ j ≫ q = π ≫ f ∧
    IsIntegral X' ∧ IsIntegral P ∧ ∃ U : X.Opens, U ≠ ⊥ ∧ IsIso (π ∣_ U)
AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.main_bir
Source context 8 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
noncomputable section
theorem main_bir {A : Type u} [CommRing A] [IsNoetherianRing A]
    {X : Scheme.{u}} [IsIntegral X] (f : X ⟶ Spec (CommRingCat.of A))
    [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f] :
    ∃ (X' P : Scheme.{u}) (π : X' ⟶ X) (j : X' ⟶ P) (q : P ⟶ Spec (CommRingCat.of A)),
      IsProper π ∧ Surjective π ∧ IsOpenImmersion j ∧ IsProper q ∧ j ≫ q = π ≫ f ∧
      IsIntegral X' ∧ IsIntegral P ∧ ∃ U : X.Opens, U ≠ ⊥ ∧ IsIso (π ∣_ U)
AlgebraicGeometry.exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_of_isIntegral
Source context 9 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_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 AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry TopologicalSpace Topology
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint
open scoped AlgebraicCurves.Geometry.Schemes.Proofs.Compactification.SolCHint.ChartData
universe u
with_weak_namespace _root_.AlgebraicGeometry
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry in
theorem exists_isProper_surjective_isOpenImmersion_isIntegral_isIso_morphismRestrict_of_isIntegral
    {A : Type u} [CommRing A] [IsNoetherianRing A]
    {X : Scheme.{u}} [IsIntegral X] (f : X ⟶ Spec (CommRingCat.of A))
    [IsSeparated f] [LocallyOfFiniteType f] [QuasiCompact f] :
    ∃ (X' P : Scheme.{u}) (π : X' ⟶ X) (j : X' ⟶ P) (q : P ⟶ Spec (CommRingCat.of A)),
      IsProper π ∧ Surjective π ∧ IsOpenImmersion j ∧ IsProper q ∧ j ≫ q = π ≫ f ∧
      IsIntegral X' ∧ IsIntegral P ∧ ∃ U : X.Opens, U ≠ ⊥ ∧ IsIso (π ∣_ U)
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.Yp

The pullback of the target along the structural morphism.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
abbrev Yp : Scheme.{u}
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.Γ

The graph morphism into the pullback.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
def Γ : (U : Scheme.{u}) ⟶ Yp p q
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.Γ_fst
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma Γ_fst : Γ p q U g hg ≫ pullback.fst p q = U.ι
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.Γ_snd
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma Γ_snd : Γ p q U g hg ≫ pullback.snd p q = g
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.isImmersion_Γ
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
instance isImmersion_Γ : IsImmersion (Γ p q U g hg)
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.quasiCompact_Γ
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
instance quasiCompact_Γ [IsSeparated q] [QuasiCompact U.ι] :
    QuasiCompact (Γ p q U g hg)
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.P'

The scheme-theoretic closure of the graph.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
abbrev P' : Scheme.{u}
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.α

The closed immersion of the graph closure into the pullback.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
abbrev α : P' p q U g hg ⟶ Yp p q
abbrev

s

L254 ↗
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.s

The canonical factorization of the graph through its closure.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
abbrev s : (U : Scheme.{u}) ⟶ P' p q U g hg
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.β

The projection of the graph closure to the source.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
def β : P' p q U g hg ⟶ P
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.g'

The extension of the original morphism to the graph closure.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
def g' : P' p q U g hg ⟶ Y
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.s_α
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma s_α : s p q U g hg ≫ α p q U g hg = Γ p q U g hg
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.s_β
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma s_β : s p q U g hg ≫ β p q U g hg = U.ι
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.s_g'
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma s_g' : s p q U g hg ≫ g' p q U g hg = g
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.g'_q
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma g'_q : g' p q U g hg ≫ q = β p q U g hg ≫ p
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.isProper_β
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
instance isProper_β [IsProper q] : IsProper (β p q U g hg)
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.isReduced_P'
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
instance isReduced_P' [IsReduced P] [IsSeparated q] [QuasiCompact U.ι] :
    IsReduced (P' p q U g hg)
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.irreducibleSpace_P'
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
instance irreducibleSpace_P' [IrreducibleSpace P] [IsSeparated q] [QuasiCompact U.ι]
    [Nonempty (U : Scheme.{u})] : IrreducibleSpace (P' p q U g hg)
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.isIntegral_P'
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
instance isIntegral_P' [IsIntegral P] [IsSeparated q] [QuasiCompact U.ι]
    [Nonempty (U : Scheme.{u})] :
    IsIntegral (P' p q U g hg)
abbrev

W

L300 ↗
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.W

The part of the pullback lying over the original open subscheme.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
abbrev W : (Yp p q).Opens
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.range_Γ_subset
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma range_Γ_subset : Set.range (Γ p q U g hg) ⊆ (W p q U : Set (Yp p q))
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.ΓW

The graph morphism restricted over the original open subscheme.

Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
def ΓW : (U : Scheme.{u}) ⟶ (W p q U : Scheme.{u})
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.ΓW_ι
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma ΓW_ι : ΓW p q U g hg ≫ (W p q U).ι = Γ p q U g hg
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.ΓW_fstRes
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma ΓW_fstRes : ΓW p q U g hg ≫ (pullback.fst p q ∣_ U) = 𝟙 _
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.isClosedImmersion_ΓW
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
instance isClosedImmersion_ΓW [IsSeparated q] : IsClosedImmersion (ΓW p q U g hg)
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.closure_range_Γ_inter_subset
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma closure_range_Γ_inter_subset [IsSeparated q] :
    closure (Set.range (Γ p q U g hg)) ∩ (W p q U : Set (Yp p q)) ⊆ Set.range (Γ p q U g hg)
AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure.range_s_eq
Source context 15 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
noncomputable section
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace GraphClosure
open _root_.AlgebraicGeometry
variable {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) (U : P.Opens) (g : (U : Scheme.{u}) ⟶ Y)
  (hg : g ≫ q = U.ι ≫ p)
lemma range_s_eq [IsSeparated q] [QuasiCompact U.ι] :
    Set.range (s p q U g hg) = (β p q U g hg) ⁻¹' (U : Set P)
AlgebraicGeometry.exists_isProper_isOpenImmersion_range_eq_preimage_comp_eq_of_isProper
Source context 11 commands

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

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

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace AbelianVarieties.NOSProofs.GraphCompactification
open _root_.CategoryTheory
open _root_.CategoryTheory.Limits
open _root_.AlgebraicGeometry
open _root_.TopologicalSpace
open _root_.Topology
universe u
with_weak_namespace _root_.AlgebraicGeometry
open AbelianVarieties.NOSProofs.GraphCompactification.AlgebraicGeometry.GraphClosure in
theorem exists_isProper_isOpenImmersion_range_eq_preimage_comp_eq_of_isProper
    {P Y S : Scheme.{u}} (p : P ⟶ S) (q : Y ⟶ S) [IsProper q] [IsIntegral P]
    (U : P.Opens) [QuasiCompact U.ι] (hU : (U : Set P).Nonempty)
    (g : (U : Scheme.{u}) ⟶ Y) (hg : g ≫ q = U.ι ≫ p) :
    ∃ (P' : Scheme.{u}) (β : P' ⟶ P) (s : (U : Scheme.{u}) ⟶ P') (g' : P' ⟶ Y),
      IsIntegral P' ∧ IsProper β ∧ IsOpenImmersion s ∧ s ≫ β = U.ι ∧
      Set.range s.base = β.base ⁻¹' (U : Set P) ∧ s ≫ g' = g ∧ g' ≫ q = β ≫ p
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.exists_ringKrullDim_eq_natCast
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Algebra
theorem exists_ringKrullDim_eq_natCast (k : Type u) [Field k] (A : Type u) [CommRing A]
    [IsDomain A] [Algebra k A] [Algebra.FiniteType k A] :
    ∃ n : ℕ, ringKrullDim A = (n : WithBot ℕ∞)
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.enat_eq_of_add_natCast_eq
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Algebra
theorem enat_eq_of_add_natCast_eq {a b : ℕ∞} {m : ℕ}
    (h : (a : WithBot ℕ∞) + (m : WithBot ℕ∞) = (b : WithBot ℕ∞) + (m : WithBot ℕ∞)) : a = b
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.height_eq_height_comap
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Algebra
theorem height_eq_height_comap (k : Type u) [Field k] {A B : Type u} [CommRing A] [IsDomain A]
    [Algebra k A] [Algebra.FiniteType k A] [CommRing B] [IsDomain B] [Algebra A B] [Algebra k B]
    [IsScalarTower k A B] [Module.Finite A B] [FaithfulSMul A B] (Q : Ideal B) [Q.IsPrime] :
    Q.height = (Q.comap (algebraMap A B)).height
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.integralClosure_transport
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Algebra
theorem integralClosure_transport {A K L : Type u} [CommRing A] [IsDomain A] [Field K] [Algebra A K]
    [IsFractionRing A K] [CommRing L] [Algebra A L] (e : K ≃ₐ[A] L)
    (hfin : Module.Finite A (integralClosure A K)) :
    IsFractionRing A L ∧ Module.Finite A (integralClosure A L) ∧
      IsDomain (integralClosure A L) ∧ IsIntegrallyClosed (integralClosure A L)
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.bijective_algebraMap_integralClosure
Source context 10 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Algebra
theorem bijective_algebraMap_integralClosure {A L : Type u} [CommRing A] [IsDomain A]
    [IsIntegrallyClosed A] [CommRing L] [Algebra A L] [IsFractionRing A L] :
    Function.Bijective (algebraMap A (integralClosure A L))
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.subsingleton_sections_of_eq_bot
Source context 9 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
theorem subsingleton_sections_of_eq_bot (X : Scheme.{u}) {U : X.Opens} (h : U = ⊥) :
    Subsingleton Γ(X, U)
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.primeIdealOf_fromSpec
Source context 9 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
theorem primeIdealOf_fromSpec {X : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U)
    (p : Spec Γ(X, U)) (h : hU.fromSpec.base p ∈ U) :
    hU.primeIdealOf ⟨hU.fromSpec.base p, h⟩ = p
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.ringKrullDim_stalk_eq_height
Source context 9 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
theorem ringKrullDim_stalk_eq_height {X : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U)
    (x : X) (hx : x ∈ U) :
    ringKrullDim (X.presheaf.stalk x) = (hU.primeIdealOf ⟨x, hx⟩).asIdeal.height
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.isIntegrallyClosed_localization_of_stalk
Source context 9 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
theorem isIntegrallyClosed_localization_of_stalk {X : Scheme.{u}} {U : X.Opens}
    (hU : IsAffineOpen U)
    (p : PrimeSpectrum Γ(X, U)) (h : hU.fromSpec.base p ∈ U)
    (hn : IsIntegrallyClosed (X.presheaf.stalk (hU.fromSpec.base p))) :
    IsIntegrallyClosed (Localization.AtPrime p.asIdeal)
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.ringKrullDim_stalk_Spec
Source context 9 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
theorem ringKrullDim_stalk_Spec (R : CommRingCat.{u}) (t : PrimeSpectrum R) :
    ringKrullDim ((Spec R).presheaf.stalk t) = t.asIdeal.height
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.isIntegrallyClosed_stalk_Spec
Source context 9 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
theorem isIntegrallyClosed_stalk_Spec (R : CommRingCat.{u}) [IsDomain R] [IsIntegrallyClosed R]
    (t : PrimeSpectrum R) : IsIntegrallyClosed ((Spec R).presheaf.stalk t)
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.isIso_morphismRestrict_of_chart
Source context 9 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
theorem isIso_morphismRestrict_of_chart {X Y : Scheme.{u}} (g : X ⟶ Y) {U : Y.Opens}
    (hU : IsAffineOpen U) {R : CommRingCat.{u}} (c : Spec R ⟶ X) [IsOpenImmersion c]
    (hrange : (g ⁻¹ᵁ U : Set X) = Set.range c.base) (φ : Γ(Y, U) ⟶ R) [IsIso φ]
    (hc : c ≫ g = Spec.map φ ≫ hU.fromSpec) : IsIso (g ∣_ U)
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.chart_finiteType
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Chart
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
theorem chart_finiteType [LocallyOfFiniteType q] {U : Y.Opens} (hU : IsAffineOpen U) :
    letI : Algebra k Γ(Y, U) := q.sectionsAlgebra U
    Algebra.FiniteType k Γ(Y, U) := by
  have h1 : (q.appLE ⊤ U le_top).hom.FiniteType :=
    q.finiteType_appLE (isAffineOpen_top _) hU le_top
  have h2 : (Scheme.ΓSpecIso (CommRingCat.of k)).inv.hom.FiniteType :=
    RingHom.FiniteType.of_surjective _
      (Scheme.ΓSpecIso (CommRingCat.of k)).commRingCatIsoToRingEquiv.symm.surjective
  exact h1.comp h2
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.preimage_fromSpecStalk_genericPoint_eq_top
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Chart
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
theorem preimage_fromSpecStalk_genericPoint_eq_top [IsIntegral Y] (U : Y.Opens)
    (hUne : (U : Set Y).Nonempty) :
    (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U = ⊤
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.chart_facts
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Chart
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
include q in
theorem chart_facts [IsIntegral Y] [LocallyOfFiniteType q] (U : Y.Opens) (hU : IsAffineOpen U)
    (hUne : (U : Set Y).Nonempty) :
    let : Algebra Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)),
          (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U) :=
      ((Y.fromSpecStalk (genericPoint Y)).app U).hom.toAlgebra
    IsFractionRing Γ(Y, U) Γ(Spec (Y.presheaf.stalk (genericPoint Y)),
        (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U) ∧
      Module.Finite Γ(Y, U) (integralClosure Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)) ∧
      IsDomain (integralClosure Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)) ∧
      IsIntegrallyClosed (integralClosure Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)) := by
  intro algL
  have : Nonempty U := by obtain ⟨y, hy⟩ := hUne; exact ⟨⟨y, hy⟩⟩
  have hη : genericPoint Y ∈ U := ((genericPoint_spec Y).mem_open_set_iff U.2).mpr
    (by obtain ⟨y, hy⟩ := hUne; exact ⟨y, Set.mem_univ _, hy⟩)
  have htop : (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U = ⊤ :=
    preimage_fromSpecStalk_genericPoint_eq_top U hUne
  let eKL : Y.functionField ≅
      Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U) :=
    (Scheme.ΓSpecIso (Y.presheaf.stalk (genericPoint Y))).symm ≪≫
      (Spec (Y.presheaf.stalk (genericPoint Y))).presheaf.mapIso (eqToIso htop).op
  have happ : (Y.fromSpecStalk (genericPoint Y)).app U =
      Y.presheaf.germ U (genericPoint Y) hη ≫ eKL.hom := by
    rw [Scheme.fromSpecStalk_app hη]
    simp only [eKL, Iso.trans_hom, Iso.symm_hom, Functor.mapIso_hom, Iso.op_hom, eqToIso.hom]
    rw [show (homOfLE le_top : (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U ⟶ ⊤) = eqToHom htop from
      Subsingleton.elim _ _]
  have : IsFractionRing Γ(Y, U) Y.functionField :=
    functionField_isFractionRing_of_isAffineOpen Y U hU
  let eA : Y.functionField ≃ₐ[Γ(Y, U)]
      Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U) :=
    AlgEquiv.ofRingEquiv (f := eKL.commRingCatIsoToRingEquiv) (fun a => by
      change eKL.hom (Y.germToFunctionField U a) = ((Y.fromSpecStalk (genericPoint Y)).app U) a
      rw [happ]
      rfl)
  let : Algebra k Γ(Y, U) := q.sectionsAlgebra U
  have : Algebra.FiniteType k Γ(Y, U) := chart_finiteType q hU
  have hfin : Module.Finite Γ(Y, U) (integralClosure Γ(Y, U) Y.functionField) :=
    IsIntegralClosure.finite_of_finiteType k Γ(Y, U) Y.functionField Y.functionField
      (integralClosure Γ(Y, U) Y.functionField)
  exact integralClosure_transport eA hfin
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.chart
Source context 11 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
theorem chart (U : Y.Opens) (hU : IsAffineOpen U) :
    let : Algebra Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)),
          (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U) :=
      ((Y.fromSpecStalk (genericPoint Y)).app U).hom.toAlgebra
    ∃ cU : Spec (CommRingCat.of (integralClosure Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U))) ⟶
        (Y.fromSpecStalk (genericPoint Y)).normalization,
      IsOpenImmersion cU ∧
      ((Y.fromSpecStalk (genericPoint Y)).fromNormalization ⁻¹ᵁ U :
          Set (Y.fromSpecStalk (genericPoint Y)).normalization) = Set.range cU.base ∧
      cU ≫ (Y.fromSpecStalk (genericPoint Y)).fromNormalization =
        Spec.map (CommRingCat.ofHom (algebraMap Γ(Y, U) (integralClosure Γ(Y, U)
          Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)))) ≫
          hU.fromSpec := by
  intro sectionAlgebra
  refine ⟨(Y.fromSpecStalk (genericPoint Y)).normalizationOpenCover.f ⟨U, hU⟩,
    by exact (Y.fromSpecStalk (genericPoint Y)).normalizationOpenCover.map_prop ⟨U, hU⟩, ?_, ?_⟩
  · have h := (Y.fromSpecStalk (genericPoint Y)).fromNormalization_preimage ⟨U, hU⟩
    change (Y.fromSpecStalk (genericPoint Y)).fromNormalization ⁻¹ᵁ U = _ at h
    rw [h]
    rfl
  · exact (Y.fromSpecStalk (genericPoint Y)).ι_fromNormalization ⟨U, hU⟩
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.exists_affine_mem
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
omit [LocallyOfFiniteType q] in
theorem exists_affine_mem (z : (Y.fromSpecStalk (genericPoint Y)).normalization) :
    ∃ (U : Y.Opens) (_ : IsAffineOpen U), (U : Set Y).Nonempty ∧
      (Y.fromSpecStalk (genericPoint Y)).fromNormalization.base z ∈ U
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.isIntegrallyClosed_stalk
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
include q in
theorem isIntegrallyClosed_stalk (z : (Y.fromSpecStalk (genericPoint Y)).normalization) :
    IsIntegrallyClosed ((Y.fromSpecStalk (genericPoint Y)).normalization.presheaf.stalk z)
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.finite_algebraMap_chart
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
include q in
theorem finite_algebraMap_chart (U : Y.Opens) (hU : IsAffineOpen U) :
    let : Algebra Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)),
          (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U) :=
      ((Y.fromSpecStalk (genericPoint Y)).app U).hom.toAlgebra
    (algebraMap Γ(Y, U) (integralClosure Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)),
          (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U))).Finite := by
  intro sectionAlgebra
  by_cases hUne : (U : Set Y).Nonempty
  · have hfacts := chart_facts q U hU hUne
    obtain ⟨-, hfin, -, -⟩ := hfacts
    rw [RingHom.Finite]
    convert hfin
  · have hbot : U = ⊥ := by
      ext1
      exact Set.not_nonempty_iff_eq_empty.mp hUne
    have : Subsingleton Γ(Y, U) := subsingleton_sections_of_eq_bot Y hbot
    rw [RingHom.Finite]
    have : Subsingleton (integralClosure Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)),
          (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)) := Module.subsingleton Γ(Y, U) _
    exact Module.Finite.of_finite
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.isFinite_fromNormalization
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
include q in
theorem isFinite_fromNormalization :
    IsFinite (Y.fromSpecStalk (genericPoint Y)).fromNormalization
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.surjective_fromNormalization
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
omit [LocallyOfFiniteType q] in
theorem surjective_fromNormalization :
    Function.Surjective (Y.fromSpecStalk (genericPoint Y)).fromNormalization.base
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.height_comap_chart
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
include q in
theorem height_comap_chart (U : Y.Opens) (hU : IsAffineOpen U) (hUne : (U : Set Y).Nonempty)
    (t : letI := ((Y.fromSpecStalk (genericPoint Y)).app U).hom.toAlgebra
      Spec (CommRingCat.of (integralClosure Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)))) :
    let : Algebra Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)),
          (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U) :=
      ((Y.fromSpecStalk (genericPoint Y)).app U).hom.toAlgebra
    t.asIdeal.height = (t.asIdeal.comap (algebraMap Γ(Y, U) (integralClosure Γ(Y, U)
        Γ(Spec (Y.presheaf.stalk (genericPoint Y)),
          (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)))).height := by
  intro algL
  have hfacts := chart_facts q U hU hUne
  obtain ⟨hfr, hfin, hdom, -⟩ := hfacts
  have : Nonempty U := by obtain ⟨y, hy⟩ := hUne; exact ⟨⟨y, hy⟩⟩
  let : Algebra k Γ(Y, U) := q.sectionsAlgebra U
  have : Algebra.FiniteType k Γ(Y, U) := chart_finiteType q hU
  let algAbar : Algebra k (integralClosure Γ(Y, U)
      Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)) :=
    ((algebraMap Γ(Y, U) (integralClosure Γ(Y, U)
      Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U))).comp
        (algebraMap k Γ(Y, U))).toAlgebra
  have : IsScalarTower k Γ(Y, U) (integralClosure Γ(Y, U)
      Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)) :=
    IsScalarTower.of_algebraMap_eq' rfl
  have : FaithfulSMul Γ(Y, U) (integralClosure Γ(Y, U)
      Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)) := by
    refine (faithfulSMul_iff_algebraMap_injective _ _).mpr fun a b hab => ?_
    have := congrArg (fun x : integralClosure Γ(Y, U)
      Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U) =>
        (x : Γ(Spec (Y.presheaf.stalk (genericPoint Y)), (Y.fromSpecStalk (genericPoint Y)) ⁻¹ᵁ U)))
      hab
    exact @IsFractionRing.injective _ _ _ _ _ hfr a b this
  have : t.asIdeal.IsPrime := t.2
  exact height_eq_height_comap k _
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.ringKrullDim_stalk_eq
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
include q in
theorem ringKrullDim_stalk_eq (z : (Y.fromSpecStalk (genericPoint Y)).normalization) :
    ringKrullDim ((Y.fromSpecStalk (genericPoint Y)).normalization.presheaf.stalk z) =
      ringKrullDim
        (Y.presheaf.stalk ((Y.fromSpecStalk (genericPoint Y)).fromNormalization.base z))
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.isIso_morphismRestrict_fromNormalization
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
include q in
theorem isIso_morphismRestrict_fromNormalization (W : Y.Opens)
    (hW : ∀ z ∈ W, IsIntegrallyClosed (Y.presheaf.stalk z)) :
    IsIso ((Y.fromSpecStalk (genericPoint Y)).fromNormalization ∣_ W)
AbelianVarieties.NOSProofs.VarietyNormalization.AlgebraicGeometry.NormalizationOfVariety.main
Source context 12 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
namespace AlgebraicGeometry
open _root_.AlgebraicGeometry
namespace NormalizationOfVariety
open _root_.AlgebraicGeometry
section Main
variable {k : Type u} [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
  [IsIntegral Y] [LocallyOfFiniteType q]
include q in
theorem main :
    ∃ (Y' : Scheme.{u}) (ν : Y' ⟶ Y), IsIntegral Y' ∧
      (∀ z : Y', IsIntegrallyClosed (Y'.presheaf.stalk z)) ∧ IsFinite ν ∧
      Function.Surjective ν.base ∧
      (∀ z : Y', ringKrullDim (Y'.presheaf.stalk z) =
        ringKrullDim (Y.presheaf.stalk (ν.base z))) ∧
      ∀ U : Y.Opens, (∀ z ∈ U, IsIntegrallyClosed (Y.presheaf.stalk z)) → IsIso (ν ∣_ U)
AlgebraicGeometry.exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_of_isIntegral
Source context 6 commands

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

@[expose] public section
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_AlgebraicGeometry_exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_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 AbelianVarieties.NOSProofs.VarietyNormalization
universe u
open CategoryTheory CategoryTheory.Limits TopologicalSpace Topology Opposite
with_weak_namespace _root_.AlgebraicGeometry
theorem exists_isFinite_isIntegrallyClosed_stalk_isIso_morphismRestrict_of_isIntegral
    (k : Type u) [Field k] {Y : Scheme.{u}} (q : Y ⟶ Spec (CommRingCat.of k))
    [IsIntegral Y] [LocallyOfFiniteType q] :
    ∃ (Y' : Scheme.{u}) (ν : Y' ⟶ Y), IsIntegral Y' ∧
      (∀ z : Y', IsIntegrallyClosed (Y'.presheaf.stalk z)) ∧ IsFinite ν ∧
      Function.Surjective ν.base ∧
      (∀ z : Y', ringKrullDim (Y'.presheaf.stalk z) =
        ringKrullDim (Y.presheaf.stalk (ν.base z))) ∧
      ∀ U : Y.Opens, (∀ z ∈ U, IsIntegrallyClosed (Y.presheaf.stalk z)) → IsIso (ν ∣_ U)