File size: 7,190 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | /-
Copyright 2025 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file has been modified.
-/
import Mathlib.AlgebraicGeometry.Morphisms.Proper
import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Scheme
import Mathlib.RingTheory.MvPolynomial.Homogeneous
import OAI.CategoryTheory.ConcreteCategory.Notation
import Mathlib.AlgebraicGeometry.ProjectiveSpectrum.Proper
/-! # Projective Space Is -/
namespace OAI.AlgebraicGeometry.Foundations.ProjectiveSpaceIs
open _root_.AlgebraicGeometry
/-!
# Projective space and explicit projective presentations
This file constructs projective space over a scheme as a pullback from `Proj`, proves its
structure morphism proper for finitely many homogeneous coordinates, and packages a closed
embedding into finite-dimensional projective space as an explicit projective presentation.
The original projective-space construction was contributed to Mathlib in
[`mathlib4` pull request #26061](https://github.com/leanprover-community/mathlib4/pull/26061).
-/
-- The contents of this file will be in mathlib as of #26061
universe u v
open _root_.CategoryTheory Limits _root_.MvPolynomial
variable (n : Type v) (S : Scheme.{max u v})
local notation "β€[" n "]" => homogeneousSubmodule n β€
local notation3 "β€[" n "].{" u "," v "}" => homogeneousSubmodule n (ULift.{max u v} β€)
attribute [local instance] MvPolynomial.gradedAlgebra
/-- Let `S` be a scheme and `n` an index set for homogeneous coordinates. This is projective space
over `S`, defined by base change to `S` of `Proj(β€[x_i | i β n])` with each variable in degree
one. For `n = Fin (d+1)`, this is the usual `d`-dimensional projective space `β^d_S`. -/
noncomputable def ProjectiveSpace : Scheme.{max u v} :=
pullback (terminal.from S) (terminal.from (Proj β€[n].{u, v}))
/-- `β(n; S)` is projective space over `S` with homogeneous coordinates indexed by `n`. -/
scoped [AlgebraicGeometry] notation "β("n"; "S")" => OAI.AlgebraicGeometry.Foundations.ProjectiveSpaceIs.ProjectiveSpace n S
namespace ProjectiveSpace
/-- Let `R` be a commutative ring and `n` an index set of polynomial variables, each assigned degree
one. The degree-zero homogeneous subring of `R[x_i | i β n]` is isomorphic to `R`: this
equivalence takes the constant coefficient, with inverse the inclusion of constant polynomials. -/
noncomputable def degreeZeroEquiv (R : Type*) [CommRing R] :
homogeneousSubmodule n R 0 β+* R where
toFun f := f.1.coeff 0
invFun r := β¨C r, isHomogeneous_C n rβ©
left_inv f := Subtype.ext (totalDegree_eq_zero_iff_eq_C.mp
((totalDegree_zero_iff_isHomogeneous n).mpr f.2)).symm
right_inv r := coeff_zero_C r
map_mul' x y := by
have hx := totalDegree_eq_zero_iff_eq_C.mp
((totalDegree_zero_iff_isHomogeneous n).mpr x.2)
have hy := totalDegree_eq_zero_iff_eq_C.mp
((totalDegree_zero_iff_isHomogeneous n).mpr y.2)
change (x.1 * y.1).coeff 0 = x.1.coeff 0 * y.1.coeff 0
rw [hx, hy, β map_mul, coeff_zero_C, coeff_zero_C, coeff_zero_C]
map_add' _ _ := rfl
/-- A polynomial ring in finitely many variables is of finite type over its degree-zero
homogeneous subring. -/
noncomputable instance degreeZeroFiniteType [Finite n] (R : Type*) [CommRing R] :
Algebra.FiniteType (homogeneousSubmodule n R 0) (MvPolynomial n R) := by
rw [β RingHom.finiteType_algebraMap]
have hC : (C : R β+* MvPolynomial n R).FiniteType := by
rw [β MvPolynomial.algebraMap_eq]
exact RingHom.finiteType_algebraMap.mpr inferInstance
have he : (degreeZeroEquiv n R).toRingHom.FiniteType :=
RingHom.FiniteType.of_surjective _ (degreeZeroEquiv n R).surjective
have h := hC.comp he
convert h using 1
exact RingHom.ext fun x β¦ totalDegree_eq_zero_iff_eq_C.mp
((totalDegree_zero_iff_isHomogeneous n).mpr x.2)
/-- Projective space on finitely many homogeneous coordinates is proper over the terminal
scheme. -/
noncomputable instance terminalProjProper [Finite n] :
IsProper (terminal.from (Proj β€[n].{u, v})) := by
have hterminal : IsTerminal (Spec β§(β€[n].{u, v} 0)) :=
IsTerminal.ofIso specULiftZIsTerminal
(Scheme.Spec.mapIso
(degreeZeroEquiv n (ULift.{max u v} β€)).toCommRingCatIso.op)
have := isIso_of_isTerminal hterminal terminalIsTerminal (terminal.from _)
rw [β terminal.comp_from (Proj.toSpecZero β€[n].{u, v}),
MorphismProperty.cancel_right_of_respectsIso (P := @IsProper)]
infer_instance
/-- Let `S` be a scheme and `n` an index set of homogeneous coordinates. This is the structure
morphism `β(n; S) β S`, the projection from the base change of `Proj(β€[x_i | i β n])` to `S`. -/
noncomputable def toBase : β(n; S) βΆ S :=
pullback.fst (terminal.from S) (terminal.from (Proj β€[n].{u, v}))
/-- Finite-dimensional projective space is proper over its base. -/
noncomputable instance toBaseProper [Finite n] : IsProper (toBase n S) := by
change IsProper (pullback.fst (terminal.from S) (terminal.from (Proj β€[n].{u, v})))
infer_instance
universe w
variable {X T : Scheme.{w}}
/-- Let `f: X β T` be a morphism of schemes. A projective presentation consists of a natural number
`d` and a closed immersion `i: X β β^d_T` such that the composite of `i` with the projection
`β^d_T β T` is `f`. -/
structure Presentation (f : X βΆ T) where
/-- The dimension of the ambient projective space. -/
ambientDimension : β
/-- The closed embedding into projective space. -/
immersion : X βΆ β(Fin (ambientDimension + 1); T)
[isClosedImmersion : IsClosedImmersion immersion]
/-- The embedding is a morphism over the base scheme. -/
immersion_toBase :
immersion β« toBase (Fin (ambientDimension + 1)) T = f
end ProjectiveSpace
open OAI.AlgebraicGeometry.Foundations.ProjectiveSpaceIs.ProjectiveSpace
universe w
variable {X T : Scheme.{w}}
/-- A morphism of schemes `f: X β T` is projective here if there exist a natural number `d` and a
closed immersion `X β β^d_T` whose composite with the projection to `T` is `f`. -/
class IsProjective (f : X βΆ T) : Prop where
/-- A finite-dimensional projective presentation exists. -/
nonempty_presentation : Nonempty (ProjectiveSpace.Presentation f)
/-- A projective morphism in the explicit-presentation sense is proper. -/
instance IsProjective.isProper {f : X βΆ T} [h : IsProjective f] : IsProper f := by
obtain β¨Pβ© := h.nonempty_presentation
let : IsClosedImmersion P.immersion := P.isClosedImmersion
have hcomp : IsProper
(P.immersion β« ProjectiveSpace.toBase (Fin (P.ambientDimension + 1)) T) := by
infer_instance
rwa [P.immersion_toBase] at hcomp
end OAI.AlgebraicGeometry.Foundations.ProjectiveSpaceIs
|