Module

Iteration.lean

Nyll.AbelianVarieties.NeronModels.Smoothening.Iteration
93 declarations indexed from sourceView source ↗

Finite smoothening by dilatations

Glue dilatations along a finite descending stratification of the special fibre. Each step decreases the smoothness defect while preserving the generic fibre and lifting points over index-one extensions. Iterating the decrease and restricting to the smooth locus produces the smooth model.

Imports26
Imported by2

Declarations

Source context 7 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
theorem sourceLocalOfRingHom (P : MorphismProperty Scheme.{u})
    (Q : ∀ {A B : Type u} [CommRing A] [CommRing B], (A →+* B) → Prop)
    [HasRingHomProperty P Q] : IsZariskiLocalAtSource P
NeronModelInfra.SmootheningIteration.StrataGlue.sqMap

The product chart used to test whether the diagonal is closed.

Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section SeparatedCriterion
variable {X₁ X : Scheme.{u}} (v : X₁ ⟶ X) (𝒲 : X₁.OpenCover)
abbrev sqMap (i : 𝒲.I₀) : pullback (𝒲.f i ≫ v) (𝒲.f i ≫ v) ⟶ pullback v v
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section SeparatedCriterion
variable {X₁ X : Scheme.{u}} (v : X₁ ⟶ X) (𝒲 : X₁.OpenCover)
instance (i : 𝒲.I₀) : IsOpenImmersion (sqMap v 𝒲 i)
NeronModelInfra.SmootheningIteration.StrataGlue.isSeparated_of_openCover
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section SeparatedCriterion
variable {X₁ X : Scheme.{u}} (v : X₁ ⟶ X) (𝒲 : X₁.OpenCover)
theorem isSeparated_of_openCover [∀ i, IsSeparated (𝒲.f i ≫ v)]
    (h : ∀ z₁ z₂ : X₁, v z₁ = v z₂ → ∃ i, z₁ ∈ Set.range (𝒲.f i) ∧ z₂ ∈ Set.range (𝒲.f i)) :
    IsSeparated v
NeronModelInfra.SmootheningIteration.StrataGlue.isIso_morphismRestrict_of_le
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Restrict
variable {X₁ X : Scheme.{u}} (v : X₁ ⟶ X)
theorem isIso_morphismRestrict_of_le {U W : X.Opens} (hW : IsIso (v ∣_ W)) (h : U ≤ W) : IsIso (v
    ∣_ U)
NeronModelInfra.SmootheningIteration.StrataGlue.isIso_pullback_snd_of_range_subset
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Restrict
variable {X₁ X : Scheme.{u}} (v : X₁ ⟶ X)
theorem isIso_pullback_snd_of_range_subset {T : Scheme.{u}} (k : T ⟶ X) (W : X.Opens) (hW : IsIso
    (v ∣_ W))
    (hk : ∀ t : T, k t ∈ W) : IsIso (pullback.snd v k)
NeronModelInfra.SmootheningIteration.StrataGlue.isIso_pullback_map
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Restrict
variable {X₁ X : Scheme.{u}} (v : X₁ ⟶ X)
theorem isIso_pullback_map {S T : Scheme.{u}} (f : X ⟶ S) (ι : T ⟶ S) (W : X.Opens) (hW : IsIso (v
    ∣_ W))
    (hι : ∀ t : ↥(pullback f ι), pullback.fst f ι t ∈ W) :
    IsIso (pullback.map (v ≫ f) ι f ι v (𝟙 T) (𝟙 S) (Category.comp_id _)
      ((Category.comp_id _).trans (Category.id_comp _).symm))
NeronModelInfra.SmootheningIteration.StrataGlue.isIso_ι_morphismRestrict
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Restrict
variable {X₁ X : Scheme.{u}} (v : X₁ ⟶ X)
theorem isIso_ι_morphismRestrict (U W : X.Opens) (h : W ≤ U) : IsIso (U.ι ∣_ W)
NeronModelInfra.SmootheningIteration.StrataGlue.isIso_morphismRestrict_of_comp
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Restrict
variable {X₁ X : Scheme.{u}} (v : X₁ ⟶ X)
theorem isIso_morphismRestrict_of_comp {Q : Scheme.{u}} (j : Q ⟶ X₁) [IsOpenImmersion j] (w : Q ⟶ X)
    (hw : j ≫ v = w) (W : X.Opens) (hW : IsIso (w ∣_ W)) (hcov : ∀ z : X₁, v z ∈ W → z ∈ Set.range
      j) :
    IsIso (v ∣_ W)
NeronModelInfra.SmootheningIteration.StrataGlue.algebraMap_injective
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Points
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
theorem algebraMap_injective {R' : Type u} [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R']
    [Algebra R R'] (h : Ideal.map (algebraMap R R') (IsLocalRing.maximalIdeal R) =
      IsLocalRing.maximalIdeal R') :
    Function.Injective (algebraMap R R')
NeronModelInfra.SmootheningIteration.StrataGlue.specMap_apply_ne_closedPoint
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Points
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
theorem specMap_apply_ne_closedPoint {R' : Type u} [CommRing R'] (g : R →+* R')
    (hinj : Function.Injective g) (q : PrimeSpectrum R') (hq : q.asIdeal = ⊥) :
    (Spec.map (CommRingCat.ofHom g)) q ≠ IsLocalRing.closedPoint R
NeronModelInfra.SmootheningIteration.StrataGlue.range_subset_of_apply_closedPoint_mem
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Points
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
theorem range_subset_of_apply_closedPoint_mem {X : Scheme.{u}} {R' : Type u} [CommRing R']
    [IsLocalRing R']
    {W : X.Opens} (x : Spec (CommRingCat.of R') ⟶ X)
    (hx : x (IsLocalRing.closedPoint R') ∈ W) : Set.range x ⊆ Set.range W.ι
NeronModelInfra.SmootheningIteration.StrataGlue.mem_iff_vanishingIdeal_le
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Dictionary
variable {X : Scheme.{u}} {U : X.Opens} (hU : IsAffineOpen U)
theorem mem_iff_vanishingIdeal_le (Z : Set X) (hZ : IsClosed Z) (y : X) (hy : y ∈ U) :
    y ∈ Z ↔ PrimeSpectrum.vanishingIdeal ((fun y : U => hU.primeIdealOf y) '' {y : U | (y : X) ∈
      Z}) ≤
      (hU.primeIdealOf ⟨y, hy⟩).asIdeal := by
  rw [NeronModelInfra.Dilatations.Construction.AffineCharts.vanishingIdeal_image_eq hU Z hZ]
  exact NeronModelInfra.Dilatations.Construction.AffineCharts.mem_iff_ideal_le hU Z hZ y hy
NeronModelInfra.SmootheningIteration.StrataGlue.XK

The open complement of the special fibre.

Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
def XK : X.Opens
NeronModelInfra.SmootheningIteration.StrataGlue.mem_XK
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
theorem mem_XK {x : X} : x ∈ XK f ↔ f x ≠ IsLocalRing.closedPoint R
NeronModelInfra.SmootheningIteration.StrataGlue.C

The open complement of a closed stratum.

Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i))
def C (m : ℕ) : X.Opens
NeronModelInfra.SmootheningIteration.StrataGlue.mem_C
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i))
omit [IsDomain R] [IsDiscreteValuationRing R] in
theorem mem_C {m : ℕ} {x : X} : x ∈ C Y hY m ↔ x ∉ Y m
NeronModelInfra.SmootheningIteration.StrataGlue.XK_le_C
Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i))
theorem XK_le_C (hYs : ∀ m, ∀ y ∈ Y m, f y = IsLocalRing.closedPoint R) (m : ℕ) : XK f ≤ C Y hY m
NeronModelInfra.SmootheningIteration.StrataGlue.idealOf

The ideal cutting out a closed center in an affine chart.

Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i))
abbrev idealOf (U : X.Opens) (hU : IsAffineOpen U) (Z : Set X) : Ideal Γ(X, U)
NeronModelInfra.SmootheningIteration.StrataGlue.secOf

