Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

| 1 | module |
| 2 | |
| 3 | public import Mathlib.Algebra.Group.MinimalAxioms |
| 4 | public import Mathlib.AlgebraicGeometry.Morphisms.SchemeTheoreticallyDominant |
| 5 | public import Mathlib.Combinatorics.Quiver.ReflQuiver |
| 6 | public import Mathlib.Order.CompletePartialOrder |
| 7 | import Mathlib.AlgebraicGeometry.Modules.Sheaf |
| 8 | import Mathlib.AlgebraicGeometry.Morphisms.WeaklyEtale |
| 9 | import Mathlib.AlgebraicGeometry.Sites.Fpqc |
| 10 | import Mathlib.CategoryTheory.EffectiveEpi.Comp |
| 11 | import Mathlib.CategoryTheory.ExtremalEpi |
| 12 | import Mathlib.RingTheory.FreeCommRing |
| 13 | import TauCeti.AlgebraicGeometry.Scheme.AffinePoints |
| 14 | import TauCeti.RingTheory.Spectrum.Prime.Topology |
| 15 | public import Lib.Speed |
| 16 | |
| 17 | /-! |
| 18 | # Line bundles on schemes via ring-valued points: descent and the Picard group |
| 19 | |
| 20 | Line bundles on a scheme `X` are described through ring-valued points `t : Spec A ⟶ X`, so that |
| 21 | restriction maps disappear. A function `f : New.PointFn X` gives an element of `A` for every such |
| 22 | point. `New.LandsIn t U` says that `t` lands in the open `U`, and `f` is regular on `U` when it is |
| 23 | natural in `A` on the points of `U`. The file shows that regular functions come from sections and |
| 24 | that functions, sections and frames descend along flat, surjective, quasi-compact morphisms, and it |
| 25 | defines the Picard group with its pull-back. |
| 26 | |
| 27 | ## Main definitions and results |
| 28 | |
| 29 | * `New.LineBundle`: a line bundle as an open cover with a cocycle of regular functions, with the |
| 30 | operations `New.LineBundle.pull`, `New.LineBundle.one`, `New.LineBundle.inv`, |
| 31 | `New.LineBundle.mul`. |
| 32 | * `New.LineBundle.IsSection`, `New.LineBundle.IsFrame`, `New.LineBundle.IsIsomorphic`, |
| 33 | `New.LineBundle.H0`: sections, nowhere vanishing sections, isomorphism, and the module of |
| 34 | sections. |
| 35 | * `New.PointFn.exists_ofSection_glue`: descent of functions along a flat, surjective, quasi-compact |
| 36 | morphism. |
| 37 | * `New.LineBundle.exists_isSection_eq_mul`, `New.LineBundle.exists_isFrame_of_fpqc`: descent of |
| 38 | sections and of frames along a flat, surjective, quasi-compact morphism. |
| 39 | * `New.Pic`, `New.LineBundle.picClass`, `New.Pic.pull`: the Picard group, written additively, the |
| 40 | class of a line bundle, and the pull-back along a morphism. |
| 41 | * `New.Pic.eq_zero_of_isLocalRing`: the Picard group of the spectrum of a local ring is trivial. |
| 42 | |
| 43 | ## Relation to the literature |
| 44 | |
| 45 | These are standard facts on line bundles and faithfully flat descent, in the language of ring-valued |
| 46 | points. |
| 47 | -/ |
| 48 | |
| 49 | @[expose] public section |
| 50 | |
| 51 | noncomputable section |
| 52 | |
| 53 | /-! ## Functions on points, line bundles as cocycles, sections and frames -/ |
| 54 | |
| 55 | section LineBundles |
| 56 | |
| 57 | open CategoryTheory AlgebraicGeometry Spec RingHom |
| 58 | |
| 59 | namespace New |
| 60 | |
| 61 | variable {X Y Z : Scheme.{0}} {ι κ : Type} |
| 62 | |
| 63 | /-! ### Functions on ring-valued points -/ |
| 64 | |
| 65 | /-- For a ring homomorphism `φ : R →+* B`, the induced morphism of schemes `Spec B ⟶ Spec R`. -/ |
| 66 | abbrev specMap {R B : Type} [CommRing R] [CommRing B] (φ : R →+* B) : |
| 67 | Spec (CommRingCat.of B) ⟶ Spec (CommRingCat.of R) := |
| 68 | Spec.map (CommRingCat.ofHom φ) |
| 69 | |
| 70 | /-- The morphism `t : Y ⟶ X` lands in the open `U`, that is, `t ⁻¹ᵁ U` is all of `Y`. -/ |
| 71 | def LandsIn (t : Y ⟶ X) (U : X.Opens) : Prop := ⊤ ≤ t ⁻¹ᵁ U |
| 72 | |
| 73 | /-- Functions on ring-valued points of `X`: rules attaching an element of `A` to every point |
| 74 | `Spec A ⟶ X`, for every ring `A`, with no compatibility required. -/ |
| 75 | abbrev PointFn (X : Scheme) : Type 1 := ∀ A : CommRingCat, (Spec.{0} A ⟶ X) → A |
| 76 | |
| 77 | variable {t : Y ⟶ X} {U : X.Opens} (f : PointFn X) |
| 78 | |
| 79 | /-- A point `t` lands in `U ⊓ V` iff it lands in both `U` and `V`. -/ |
| 80 | @[simp] |
| 81 | lemma landsIn_inf {V : X.Opens} : LandsIn t (U ⊓ V) ↔ LandsIn t U ∧ LandsIn t V := by |
| 82 | rw [LandsIn, Scheme.Hom.preimage_inf, le_inf_iff, LandsIn, LandsIn] |
| 83 | |
| 84 | /-- Any point `t` lands in the top open subscheme `⊤`. -/ |
| 85 | @[simp] |
| 86 | lemma landsIn_top : LandsIn t ⊤ := le_rfl |
| 87 | |
| 88 | /-- A point `s` lands in the preimage open `t ⁻¹ᵁ U` iff `s ≫ t` lands in `U`. -/ |
| 89 | @[simp] |
| 90 | lemma landsIn_preimage {s : Z ⟶ Y} : LandsIn s (t ⁻¹ᵁ U) ↔ LandsIn (s ≫ t) U := .rfl |
| 91 | |
| 92 | /-- If `t` lands in `U`, then its precomposition with any morphism `a ≫ t` lands in `U`. -/ |
| 93 | lemma LandsIn.comp (ht : LandsIn t U) (a : Z ⟶ Y) : LandsIn (Y := Z) (a ≫ t) U := by |
| 94 | simpa [LandsIn] using a.preimage_mono ht |
| 95 | |
| 96 | /-- The function `f` is regular on `U`: for points `t : Spec A ⟶ X` landing in `U`, its value |
| 97 | commutes with all ring maps `φ : A ⟶ B`. -/ |
| 98 | def PointFn.IsRegularOn (U : X.Opens) : Prop := |
| 99 | ∀ ⦃A B : CommRingCat⦄ (φ : A ⟶ B) (t : Spec A ⟶ X), LandsIn t U → f B (Spec.map φ ≫ t) = φ (f A t) |
| 100 | |
| 101 | /-- For a point `t : Spec A ⟶ X` landing in `U`, the ring map `Γ(X, U) ⟶ A` evaluating sections |
| 102 | at `t`. -/ |
| 103 | def PointFn.evalSection {A : CommRingCat} (t : Spec A ⟶ X) (h : LandsIn t U) : Γ(X, U) ⟶ A := |
| 104 | t.appLE U ⊤ h ≫ (Scheme.ΓSpecIso A).hom |
| 105 | |
| 106 | open scoped Classical in |
| 107 | /-- The function on points given by a section `s` over `U`: its value at `t` is the pull-back of |
| 108 | `s` along `t` if `t` lands in `U`, and `0` otherwise. -/ |
| 109 | def PointFn.ofSection : Γ(X, U) →ₙ+* PointFn X where |
| 110 | toFun s _ t := if h : LandsIn t U then evalSection t h s else 0 |
| 111 | map_mul' := by aesop |
| 112 | map_zero' := by aesop |
| 113 | map_add' := by aesop |
| 114 | |
| 115 | variable (X ι) in |
| 116 | /-- A line bundle on X as an open cover U_i with transition functions g_ij regular on U_i ∩ U_j, |
| 117 | satisfying g_ii = 1 and g_ij g_jk = g_ik (`opens i` is U_i, `transition i j` is g_ij). -/ |
| 118 | @[ext] |
| 119 | structure LineBundle where |
| 120 | /-- The open sets on which the bundle is trivialised. -/ |
| 121 | opens : ι → X.Opens |
| 122 | /-- The transition functions, as functions on ring-valued points of `X`. -/ |
| 123 | transition : ι → ι → PointFn X |
| 124 | /-- The open sets cover `X`. -/ |
| 125 | cover : ⨆ i : ι, opens i = ⊤ := by simp [← iSup_inf_iSup, ← iInf_iSup_eq_of_finite, |
| 126 | LineBundle.cover] |
| 127 | /-- The transition function g_ij is regular on U_i ∩ U_j. -/ |
| 128 | regular (i j : ι) : (transition i j).IsRegularOn (opens i ⊓ opens j) := by |
| 129 | simp_all [PointFn.IsRegularOn, LineBundle.regular _ _ _ _] |
| 130 | /-- The function g_ii is 1 at the points of U_i. -/ |
| 131 | transition_self (i : ι) (A : CommRingCat) (t : Spec A ⟶ X) : |
| 132 | LandsIn t (opens i) → transition i i A t = 1 := by |
| 133 | simp +contextual [LineBundle.transition_self] |
| 134 | /-- The cocycle condition g_ij g_jk = g_ik at the points of U_i ∩ U_j ∩ U_k. -/ |
| 135 | transition_trans (i j k : ι) (A : CommRingCat) (t : Spec A ⟶ X) : |
| 136 | LandsIn t (opens i) → LandsIn t (opens j) → LandsIn t (opens k) → |
| 137 | transition i j A t * transition j k A t = transition i k A t := by |
| 138 | (try simp +contextual [LineBundle.transition_trans, ← Finset.prod_mul_distrib]) <;> |
| 139 | grind [LineBundle.transition_trans] |
| 140 | |
| 141 | variable (L : LineBundle X ι) (M : LineBundle X κ) (R : Type) [CommRing R] [X.Over (Spec ⟨R⟩)] |
| 142 | (p : Y ⟶ X) |
| 143 | |
| 144 | /-- For `p : Y ⟶ X` and a function `f` on ring-valued points of `X`, the function |
| 145 | `t ↦ f (t ≫ p)` on ring-valued points of `Y`. -/ |
| 146 | @[simp] |
| 147 | def PointFn.pull (f : PointFn X) : PointFn Y := |
| 148 | fun (A : CommRingCat) (t : Spec A ⟶ Y) ↦ f A (t ≫ p) |
| 149 | |
| 150 | /-- For a scheme `X` over `R`, a point `t : Spec A ⟶ X` makes `A` an `R`-algebra, and a scalar |
| 151 | `r : R` gives the function sending each such `t` to the image of `r` in `A`. -/ |
| 152 | instance : Algebra R (PointFn X) := |
| 153 | toAlgebra (.pi fun _ ↦ .pi (· ≫ X ↘ Spec ⟨R⟩ |> preimage |>.hom)) |
| 154 | |
| 155 | namespace LineBundle |
| 156 | |
| 157 | /-! ### Operations on line bundles -/ |
| 158 | |
| 159 | /-- The pull-back of the line bundle (U_i, g_ij) along p: Y → X, with cover p⁻¹U_i and |
| 160 | transition functions p*g_ij. -/ |
| 161 | @[simps] |
| 162 | def pull : LineBundle Y ι where |
| 163 | opens i := p ⁻¹ᵁ L.opens i |
| 164 | transition i j := (L.transition i j).pull p |
| 165 | cover := p.iSup_preimage_eq_top L.cover |
| 166 | |
| 167 | /-- The trivial line bundle on X: the single open set X and the transition function 1. -/ |
| 168 | @[simps] |
| 169 | def one {X : Scheme} : LineBundle X Unit where |
| 170 | opens _ := ⊤ |
| 171 | transition _ _ := 1 |
| 172 | |
| 173 | /-- The dual line bundle: the same cover, with (i, j) transition function g_ji. -/ |
| 174 | @[simps] |
| 175 | def inv : LineBundle X ι where |
| 176 | opens := L.opens |
| 177 | transition i j := L.transition j i |
| 178 | |
| 179 | /-- The tensor product L ⊗ M: the cover by the intersections of an open of L with an open of M, with |
| 180 | products of transition functions. -/ |
| 181 | @[simps] |
| 182 | def mul : LineBundle X (ι × κ) where |
| 183 | opens i := L.opens i.1 ⊓ M.opens i.2 |
| 184 | transition i j := L.transition i.1 j.1 * M.transition i.2 j.2 |
| 185 | |
| 186 | /-! ### Sections -/ |
| 187 | |
| 188 | /-- The family (s_i) is a global section of L: each s_i is regular on U_i, and s_i = g_ij s_j at |
| 189 | points landing in U_i and U_j. -/ |
| 190 | def IsSection (s : ι → PointFn X) : Prop := |
| 191 | (∀ i : ι, (s i).IsRegularOn (L.opens i)) ∧ |
| 192 | ∀ (i j : ι) (A : CommRingCat) (t : Spec A ⟶ X), LandsIn t (L.opens i) → LandsIn t (L.opens j) → |
| 193 | s i A t = L.transition i j A t * s j A t |
| 194 | |
| 195 | /-- The family s is a nowhere vanishing global section of L: a section with s_i a unit at every |
| 196 | point landing in U_i. -/ |
| 197 | def IsFrame (s : ι → PointFn X) : Prop := |
| 198 | L.IsSection s ∧ |
| 199 | ∀ (i : ι) (A : CommRingCat) (t : Spec A ⟶ X), LandsIn t (L.opens i) → IsUnit (s i A t) |
| 200 | |
| 201 | /-- The line bundles L and M are isomorphic: L ⊗ M⁻¹ has a nowhere vanishing global section. -/ |
| 202 | def IsIsomorphic : Prop := ∃ u : ι × κ → PointFn X, (L.mul M.inv).IsFrame u |
| 203 | |
| 204 | /-- The R-module of global sections of L, for a scheme X over R. Each s_i is normalised to be zero |
| 205 | at the points that do not land in U_i. -/ |
| 206 | def H0 : Submodule R (ι → PointFn X) where |
| 207 | carrier := |
| 208 | {s : ι → PointFn X | |
| 209 | L.IsSection s ∧ |
| 210 | ∀ (i : ι) (A : CommRingCat) (t : Spec A ⟶ X), ¬LandsIn t (L.opens i) → s i A t = 0} |
| 211 | add_mem' := by |
| 212 | simp [IsSection, PointFn.IsRegularOn] |
| 213 | grind |
| 214 | zero_mem' := by simp [IsSection, PointFn.IsRegularOn] |
| 215 | smul_mem' := by |
| 216 | -- at a point `t` a scalar acts by multiplication with its image in the ring of `t` |
| 217 | simp [IsSection, PointFn.IsRegularOn, HSMul.hSMul, SMul.smul] |
| 218 | grind |
| 219 | |
| 220 | variable {L R} in |
| 221 | /-- A global section in `H0` has regular components satisfying the transition equations. -/ |
| 222 | lemma H0.isSection_val (s : L.H0 R) : L.IsSection s.val := |
| 223 | s.property.1 |
| 224 | |
| 225 | end LineBundle |
| 226 | |
| 227 | end New |
| 228 | |
| 229 | end LineBundles |
| 230 | |
| 231 | namespace New |
| 232 | |
| 233 | /-! |
| 234 | ## Gluing of morphisms, evaluation of sections and fpqc descent |
| 235 | |
| 236 | * `New.PointFn.IsRegularOn.ext_of_dominant_of_isOpenCover`: regular functions are determined by |
| 237 | their pull-backs along a quasi-compact, scheme-theoretically dominant morphism. |
| 238 | -/ |
| 239 | |
| 240 | section PointFunctions |
| 241 | |
| 242 | open CategoryTheory AlgebraicGeometry TopologicalSpace.Opens Scheme TopCat.Presheaf Hom Spec |
| 243 | Limits.pullback EffectiveEpi Category IsLocalRing IsOpenImmersion |
| 244 | open TopologicalSpace (IsOpenCover) |
| 245 | |
| 246 | variable {X Y : Scheme} {κ : Type} |
| 247 | {U : X.Opens} {A B : CommRingCat} {f g : PointFn X} {t : Spec A ⟶ X} (p : Y ⟶ X) (s : Γ(X, U)) |
| 248 | |
| 249 | /-! ### Points that land in an open -/ |
| 250 | |
| 251 | /-- If a morphism `t` lands in `U` and `U ≤ V`, then `t` lands in `V`. -/ |
| 252 | lemma LandsIn.mono {t : Y ⟶ X} {V : X.Opens} (ht : LandsIn t U) (h_le : U ≤ V) : LandsIn t V := |
| 253 | ht.trans (t.preimage_mono h_le) |
| 254 | |
| 255 | /-- For a local ring `B`, a point `z : Spec B ⟶ X` lands in `U` exactly when the image of the closed |
| 256 | point lies in `U`. -/ |
| 257 | lemma landsIn_iff_mem {z : Spec B ⟶ X} [IsLocalRing B] : LandsIn z U ↔ z (closedPoint B) ∈ U := |
| 258 | top_le_iff.trans closed_point_mem_iff.symm |
| 259 | |
| 260 | /-- For a local ring `B`, a point `t : Spec B ⟶ Y` lands in some member of an open cover `V` of |
| 261 | `Y`. -/ |
| 262 | lemma exists_landsIn_of_isOpenCover {V : κ → Y.Opens} (hV : IsOpenCover V) [IsLocalRing B] |
| 263 | (t : Spec B ⟶ Y) : ∃ i : κ, LandsIn t (V i) := by |
| 264 | simpa only [landsIn_iff_mem] using hV.exists_mem (t (closedPoint B)) |
| 265 | |
| 266 | /-- The opens `M.opens` of a line bundle `M` on `Y` form an open cover of `Y`. -/ |
| 267 | lemma LineBundle.isOpenCover (M : LineBundle Y κ) : IsOpenCover M.opens := M.cover |
| 268 | |
| 269 | /-- For a local ring `B`, a point `t : Spec B ⟶ Y` lands in some member of the open cover |
| 270 | `M.opens` of `Y`. -/ |
| 271 | lemma LineBundle.exists_landsIn (M : LineBundle Y κ) [IsLocalRing B] (t : Spec B ⟶ Y) : |
| 272 | ∃ i : κ, LandsIn t (M.opens i) := exists_landsIn_of_isOpenCover M.isOpenCover t |
| 273 | |
| 274 | /-- A morphism that factors through `Spec Γ(X, U) ⟶ X`, for an affine open `U`, lands in `U`. -/ |
| 275 | lemma landsIn_fromSpec (hU : IsAffineOpen U) (t : Y ⟶ Spec Γ(X, U)) : |
| 276 | LandsIn (Y := Y) (t ≫ hU.fromSpec) U := by simp [LandsIn, hU.fromSpec_preimage_self] |
| 277 | |
| 278 | /-- A point lands in the image of an open immersion `c : Spec R ⟶ X` exactly when it factors |
| 279 | through `c`. -/ |
| 280 | lemma landsIn_opensRange {R : CommRingCat} {c : Spec R ⟶ X} [IsOpenImmersion c] : |
| 281 | LandsIn t c.opensRange ↔ ∃ φ : R ⟶ A, Spec.map φ ≫ c = t := by |
| 282 | refine ⟨fun ht ↦ ?_, fun ⟨φ, hφ⟩ ↦ by simp [← hφ, LandsIn]⟩ |
| 283 | have h_range : Set.range t ⊆ Set.range c := Set.range_subset_iff.2 fun y ↦ ht (mem_top y) |
| 284 | exact ⟨preimage (IsOpenImmersion.lift c t h_range), by simp⟩ |
| 285 | |
| 286 | /-- A morphism that factors through the inclusion of `U` lands in `U`. -/ |
| 287 | lemma landsIn_comp_incl {t : Y ⟶ U} : LandsIn (Y := Y) (t ≫ U.ι) U := by simp [LandsIn] |
| 288 | |
| 289 | /-- A morphism landing in an open subscheme factors through its inclusion. -/ |
| 290 | lemma LandsIn.exists_lift {t : Y ⟶ X} (ht : LandsIn t U) : ∃ t' : Y ⟶ U, t' ≫ U.ι = t := |
| 291 | ⟨Y.topIso.inv ≫ t.resLE U ⊤ ht, by |
| 292 | rw [assoc, t.resLE_comp_ι ht, Scheme.toIso_inv_ι_assoc]⟩ |
| 293 | |
| 294 | lemma landsIn_iInf {V : κ → X.Opens} (p : Y ⟶ X) [Finite κ] : |
| 295 | LandsIn p (iInf V) ↔ ∀ a : κ, LandsIn p (V a) := by simp [LandsIn, ← coe_inj, coe_iInf] |
| 296 | |
| 297 | /-! ### Testing and gluing on a cover -/ |
| 298 | |
| 299 | lemma isOpenCover_top : IsOpenCover fun _ : Unit ↦ (⊤ : Y.Opens) := iSup_const |
| 300 | |
| 301 | lemma isOpenCover_preimage {V : κ → X.Opens} (hV : IsOpenCover V) (p : Y ⟶ X) : |
| 302 | IsOpenCover fun i : κ ↦ p ⁻¹ᵁ V i := p.iSup_preimage_eq_top hV |
| 303 | |
| 304 | /-- The intersections of the members of two open covers form an open cover. -/ |
| 305 | lemma isOpenCover_inf {ι : Type} {V : κ → Y.Opens} {W : ι → Y.Opens} (hV : IsOpenCover V) |
| 306 | (hW : IsOpenCover W) : IsOpenCover fun i : κ × ι ↦ V i.1 ⊓ W i.2 := by |
| 307 | rw [IsOpenCover, ← iSup_inf_iSup, hV.iSup_eq_top, hW.iSup_eq_top, top_inf_eq] |
| 308 | |
| 309 | /-- Two morphisms from `Y` are equal if they agree on every ring-valued point that lands in a member |
| 310 | of an open cover `V` of `Y`. -/ |
| 311 | lemma hom_ext_of_isOpenCover {V : κ → Y.Opens} (hV : IsOpenCover V) {f g : Y ⟶ X} |
| 312 | (h : ∀ (i : κ) (A : CommRingCat) (t : Spec A ⟶ Y), LandsIn t (V i) → t ≫ f = t ≫ g) : |
| 313 | f = g := by |
| 314 | -- The members of an affine refinement of the cover are such points. |
| 315 | let 𝒰 : Y.OpenCover := (Y.openCoverOfIsOpenCover V hV).affineRefinement.openCover |
| 316 | exact 𝒰.hom_ext f g fun k ↦ h k.1 _ (𝒰.f k) landsIn_comp_incl |
| 317 | |
| 318 | /-- Two morphisms from `Y` are equal if they agree on every ring-valued point that lands in a |
| 319 | trivialising open of a line bundle `M` on `Y`. -/ |
| 320 | lemma hom_ext_of_cover (M : LineBundle Y κ) {f g : Y ⟶ X} |
| 321 | (h : ∀ (i : κ) (A : CommRingCat) (t : Spec A ⟶ Y), LandsIn t (M.opens i) → t ≫ f = t ≫ g) : |
| 322 | f = g := |
| 323 | hom_ext_of_isOpenCover M.isOpenCover h |
| 324 | |
| 325 | /-- Gluing on an open cover `V` of `Y`. Attach to each point `t : Spec A ⟶ Y` landing in |
| 326 | `V i` (that is, with image inside it) a morphism `F i A t _ : Spec A ⟶ X`, compatibly with |
| 327 | ring maps `φ : A ⟶ B` and change of the index `i`. Then some `f : Y ⟶ X` has `t ≫ f = F i A t _` |
| 328 | for all such `t`. -/ |
| 329 | lemma exists_hom_of_cover {V : κ → Y.Opens} (hV : IsOpenCover V) |
| 330 | (F : (i : κ) → (A : CommRingCat) → (t : Spec A ⟶ Y) → LandsIn t (V i) → (Spec A ⟶ X)) |
| 331 | (h : ∀ (i j : κ) (A B : CommRingCat) (φ : A ⟶ B) (t : Spec A ⟶ Y) |
| 332 | (hi : LandsIn t (V i)) (hj : LandsIn (Spec.map φ ≫ t) (V j)), |
| 333 | F j B (Spec.map φ ≫ t) hj = Spec.map φ ≫ F i A t hi) : |
| 334 | ∃ f : Y ⟶ X, ∀ (i : κ) (A : CommRingCat) (t : Spec A ⟶ Y) (hi : LandsIn t (V i)), |
| 335 | t ≫ f = F i A t hi := by |
| 336 | -- On each member of the cover the rule on affine points induces a morphism. |
| 337 | let F₀ (i : κ) {A : CommRingCat} (t : Spec A ⟶ (V i).toScheme) : Spec A ⟶ X := |
| 338 | F i A (t ≫ (V i).ι) landsIn_comp_incl |
| 339 | -- Every morphism of affine schemes comes from a ring map, so `h` applies to it. |
| 340 | have h_nat (i : κ) {A B : CommRingCat} (φ : Spec B ⟶ Spec A) (t : Spec A ⟶ (V i).toScheme) : |
| 341 | F₀ i (φ ≫ t) = φ ≫ F₀ i t := by |
| 342 | obtain ⟨ψ, rfl⟩ := Spec.map_surjective φ |
| 343 | simpa only [F₀, assoc] using |
| 344 | h i i A B ψ (t ≫ (V i).ι) landsIn_comp_incl (landsIn_comp_incl.comp _) |
| 345 | let G (i : κ) : (V i).toScheme ⟶ X := Scheme.homOfAffinePoints (F₀ i) (h_nat i) |
| 346 | have h_eval (i : κ) {A : CommRingCat} (t : Spec A ⟶ (V i).toScheme) : |
| 347 | t ≫ G i = F₀ i t := Scheme.comp_homOfAffinePoints (F₀ i) (h_nat i) t |
| 348 | have h_same (i j : κ) {A : CommRingCat} (x : Spec A ⟶ (V i).toScheme) |
| 349 | (y : Spec A ⟶ (V j).toScheme) (h_point : x ≫ (V i).ι = y ≫ (V j).ι) : F₀ i x = F₀ j y := by |
| 350 | have hj : LandsIn (Spec.map (𝟙 A) ≫ (x ≫ (V i).ι)) (V j) := by |
| 351 | simpa [h_point] using (landsIn_comp_incl (t := y)) |
| 352 | simpa [F₀, h_point] using (h i j A A (𝟙 A) (x ≫ (V i).ι) landsIn_comp_incl hj).symm |
| 353 | -- The two local maps agree on the overlap because its points have the same image in `Y`. |
| 354 | have hG (i j : κ) : fst (V i).ι (V j).ι ≫ G i = snd (V i).ι (V j).ι ≫ G j := by |
| 355 | refine Scheme.hom_ext_of_forall_spec fun A t ↦ ?_ |
| 356 | rw [← assoc, ← assoc, h_eval, h_eval] |
| 357 | exact h_same i j _ _ (by simp only [assoc, condition]) |
| 358 | let 𝒰 : Y.OpenCover := Y.openCoverOfIsOpenCover V hV |
| 359 | have h_glue (i : κ) : (V i).ι ≫ 𝒰.glueMorphisms G hG = G i := |
| 360 | 𝒰.ι_glueMorphisms G hG i |
| 361 | refine ⟨𝒰.glueMorphisms G hG, fun i A t hi ↦ ?_⟩ |
| 362 | -- A point landing in `V i` factors through this member of the cover. |
| 363 | obtain ⟨t', h_fac⟩ := hi.exists_lift |
| 364 | calc |
| 365 | t ≫ 𝒰.glueMorphisms G hG = t' ≫ G i := by rw [← h_fac, assoc, h_glue] |
| 366 | _ = F₀ i t' := h_eval i t' |
| 367 | _ = F i A t hi := by simp [F₀, h_fac] |
| 368 | |
| 369 | /-- `U ≤ W` holds if every ring-valued point that lands in `U` and in a member of an open cover |
| 370 | `V` of `Y` lands in `W`. -/ |
| 371 | lemma le_of_cover {V : κ → Y.Opens} (hV : IsOpenCover V) {U W : Y.Opens} |
| 372 | (h : ∀ (i : κ) (A : CommRingCat) (t : Spec A ⟶ Y), LandsIn t (V i) → LandsIn t U → |
| 373 | LandsIn t W) : U ≤ W := by |
| 374 | -- Test on the point `Spec 𝒪_x → Y`, which lies in an open exactly when `x` does. |
| 375 | intro x hx |
| 376 | obtain ⟨i, hi⟩ := exists_landsIn_of_isOpenCover hV (Y.fromSpecStalk x) |
| 377 | simpa [landsIn_iff_mem] using h i _ _ hi (by simpa [landsIn_iff_mem] using hx) |
| 378 | |
| 379 | /-! ### Effective epimorphisms -/ |
| 380 | |
| 381 | /-- An effective epimorphism of schemes is scheme-theoretically dominant. -/ |
| 382 | instance [EffectiveEpi p] : IsSchemeTheoreticallyDominant p := by |
| 383 | -- `p` factors through the closed immersion of its image, which is thus an isomorphism. |
| 384 | have : IsIso p.imageι := ExtremalEpi.isIso p p.toImage p.imageι p.toImage_imageι |
| 385 | have h_ker : p.imageι.ker = ⊥ := p.imageι.ker_eq_bot_of_isIso |
| 386 | exact ⟨by rwa [IdealSheafData.ker_subschemeι] at h_ker⟩ |
| 387 | |
| 388 | namespace PointFn |
| 389 | |
| 390 | /-! ### Evaluation of sections -/ |
| 391 | |
| 392 | /-- At a point `t` that lands in `U`, the function of a section `s` is evaluation of `s` at `t`. -/ |
| 393 | lemma ofSection_eq (h : LandsIn t U) (s : Γ(X, U)) : ofSection s A t = evalSection t h s := |
| 394 | dite_eq_left h |
| 395 | |
| 396 | /-- At a point `t` that does not land in `U`, the function of a section over `U` is `0`. -/ |
| 397 | lemma ofSection_eq_zero (h : ¬LandsIn t U) (s : Γ(X, U)) : ofSection s A t = 0 := dite_eq_right h |
| 398 | |
| 399 | /-- Let `W ≤ p ⁻¹ᵁ U`, let `s` be a section over `U`, and let the point `x` land in `W`. The value |
| 400 | at `x` of the pull-back of `s` along `p`, restricted to `W`, is the value of `s` at `x ≫ p`. -/ |
| 401 | lemma ofSection_appLE {x : Spec A ⟶ Y} (p : Y ⟶ X) {W : Y.Opens} (h_le : W ≤ p ⁻¹ᵁ U) |
| 402 | (s : Γ(X, U)) (h : LandsIn x W) : |
| 403 | ofSection (p.appLE U W h_le s) A x = ofSection s A (x ≫ p) := by |
| 404 | have h_comp : LandsIn (x ≫ p) U := landsIn_preimage.1 (h.mono h_le) |
| 405 | have h_eval : evalSection (x ≫ p) h_comp = p.appLE U W h_le ≫ evalSection x h := |
| 406 | (appLE_comp_appLE_assoc x p U W ⊤ h_le h (ΓSpecIso A).hom).symm |
| 407 | simp [ofSection_eq h, ofSection_eq h_comp, h_eval] |
| 408 | |
| 409 | /-- An element `r` of a ring `B`, read as a global section of `Spec B`, has the value `φ r` at the |
| 410 | point given by a ring map `φ : B ⟶ A`. -/ |
| 411 | lemma ofSection_ΓSpecIso_inv (φ : B ⟶ A) (r : B) : |
| 412 | ofSection ((ΓSpecIso B).inv r) A (Spec.map φ) = φ r := by |
| 413 | have h_eval : evalSection (Spec.map φ) landsIn_top = (ΓSpecIso B).hom ≫ φ := |
| 414 | ΓSpecIso_naturality φ |
| 415 | rw [ofSection_eq landsIn_top, h_eval, CommRingCat.comp_apply, Iso.inv_hom_id_apply] |
| 416 | |
| 417 | /-- The function of a section `s` over `U` is regular on `U`. -/ |
| 418 | lemma isRegularOn_ofSection : (ofSection s).IsRegularOn U := by |
| 419 | intro A B φ t ht |
| 420 | rw [← ofSection_appLE t ht s landsIn_top, ofSection_eq ht, evalSection, |
| 421 | CommRingCat.comp_apply, ← ofSection_ΓSpecIso_inv φ, Iso.hom_inv_id_apply] |
| 422 | |
| 423 | /-- At a point that lands in `V`, a section over `U` and its restriction to `V` have the same |
| 424 | value. -/ |
| 425 | lemma ofSection_map {V : X.Opens} (i : Opposite.op U ⟶ Opposite.op V) (ht : LandsIn t V) : |
| 426 | ofSection (U := V) (X.presheaf.map i s) A t = ofSection s A t := by |
| 427 | -- restriction is pull-back along the identity of `X` |
| 428 | have h_res : X.presheaf.map i = appLE (𝟙 X) U V (leOfHom i.unop) := by |
| 429 | rw [appLE, Subsingleton.elim i (homOfLE (leOfHom i.unop)).op] |
| 430 | exact (id_comp _).symm |
| 431 | rw [h_res, ofSection_appLE (𝟙 X) _ s ht, comp_id] |
| 432 | |
| 433 | /-- For `x ∈ U`, the point `Spec 𝒪_x ⟶ X` lands in `U`. -/ |
| 434 | lemma landsIn_fromSpecStalk {x : X} (hx : x ∈ U) : LandsIn (X.fromSpecStalk x) U := by |
| 435 | simpa [landsIn_iff_mem] using hx |
| 436 | |
| 437 | /-- A point of an affine open `U` is `Spec` of its evaluation map, followed by |
| 438 | `Spec Γ(X, U) → X`. -/ |
| 439 | lemma map_evalSection_fromSpec (hU : IsAffineOpen U) (h : LandsIn t U) : |
| 440 | Spec.map (evalSection t h) ≫ hU.fromSpec = t := by |
| 441 | simp [evalSection, hU.SpecMap_appLE_fromSpec t (isAffineOpen_top _) h, IsAffineOpen.fromSpec_top] |
| 442 | |
| 443 | /-- Two `A`-valued points of an affine open `U` are equal if all sections over `U` have the same |
| 444 | value at them. -/ |
| 445 | lemma point_eq_of_ofSection_eq {x t : Spec A ⟶ X} (hU : IsAffineOpen U) (ht : LandsIn t U) |
| 446 | (hx : LandsIn x U) (h_val : ∀ s : Γ(X, U), ofSection s A t = ofSection s A x) : t = x := by |
| 447 | have h_eval : evalSection t ht = evalSection x hx := |
| 448 | ConcreteCategory.hom_ext _ _ fun s ↦ by rw [← ofSection_eq ht, ← ofSection_eq hx, h_val] |
| 449 | rw [← map_evalSection_fromSpec hU ht, h_eval, map_evalSection_fromSpec hU hx] |
| 450 | |
| 451 | /-- At the point of an affine open `U` given by a ring map `φ : Γ(X, U) ⟶ A`, the value of `s` is |
| 452 | `φ s`. -/ |
| 453 | @[simp] |
| 454 | lemma ofSection_map_fromSpec (hU : IsAffineOpen U) (s : Γ(X, U)) (φ : Γ(X, U) ⟶ A) : |
| 455 | ofSection s A (Spec.map φ ≫ hU.fromSpec) = φ s := by |
| 456 | have h_eval : evalSection (Spec.map φ ≫ hU.fromSpec) (landsIn_fromSpec hU _) = φ := by |
| 457 | apply map_injective |
| 458 | rw [← cancel_mono hU.fromSpec, map_evalSection_fromSpec] |
| 459 | rw [ofSection_eq (landsIn_fromSpec hU _), h_eval] |
| 460 | |
| 461 | /-- For `x ∈ U`, the value of a section `s` over `U` at the point `Spec 𝒪_x ⟶ X` is the germ of |
| 462 | `s` at `x`. -/ |
| 463 | lemma ofSection_fromSpecStalk {x : X} (hx : x ∈ U) (s : Γ(X, U)) : |
| 464 | ofSection s (X.presheaf.stalk x) (X.fromSpecStalk x) = X.presheaf.germ U x hx s := by |
| 465 | have h_eval : evalSection (X.fromSpecStalk x) (landsIn_fromSpecStalk hx) = |
| 466 | X.presheaf.germ U x hx := by |
| 467 | -- the two restriction maps that occur compose to the identity of `Γ(Spec 𝒪_x, ⊤)` |
| 468 | simp [evalSection, appLE, fromSpecStalk_app hx, ← Functor.map_comp_assoc, |
| 469 | Subsingleton.elim _ (𝟙 _)] |
| 470 | rw [ofSection_eq (landsIn_fromSpecStalk hx), h_eval] |
| 471 | |
| 472 | /-- A point of `U` lands in the basic open of the section `s` exactly when the value of `s` there |
| 473 | is a unit. -/ |
| 474 | lemma landsIn_basicOpen (h : LandsIn t U) (s : Γ(X, U)) : |
| 475 | LandsIn t (X.basicOpen s) ↔ IsUnit (ofSection s A t) := by |
| 476 | -- The preimage of the basic open of `s` is the basic open of its value `a` in `A`, and the |
| 477 | -- latter is all of `Spec A` exactly when `a` generates the unit ideal. |
| 478 | have h_preimage : t ⁻¹ᵁ X.basicOpen s = PrimeSpectrum.basicOpen (evalSection t h s) := by |
| 479 | rw [← top_inf_eq (t ⁻¹ᵁ X.basicOpen s), ← basicOpen_appLE t ⊤ U h s] |
| 480 | exact basicOpen_eq_of_affine' (t.appLE U ⊤ h s) |
| 481 | rw [LandsIn, top_le_iff, h_preimage, ofSection_eq h] |
| 482 | exact PrimeSpectrum.basicOpen_eq_top_iff _ |
| 483 | |
| 484 | /-- The value at `t` of the pull-back of a global section `c` along `p : Y ⟶ X` is the value of `c` |
| 485 | at `t ≫ p`. -/ |
| 486 | lemma ofSection_appTop (c : Γ(X, ⊤)) (A : CommRingCat) (t : Spec A ⟶ Y) : |
| 487 | ofSection (p.appTop c) A t = ofSection c A (t ≫ p) := rfl |
| 488 | |
| 489 | /-- A global section `c` of the open subscheme `U`, read as a section of `X` over `U`, has at |
| 490 | `x ≫ U.ι` the value of `c` at `x`. -/ |
| 491 | lemma ofSection_topIso_hom (c : Γ(U, ⊤)) (x : Spec A ⟶ U.toScheme) : |
| 492 | ofSection (U.topIso.hom c) A (x ≫ U.ι) = ofSection c A x := by |
| 493 | have h_pull : U.ι.appLE U ⊤ (by simp) = U.topIso.inv := U.ι_appLE U ⊤ (by simp) |
| 494 | rw [← ofSection_appLE U.ι (by simp) _ landsIn_top, h_pull, Iso.hom_inv_id_apply] |
| 495 | |
| 496 | /-- Descent of functions along a flat, surjective, quasi-compact `p : Y ⟶ X`. Let `V` be an open |
| 497 | cover of `Y`. If the functions `f a`, regular on `p ⁻¹ᵁ U ⊓ V a`, agree at points with the same |
| 498 | image in `X`, they are pull-backs of one section over `U`. -/ |
| 499 | lemma exists_ofSection_glue (p : Y ⟶ X) [Flat p] [Surjective p] [QuasiCompact p] |
| 500 | {V : κ → Y.Opens} (hV : IsOpenCover V) (f : κ → PointFn Y) |
| 501 | (hf : ∀ a : κ, IsRegularOn (f a) (p ⁻¹ᵁ U ⊓ V a)) |
| 502 | (h : ∀ (a b : κ) (A : CommRingCat) (t s : Spec A ⟶ Y), t ≫ p = s ≫ p → LandsIn (t ≫ p) U → |
| 503 | LandsIn t (V a) → LandsIn s (V b) → f a A t = f b A s) : |
| 504 | ∃ s : Γ(X, U), ∀ (a : κ) (A : CommRingCat) (t : Spec A ⟶ Y), |
| 505 | LandsIn (t ≫ p) U → LandsIn t (V a) → ofSection s A (t ≫ p) = f a A t := by |
| 506 | -- A function is a morphism to the affine line `𝔸 = Spec ℤ[T]`. Glue the `f a` to a morphism |
| 507 | -- `q` on `p ⁻¹ᵁ U`, descend it along the effective epimorphism `p ⁻¹ᵁ U → U`, and pull back `T`. |
| 508 | have in_U {Z : Scheme} (r : Z ⟶ Limits.pullback p U.ι) : LandsIn ((r ≫ fst p U.ι) ≫ p) U := by |
| 509 | simpa only [assoc, condition] using landsIn_comp_incl (t := r ≫ snd p U.ι) |
| 510 | let 𝔸 : Scheme := Spec (CommRingCat.of (FreeCommRing (Fin 1))) |
| 511 | obtain ⟨q, hq⟩ : ∃ q : Limits.pullback p U.ι ⟶ 𝔸, |
| 512 | ∀ (a : κ) (A : CommRingCat) (t : Spec A ⟶ Limits.pullback p U.ι), |
| 513 | LandsIn t (fst p U.ι ⁻¹ᵁ V a) → |
| 514 | t ≫ q = specMap (FreeCommRing.lift ![f a A (t ≫ fst p U.ι)]) := by |
| 515 | refine exists_hom_of_cover (isOpenCover_preimage hV _) _ fun i j A B φ t hi hj ↦ ?_ |
| 516 | have natural : f j B ((map φ ≫ t) ≫ fst p U.ι) = φ (f i A (t ≫ fst p U.ι)) := by |
| 517 | rw [← hf i φ _ (landsIn_inf.2 ⟨in_U t, landsIn_preimage.1 hi⟩), ← assoc] |
| 518 | exact h j i B _ _ rfl (in_U _) hj (landsIn_preimage.1 (hi.comp _)) |
| 519 | rw [← map_comp] |
| 520 | -- both ring maps send the variable to the value in `natural` |
| 521 | refine congrArg Spec.map (CommRingCat.hom_ext (FreeCommRing.hom_ext fun k ↦ ?_)) |
| 522 | simpa using natural |
| 523 | -- By `h`, the morphism `q` is constant on the fibres of `p`. |
| 524 | have descends {Z : Scheme} (a b : Z ⟶ Limits.pullback p U.ι) |
| 525 | (hab : a ≫ snd p U.ι = b ≫ snd p U.ι) : a ≫ q = b ≫ q := by |
| 526 | refine hom_ext_of_isOpenCover (isOpenCover_inf (isOpenCover_preimage hV (a ≫ fst p U.ι)) |
| 527 | (isOpenCover_preimage hV (b ≫ fst p U.ι))) fun i A r hr ↦ ?_ |
| 528 | -- At a point `r` of `Z`, `hq` computes both sides; `r ≫ a` and `r ≫ b` have the same image |
| 529 | -- in `X` by `hab` and `condition`, so the values of the `f` there agree by `h`. |
| 530 | obtain ⟨ha, hb⟩ : LandsIn ((r ≫ a) ≫ fst p U.ι) (V i.1) ∧ |
| 531 | LandsIn ((r ≫ b) ≫ fst p U.ι) (V i.2) := by simpa using hr |
| 532 | have h_image : ((r ≫ a) ≫ fst p U.ι) ≫ p = ((r ≫ b) ≫ fst p U.ι) ≫ p := by |
| 533 | simp [condition, reassoc_of% hab] |
| 534 | rw [← assoc, ← assoc, hq i.1 A _ ha, hq i.2 A _ hb, h i.1 i.2 A _ _ h_image (in_U _) ha hb] |
| 535 | let d : U.toScheme ⟶ 𝔸 := desc (snd p U.ι) q descends |
| 536 | let T : Γ(𝔸, ⊤) := (ΓSpecIso _).inv (FreeCommRing.of 0) |
| 537 | refine ⟨U.topIso.hom (d.appTop T), fun a A t ht hta ↦ ?_⟩ |
| 538 | -- Factor `t ≫ p` through `U`, and `t` through the fibre product. |
| 539 | obtain ⟨tU, htU⟩ := ht.exists_lift |
| 540 | have value : tU ≫ d = specMap (FreeCommRing.lift ![f a A t]) := by |
| 541 | rw [← lift_snd t tU htU.symm, assoc, fac, |
| 542 | hq a A (Limits.pullback.lift t tU htU.symm) (by rwa [landsIn_preimage, lift_fst]), lift_fst] |
| 543 | -- The value of `d^* T` at `tU` is the value of `T` at `tU ≫ d`, which is `f a A t` by `value`. |
| 544 | rw [← htU, ofSection_topIso_hom, ofSection_appTop, value, ofSection_ΓSpecIso_inv] |
| 545 | simp |
| 546 | |
| 547 | namespace IsRegularOn |
| 548 | |
| 549 | /-! ### Regular functions -/ |
| 550 | |
| 551 | /-- A function that is regular on `U` agrees, at the points of `U`, with the function of a section |
| 552 | over `U`. -/ |
| 553 | lemma exists_ofSection (hf : f.IsRegularOn U) : |
| 554 | ∃ s : Γ(X, U), ∀ (A : CommRingCat) (t : Spec A ⟶ X), LandsIn t U → ofSection s A t = f A t := by |
| 555 | -- this is descent along the identity of `X`, with the cover of `X` by one open |
| 556 | simpa using exists_ofSection_glue (𝟙 X) isOpenCover_top (fun _ ↦ f) |
| 557 | (fun _ ↦ by simpa [IsRegularOn] using hf) (by simp +contextual) |
| 558 | |
| 559 | /-- If `f` is regular on `U`, its pull-back along `p : Y ⟶ X` is regular on the preimage of `U`. -/ |
| 560 | lemma pull (hf : f.IsRegularOn U) : (f.pull p).IsRegularOn (p ⁻¹ᵁ U) := by aesop_cat |
| 561 | |
| 562 | /-- A function that is regular on `U` is regular on every smaller open `V ≤ U`. -/ |
| 563 | lemma mono (hf : f.IsRegularOn U) {V : X.Opens} (h_le : V ≤ U) : f.IsRegularOn V := |
| 564 | fun _ _ φ t ht ↦ hf φ t (ht.mono h_le) |
| 565 | |
| 566 | /-- The product of a function regular on `U` and one regular on `V` is regular on `U ⊓ V`. -/ |
| 567 | lemma mul (hf : f.IsRegularOn U) {V : X.Opens} (hg : g.IsRegularOn V) : |
| 568 | (f * g).IsRegularOn (U ⊓ V) := by |
| 569 | intro A B φ t ht |
| 570 | obtain ⟨htU, htV⟩ : LandsIn t U ∧ LandsIn t V := landsIn_inf.1 ht |
| 571 | simp [hf φ t htU, hg φ t htV] |
| 572 | |
| 573 | /-- Let `p : Y ⟶ X` be quasi-compact and scheme-theoretically dominant, and let `V` be an open |
| 574 | cover of `Y`. Functions `f`, `g` regular on `U` agree at the points of `U` if their pull-backs |
| 575 | agree at the points of each `p ⁻¹ᵁ U ⊓ V a`. -/ |
| 576 | lemma ext_of_dominant_of_isOpenCover (p : Y ⟶ X) [IsSchemeTheoreticallyDominant p] |
| 577 | [QuasiCompact p] (hf : f.IsRegularOn U) (hg : g.IsRegularOn U) |
| 578 | {V : κ → Y.Opens} (hV : IsOpenCover V) |
| 579 | (h : ∀ (a : κ) (A : CommRingCat) (t : Spec A ⟶ Y), LandsIn (t ≫ p) U → LandsIn t (V a) → |
| 580 | f A (t ≫ p) = g A (t ≫ p)) |
| 581 | (A : CommRingCat) (t : Spec A ⟶ X) (ht : LandsIn t U) : f A t = g A t := by |
| 582 | -- `f` and `g` come from sections `s`, `s'` over `U`, and pulling back sections along `p` is |
| 583 | -- injective. The pull-backs have the same germ at every point `x` of `p ⁻¹ᵁ U`. |
| 584 | obtain ⟨s, hs⟩ := hf.exists_ofSection |
| 585 | obtain ⟨s', hs'⟩ := hg.exists_ofSection |
| 586 | have sections_eq : s = s' := by |
| 587 | refine p.app_injective _ (section_ext Y.sheaf _ _ _ fun x hx ↦ ?_) |
| 588 | have in_U : LandsIn (Y.fromSpecStalk x) (p ⁻¹ᵁ U) := landsIn_fromSpecStalk hx |
| 589 | obtain ⟨a, ha⟩ := exists_landsIn_of_isOpenCover hV (Y.fromSpecStalk x) |
| 590 | -- germs are values at the point `Spec 𝒪_x → Y`, where `h` applies |
| 591 | change Y.presheaf.germ (p ⁻¹ᵁ U) x hx (p.app U s) = Y.presheaf.germ (p ⁻¹ᵁ U) x hx (p.app U s') |
| 592 | rw [← ofSection_fromSpecStalk hx, ← ofSection_fromSpecStalk hx, app_eq_appLE, |
| 593 | ofSection_appLE p le_rfl s in_U, ofSection_appLE p le_rfl s' in_U, hs _ _ in_U, hs' _ _ in_U] |
| 594 | exact h a _ _ in_U ha |
| 595 | rw [← hs A t ht, ← hs' A t ht, sections_eq] |
| 596 | |
| 597 | /-- Let `p : Y ⟶ X` be quasi-compact and scheme-theoretically dominant, and let `M` be a line |
| 598 | bundle on `Y`. Functions `f`, `g` regular on `U` agree at the points of `U` if their pull-backs |
| 599 | agree at the points of each `p ⁻¹ᵁ U ⊓ M.opens a`. -/ |
| 600 | lemma ext_of_dominant (p : Y ⟶ X) (hf : f.IsRegularOn U) (hg : g.IsRegularOn U) |
| 601 | (M : LineBundle Y κ) [IsSchemeTheoreticallyDominant p] [QuasiCompact p] |
| 602 | (h : ∀ (a : κ) (A : CommRingCat) (t : Spec A ⟶ Y), LandsIn (t ≫ p) U → LandsIn t (M.opens a) → |
| 603 | f A (t ≫ p) = g A (t ≫ p)) |
| 604 | (A : CommRingCat) (t : Spec A ⟶ X) (ht : LandsIn t U) : f A t = g A t := |
| 605 | hf.ext_of_dominant_of_isOpenCover p hg M.isOpenCover h A t ht |
| 606 | |
| 607 | end IsRegularOn |
| 608 | |
| 609 | end PointFn |
| 610 | |
| 611 | end PointFunctions |
| 612 | |
| 613 | /-! |
| 614 | ## Descent of sections and frames, the Picard group and its pull-back |
| 615 | |
| 616 | * `New.LineBundle.IsIsomorphic.exists_isFrame`, `New.LineBundle.IsIsomorphic.mul`: having a frame |
| 617 | is invariant under isomorphism, and isomorphism is compatible with tensor products. |
| 618 | -/ |
| 619 | |
| 620 | section PicardGroup |
| 621 | |
| 622 | open CategoryTheory AlgebraicGeometry PointFn Ring LandsIn LineBundle |
| 623 | |
| 624 | variable {X Y Z : Scheme} {ι κ : Type} |
| 625 | {A : CommRingCat} {L : LineBundle X ι} {M : LineBundle X κ} {u s : ι → PointFn X} |
| 626 | (K : LineBundle X ι) (p : Y ⟶ X) (q : Z ⟶ Y) |
| 627 | |
| 628 | namespace LineBundle |
| 629 | |
| 630 | /-- At the points of `K.opens i ⊓ K.opens j` the transition functions `K.transition i j` and |
| 631 | `K.transition j i` of a line bundle are inverse to each other. -/ |
| 632 | lemma transition_mul_transition {i j : ι} {t : Spec A ⟶ X} (hi : LandsIn t (K.opens i)) |
| 633 | (hj : LandsIn t (K.opens j)) : K.transition i j A t * K.transition j i A t = 1 := by |
| 634 | rw [K.transition_trans i j i A t hi hj hi, K.transition_self i A t hi] |
| 635 | |
| 636 | /-- A transition function `K.transition i j` of a line bundle is a unit at the points of |
| 637 | `K.opens i ⊓ K.opens j`. -/ |
| 638 | lemma isUnit_transition {i j : ι} {t : Spec A ⟶ X} (hi : LandsIn t (K.opens i)) |
| 639 | (hj : LandsIn t (K.opens j)) : IsUnit (K.transition i j A t) := |
| 640 | IsUnit.of_mul_eq_one (K.transition j i A t) (transition_mul_transition K hi hj) |
| 641 | |
| 642 | /-- Pulling back along `q ≫ p` is pulling back along `p`, then along `q`. -/ |
| 643 | @[simp] |
| 644 | lemma pull_comp : K.pull (q ≫ p) = (K.pull p).pull q := by |
| 645 | -- Deliberately not `rfl`: with a `rfl` proof the lemma is tagged `@[defeq]`, so `simp` rewrites |
| 646 | -- with it without recording a proof, and the kernel must then check the two pull-backs equal |
| 647 | -- for the concrete `p` and `q` by unfolding them to the structure sheaf. |
| 648 | cases K; rfl |
| 649 | |
| 650 | @[simp] |
| 651 | lemma pull_id : K.pull (𝟙 X) = K := rfl |
| 652 | |
| 653 | /-- Pulling back a section of a line bundle gives a section of the pulled-back bundle. -/ |
| 654 | lemma IsSection.pull (hs : L.IsSection s) (p : Y ⟶ X) : |
| 655 | (L.pull p).IsSection fun i : ι ↦ (s i).pull p := by |
| 656 | aesop (add simp [IsSection, IsRegularOn]) |
| 657 | |
| 658 | /-- Pointwise products of sections of `L` and `M` form a section of their tensor product. -/ |
| 659 | lemma IsSection.mul (hs : L.IsSection s) {r : κ → PointFn X} (hr : M.IsSection r) : |
| 660 | (L.mul M).IsSection fun i : ι × κ ↦ s i.1 * r i.2 := by |
| 661 | refine ⟨fun i ↦ (hs.1 i.1).mul (hr.1 i.2), ?_⟩ |
| 662 | rintro ⟨a, b⟩ ⟨c, d⟩ A t hi hj |
| 663 | obtain ⟨ha, hb⟩ : LandsIn t (L.opens a) ∧ LandsIn t (M.opens b) := by simpa using hi |
| 664 | obtain ⟨hc, hd⟩ : LandsIn t (L.opens c) ∧ LandsIn t (M.opens d) := by simpa using hj |
| 665 | simp [hs.2 a c A t ha hc, hr.2 b d A t hb hd, mul_mul_mul_comm] |
| 666 | |
| 667 | /-- Let `π : Y ⟶ X` be flat, surjective and quasi-compact, let `w` be a section of the pullback of |
| 668 | `M ⊗ L⁻¹` along `π` whose value at a point of `Y` depends only on its image in `X`, and let `s` be |
| 669 | a section of `L`. For each chart `i` of `M`, the products `w (i, a) * s a` over the charts `a` of |
| 670 | `L` descend to one function over `M.opens i` (they agree at points with the same image). -/ |
| 671 | private lemma exists_ofSection_eq_mul (π : Y ⟶ X) [Flat π] [Surjective π] [QuasiCompact π] |
| 672 | {w : κ × ι → PointFn Y} (hw : ((M.mul L.inv).pull π).IsSection w) (hs : L.IsSection s) |
| 673 | (h_fibre : ∀ (i : κ × ι) (B : CommRingCat) (t t' : Spec B ⟶ Y), t ≫ π = t' ≫ π → |
| 674 | LandsIn (t ≫ π) ((M.mul L.inv).opens i) → w i B t = w i B t') (i : κ) : |
| 675 | ∃ r : Γ(X, M.opens i), ∀ (a : ι) (B : CommRingCat) (t : Spec B ⟶ Y), |
| 676 | LandsIn (t ≫ π) (M.opens i) → LandsIn (t ≫ π) (L.opens a) → |
| 677 | ofSection r B (t ≫ π) = w (i, a) B t * s a B (t ≫ π) := by |
| 678 | have h_product := hw.mul (hs.pull π) |
| 679 | refine exists_ofSection_glue π (L.pull π).isOpenCover (fun a ↦ w (i, a) * (s a).pull π) ?_ ?_ |
| 680 | · exact fun a ↦ (h_product.1 ((i, a), a)).mono (by simp [Scheme.Hom.preimage_inf]) |
| 681 | · intro a b B t t' h_image hi ha hb |
| 682 | have ha' : LandsIn (t ≫ π) (L.opens a) := by simpa using ha |
| 683 | have hb' : LandsIn (t ≫ π) (L.opens b) := by simpa [h_image] using hb |
| 684 | -- With the chart of `M` fixed, the two transitions from `L` and `L.inv` cancel. |
| 685 | have h_agree := h_product.2 ((i, a), a) ((i, b), b) B t |
| 686 | (by simp [hi, ha']) (by simp [hi, hb']) |
| 687 | simp [PointFn.pull, |
| 688 | M.transition_self i B _ hi, one_mul, transition_mul_transition L hb' ha'] at h_agree |
| 689 | have h_same := h_fibre (i, b) B t t' h_image (by simp [hi, hb']) |
| 690 | simpa [← h_image, ← h_same] using h_agree |
| 691 | |
| 692 | /-- Let `π : Y ⟶ X` be flat, surjective and quasi-compact, and let `u` be a section of the |
| 693 | pullback of `M ⊗ L⁻¹` along `π` whose value at a point of `Y` depends only on its image in `X`. |
| 694 | Then the product of `u` with a section `s` of `L` descends to a section `r` of `M`, with `r i` |
| 695 | zero at the points that do not land in `M.opens i`. -/ |
| 696 | lemma exists_isSection_eq_mul (π : Y ⟶ X) [Flat π] [Surjective π] [QuasiCompact π] |
| 697 | {u : κ × ι → PointFn Y} (hu : ((M.mul L.inv).pull π).IsSection u) (hs : L.IsSection s) |
| 698 | (h_fibre : ∀ (i : κ × ι) (B : CommRingCat) (t t' : Spec B ⟶ Y), t ≫ π = t' ≫ π → |
| 699 | LandsIn (t ≫ π) ((M.mul L.inv).opens i) → u i B t = u i B t') : |
| 700 | ∃ r : κ → PointFn X, |
| 701 | M.IsSection r ∧ |
| 702 | (∀ (i : κ) (A : CommRingCat) (t : Spec A ⟶ X), ¬LandsIn t (M.opens i) → r i A t = 0) ∧ |
| 703 | ∀ (i : κ) (a : ι) (A : CommRingCat) (t : Spec A ⟶ Y), |
| 704 | LandsIn (t ≫ π) (M.opens i) → LandsIn (t ≫ π) (L.opens a) → |
| 705 | r i A (t ≫ π) = u (i, a) A t * s a A (t ≫ π) := by |
| 706 | have h_product := hu.mul (hs.pull π) |
| 707 | -- For each `i`, the products `u (i, a) * s a` descend to a function `r i` over `M.opens i`. |
| 708 | choose r hr using exists_ofSection_eq_mul π hu hs h_fibre |
| 709 | have r_sec : M.IsSection fun i : κ ↦ ofSection (r i) := by |
| 710 | refine ⟨fun i ↦ isRegularOn_ofSection _, fun i j A t hi hj ↦ ?_⟩ |
| 711 | -- `r i = transition i j * r j` can be tested after composing with `π`, on the cover of |
| 712 | -- `L.pull π` |
| 713 | have h_right : (M.transition i j * ofSection (r j)).IsRegularOn (M.opens i ⊓ M.opens j) := |
| 714 | ((M.regular i j).mul (isRegularOn_ofSection (r j))).mono (by simp) |
| 715 | refine ((isRegularOn_ofSection (r i)).mono inf_le_left).ext_of_dominant_of_isOpenCover π h_right |
| 716 | (L.pull π).isOpenCover (fun a B x hx ha ↦ ?_) A t (landsIn_inf.2 ⟨hi, hj⟩) |
| 717 | obtain ⟨hxi, hxj⟩ := landsIn_inf.1 hx |
| 718 | have hxa : LandsIn (x ≫ π) (L.opens a) := by simpa using ha |
| 719 | -- With the chart of `L` fixed, only the transition from `M` remains. |
| 720 | have h_overlap := h_product.2 ((i, a), a) ((j, a), a) B x |
| 721 | (by simp [hxi, hxa]) (by simp [hxj, hxa]) |
| 722 | rw [Pi.mul_apply, Pi.mul_apply, hr i a B x hxi hxa, hr j a B x hxj hxa] |
| 723 | simpa [PointFn.pull, |
| 724 | L.transition_self a B _ hxa, mul_one] using h_overlap |
| 725 | exact ⟨fun i ↦ ofSection (r i), r_sec, fun i A t ht ↦ ofSection_eq_zero ht (r i), hr⟩ |
| 726 | |
| 727 | /-- Let `p : Y ⟶ X` be surjective. A section `r` of `M` is a frame if its pullback along `p` is |
| 728 | the product of a frame `u` of the pullback of `M ⊗ L⁻¹` and the pullback of a frame `s` of `L`. -/ |
| 729 | lemma IsSection.isFrame_of_eq_mul (p : Y ⟶ X) [Surjective p] {r : κ → PointFn X} |
| 730 | (hr : M.IsSection r) {u : κ × ι → PointFn Y} (hu : ((M.mul L.inv).pull p).IsFrame u) |
| 731 | (hs : L.IsFrame s) |
| 732 | (h_eq : ∀ (i : κ) (a : ι) (A : CommRingCat) (t : Spec A ⟶ Y), |
| 733 | LandsIn (t ≫ p) (M.opens i) → LandsIn (t ≫ p) (L.opens a) → |
| 734 | r i A (t ≫ p) = u (i, a) A t * s a A (t ≫ p)) : |
| 735 | M.IsFrame r := by |
| 736 | obtain ⟨-, u_unit⟩ := hu |
| 737 | obtain ⟨-, s_unit⟩ := hs |
| 738 | refine ⟨hr, fun i A t ht ↦ ?_⟩ |
| 739 | obtain ⟨c, hc⟩ := (hr.1 i).exists_ofSection |
| 740 | -- Upstairs `c` is a product of two units, so the preimage of the open set where `c` is a |
| 741 | -- unit contains the preimage of `M.opens i`; as `p` is surjective, the same holds in `X`. |
| 742 | have h_preimage : p ⁻¹ᵁ M.opens i ≤ p ⁻¹ᵁ X.basicOpen c := by |
| 743 | refine le_of_cover (L.pull p).isOpenCover fun a B x ha hx ↦ ?_ |
| 744 | have hxa : LandsIn (x ≫ p) (L.opens a) := by simpa using ha |
| 745 | have hxi : LandsIn (x ≫ p) (M.opens i) := by simpa using hx |
| 746 | rw [landsIn_preimage, landsIn_basicOpen hxi, hc B _ hxi, h_eq i a B x hxi hxa] |
| 747 | exact (u_unit (i, a) B x (by simp [hxi, hxa])).mul (s_unit a B (x ≫ p) hxa) |
| 748 | have h_le : M.opens i ≤ X.basicOpen c := p.surjective.forall.2 h_preimage |
| 749 | rw [← hc A t ht] |
| 750 | exact (landsIn_basicOpen ht c).1 (ht.mono h_le) |
| 751 | |
| 752 | /-- Let `π : Y ⟶ X` be flat, surjective and quasi-compact, and let `u` be a section of the |
| 753 | pullback of `M ⊗ L⁻¹` along `π` whose value at a point of `Y` depends only on its image in `X`. |
| 754 | Then the product of `u` with a section `s` of `L` descends to a section `r` of `M`, with `r i` |
| 755 | zero off `M.opens i`, which is a frame if `u` and `s` are frames. -/ |
| 756 | lemma exists_section_mul (π : Y ⟶ X) [Flat π] [Surjective π] [QuasiCompact π] |
| 757 | {u : κ × ι → PointFn Y} (hu : ((M.mul L.inv).pull π).IsSection u) (hs : L.IsSection s) |
| 758 | (h_fibre : ∀ (i : κ × ι) (B : CommRingCat) (t t' : Spec B ⟶ Y), t ≫ π = t' ≫ π → |
| 759 | LandsIn (t ≫ π) ((M.mul L.inv).opens i) → u i B t = u i B t') : |
| 760 | ∃ r : κ → PointFn X, |
| 761 | (M.IsSection r ∧ ∀ (i : κ) (A : CommRingCat) (t : Spec A ⟶ X), |
| 762 | ¬LandsIn t (M.opens i) → r i A t = 0) ∧ |
| 763 | (∀ (i : κ) (a : ι) (A : CommRingCat) (t : Spec A ⟶ Y), |
| 764 | LandsIn (t ≫ π) (M.opens i) → LandsIn (t ≫ π) (L.opens a) → |
| 765 | r i A (t ≫ π) = u (i, a) A t * s a A (t ≫ π)) ∧ |
| 766 | (((M.mul L.inv).pull π).IsFrame u → L.IsFrame s → M.IsFrame r) := by |
| 767 | obtain ⟨r, r_sec, r_zero, r_eq⟩ := exists_isSection_eq_mul π hu hs h_fibre |
| 768 | exact ⟨r, ⟨r_sec, r_zero⟩, r_eq, |
| 769 | fun u_frame s_frame ↦ r_sec.isFrame_of_eq_mul π u_frame s_frame r_eq⟩ |
| 770 | |
| 771 | /-- fpqc descent: a line bundle L on X has a nowhere vanishing global section if its pull-back |
| 772 | along a flat, surjective, quasi-compact π: Y → X has one whose values at ring-valued points |
| 773 | depend only on their images under π. -/ |
| 774 | lemma exists_isFrame_of_fpqc (π : Y ⟶ X) [Flat π] [Surjective π] [QuasiCompact π] |
| 775 | {u : ι → PointFn Y} (hu : (L.pull π).IsFrame u) |
| 776 | (h_fibre : ∀ (i : ι) (B : CommRingCat) (t t' : Spec B ⟶ Y), t ≫ π = t' ≫ π → |
| 777 | LandsIn (t ≫ π) (L.opens i) → u i B t = u i B t') : |
| 778 | ∃ s : ι → PointFn X, L.IsFrame s := by |
| 779 | -- Read `u` as a frame of the pull-back of `L ⊗ one⁻¹` and multiply it by the frame `1` of |
| 780 | -- `one`. |
| 781 | have u_frame : ((L.mul one.inv).pull π).IsFrame fun a ↦ u a.1 := by |
| 782 | aesop (add simp [IsFrame, IsSection, IsRegularOn]) |
| 783 | have one_frame : (one : LineBundle X Unit).IsFrame 1 := by simp [IsFrame, IsSection, IsRegularOn] |
| 784 | obtain ⟨s, s_sec, -, s_eq⟩ := exists_isSection_eq_mul π u_frame.1 one_frame.1 |
| 785 | fun a B t t' h_image ha ↦ h_fibre a.1 B t t' h_image (landsIn_inf.1 ha).1 |
| 786 | exact ⟨s, s_sec.isFrame_of_eq_mul π u_frame one_frame s_eq⟩ |
| 787 | |
| 788 | /-- Every line bundle is isomorphic to itself. -/ |
| 789 | lemma IsIsomorphic.refl : K.IsIsomorphic K := by |
| 790 | -- the transition functions `transition i j` form a frame of `K ⊗ K⁻¹` |
| 791 | refine ⟨K.transition.uncurry, ⟨fun i ↦ K.regular i.1 i.2, ?_⟩, ?_⟩ |
| 792 | · rintro ⟨a, b⟩ ⟨c, d⟩ A t hi hj |
| 793 | obtain ⟨ha, hb⟩ : LandsIn t (K.opens a) ∧ LandsIn t (K.opens b) := by simpa using hi |
| 794 | obtain ⟨hc, hd⟩ : LandsIn t (K.opens c) ∧ LandsIn t (K.opens d) := by simpa using hj |
| 795 | simp only [mul_transition, inv_transition, Function.uncurry, Pi.mul_apply] |
| 796 | rw [← K.transition_trans a c b A t ha hc hb, ← K.transition_trans c d b A t hc hd hb] |
| 797 | ring |
| 798 | · rintro ⟨a, b⟩ A t hi |
| 799 | obtain ⟨ha, hb⟩ : LandsIn t (K.opens a) ∧ LandsIn t (K.opens b) := by simpa using hi |
| 800 | exact isUnit_transition K ha hb |
| 801 | |
| 802 | /-- A line bundle `L` that is isomorphic to a line bundle `M` with a frame has a frame itself. -/ |
| 803 | lemma IsIsomorphic.exists_isFrame (h_iso : L.IsIsomorphic M) |
| 804 | (h_frame : ∃ s : κ → PointFn X, M.IsFrame s) : ∃ r : ι → PointFn X, L.IsFrame r := by |
| 805 | obtain ⟨u, hu⟩ := h_iso |
| 806 | obtain ⟨s, hs⟩ := h_frame |
| 807 | obtain ⟨r, r_sec, -, r_eq⟩ := exists_isSection_eq_mul (𝟙 X) hu.1 hs.1 (h_fibre := by simp) |
| 808 | exact ⟨r, r_sec.isFrame_of_eq_mul (𝟙 X) hu hs r_eq⟩ |
| 809 | |
| 810 | /-- Pulling back a frame of a line bundle gives a frame of the pulled-back bundle. -/ |
| 811 | lemma IsFrame.pull (hu : L.IsFrame u) (p : Y ⟶ X) : |
| 812 | (L.pull p).IsFrame fun i : ι ↦ (u i).pull p := |
| 813 | ⟨hu.1.pull p, fun i A t ht ↦ hu.2 i A (t ≫ p) (landsIn_preimage.1 ht)⟩ |
| 814 | |
| 815 | /-- The pointwise inverse of a frame `u` of `L` is a frame of the dual bundle `L.inv`. -/ |
| 816 | lemma IsFrame.inv (hu : L.IsFrame u) : |
| 817 | L.inv.IsFrame fun (i : ι) (A : CommRingCat) (t : Spec A ⟶ X) ↦ inverse (u i A t) := by |
| 818 | obtain ⟨⟨u_regular, u_eq⟩, u_unit⟩ := hu |
| 819 | refine ⟨⟨fun i A B φ t ht ↦ ?_, fun i j A t hi hj ↦ ?_⟩, |
| 820 | fun i A t hi ↦ (u_unit i A t hi).ringInverse⟩ |
| 821 | · -- a ring map sends the inverse of a unit to the inverse of its image |
| 822 | simp only [u_regular i φ t ht] |
| 823 | exact ((u_unit i A t ht).map_ringInverse φ.hom).symm |
| 824 | · -- both sides are inverse to `u i` |
| 825 | have hj_inv : u j A t * inverse (u j A t) = 1 := mul_inverse_cancel _ (u_unit j A t hj) |
| 826 | apply (u_unit i A t hi).mul_left_cancel |
| 827 | rw [mul_inverse_cancel _ (u_unit i A t hi), u_eq i j A t hi hj, inv_transition] |
| 828 | linear_combination |
| 829 | -(u j A t * inverse (u j A t)) * transition_mul_transition L hi hj - hj_inv |
| 830 | |
| 831 | /-- The products of the values of a frame of `L` and a frame of `M` form a frame of `L.mul M`. -/ |
| 832 | lemma IsFrame.mul (hu : L.IsFrame u) {v : κ → PointFn X} (hv : M.IsFrame v) : |
| 833 | (L.mul M).IsFrame fun i : ι × κ ↦ u i.1 * v i.2 := by |
| 834 | refine ⟨hu.1.mul hv.1, ?_⟩ |
| 835 | rintro ⟨a, b⟩ A t hi |
| 836 | obtain ⟨ha, hb⟩ : LandsIn t (L.opens a) ∧ LandsIn t (M.opens b) := by simpa using hi |
| 837 | exact (hu.2 a A t ha).mul (hv.2 b A t hb) |
| 838 | |
| 839 | /-- Let `e : κ → ι` send each open of `M` into an open of `L`, and let the transition function |
| 840 | `M.transition a b` agree with `L.transition (e a) (e b)` at the points of |
| 841 | `M.opens a ⊓ M.opens b`. Then a frame `u` of `L` restricts to the frame `u ∘ e` of `M`. -/ |
| 842 | lemma IsFrame.comp_of_le (hu : L.IsFrame u) (e : κ → ι) |
| 843 | (h_le : ∀ a : κ, M.opens a ≤ L.opens (e a)) |
| 844 | (h_transition : ∀ (a b : κ) (A : CommRingCat) (t : Spec A ⟶ X), |
| 845 | LandsIn t (M.opens a) → LandsIn t (M.opens b) → |
| 846 | M.transition a b A t = L.transition (e a) (e b) A t) : |
| 847 | M.IsFrame (u ∘ e) := by |
| 848 | obtain ⟨⟨u_regular, u_eq⟩, u_unit⟩ := hu |
| 849 | refine ⟨⟨fun a ↦ (u_regular (e a)).mono (h_le a), fun a b A t ha hb ↦ ?_⟩, |
| 850 | fun a A t ha ↦ u_unit (e a) A t (ha.mono (h_le a))⟩ |
| 851 | rw [h_transition a b A t ha hb] |
| 852 | exact u_eq (e a) (e b) A t (ha.mono (h_le a)) (hb.mono (h_le b)) |
| 853 | |
| 854 | /-- Isomorphism of line bundles is compatible with tensor products: if `L ≅ M` and `N ≅ P`, then |
| 855 | `L.mul N` is isomorphic to `M.mul P`. -/ |
| 856 | lemma IsIsomorphic.mul {μ ν : Type} {N : LineBundle X μ} {P : LineBundle X ν} |
| 857 | (hLM : L.IsIsomorphic M) (hNP : N.IsIsomorphic P) : (L.mul N).IsIsomorphic (M.mul P) := by |
| 858 | obtain ⟨u, hu⟩ : ∃ u : ι × κ → PointFn X, (L.mul M.inv).IsFrame u := hLM |
| 859 | obtain ⟨v, hv⟩ : ∃ v : μ × ν → PointFn X, (N.mul P.inv).IsFrame v := hNP |
| 860 | -- `(L ⊗ N) ⊗ (M ⊗ P)⁻¹` is `(L ⊗ M⁻¹) ⊗ (N ⊗ P⁻¹)` up to reindexing the cover |
| 861 | refine ⟨_, (hu.mul hv).comp_of_le (Equiv.prodProdProdComm ι μ κ ν) ?_ ?_⟩ |
| 862 | · rintro ⟨⟨a, b⟩, c, d⟩ |
| 863 | simp [inf_inf_inf_comm (L.opens a)] |
| 864 | · rintro ⟨⟨a, b⟩, c, d⟩ ⟨⟨a', b'⟩, c', d'⟩ A t - - |
| 865 | simp [mul_mul_mul_comm] |
| 866 | |
| 867 | /-- If `u` is a frame of `L`, every section `s` of `L` is `c * u` at the points of the cover, for a |
| 868 | global function `c` on `X`. -/ |
| 869 | lemma IsFrame.exists_eq_mul (hu : L.IsFrame u) (hs : L.IsSection s) : |
| 870 | ∃ c : Γ(X, ⊤), ∀ (i : ι) (A : CommRingCat) (t : Spec A ⟶ X), LandsIn t (L.opens i) → |
| 871 | s i A t = (ofSection c * u i) A t := by |
| 872 | -- the quotients `s i / u i` agree on overlaps, so they glue to a global function `c` |
| 873 | obtain ⟨⟨inv_regular, inv_eq⟩, -⟩ := hu.inv |
| 874 | obtain ⟨s_regular, s_eq⟩ := hs |
| 875 | have h_agree (a b : ι) (A : CommRingCat) (t : Spec A ⟶ X) (ha : LandsIn t (L.opens a)) |
| 876 | (hb : LandsIn t (L.opens b)) : |
| 877 | inverse (u a A t) * s a A t = inverse (u b A t) * s b A t := by |
| 878 | have h_inv : inverse (u a A t) = L.transition b a A t * inverse (u b A t) := |
| 879 | inv_eq a b A t ha hb |
| 880 | rw [h_inv, s_eq a b A t ha hb] |
| 881 | linear_combination (inverse (u b A t) * s b A t) * transition_mul_transition L hb ha |
| 882 | obtain ⟨c, hc⟩ : ∃ c : Γ(X, ⊤), ∀ (a : ι) (A : CommRingCat) (t : Spec A ⟶ X), |
| 883 | LandsIn t (L.opens a) → ofSection c A t = inverse (u a A t) * s a A t := by |
| 884 | simpa using exists_ofSection_glue (𝟙 X) (U := ⊤) L.isOpenCover |
| 885 | (fun a A t ↦ inverse (u a A t) * s a A t) |
| 886 | (fun a ↦ ((inv_regular a).mul (s_regular a)).mono (by simp)) (by simpa using h_agree) |
| 887 | refine ⟨c, fun i A t hi ↦ ?_⟩ |
| 888 | rw [Pi.mul_apply, Pi.mul_apply, hc i A t hi, mul_right_comm, |
| 889 | inverse_mul_cancel _ (hu.2 i A t hi), one_mul] |
| 890 | |
| 891 | end LineBundle |
| 892 | |
| 893 | open Equiv IsIsomorphic Quotient |
| 894 | |
| 895 | /-- Isomorphism of line bundles is symmetric: inverting a frame of `L ⊗ M⁻¹` gives `L⁻¹ ≅ M⁻¹`, |
| 896 | so `M ⊗ L⁻¹ ≅ M ⊗ M⁻¹`, and the latter has a frame. -/ |
| 897 | protected lemma LineBundle.IsIsomorphic.symm (h_iso : L.IsIsomorphic M) : M.IsIsomorphic L := by |
| 898 | obtain ⟨v, hv⟩ := h_iso |
| 899 | have h_mul : (M.mul L.inv).IsIsomorphic (M.mul M.inv) := (IsIsomorphic.refl M).mul ⟨_, hv.inv⟩ |
| 900 | exact h_mul.exists_isFrame (IsIsomorphic.refl M) |
| 901 | |
| 902 | /-- Isomorphism of line bundles is transitive: `L ≅ M` gives `L ⊗ N⁻¹ ≅ M ⊗ N⁻¹`, and the latter |
| 903 | has a frame if `M ≅ N`. -/ |
| 904 | protected lemma LineBundle.IsIsomorphic.trans {μ : Type} {N : LineBundle X μ} |
| 905 | (hLM : L.IsIsomorphic M) (hMN : M.IsIsomorphic N) : L.IsIsomorphic N := |
| 906 | (hLM.mul (IsIsomorphic.refl N.inv)).exists_isFrame hMN |
| 907 | |
| 908 | /-! ### The Picard group -/ |
| 909 | |
| 910 | /-- The Picard group of `X`: line bundles given by a cover and a cocycle, modulo isomorphism. The |
| 911 | group law is written additively. -/ |
| 912 | def Pic (X : Scheme) : Type 1 := |
| 913 | Quotient (α := Σ ι : Type, LineBundle X ι) |
| 914 | { r := fun L M ↦ L.2.IsIsomorphic M.2 |
| 915 | iseqv := |
| 916 | { refl := fun L ↦ IsIsomorphic.refl L.2 |
| 917 | symm := IsIsomorphic.symm |
| 918 | trans := IsIsomorphic.trans } } |
| 919 | |
| 920 | /-- The class of the line bundle K in the Picard group of X. -/ |
| 921 | def LineBundle.picClass : Pic X := ⟦⟨ι, K⟩⟧ |
| 922 | |
| 923 | /-- Two line bundles have the same class in the Picard group if and only if they are isomorphic. -/ |
| 924 | lemma LineBundle.picClass_eq_iff : L.picClass = M.picClass ↔ L.IsIsomorphic M := eq |
| 925 | |
| 926 | /-- Let `e : κ → ι` send each open of `M` into an open of `L`, that is, `M.opens a ≤ L.opens (e a)`. |
| 927 | Suppose that at every point in `M.opens a` the transition functions agree: |
| 928 | `M.transition a b = L.transition (e a) (e b)`. Then `L` and `M` have the same class in the Picard |
| 929 | group. -/ |
| 930 | lemma LineBundle.picClass_eq_of_le (e : κ → ι) (h_le : ∀ a : κ, M.opens a ≤ L.opens (e a)) |
| 931 | (h_transition : ∀ (a b : κ) (A : CommRingCat) (t : Spec A ⟶ X), LandsIn t (M.opens a) → |
| 932 | M.transition a b A t = L.transition (e a) (e b) A t) : |
| 933 | L.picClass = M.picClass := by |
| 934 | -- a frame of `L ⊗ L⁻¹`, read at the indices `(i, e a)`, is a frame of `L ⊗ M⁻¹` |
| 935 | obtain ⟨u, hu⟩ : ∃ u : ι × ι → PointFn X, (L.mul L.inv).IsFrame u := IsIsomorphic.refl L |
| 936 | have h_frame : (L.mul M.inv).IsFrame (u ∘ Prod.map id e) := by |
| 937 | refine hu.comp_of_le (Prod.map id e) (fun i ↦ inf_le_inf le_rfl (h_le i.2)) ?_ |
| 938 | rintro ⟨i, a⟩ ⟨j, b⟩ A t - hj |
| 939 | simp [h_transition b a A t (landsIn_inf.1 hj).2] |
| 940 | exact picClass_eq_iff.2 ⟨_, h_frame⟩ |
| 941 | |
| 942 | /-- The tensor product of line bundles is associative up to isomorphism. -/ |
| 943 | lemma LineBundle.picClass_mul_assoc {μ : Type} (N : LineBundle X μ) : |
| 944 | ((L.mul M).mul N).picClass = (L.mul (M.mul N)).picClass := |
| 945 | picClass_eq_of_le (fun a ↦ ((a.1, a.2.1), a.2.2)) (by simp [inf_assoc]) (by simp [mul_assoc]) |
| 946 | |
| 947 | /-- The tensor product of line bundles is commutative up to isomorphism. -/ |
| 948 | lemma LineBundle.picClass_mul_comm : (L.mul M).picClass = (M.mul L).picClass := |
| 949 | picClass_eq_of_le (fun a ↦ (a.2, a.1)) (by simp) (by simp [mul_comm]) |
| 950 | |
| 951 | /-- The trivial line bundle is neutral for the tensor product up to isomorphism. -/ |
| 952 | lemma LineBundle.picClass_mul_one : (L.mul one).picClass = L.picClass := |
| 953 | picClass_eq_of_le (fun a ↦ (a, ())) (by simp) (by simp) |
| 954 | |
| 955 | /-- The tensor product of a line bundle with its dual is isomorphic to the trivial bundle. -/ |
| 956 | lemma LineBundle.picClass_mul_inv : |
| 957 | (L.mul L.inv).picClass = (one : LineBundle X Unit).picClass := by |
| 958 | -- a frame of `L ⊗ L⁻¹` is also a frame of `(L ⊗ L⁻¹) ⊗ one⁻¹` |
| 959 | obtain ⟨u, hu⟩ : ∃ u : ι × ι → PointFn X, (L.mul L.inv).IsFrame u := IsIsomorphic.refl L |
| 960 | exact picClass_eq_iff.2 ⟨u ∘ Prod.fst, hu.comp_of_le _ (fun _ ↦ inf_le_left) (by simp)⟩ |
| 961 | |
| 962 | /-- The sum in the Picard group is the tensor product of line bundles. -/ |
| 963 | instance : Add (Pic X) where |
| 964 | add := Quotient.map₂ (fun L M ↦ ⟨L.fst × M.fst, L.snd.mul M.snd⟩) |
| 965 | fun _ _ hL _ _ hM ↦ IsIsomorphic.mul hL hM |
| 966 | |
| 967 | /-- The negative in the Picard group is the dual line bundle. -/ |
| 968 | instance : Neg (Pic X) where |
| 969 | neg := Quotient.map (fun L ↦ ⟨L.fst, L.snd.inv⟩) fun _ _ ⟨_, hu⟩ ↦ ⟨_, hu.inv⟩ |
| 970 | |
| 971 | /-- Zero in the Picard group is the class of the trivial line bundle. -/ |
| 972 | instance : Zero (Pic X) where |
| 973 | zero := one.picClass |
| 974 | |
| 975 | instance : AddCommGroup (Pic X) where |
| 976 | toAddGroup := AddGroup.ofRightAxioms |
| 977 | (fun a b c ↦ Quotient.inductionOn₃ a b c fun _ _ N ↦ picClass_mul_assoc N.2) |
| 978 | (Quotient.ind fun _ ↦ picClass_mul_one) (Quotient.ind fun _ ↦ picClass_mul_inv) |
| 979 | add_comm a b := Quotient.inductionOn₂ a b fun _ _ ↦ picClass_mul_comm |
| 980 | |
| 981 | /-- The class of the tensor product `L.mul M` is the sum of the classes of `L` and `M`. -/ |
| 982 | @[simp] |
| 983 | lemma LineBundle.picClass_mul : (L.mul M).picClass = L.picClass + M.picClass := rfl |
| 984 | |
| 985 | /-- The class of the trivial line bundle `one` is `0` in the Picard group. -/ |
| 986 | lemma LineBundle.picClass_one : (one : LineBundle X Unit).picClass = 0 := rfl |
| 987 | |
| 988 | /-- Every element of the Picard group is the class of some line bundle. -/ |
| 989 | lemma Pic.exists_picClass_eq (c : Pic X) : ∃ (ι : Type) (L : LineBundle X ι), L.picClass = c := by |
| 990 | obtain ⟨ι, L⟩ := c |
| 991 | exact ⟨ι, L, rfl⟩ |
| 992 | |
| 993 | /-- A line bundle with zero class in the Picard group has a nowhere vanishing section. -/ |
| 994 | lemma LineBundle.exists_isFrame_of_picClass_eq_zero (h_zero : L.picClass = 0) : |
| 995 | ∃ s : ι → PointFn X, L.IsFrame s := |
| 996 | (picClass_eq_iff.1 (h_zero.trans picClass_one.symm)).exists_isFrame |
| 997 | ⟨1, by simp [IsFrame, IsSection, IsRegularOn]⟩ |
| 998 | |
| 999 | namespace Pic |
| 1000 | |
| 1001 | /-- For p: Y → X, the homomorphism Pic X → Pic Y sending the class of a line bundle to the class |
| 1002 | of its pull-back. -/ |
| 1003 | def pull : Pic X →+ Pic Y := |
| 1004 | AddMonoidHom.mk' (Quotient.map (fun L ↦ ⟨L.fst, L.2.pull p⟩) fun _ _ ⟨_, h⟩ ↦ ⟨_, h.pull p⟩) <| by |
| 1005 | rintro ⟨L⟩ ⟨M⟩ |
| 1006 | rfl |
| 1007 | |
| 1008 | /-- Pull-back along `p` sends the class of a line bundle `K` to the class of its pull-back. -/ |
| 1009 | @[simp] |
| 1010 | lemma pull_picClass : pull p K.picClass = (K.pull p).picClass := rfl |
| 1011 | |
| 1012 | /-- Pull-back along `q ≫ p` is pull-back along `p` followed by pull-back along `q`. -/ |
| 1013 | lemma pull_comp (c : Pic X) : pull (q ≫ p) c = pull q (pull p c) := by |
| 1014 | obtain ⟨L⟩ := c |
| 1015 | rfl |
| 1016 | |
| 1017 | /-- Pull-back along the identity of `X` is the identity on the Picard group. -/ |
| 1018 | @[simp] |
| 1019 | lemma pull_id (c : Pic X) : pull (𝟙 X) c = c := by |
| 1020 | obtain ⟨L⟩ := c |
| 1021 | rfl |
| 1022 | |
| 1023 | /-- The Picard group of the spectrum of a local ring `A` is trivial. -/ |
| 1024 | lemma eq_zero_of_isLocalRing (c : Pic (Spec A)) [IsLocalRing A] : c = 0 := by |
| 1025 | obtain ⟨ι, L, rfl⟩ := c.exists_picClass_eq |
| 1026 | -- As `A` is local, some member `L.opens i` of the cover is the whole of `Spec A`. So the trivial |
| 1027 | -- bundle is `L` restricted to the single chart `i`, where the transition function is 1. |
| 1028 | obtain ⟨i, hi⟩ := L.exists_landsIn (𝟙 (Spec A)) |
| 1029 | have h_top : ⊤ ≤ L.opens i := by simpa [LandsIn] using hi |
| 1030 | rw [← picClass_one] |
| 1031 | exact picClass_eq_of_le (fun _ ↦ i) (fun _ ↦ h_top) |
| 1032 | fun _ _ B t _ ↦ (L.transition_self i B t (landsIn_top.mono h_top)).symm |
| 1033 | |
| 1034 | end Pic |
| 1035 | |
| 1036 | end PicardGroup |
| 1037 | |
| 1038 | end New |
| 1039 | |
| 1040 | end |