[{"data":1,"prerenderedAt":4},["ShallowReactive",2],{"Q8X2VSPRwQ":3},"# Formalizing Görtz-Wedhorn's Algebraic Geometry in Lean 4\n\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-lightblue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Lean 4](https://img.shields.io/badge/Lean-4.24.0-blue.svg)](https://leanprover-community.github.io/)\n[![Mathlib](https://img.shields.io/badge/Mathlib-4.24.0-blue.svg)](https://github.com/leanprover-community/mathlib4)\n\nA formalization project in **Lean 4** of selected results from Ulrich Görtz and Torsten Wedhorn's *\"Algebraic Geometry I\"* (2nd Edition). This repository serves as a portfolio demonstration of formal mathematics and proof verification capabilities in modern algebraic geometry.\n\n## Project Overview\n\nThis project formalizes selected results from Ulrich Görtz and Torsten Wedhorn's *Algebraic Geometry I* (2nd Edition) using Lean 4. The work focuses on building foundational infrastructure in scheme theory and dimension theory, with the long-term objective of formalizing significant theorems such as Bézout's theorem or Zariski's Main Theorem.\n\n### Reference and Methodology\n\n- **Primary Source**: Ulrich Görtz and Torsten Wedhorn, *Algebraic Geometry I*, 2nd Edition\n- **Current Focus**: Chapter 5 (Schemes) and topological Krull dimension theory\n- **Long-term Goals**: Major theorems including Bézout's theorem, Zariski's Main Theorem, and cohomological results\n\n### Current Progress\n\n**Completed Formalizations:**\n- **Lemma 5.7 (Görtz-Wedhorn)**: Complete formalization of fundamental topological Krull dimension properties\n  - Dimension inequality for subspaces: `dim(Y) ≤ dim(X)`\n  - Strict inequality for proper closed subsets of irreducible spaces\n  - Dimension formula via open covers: `dim(X) = sup{dim(U_i)}`\n  - Dimension formula via irreducible components: `dim(X) = sup{dim(Y)}`\n  - Scheme dimension characterization via local rings: `dim(X) = sup{dim(O_{X,x})}`\n\n**Supporting Infrastructure:**\n- **Reduced closed subschemes**: Construction of the unique reduced closed subscheme structure on a given closed subset of a scheme, using vanishing ideal sheaves and radical constructions\n\n**Code Statistics:**\n- Total formalization: approximately 800 lines of Lean 4 code\n- Main dimension theory file: 675 lines\n- Scheme construction utilities: 133 lines\n\n## Setup and Installation\n\n### Prerequisites\n- [Lean 4](https://leanprover-community.github.io/get_started.html) (version 4.24.0)\n- [Lake](https://github.com/leanprover/lake) build system\n- Git\n\n### Quick Start\n```bash\ngit clone https://github.com/ADA-Projects/Lean-AG.git\ncd Lean-AG\nlake exe cache get\nlake build\n```\n\n## Repository Structure\n\n```\nLean-AG/\n├── GWchap5/                         # Main formalization directory\n│   ├── gw_sect5-3.lean             # Topological Krull dimension theory (675 lines)\n│   └── RedClosedSubscheme.lean   # Reduced closed subscheme construction (133 lines)\n├── GWchap5.lean                    # Root module imports\n├── lakefile.toml                   # Lake build configuration\n├── lean-toolchain                  # Lean version specification\n└── README.md                       # This file\n```\n\n### File Descriptions\n\n- **[`GWchap5/gw_sect5-3.lean`](GWchap5/gw_sect5-3.lean)**: Core dimension theory formalization\n  - Maps between irreducible closed sets induced by continuous functions\n  - Dimension inequalities for embeddings and subspaces\n  - Topological Krull dimension theory\n  - Complete proof of Lemma 5.7 (Görtz-Wedhorn)\n  - Scheme dimension characterization via local rings\n\n- **[`GWchap5/RedClosedSubscheme.lean`](GWchap5/RedClosedSubscheme.lean)**: Scheme-theoretic constructions\n  - Reduced closed subscheme construction for closed subsets\n  - Proof that the construction yields a reduced scheme\n  - Supporting infrastructure for scheme theory\n\n- **[`lakefile.toml`](lakefile.toml)**: Lake build system configuration with Mathlib v4.24.0 dependencies\n- **[`lean-toolchain`](lean-toolchain)**: Specifies Lean 4.24.0 for reproducible builds\n\n## Formalized Theorems\n\n### Lemma 5.7 (Görtz-Wedhorn)\n\nThis foundational lemma establishes basic properties of topological Krull dimension:\n\n```lean\ntheorem thm_scheme_dim :\n  (∀ (X : Type*) [TopologicalSpace X] (Y : Set X),\n    topologicalKrullDim Y ≤ topologicalKrullDim X) ∧\n  (∀ (X : Type*) [TopologicalSpace X] (Y : Set X),\n    IsIrreducible (Set.univ : Set X) →\n    topologicalKrullDim X ≠ ⊤ →\n    IsClosed Y → Y ⊂ Set.univ → Y.Nonempty →\n    topologicalKrullDim Y \u003C topologicalKrullDim X) ∧\n  (∀ (X : Type*) [TopologicalSpace X] (ι : Type*) (U : ι → Set X),\n    (∀ i, IsOpen (U i)) → (⋃ i, U i = Set.univ) →\n    topologicalKrullDim X = ⨆ i, topologicalKrullDim (U i)) ∧\n  (∀ (X : Type*) [TopologicalSpace X],\n    topologicalKrullDim X = ⨆ (Y ∈ irreducibleComponents X), topologicalKrullDim Y) ∧\n  (∀ (X : Scheme), schemeDim X = ⨆ x : X, ringKrullDim (X.presheaf.stalk x))\n```\n\n### Supporting Results\n\n**Maps on Irreducible Closed Sets:**\n- `IrreducibleCloseds.mapOfContinuous`: Maps induced by continuous functions\n- `mapOfContinuous_injective_of_embedding`: Injectivity for embeddings\n- `mapOfContinuous_strictMono_of_embedding`: Strict monotonicity for embeddings\n\n**Dimension Theory:**\n- `topologicalKrullDim_subspace_le`: Dimension inequality for subspaces\n- `topological_dim_proper_closed_subset_lt`: Strict inequality for proper closed subsets\n- `topological_dim_open_cover`: Dimension via open covers\n- `topological_dim_irreducible_components`: Dimension via irreducible components\n- `scheme_dim_eq_sup_local_rings`: Scheme dimension via local ring dimensions\n\n**Scheme Constructions:**\n- `reducedClosedSubscheme`: Construction of reduced closed subschemes\n- `reducedClosedSubscheme_ι`: Closed immersion from reduced subscheme\n- `reducedClosedSubscheme_isReduced`: Proof that the construction is reduced\n\n## Development Roadmap\n\n### Near-term\n- Complete fundamental results from Chapter 5\n- Additional scheme-theoretic constructions and morphism properties\n\n### Medium-term\n- Intersection theory foundations\n- Projective geometry and varieties\n- Major theorems: Bézout's theorem, Zariski's Main Theorem\n\n### Long-term\n- Cohomology theory and vanishing theorems\n- Riemann-Roch theorem\n- Advanced topics in algebraic geometry\n\n## References and Acknowledgments\n\n- Ulrich Görtz and Torsten Wedhorn, *\"Algebraic Geometry I\"*, 2nd Edition, Springer (2020)\n- [Mathlib Community](https://leanprover-community.github.io/) for the extensive mathematics library\n- [Lean 4 Manual](https://lean-lang.org/lean4/doc/) for language documentation\n- [Pietro Monticone's LeanProject template](https://github.com/pitmonticone/LeanProject) for the project structure and blueprint configuration\n\n---\n\n**Note**: This is an active formalization project. The code compiles with Lean 4.24.0 and Mathlib 4.24.0.\n",1794686188683]