The restriction of a base-ring element to an affine chart.

Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i))
abbrev secOf (U : X.Opens) (π : R) : Γ(X, U)
structure

Dil

L294 ↗
NeronModelInfra.SmootheningIteration.StrataGlue.Dil

An actual dilatation with its affine charts and generic-fibre comparison.

Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i))
structure Dil (Z : Set X) where
  /-- The dilatation scheme. -/
  D : Scheme.{u}
  /-- The dilatation morphism. -/
  p : D ⟶ X
  /-- The dilatation morphism is affine. -/
  affine : IsAffineHom p
  /-- The structural morphism is locally of finite type. -/
  loft : LocallyOfFiniteType p
  /-- The dilatation is an isomorphism away from the special fibre. -/
  isIso_restrict : ∀ W : X.Opens, (∀ x ∈ W, f x ≠ IsLocalRing.closedPoint R) → IsIso (p ∣_ W)
  /-- Special-fibre points map into the chosen center. -/
  apply_mem : ∀ d : D, f (p d) = IsLocalRing.closedPoint R → p d ∈ Z
  /-- Affine dilatation charts and their compatibility with the structure morphism. -/
  chart : ∀ (U : X.Opens) (hU : IsAffineOpen U) (π : R), IsLocalRing.maximalIdeal R = Ideal.span
    {π} →
    ∃ e : (↑(p ⁻¹ᵁ U) : Scheme.{u}) ≅
        Spec (CommRingCat.of (AffineDilatation.Ring (idealOf U hU Z) (secOf f U π))),
      (p ⁻¹ᵁ U).ι ≫ p = e.hom ≫
        Spec.map (CommRingCat.ofHom (algebraMap Γ(X, U)
          (AffineDilatation.Ring (idealOf U hU Z) (secOf f U π)))) ≫ hU.fromSpec
NeronModelInfra.SmootheningIteration.StrataGlue.ChartConcl

A dilatation chart together with the point-lifting locus it covers.

Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i))
def ChartConcl {X₁ : Scheme.{u}} (v : X₁ ⟶ X) (i : ℕ) (U : X.Opens) (hU : IsAffineOpen U) (π : R)
    : Prop
structure

Prev

L333 ↗
NeronModelInfra.SmootheningIteration.StrataGlue.Prev

The model and lifting properties after finitely many gluing steps.

Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Setup
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i))
structure Prev (n : ℕ) where
  /-- The model at this stage. -/
  Q : Scheme.{u}
  /-- The morphism to the initial scheme. -/
  w : Q ⟶ X
  /-- The structural morphism is separated. -/
  sep : IsSeparated w
  /-- The structural morphism is locally of finite type. -/
  loft : LocallyOfFiniteType w
  /-- The structural morphism is quasi-compact. -/
  qc : QuasiCompact w
  /-- The generic open is unchanged. -/
  isoK : IsIso (w ∣_ XK f)
  /-- The complement of the initial stratum is unchanged. -/
  isoC : IsIso (w ∣_ C Y hY 0)
  /-- The model avoids the next stratum. -/
  notMem : ∀ q : Q, w q ∉ Y n
  /-- Points outside the next stratum lift to this model. -/
  lift : ∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R'],
    Ideal.map (algebraMap R R') (IsLocalRing.maximalIdeal R) = IsLocalRing.maximalIdeal R' →
    ∀ x : Spec (CommRingCat.of R') ⟶ X, x ≫ f = Spec.map (CommRingCat.ofHom (algebraMap R R')) →
      x (IsLocalRing.closedPoint R') ∉ Y n → ∃ x₁ : Spec (CommRingCat.of R') ⟶ Q, x₁ ≫ w = x
  /-- Affine dilatation charts and their compatibility with the structure morphism. -/
  chart : ∀ i, i < n → ∀ (U : X.Opens) (hU : IsAffineOpen U), (∀ y ∈ U, y ∉ Y (i + 1)) →
    ∀ π : R, IsLocalRing.maximalIdeal R = Ideal.span {π} → ChartConcl f Y w i U hU π
NeronModelInfra.SmootheningIteration.StrataGlue.prevZero

The initial model obtained by removing the first closed stratum.

Source context 16 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Base
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f]
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
def prevZero : Prev f Y hY 0 where
  Q := ↑(C Y hY 0)
  w := (C Y hY 0).ι
  sep := inferInstance
  loft := inferInstance
  qc := by
    have : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian f
    infer_instance
  isoK := isIso_ι_morphismRestrict _ _ (XK_le_C f Y hY hYs 0)
  isoC := isIso_ι_morphismRestrict _ _ le_rfl
  notMem := fun q => q.2
  lift := by
    intro R' _ _ _ _ _ x _ hx₀
    exact ⟨IsOpenImmersion.lift (C Y hY 0).ι x (range_subset_of_apply_closedPoint_mem (W := C Y hY
      0) x hx₀),
      IsOpenImmersion.lift_fac _ _ _⟩
  chart := fun i hi => absurd hi (Nat.not_lt_zero i)
NeronModelInfra.SmootheningIteration.StrataGlue.E

The dilatation locus outside the next stratum.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def E : 𝔇.D.Opens
NeronModelInfra.SmootheningIteration.StrataGlue.U₀

The generic-fibre open of the new dilatation.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
abbrev U₀ : 𝔇.D.Opens
NeronModelInfra.SmootheningIteration.StrataGlue.U₀_le_E
Source context 18 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
include hYs in
theorem U₀_le_E : U₀ 𝔇 ≤ E hY 𝔇
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
instance : IsIso (𝔇.p ∣_ XK f)
NeronModelInfra.SmootheningIteration.StrataGlue.iE

The generic open included in the new chart.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def iE : (↑(U₀ 𝔇) : Scheme.{u}) ⟶ ↑(E hY 𝔇)
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
instance : IsOpenImmersion (iE hY hYs 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.iQ

The generic open identified with the preceding model.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def iQ : (↑(U₀ 𝔇) : Scheme.{u}) ⟶ 𝔓.Q
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
instance : IsOpenImmersion (iQ hY 𝔓 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.iQ_w
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem iQ_w : iQ hY 𝔓 𝔇 ≫ 𝔓.w = (U₀ 𝔇).ι ≫ 𝔇.p
NeronModelInfra.SmootheningIteration.StrataGlue.iE_p
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem iE_p : iE hY hYs 𝔇 ≫ (E hY 𝔇).ι ≫ 𝔇.p = (U₀ 𝔇).ι ≫ 𝔇.p
NeronModelInfra.SmootheningIteration.StrataGlue.X₁

The model obtained by gluing the preceding stage to the new chart.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def X₁ : Scheme.{u}
NeronModelInfra.SmootheningIteration.StrataGlue.jE

The new chart included in the glued model.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def jE : (↑(E hY 𝔇) : Scheme.{u}) ⟶ X₁ hY hYs 𝔓 𝔇
NeronModelInfra.SmootheningIteration.StrataGlue.jQ

The preceding model included in the glued model.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def jQ : 𝔓.Q ⟶ X₁ hY hYs 𝔓 𝔇
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
instance : IsOpenImmersion (jE hY hYs 𝔓 𝔇)
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
instance : IsOpenImmersion (jQ hY hYs 𝔓 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.v

The structural morphism from the glued model to the initial scheme.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def v : X₁ hY hYs 𝔓 𝔇 ⟶ X
NeronModelInfra.SmootheningIteration.StrataGlue.jE_v
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem jE_v : jE hY hYs 𝔓 𝔇 ≫ v hY hYs 𝔓 𝔇 = (E hY 𝔇).ι ≫ 𝔇.p
NeronModelInfra.SmootheningIteration.StrataGlue.jQ_v
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem jQ_v : jQ hY hYs 𝔓 𝔇 ≫ v hY hYs 𝔓 𝔇 = 𝔓.w
NeronModelInfra.SmootheningIteration.StrataGlue.jE_iE
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem jE_iE : iE hY hYs 𝔇 ≫ jE hY hYs 𝔓 𝔇 = iQ hY 𝔓 𝔇 ≫ jQ hY hYs 𝔓 𝔇
NeronModelInfra.SmootheningIteration.StrataGlue.v_jE_apply
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem v_jE_apply (e : (E hY 𝔇 : Scheme.{u})) : v hY hYs 𝔓 𝔇 (jE hY hYs 𝔓 𝔇 e) = 𝔇.p e.1
NeronModelInfra.SmootheningIteration.StrataGlue.v_jQ_apply
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem v_jQ_apply (q : 𝔓.Q) : v hY hYs 𝔓 𝔇 (jQ hY hYs 𝔓 𝔇 q) = 𝔓.w q
NeronModelInfra.SmootheningIteration.StrataGlue.cover
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem cover (z : X₁ hY hYs 𝔓 𝔇) : (∃ e, jE hY hYs 𝔓 𝔇 e = z) ∨ ∃ q, jQ hY hYs 𝔓 𝔇 q = z
NeronModelInfra.SmootheningIteration.StrataGlue.mem_U₀
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem mem_U₀ (e : (E hY 𝔇 : Scheme.{u})) (he : 𝔇.p e.1 ∉ Y n) : e.1 ∈ U₀ 𝔇
NeronModelInfra.SmootheningIteration.StrataGlue.jE_mem_range_jQ
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem jE_mem_range_jQ (e : (E hY 𝔇 : Scheme.{u})) (he : 𝔇.p e.1 ∉ Y n) :
    jE hY hYs 𝔓 𝔇 e ∈ Set.range (jQ hY hYs 𝔓 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.mem_range_jE
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem mem_range_jE (z : X₁ hY hYs 𝔓 𝔇) (hz : v hY hYs 𝔓 𝔇 z ∈ Y n) :
    z ∈ Set.range (jE hY hYs 𝔓 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.mem_range_jQ
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem mem_range_jQ (z : X₁ hY hYs 𝔓 𝔇) (hz : v hY hYs 𝔓 𝔇 z ∉ Y n) :
    z ∈ Set.range (jQ hY hYs 𝔓 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.v_notMem
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem v_notMem (hanti : ∀ i, Y (i + 1) ⊆ Y i) (z : X₁ hY hYs 𝔓 𝔇) : v hY hYs 𝔓 𝔇 z ∉ Y (n + 1)
NeronModelInfra.SmootheningIteration.StrataGlue.cov

The open cover supplied by the gluing pushout.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def cov : (X₁ hY hYs 𝔓 𝔇).OpenCover
NeronModelInfra.SmootheningIteration.StrataGlue.cov_f_zero
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem cov_f_zero : (cov hY hYs 𝔓 𝔇).f WalkingSpan.zero = iE hY hYs 𝔇 ≫ jE hY hYs 𝔓 𝔇
NeronModelInfra.SmootheningIteration.StrataGlue.cov_f_left
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem cov_f_left : (cov hY hYs 𝔓 𝔇).f WalkingSpan.left = jE hY hYs 𝔓 𝔇
NeronModelInfra.SmootheningIteration.StrataGlue.cov_f_right
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem cov_f_right : (cov hY hYs 𝔓 𝔇).f WalkingSpan.right = jQ hY hYs 𝔓 𝔇
NeronModelInfra.SmootheningIteration.StrataGlue.isSeparated_v
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
instance isSeparated_v : IsSeparated (v hY hYs 𝔓 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.locallyOfFiniteType_v
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
instance locallyOfFiniteType_v : LocallyOfFiniteType (v hY hYs 𝔓 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.quasiCompact_v
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
instance quasiCompact_v [LocallyOfFiniteType f] : QuasiCompact (v hY hYs 𝔓 𝔇)
NeronModelInfra.SmootheningIteration.StrataGlue.isIso_restrict_XK
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem isIso_restrict_XK : IsIso (v hY hYs 𝔓 𝔇 ∣_ XK f)
NeronModelInfra.SmootheningIteration.StrataGlue.isIso_restrict_C
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem isIso_restrict_C (hanti : ∀ i, Y (i + 1) ⊆ Y i) : IsIso (v hY hYs 𝔓 𝔇 ∣_ C Y hY 0)
NeronModelInfra.SmootheningIteration.StrataGlue.algebraMap_ne_zero
Source context 21 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
section Lift
variable (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
variable (hR' : Ideal.map (algebraMap R R') (IsLocalRing.maximalIdeal R) =
    IsLocalRing.maximalIdeal R')
include hR' in
theorem algebraMap_ne_zero {π : R} (hπ : IsLocalRing.maximalIdeal R = Ideal.span {π}) :
    algebraMap R R' π ≠ 0
NeronModelInfra.SmootheningIteration.StrataGlue.exists_lift_D
Source context 21 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
section Lift
variable (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
variable (hR' : Ideal.map (algebraMap R R') (IsLocalRing.maximalIdeal R) =
    IsLocalRing.maximalIdeal R')
include hY hR' in
theorem exists_lift_D (x : Spec (CommRingCat.of R') ⟶ X)
    (hx : x ≫ f = Spec.map (CommRingCat.ofHom (algebraMap R R')))
    (hx₀ : x (IsLocalRing.closedPoint R') ∈ Y n) :
    ∃ x₁ : Spec (CommRingCat.of R') ⟶ 𝔇.D, x₁ ≫ 𝔇.p = x
NeronModelInfra.SmootheningIteration.StrataGlue.exists_lift
Source context 21 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
section Lift
variable (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
variable (hR' : Ideal.map (algebraMap R R') (IsLocalRing.maximalIdeal R) =
    IsLocalRing.maximalIdeal R')
include hR' in
theorem exists_lift (x : Spec (CommRingCat.of R') ⟶ X)
    (hx : x ≫ f = Spec.map (CommRingCat.ofHom (algebraMap R R')))
    (hxn : x (IsLocalRing.closedPoint R') ∉ Y (n + 1)) :
    ∃ x₁ : Spec (CommRingCat.of R') ⟶ X₁ hY hYs 𝔓 𝔇, x₁ ≫ v hY hYs 𝔓 𝔇 = x
NeronModelInfra.SmootheningIteration.StrataGlue.chart_new
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem chart_new (U : X.Opens) (hU : IsAffineOpen U) (hUY : ∀ y ∈ U, y ∉ Y (n + 1)) (π : R)
    (hπ : IsLocalRing.maximalIdeal R = Ideal.span {π}) : ChartConcl f Y (v hY hYs 𝔓 𝔇) n U hU
      π
NeronModelInfra.SmootheningIteration.StrataGlue.chart_old
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
theorem chart_old (hanti : ∀ i, Y (i + 1) ⊆ Y i) (i : ℕ) (hi : i < n) (U : X.Opens) (hU :
    IsAffineOpen U)
    (hUY : ∀ y ∈ U, y ∉ Y (i + 1)) (π : R) (hπ : IsLocalRing.maximalIdeal R = Ideal.span {π}) :
    ChartConcl f Y (v hY hYs 𝔓 𝔇) i U hU π
NeronModelInfra.SmootheningIteration.StrataGlue.prevSucc

The next gluing stage, with the previous and new affine charts.

Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Step
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {n : ℕ} (𝔓 : Prev f Y hY n) (𝔇 : Dil f (Y n))
def prevSucc [LocallyOfFiniteType f] (hanti : ∀ i, Y (i + 1) ⊆ Y i) : Prev f Y hY (n + 1) where
  Q := X₁ hY hYs 𝔓 𝔇
  w := v hY hYs 𝔓 𝔇
  sep := inferInstance
  loft := inferInstance
  qc := inferInstance
  isoK := isIso_restrict_XK hY hYs 𝔓 𝔇
  isoC := isIso_restrict_C hY hYs 𝔓 𝔇 hanti
  notMem := v_notMem hY hYs 𝔓 𝔇 hanti
  lift := fun R' _ _ _ _ hR' x hx hxn => exists_lift hY hYs 𝔓 𝔇 R' hR' x hx hxn
  chart := by
    intro i hi U hU hUY π hπ
    rcases Nat.lt_succ_iff_lt_or_eq.mp hi with hi | rfl
    · exact chart_old hY hYs 𝔓 𝔇 hanti i hi U hU hUY π hπ
    · exact chart_new hY hYs 𝔓 𝔇 U hU hUY π hπ
NeronModelInfra.SmootheningIteration.StrataGlue.isIso_genericFibre
Source context 18 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Consequences
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {X₁ : Scheme.{u}} (v : X₁ ⟶ X) (hC : IsIso (v ∣_ C Y hY 0))
include hYs hC in
theorem isIso_genericFibre (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K] :
    IsIso (pullback.map (v ≫ f) (specGenericFibreInclusion R K) f (specGenericFibreInclusion R K)
      v (𝟙 _) (𝟙 _) (Category.comp_id _) ((Category.comp_id _).trans (Category.id_comp _).symm))
NeronModelInfra.SmootheningIteration.StrataGlue.lift_unique
Source context 21 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Consequences
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} {f : X ⟶ Spec (CommRingCat.of R)}
variable {Y : ℕ → Set X} (hY : ∀ i, IsClosed (Y i)) (hYs : ∀ m, ∀ y ∈ Y m, f y =
    IsLocalRing.closedPoint R)
variable {X₁ : Scheme.{u}} (v : X₁ ⟶ X) (hC : IsIso (v ∣_ C Y hY 0))
variable [IsSeparated v]
variable (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
variable (hR' : Ideal.map (algebraMap R R') (IsLocalRing.maximalIdeal R) =
    IsLocalRing.maximalIdeal R')
include hYs hC hR' in
theorem lift_unique (x₁ x₂ : Spec (CommRingCat.of R') ⟶ X₁) (h : x₁ ≫ v = x₂ ≫ v)
    (hx : x₁ ≫ v ≫ f = Spec.map (CommRingCat.ofHom (algebraMap R R'))) : x₁ = x₂
NeronModelInfra.SmootheningIteration.StrataGlue.nonempty_prev
Source context 17 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
noncomputable section
namespace StrataGlue
section Main
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f]
variable (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i)) (hanti : ∀ i, Y (i + 1) ⊆ Y i)
  (hYs : ∀ m, ∀ y ∈ Y m, f y = IsLocalRing.closedPoint R)
include hanti hYs in
theorem nonempty_prev : ∀ n, Nonempty (Prev f Y hY n)
  | 0 => ⟨prevZero f Y hY hYs⟩
  | n + 1 => by
    obtain ⟨𝔓⟩ := nonempty_prev n
    obtain ⟨D, p, h1, h2, h3, h4, h5⟩ :=
      NeronModelInfra.exists_isAffineHom_isIso_morphismRestrict_iso_affineDilatation_of_isClosed f
        (Y n) (hY n)
        (hYs n)
    let 𝔇 : Dil f (Y n) := ⟨D, p, h1, h2, h3, h4, h5⟩
    exact ⟨prevSucc hY hYs 𝔓 𝔇 hanti⟩
NeronModelInfra.exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
open NeronModelInfra.SmootheningIteration
open scoped NeronModelInfra.SmootheningIteration.StrataGlue
theorem
    exists_hom_isIso_morphismRestrict_compl_iso_affineDilatation_of_antitone_isClosed
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f]
    (t : ℕ) (Y : ℕ → Set X) (hY : ∀ i, IsClosed (Y i)) (hanti : ∀ i, Y (i + 1) ⊆ Y i) (hYt : Y t =
      ∅)
    (hYs : ∀ y ∈ Y 0, f y = IsLocalRing.closedPoint R) :
    ∃ (X₁ : Scheme.{u}) (v : X₁ ⟶ X),
      IsSeparated v ∧ LocallyOfFiniteType v ∧ QuasiCompact v ∧
      IsIso (pullback.map (v ≫ f) (specGenericFibreInclusion R K) f (specGenericFibreInclusion R
        K) v
        (𝟙 _) (𝟙 _) (Category.comp_id _) ((Category.comp_id _).trans (Category.id_comp _).symm)) ∧
      IsIso (v ∣_ ⟨(Y 0)ᶜ, (hY 0).isOpen_compl⟩) ∧
      (∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R'],
        Ideal.map (algebraMap R R') (IsLocalRing.maximalIdeal R) = IsLocalRing.maximalIdeal R' →
        ∀ x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f,
          ∃! x₁ : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) (v ≫ f), x₁.1 ≫ v
            = x.1) ∧
      (∀ (i : ℕ), i < t → ∀ (U : X.Opens) (hU : IsAffineOpen U), (∀ y ∈ (U : Set X), y ∉ Y (i +
        1)) →
        ∀ (π : R), IsLocalRing.maximalIdeal R = Ideal.span {π} →
        ∃ (W : X₁.Opens)
          (e : (W : Scheme.{u}) ≅
            Spec (CommRingCat.of (AffineDilatation.Ring
              (PrimeSpectrum.vanishingIdeal ((fun y : U => hU.primeIdealOf y) '' {y : U | (y : X)
                ∈ Y i}))
              ((X.presheaf.map (homOfLE le_top).op).hom
                (f.appTop.hom ((Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom π)))))),
          W.ι ≫ v = e.hom ≫
            Spec.map (CommRingCat.ofHom (algebraMap Γ(X, U) (AffineDilatation.Ring
              (PrimeSpectrum.vanishingIdeal ((fun y : U => hU.primeIdealOf y) '' {y : U | (y : X)
                ∈ Y i}))
              ((X.presheaf.map (homOfLE le_top).op).hom
                (f.appTop.hom ((Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom π)))))) ≫ hU.fromSpec ∧
          ∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R'],
            Ideal.map (algebraMap R R') (IsLocalRing.maximalIdeal R) = IsLocalRing.maximalIdeal R' →
            ∀ x₁ : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) (v ≫ f),
              (x₁.1 ≫ v) (IsLocalRing.closedPoint R') ∈ Y i →
              (x₁.1 ≫ v) (IsLocalRing.closedPoint R') ∈ U →
              x₁.1 (IsLocalRing.closedPoint R') ∈ W) := by
  have hYs' : ∀ m, ∀ y ∈ Y m, f y = IsLocalRing.closedPoint R :=
    fun m y hy => hYs y ((antitone_nat_of_succ_le hanti) (Nat.zero_le m) hy)
  obtain ⟨𝔓⟩ := StrataGlue.nonempty_prev f Y hY hanti hYs' t
  refine ⟨𝔓.Q, 𝔓.w, 𝔓.sep, 𝔓.loft, 𝔓.qc, StrataGlue.isIso_genericFibre hY hYs' 𝔓.w 𝔓.isoC K,
    𝔓.isoC, ?_,
    fun i hi U hU hUY π hπ => 𝔓.chart i hi U hU hUY π hπ⟩
  intro R' _ _ _ _ hR' x
  obtain ⟨x₁, hx₁⟩ := 𝔓.lift R' hR' x.1 x.2 (by rw [hYt]; exact Set.notMem_empty _)
  refine ⟨⟨x₁, by rw [← Category.assoc, hx₁]; exact x.2⟩, hx₁, ?_⟩
  rintro ⟨x₂, hx₂'⟩ hx₂
  exact Subtype.ext (StrataGlue.lift_unique hY hYs' 𝔓.w 𝔓.isoC R' hR' x₂ x₁ (hx₂.trans hx₁.symm)
    hx₂')
NeronModelInfra.SmootheningIteration.Stratification.IsIdxSpec

A special point realized over an index-one extension of valuation rings.

Source context 12 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
namespace Stratification
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] {X : Scheme.{u}} (f :
    X ⟶ Spec (CommRingCat.of R))
def IsIdxSpec (y : X) : Prop
NeronModelInfra.SmootheningIteration.Stratification.GoodClause

Smoothness and differential freeness at a point of an affine stratum.

Source context 12 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
namespace Stratification
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] {X : Scheme.{u}} (f :
    X ⟶ Spec (CommRingCat.of R))
def GoodClause (C : Set X) (U : X.Opens) (hU : IsAffineOpen U) (y : X) (hyU : y ∈ U) : Prop
NeronModelInfra.SmootheningIteration.Stratification.Good

The points admitting a smooth and differentially free chart on the stratum.

Source context 12 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
namespace Stratification
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] {X : Scheme.{u}} (f :
    X ⟶ Spec (CommRingCat.of R))
def Good (C : Set X) : Set X
NeronModelInfra.SmootheningIteration.Stratification.step

The remaining locus after removing the good points of its closure.

Source context 12 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
namespace Stratification
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] {X : Scheme.{u}} (f :
    X ⟶ Spec (CommRingCat.of R))
def step (S : Set X) : Set X
NeronModelInfra.SmootheningIteration.Stratification.step_subset
Source context 12 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
namespace Stratification
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] {X : Scheme.{u}} (f :
    X ⟶ Spec (CommRingCat.of R))
theorem step_subset (S : Set X) : step f S ⊆ S
NeronModelInfra.SmootheningIteration.Stratification.iterate_step_subset
Source context 12 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
namespace Stratification
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] {X : Scheme.{u}} (f :
    X ⟶ Spec (CommRingCat.of R))
theorem iterate_step_subset (S : Set X) (n : ℕ) : (step f)^[n] S ⊆ S
NeronModelInfra.SmootheningIteration.Stratification.iterate_step_succ_subset
Source context 12 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TensorProduct
namespace Stratification
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R] {X : Scheme.{u}} (f :
    X ⟶ Spec (CommRingCat.of R))
theorem iterate_step_succ_subset (S : Set X) (n : ℕ) : (step f)^[n + 1] S ⊆ (step f)^[n] S
NeronModelInfra.exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
open NeronModelInfra.SmootheningIteration
open NeronModelInfra.SmootheningIteration.Stratification
theorem
    exists_antitone_isClosed_forall_indexOne_chart_of_smooth_pullback_snd
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f] [QuasiCompact f]
    (_hK : Smooth (pullback.snd f (specGenericFibreInclusion R K))) :
    ∃ (t : ℕ) (Y : ℕ → Set X), (∀ i, IsClosed (Y i)) ∧ (∀ i, Y (i + 1) ⊆ Y i) ∧ Y t = ∅ ∧
      (∀ y ∈ Y 0, f y = IsLocalRing.closedPoint R) ∧ (∀ y ∈ Y 0, y ∉ (f.smoothLocus : Set X)) ∧
      (∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
        [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
        ∀ x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f,
          x.1 (IsLocalRing.closedPoint R') ∉ (f.smoothLocus : Set X) →
          x.1 (IsLocalRing.closedPoint R') ∈ Y 0) ∧
      (∀ (i : ℕ), i < t → ∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R']
        [Algebra R R'] [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
        ∀ x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f,
          x.1 (IsLocalRing.closedPoint R') ∈ Y i → x.1 (IsLocalRing.closedPoint R') ∉ Y (i + 1) →
          ∃ (U : X.Opens) (hU : IsAffineOpen U) (hxU : x.1 (IsLocalRing.closedPoint R') ∈ U),
            (∀ y ∈ (U : Set X), y ∉ Y (i + 1)) ∧
            let : Algebra R Γ(X, U) :=
              ((X.presheaf.map (homOfLE le_top).op).hom.comp
                (f.appTop.hom.comp (Scheme.ΓSpecIso (CommRingCat.of R)).inv.hom)).toAlgebra
            let J : Ideal Γ(X, U) :=
              PrimeSpectrum.vanishingIdeal ((fun y : U => hU.primeIdealOf y) '' {y : U | (y : X) ∈
                Y i})
            (∀ g : Γ(X, U),
              (∀ (R'' : Type u) [CommRing R''] [IsDomain R''] [IsDiscreteValuationRing R'']
                [Algebra R R'']
                [IsLocalHom (algebraMap R R'')], IsIndexOneExtension R R'' →
                ∀ c : Γ(X, U) →ₐ[R] R'', J ≤ (IsLocalRing.maximalIdeal R'').comap c →
                  g ∈ (IsLocalRing.maximalIdeal R'').comap c) → g ∈ J) ∧
            (∀ (𝔮 : Ideal (Γ(X, U) ⧸ J)) [𝔮.IsPrime],
              𝔮.comap (Ideal.Quotient.mk J) = (hU.primeIdealOf ⟨x.1 (IsLocalRing.closedPoint R'),
                hxU⟩).asIdeal →
              (∀ [Algebra (IsLocalRing.ResidueField R) (Γ(X, U) ⧸ J)]
                [IsScalarTower R (IsLocalRing.ResidueField R) (Γ(X, U) ⧸ J)],
                Algebra.IsSmoothAt (IsLocalRing.ResidueField R) 𝔮) ∧
              (⟨𝔮, ‹_›⟩ : PrimeSpectrum (Γ(X, U) ⧸ J)) ∈
                Module.freeLocus (Γ(X, U) ⧸ J) ((Γ(X, U) ⧸ J) ⊗[Γ(X, U)] Ω[Γ(X, U)⁄R]))) := by
  classical
  let S₀ : Set X := {y | IsIdxSpec f y ∧ y ∉ (f.smoothLocus : Set X)}
  let Sq : ℕ → Set X := fun n => (step f)^[n] S₀
  have hSq_succ : ∀ n, Sq (n + 1) = step f (Sq n) := fun n => Function.iterate_succ_apply' (step
    f) n S₀
  have hidx_k : ∀ y : X, IsIdxSpec f y → f y = IsLocalRing.closedPoint R := by
    rintro y ⟨R', _, _, _, _, _, _, x, rfl⟩
    change (x.1 ≫ f).base (IsLocalRing.closedPoint R') = _
    rw [x.2]
    exact IsLocalRing.comap_closedPoint (algebraMap R R')
  have hSqidx : ∀ n, ∀ y ∈ Sq n, IsIdxSpec f y := fun n y hy => (iterate_step_subset f S₀ n hy).1
  have hSqk : ∀ n, ∀ y ∈ Sq n, f y = IsLocalRing.closedPoint R := fun n y hy => hidx_k y (hSqidx n
    y hy)
  have hSq_shape : ∀ n, ∀ s ∈ Sq n, ∃ (R' : Type u) (_ : CommRing R') (_ : IsDomain R') (_ :
    IsDiscreteValuationRing R')
      (_ : Algebra R R') (_ : IsLocalHom (algebraMap R R')) (_ : IsIndexOneExtension R R')
      (x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f), x.1
        (IsLocalRing.closedPoint R') = s :=
    fun n s hs => hSqidx n s hs
  have hfib : IsClosed {y : X | f y = IsLocalRing.closedPoint R} := by
    have h1 : IsClosed ({IsLocalRing.closedPoint R} : Set (Spec (CommRingCat.of R))) :=
      (PrimeSpectrum.isClosed_singleton_iff_isMaximal _).mpr (IsLocalRing.maximalIdeal.isMaximal R)
    exact h1.preimage f.base.hom.continuous
  have hYk : ∀ n, ∀ y ∈ closure (Sq n), f y = IsLocalRing.closedPoint R := fun n =>
    (hfib.closure_subset_iff.mpr (fun y hy => hSqk n y hy))
  have hY0sm : ∀ y ∈ closure (Sq 0), y ∉ (f.smoothLocus : Set X) := by
    have : closure (Sq 0) ⊆ (f.smoothLocus : Set X)ᶜ :=
      (f.smoothLocus.2.isClosed_compl).closure_subset_iff.mpr (fun y hy => hy.2)
    exact fun y hy => this hy
  have hstrict : ∀ S : Set X, S ⊆ S₀ → S.Nonempty → ¬ closure S ⊆ closure (step f S) := by
    intro S hS ⟨s, hs⟩ hle
    obtain ⟨_, ⟨U, hU, rfl⟩, hsU, -⟩ := X.isBasis_affineOpens.exists_subset_of_mem_open
      (Set.mem_univ s) isOpen_univ
    obtain ⟨W, hWU, hWne, hWgood⟩ :=
      NeronModelInfra.exists_opens_inter_closure_eq_setOf_isSmoothAt_and_mem_freeLocus f S
        (fun s hs => (hS hs).1) (fun s hs => hidx_k s (hS hs).1) U hU
    obtain ⟨w, hwS, hwW⟩ := hWne ⟨s, subset_closure hs, hsU⟩
    have hmiss : closure (step f S) ⊆ (W : Set X)ᶜ := by
      refine (W.2.isClosed_compl).closure_subset_iff.mpr ?_
      rintro y ⟨hyS, hyngood⟩ hyW
      exact hyngood ⟨U, hU, hWU hyW, (hWgood y (hWU hyW) (subset_closure hyS)).mp hyW⟩
    exact hmiss (hle hwS) hwW
  have : IsLocallyNoetherian X := LocallyOfFiniteType.isLocallyNoetherian f
  have : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace f
  have : IsNoetherian X := {}
  have hterm : ∃ t : ℕ, Sq t = ∅ := by
    by_contra hne
    push Not at hne
    have hchain : ∀ n, (⟨closure (Sq (n + 1)), isClosed_closure⟩ : TopologicalSpace.Closeds X) <
        ⟨closure (Sq n), isClosed_closure⟩ := by
      intro n
      refine lt_of_le_of_ne ?_ ?_
      · exact closure_mono (by rw [hSq_succ]; exact step_subset f _)
      · intro h
        have h' : closure (Sq n) ⊆ closure (Sq (n + 1)) := by
          have := congrArg (fun C : TopologicalSpace.Closeds X => (C : Set X)) h
          exact this.symm.subset
        rw [hSq_succ] at h'
        exact hstrict (Sq n) (iterate_step_subset f S₀ n) (hne n) h'
    exact (RelEmbedding.natGT (fun n => (⟨closure (Sq n), isClosed_closure⟩ :
      TopologicalSpace.Closeds X)) hchain).not_wellFounded
      wellFounded_lt
  obtain ⟨t, ht⟩ := hterm
  have hmemSq : ∀ (i : ℕ) (y : X), y ∈ S₀ → y ∈ closure (Sq i) → y ∈ Sq i := by
    intro i
    induction i with
    | zero => exact fun y hy _ => hy
    | succ j ih =>
      intro y hy0 hyY
      have hyj : y ∈ Sq j := ih y hy0 (closure_mono (by rw [hSq_succ]; exact step_subset f _) hyY)
      rw [hSq_succ]
      refine ⟨hyj, ?_⟩
      rintro ⟨U, hU, hyU, hgood⟩
      obtain ⟨W, hWU, -, hWgood⟩ :=
        NeronModelInfra.exists_opens_inter_closure_eq_setOf_isSmoothAt_and_mem_freeLocus f (Sq j)
          (hSq_shape j) (hSqk j) U hU
      have hyW : y ∈ W := (hWgood y hyU (subset_closure hyj)).mpr hgood
      have hmiss : closure (step f (Sq j)) ⊆ (W : Set X)ᶜ := by
        refine (W.2.isClosed_compl).closure_subset_iff.mpr ?_
        rintro y' ⟨hy'S, hy'ngood⟩ hy'W
        exact hy'ngood ⟨U, hU, hWU hy'W, (hWgood y' (hWU hy'W) (subset_closure hy'S)).mp hy'W⟩
      rw [hSq_succ] at hyY
      exact hmiss hyY hyW
  have hYempty : closure (Sq t) = ∅ := by rw [ht, closure_empty]
  refine ⟨t, fun n => closure (Sq n), fun n => isClosed_closure,
    fun n => closure_mono (by rw [hSq_succ]; exact step_subset f _), hYempty,
    hYk 0, hY0sm, ?_, ?_⟩
  · intro R' _ _ _ _ _ hR' x hx
    exact subset_closure ⟨⟨R', inferInstance, inferInstance, inferInstance, inferInstance,
      inferInstance, hR', x, rfl⟩, hx⟩
  · intro i hi R' _ _ _ _ _ hR' x hyi hyi1
    set y := x.1 (IsLocalRing.closedPoint R') with hy
    have hy0 : y ∈ S₀ := ⟨⟨R', inferInstance, inferInstance, inferInstance, inferInstance,
      inferInstance, hR', x, rfl⟩,
      hY0sm y (closure_mono (iterate_step_subset f S₀ i) hyi)⟩
    have hySi : y ∈ Sq i := hmemSq i y hy0 hyi
    have hgood : y ∈ Good f (closure (Sq i)) := by
      by_contra h
      exact hyi1 (subset_closure (by rw [hSq_succ]; exact ⟨hySi, h⟩))
    obtain ⟨U, hU, hyU, hgoodU⟩ := hgood
    let algU : Algebra R Γ(X, U) := f.sectionsAlgebra U
    obtain ⟨h, hhvan, hhy⟩ : ∃ h : Γ(X, U), (∀ z : U, (z : X) ∈ closure (Sq (i + 1)) → h ∈
      (hU.primeIdealOf z).asIdeal) ∧
        h ∉ (hU.primeIdealOf ⟨y, hyU⟩).asIdeal := by
      let T : Set (PrimeSpectrum Γ(X, U)) := (fun z : U => hU.primeIdealOf z) '' {z : U | (z : X)
        ∈ closure (Sq (i + 1))}
      have hT : IsClosed T := by
        have hcl : IsClosed {z : U | (z : X) ∈ closure (Sq (i + 1))} := isClosed_closure.preimage
          continuous_subtype_val
        have : T = Scheme.homeoOfIso hU.isoSpec '' {z : U | (z : X) ∈ closure (Sq (i + 1))} := by
          ext q
          simp only [T, Set.mem_image, Scheme.homeoOfIso_apply]
          rfl
        rw [this]
        exact (Scheme.homeoOfIso hU.isoSpec).isClosed_image.mpr hcl
      have hyT : hU.primeIdealOf ⟨y, hyU⟩ ∉ T := by
        rintro ⟨z, hz, hzy⟩
        apply hyi1
        have : (z : X) = y := by
          have := congrArg (fun q => hU.fromSpec.base q) hzy
          simpa only [IsAffineOpen.fromSpec_primeIdealOf] using this
        rw [← this]; exact hz
      have hnot : ¬ ((PrimeSpectrum.vanishingIdeal T : Ideal Γ(X, U)) ≤ (hU.primeIdealOf ⟨y,
        hyU⟩).asIdeal) := by
        intro hle
        apply hyT
        have : hU.primeIdealOf ⟨y, hyU⟩ ∈ PrimeSpectrum.zeroLocus (PrimeSpectrum.vanishingIdeal T
          : Set Γ(X, U)) := hle
        rwa [PrimeSpectrum.zeroLocus_vanishingIdeal_eq_closure, hT.closure_eq] at this
      obtain ⟨h, hhI, hhy⟩ := Set.not_subset.mp hnot
      refine ⟨h, fun z hz => ?_, hhy⟩
      exact (PrimeSpectrum.mem_vanishingIdeal _ _).mp hhI _ ⟨z, hz, rfl⟩
    have hyh : y ∈ X.basicOpen h := (mem_basicOpen_iff_notMem hU h y hyU).mpr hhy
    refine ⟨X.basicOpen h, hU.basicOpen h, hyh, ?_, ?_, ?_⟩
    · intro z hz hz'
      have hzU : z ∈ U := X.basicOpen_le h hz
      exact (mem_basicOpen_iff_notMem hU h z hzU).mp hz (hhvan ⟨z, hzU⟩ hz')
    · exact NeronModelInfra.mem_vanishingIdeal_closure_of_forall_indexOne_algHom
        f (Sq i) (hSq_shape i) (X.basicOpen h) (hU.basicOpen h)
    · exact NeronModelInfra.isSmoothAt_and_mem_freeLocus_basicOpen_of_isSmoothAt_of_mem_freeLocus
        f (closure (Sq i)) (hYk i) U hU h y hyU hyh hgoodU
NeronModelInfra.SmootheningIteration.DefectDrop.exists_lift_of_apply_closedPoint_mem
Source context 13 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_smoothnessDefect_add_one_le_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra
open TensorProduct IsLocalRing
noncomputable section
namespace DefectDrop
theorem exists_lift_of_apply_closedPoint_mem {U X : Scheme.{u}} (g : U ⟶ X) [IsOpenImmersion g]
    {R' : Type u} [CommRing R'] [IsLocalRing R'] (a : Spec (CommRingCat.of R') ⟶ X)
    (h : a (IsLocalRing.closedPoint R') ∈ Set.range g) :
    ∃ a' : Spec (CommRingCat.of R') ⟶ U, a' ≫ g = a
NeronModelInfra.SmootheningIteration.DefectDrop.fromSpec_comp_eq
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_smoothnessDefect_add_one_le_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra
open TensorProduct IsLocalRing
noncomputable section
namespace DefectDrop
section Chart
variable {R : Type u} [CommRing R] {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
  (U : X.Opens) (hU : IsAffineOpen U)
theorem fromSpec_comp_eq :
    hU.fromSpec ≫ f = Spec.map (CommRingCat.ofHom (algebraMap R Γ(X, U) (self := f.sectionsAlgebra
      U)))
NeronModelInfra.SmootheningIteration.DefectDrop.mem_smoothLocus_of_apply_eq_bot
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_smoothnessDefect_add_one_le_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra
open TensorProduct IsLocalRing
noncomputable section
namespace DefectDrop
section GenericPoint
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
  (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
  {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f]
theorem mem_smoothLocus_of_apply_eq_bot {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
    [LocallyOfFiniteType f] (hK : Smooth (pullback.snd f (specGenericFibreInclusion R K)))
    (y : X) (hy : f y = (⊥ : PrimeSpectrum R)) : y ∈ f.smoothLocus
NeronModelInfra.SmootheningIteration.DefectDrop.apply_bot_mem_smoothLocus
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_smoothnessDefect_add_one_le_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra
open TensorProduct IsLocalRing
noncomputable section
namespace DefectDrop
section GenericPoint
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
  (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
  {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f]
theorem apply_bot_mem_smoothLocus (hK : Smooth (pullback.snd f (specGenericFibreInclusion R K)))
    {R' : Type u} [CommRing R'] [IsDomain R'] [Algebra R R'] (hinj : Function.Injective
      (algebraMap R R'))
    (a : Spec (CommRingCat.of R') ⟶ X) (ha : a ≫ f = Spec.map (CommRingCat.ofHom (algebraMap R
      R'))) :
    a (⊥ : PrimeSpectrum R') ∈ f.smoothLocus
NeronModelInfra.SmootheningIteration.DefectDrop.mem_smoothLocus_iff_mem_algebra_smoothLocus
Source context 15 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_smoothnessDefect_add_one_le_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra
open TensorProduct IsLocalRing
noncomputable section
namespace DefectDrop
section SmoothLocusChart
variable {R : Type u} [CommRing R] {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R))
  [LocallyOfFinitePresentation f] (U : X.Opens) (hU : IsAffineOpen U)
theorem mem_smoothLocus_iff_mem_algebra_smoothLocus (x : X) (hx : x ∈ U) :
    let : Algebra R Γ(X, U) := f.sectionsAlgebra U
    x ∈ f.smoothLocus ↔
      hU.primeIdealOf ⟨x, hx⟩ ∈ Algebra.smoothLocus R Γ(X, U) := by
  intro iR
  let iΓ : Algebra Γ(Spec (CommRingCat.of R), ⊤) Γ(X, U) := (f.appLE ⊤ U le_top).hom.toAlgebra
  let iRΓ : Algebra R Γ(Spec (CommRingCat.of R), ⊤) := (Scheme.ΓSpecIso (CommRingCat.of
    R)).inv.hom.toAlgebra
  have : IsScalarTower R Γ(Spec (CommRingCat.of R), ⊤) Γ(X, U) :=
    IsScalarTower.of_algebraMap_eq' rfl
  rw [Scheme.Hom.mem_smoothLocus,
    AlgebraicGeometry.formallySmooth_stalkMap_iff ⊤ (isAffineOpen_top _) U hU le_top hx]
  change Algebra.IsSmoothAt Γ(Spec (CommRingCat.of R), ⊤) (hU.primeIdealOf ⟨x, hx⟩).asIdeal ↔
    Algebra.IsSmoothAt R (hU.primeIdealOf ⟨x, hx⟩).asIdeal
  have : IsLocalization.Away (1 : R) Γ(Spec (CommRingCat.of R), ⊤) :=
    IsLocalization.away_of_isUnit_of_bijective _ isUnit_one
      (ConcreteCategory.bijective_of_isIso (Scheme.ΓSpecIso (CommRingCat.of R)).inv)
  have : Algebra.FormallyEtale R Γ(Spec (CommRingCat.of R), ⊤) :=
    Algebra.FormallyEtale.of_isLocalization (Submonoid.powers (1 : R))
  exact (Algebra.FormallySmooth.iff_restrictScalars (R := R) (A := Γ(Spec (CommRingCat.of R),
    ⊤))).symm
NeronModelInfra.exists_hom_isIso_smoothnessDefect_add_one_le_of_smooth_pullback_snd
Source context 11 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_hom_isIso_smoothnessDefect_add_one_le_of_smooth_pullback_snd.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
open NeronModelInfra.SmootheningIteration
open NeronModelInfra.SmootheningIteration.DefectDrop
theorem
    exists_hom_isIso_smoothnessDefect_add_one_le_of_smooth_pullback_snd
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f] [QuasiCompact f]
    (hK : Smooth (pullback.snd f (specGenericFibreInclusion R K))) :
    ∃ (X₁ : Scheme.{u}) (v : X₁ ⟶ X),
      IsSeparated v ∧ LocallyOfFiniteType (v ≫ f) ∧ QuasiCompact (v ≫ f) ∧
      IsIso (pullback.map (v ≫ f) (specGenericFibreInclusion R K) f (specGenericFibreInclusion R
        K) v
        (𝟙 _) (𝟙 _) (Category.comp_id _) ((Category.comp_id _).trans (Category.id_comp _).symm)) ∧
      IsIso (v ∣_ f.smoothLocus) ∧
      (∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
        [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
        ∀ x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f,
          ∃ x₁ : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) (v ≫ f),
            x₁.1 ≫ v = x.1) ∧
      (∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
        [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
        ∀ x₁ : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) (v ≫ f),
          smoothnessDefect (v ≫ f) x₁.1 + 1 ≤ max 1 (smoothnessDefect f (x₁.1 ≫ v)))
NeronModelInfra.SmootheningIteration.Smoothening.gfm

The actual morphism on generic fibres induced by a morphism of models.

Source context 13 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TopologicalSpace
namespace Smoothening
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
def gfm {X' X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) (u : X' ⟶ X) :
    pullback (u ≫ f) (specGenericFibreInclusion R K) ⟶ pullback f (specGenericFibreInclusion R K)
NeronModelInfra.SmootheningIteration.Smoothening.gfm_fst
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TopologicalSpace
namespace Smoothening
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
omit [IsDomain R] [IsDiscreteValuationRing R] [IsFractionRing R K] in
theorem gfm_fst {X' X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) (u : X' ⟶ X) :
    gfm K f u ≫ pullback.fst f (specGenericFibreInclusion R K) =
      pullback.fst (u ≫ f) (specGenericFibreInclusion R K) ≫ u
NeronModelInfra.SmootheningIteration.Smoothening.gfm_snd
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TopologicalSpace
namespace Smoothening
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
omit [IsDomain R] [IsDiscreteValuationRing R] [IsFractionRing R K] in
theorem gfm_snd {X' X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) (u : X' ⟶ X) :
    gfm K f u ≫ pullback.snd f (specGenericFibreInclusion R K) =
      pullback.snd (u ≫ f) (specGenericFibreInclusion R K)
NeronModelInfra.SmootheningIteration.Smoothening.isIso_gfm_comp
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TopologicalSpace
namespace Smoothening
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
omit [IsDomain R] [IsDiscreteValuationRing R] [IsFractionRing R K] in
theorem isIso_gfm_comp {X'' X' X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) (u : X' ⟶ X)
    (w : X'' ⟶ X') [IsIso (gfm K f u)] [IsIso (gfm K (u ≫ f) w)] : IsIso (gfm K f (w ≫ u))
NeronModelInfra.SmootheningIteration.Smoothening.smooth_snd_of_isIso_gfm
Source context 14 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TopologicalSpace
namespace Smoothening
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
omit [IsDomain R] [IsDiscreteValuationRing R] [IsFractionRing R K] in
theorem smooth_snd_of_isIso_gfm {X' X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) (u : X' ⟶ X)
    (hK : Smooth (pullback.snd f (specGenericFibreInclusion R K))) [IsIso (gfm K f u)] :
    Smooth (pullback.snd (u ≫ f) (specGenericFibreInclusion R K))
NeronModelInfra.SmootheningIteration.Smoothening.smoothen_of_le
Source context 13 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TopologicalSpace
namespace Smoothening
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
theorem smoothen_of_le (n : ℕ) :
    ∀ {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f] [QuasiCompact f],
      Smooth (pullback.snd f (specGenericFibreInclusion R K)) →
      (∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
        [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
        ∀ x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f,
          smoothnessDefect f x.1 ≤ n) →
      ∃ (X' : Scheme.{u}) (u : X' ⟶ X),
        IsSeparated u ∧ LocallyOfFiniteType (u ≫ f) ∧ QuasiCompact (u ≫ f) ∧
        IsIso (gfm K f u) ∧
        (∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
          [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
          ∀ x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f,
            ∃ x' : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) (u ≫ f),
              x'.1 ≫ u = x.1) ∧
        (∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
          [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
          ∀ x' : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) (u ≫ f),
            smoothnessDefect (u ≫ f) x'.1 = 0)
NeronModelInfra.SmootheningIteration.Smoothening.isIso_gfm_smoothLocus_ι
Source context 13 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TopologicalSpace
namespace Smoothening
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
theorem isIso_gfm_smoothLocus_ι {X : Scheme.{u}} (g : X ⟶ Spec (CommRingCat.of R))
    [LocallyOfFiniteType g]
    (hK : Smooth (pullback.snd g (specGenericFibreInclusion R K))) :
    IsIso (gfm K g g.smoothLocus.ι)
NeronModelInfra.SmootheningIteration.Smoothening.main
Source context 13 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra.SmootheningIteration
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry NeronModelInfra TopologicalSpace
namespace Smoothening
variable {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
variable (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
theorem main {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f]
    [QuasiCompact f]
    (hK : Smooth (pullback.snd f (specGenericFibreInclusion R K))) :
    ∃ (X' : Scheme.{u}) (u : X' ⟶ X),
      Smooth (u ≫ f) ∧ QuasiCompact (u ≫ f) ∧ IsSeparated u ∧
      IsIso (gfm K f u) ∧
      ∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
        [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
        ∀ x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f,
          ∃ x' : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) (u ≫ f), x'.1 ≫ u
            = x.1
NeronModelInfra.exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension
Source context 10 commands

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

@[expose] public section
open CategoryTheory CategoryTheory.Limits AlgebraicGeometry Opposite NeronModelInfra
open TensorProduct IsLocalRing TopologicalSpace Topology
open NeronModelInfra.SmootheningBounds.NeronSmootheningBound (smoothnessDefect_comp_eq)
open NeronModelInfra.Dilatations.Construction.AffineCharts
  (primeIdealOf_fromSpec fromSpec_mem mem_basicOpen_iff_notMem)
open SchemeTheory.LocalGeometry.SmoothnessDefect (finiteType_sectionsAlgebra)
universe u v w
section
/-
Anthropic FLT upstream notice: Copyright 2026 Anthropic, PBC.
Released under Apache 2.0 license as described in the file LICENSE.
Adapted Anthropic FLT source (pinned revision):
https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/P2M/Sol/S_NeronModelInfra_exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension.lean
Upstream NOTICE: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/NOTICE
Upstream per-file ATTRIBUTION: https://github.com/anthropics/fermats-last-theorem/blob/6e837e75355538c7f80bab5b956861e86c4eacc2/ATTRIBUTION.md
Copies of these notices are retained in the AbelianVarieties directory.
Existing upstream author/copyright comments in the source are retained below.

Local adaptation and maintenance: Naganori Yamaguchi (https://github.com/n-yamaguchi-0729).
AI assistance in local adaptation and maintenance: OpenAI Codex.
-/
namespace NeronModelInfra
open NeronModelInfra.SmootheningIteration
theorem
    exists_smooth_hom_isIso_genericFibre_lift_of_isIndexOneExtension
    {R : Type u} [CommRing R] [IsDomain R] [IsDiscreteValuationRing R]
    (K : Type u) [Field K] [Algebra R K] [IsFractionRing R K]
    {X : Scheme.{u}} (f : X ⟶ Spec (CommRingCat.of R)) [LocallyOfFiniteType f] [QuasiCompact f]
    (hK : Smooth (pullback.snd f (specGenericFibreInclusion R K))) :
    ∃ (X' : Scheme.{u}) (u : X' ⟶ X),
      Smooth (u ≫ f) ∧ QuasiCompact (u ≫ f) ∧ IsSeparated u ∧
      IsIso (pullback.map (u ≫ f) (specGenericFibreInclusion R K) f (specGenericFibreInclusion R
        K) u
        (𝟙 _) (𝟙 _) (Category.comp_id _) ((Category.comp_id _).trans (Category.id_comp _).symm)) ∧
      ∀ (R' : Type u) [CommRing R'] [IsDomain R'] [IsDiscreteValuationRing R'] [Algebra R R']
        [IsLocalHom (algebraMap R R')], IsIndexOneExtension R R' →
        ∀ x : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) f,
          ∃ x' : SchemeHomOver (Spec.map (CommRingCat.ofHom (algebraMap R R'))) (u ≫ f), x'.1 ≫ u
            = x.1