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 | import TauCeti.AlgebraicGeometry.AffineScheme.Basic |
| 4 | import TauCeti.AlgebraicGeometry.Morphisms.Separated |
| 5 | import TauCeti.AlgebraicGeometry.Morphisms.Smooth.StandardSmooth |
| 6 | public import Mathlib.AlgebraicGeometry.Sites.Fpqc |
| 7 | import Mathlib.AlgebraicGeometry.QuasiAffine |
| 8 | import Mathlib.AlgebraicGeometry.ValuativeCriterion |
| 9 | import Mathlib.CategoryTheory.Sites.SubcanonicalOver |
| 10 | import Mathlib.RingTheory.Finiteness.ModuleFinitePresentation |
| 11 | import Mathlib.RingTheory.Henselian |
| 12 | import Mathlib.RingTheory.TotallySplit |
| 13 | public import Lib.Cohomology.ProperBaseChange.PlaceSpace |
| 14 | public import Lib.General.Geometry.EtaleCharts |
| 15 | public import Lib.Shimura.AbelianScheme.Basic |
| 16 | import Lib.Cohomology.Etale.DenseSubfunctors |
| 17 | |
| 18 | /-! |
| 19 | # Functors of points of proper schemes: closed loci, atlases and descent of relations |
| 20 | |
| 21 | Schemes over `Spec R` are studied through their functors of points. The functor of points of a |
| 22 | proper scheme is proper and separated. On comparable rings (`New.Variety.IsComparableRing`), its |
| 23 | points all come from one affine scheme. If the scheme is smooth of relative dimension `d` after base |
| 24 | change to `k`, it also has an étale atlas. |
| 25 | |
| 26 | ## Main definitions and results |
| 27 | |
| 28 | * `New.Variety.exists_ideal_le_ker_iff_factors`: for a closed immersion `i : Z ⟶ X` and a point `a` |
| 29 | of `X` with values in `S`, one ideal `I` of `S` describes the ring maps `γ : S →+* B` along which |
| 30 | `a` lands in `Z`, namely those that kill `I`. It is finitely generated if `i` is of finite |
| 31 | presentation. |
| 32 | * `New.Variety.exists_locallyOfFiniteType_forall_factors`: a quasi-compact scheme `X` |
| 33 | receives a morphism `Spec T ⟶ X` from one affine scheme, locally of finite type, through which |
| 34 | every point with values in a comparable ring (`New.Variety.IsComparableRing`) factors. |
| 35 | * `New.Variety.isProperOver_pointsToBase`: the functor of points of `X` over `R` satisfies |
| 36 | `New.Variety.IsProperOver`. |
| 37 | * `New.Variety.isSeparatedFunctor_algPointsOf`: if `W` is separated over `Spec R` and `k` is an |
| 38 | `R`-algebra, the points of `W` with values in `k`-algebras form a separated functor |
| 39 | (`New.Variety.IsSeparatedFunctor`). |
| 40 | * `New.Variety.hasAtlas_algPointsOf`: if `W` is proper over `Spec R` and smooth of relative |
| 41 | dimension `d` after base change to `k`, the functor has an atlas of dimension `d`. |
| 42 | * `New.Variety.isAffinelyCovered_algPointsOf`: on rings satisfying `New.Variety.IsComparableRing`, |
| 43 | one affine scheme surjects onto the points of a proper `W`. |
| 44 | * `New.Variety.exists_hom_of_rel` builds a homomorphism A → B of commutative group objects over S |
| 45 | from a homomorphism f : W → B and a relation between T-points of W and of A. The relation is |
| 46 | stable under pull-back and subtraction, compatible with f, and defined on an fpqc cover of A. |
| 47 | |
| 48 | Notions from other files: |
| 49 | * `New.Variety.IsComparableRing`, applied to the identity map of a ring: for any a, b in the ring |
| 50 | there is an idempotent e with a ∣ e * b and b ∣ (1 - e) * a. |
| 51 | * `New.Variety.pointsToBase`: For a morphism s: X → Spec R, the map from the functor of points of X |
| 52 | to the functor A ↦ Hom(R, A) that sends x ∈ X(A) to the ring map R → A of s∘x. |
| 53 | * `New.Variety.HasAtlas`: X is separated and has finitely many charts, each with exactly d étale |
| 54 | coordinates, that contain every field-valued point. |
| 55 | * `New.Variety.IsOpenSubfunctor`: V is an open subfunctor of X: each x ∈ X(A) has an ideal I of A |
| 56 | such that, for φ: A → B, φ(x) ∈ V(B) iff φ(I)B = B. |
| 57 | * `New.IsAdditive`: The morphism f : A → B of commutative group objects is a homomorphism: composing |
| 58 | with f is additive on U-points for every U. |
| 59 | |
| 60 | ## Relation to the literature |
| 61 | |
| 62 | Known; see `Lib.Cohomology.Etale.FilteredLimits` and `Lib.PadicComparison.HodgeTate.PeriodMap` for |
| 63 | sources. |
| 64 | -/ |
| 65 | |
| 66 | @[expose] public section |
| 67 | |
| 68 | /-! ## Morphisms of spectra over a base and algebra maps -/ |
| 69 | |
| 70 | section SpecOver |
| 71 | |
| 72 | open CategoryTheory AlgebraicGeometry CommRingCat Over OverMorphism |
| 73 | |
| 74 | namespace New.specOver |
| 75 | |
| 76 | variable {R C D E : Type} [CommRing R] [CommRing C] [CommRing D] [CommRing E] [Algebra R C] |
| 77 | [Algebra R D] [Algebra R E] (φ : C →ₐ[R] D) (ψ : D →ₐ[R] E) |
| 78 | |
| 79 | /-- For an R-algebra homomorphism φ: C→D, the induced morphism Spec D → Spec C of schemes over |
| 80 | Spec R. -/ |
| 81 | noncomputable def map : specOver R D ⟶ specOver R C := |
| 82 | homMk (Spec.map (ofHom φ)) (by simp [← Spec.map_comp, ← ofHom_comp]) |
| 83 | |
| 84 | @[reassoc] |
| 85 | lemma map_comp : map ψ ≫ map φ = map (ψ.comp φ) := ext (Spec.map_comp ..).symm |
| 86 | |
| 87 | @[simp] |
| 88 | lemma map_id : map (AlgHom.id R C) = 𝟙 (specOver R C) := ext (Spec.map_id _) |
| 89 | |
| 90 | /-- Every morphism `Spec D ⟶ Spec C` over `Spec R` is induced by exactly one `R`-algebra map |
| 91 | `C → D`. -/ |
| 92 | lemma map_bijective : (map : (C →ₐ[R] D) → (specOver R D ⟶ specOver R C)).Bijective := by |
| 93 | -- `Spec` is fully faithful on the opposite category of `R`-algebras. |
| 94 | let toOp : (C →ₐ[R] D) ≃ (Opposite.op (CommAlgCat.of R D) ⟶ Opposite.op (CommAlgCat.of R C)) := |
| 95 | { toFun φ := (CommAlgCat.ofHom φ).op, invFun f := f.unop.hom } |
| 96 | exact (toOp.trans (algSpec.fullyFaithful (R := .of R)).homEquiv).bijective |
| 97 | |
| 98 | end New.specOver |
| 99 | |
| 100 | end SpecOver |
| 101 | |
| 102 | /-! ## The ideal cutting out the locus of a closed subscheme -/ |
| 103 | |
| 104 | section FactorisationIdeal |
| 105 | |
| 106 | open CategoryTheory AlgebraicGeometry Ideal.Quotient Limits.pullback CommRingCat Spec RingHom |
| 107 | |
| 108 | namespace New.Variety |
| 109 | |
| 110 | /-- A ring map `γ : S →+* B` kills the ideal `I` if and only if `Spec γ` factors through |
| 111 | `Spec (S ⧸ I) ⟶ Spec S`. -/ |
| 112 | lemma le_ker_iff_factors {S B : Type} [CommRing S] [CommRing B] {I : Ideal S} {γ : S →+* B} : |
| 113 | I ≤ ker γ ↔ ∃ l : Spec (of B) ⟶ Spec (of (S ⧸ I)), |
| 114 | l ≫ specMap (Ideal.Quotient.mk I) = specMap γ := by |
| 115 | refine ⟨fun hI ↦ ⟨specMap (lift I γ hI), (map_comp ..).symm⟩, ?_⟩ |
| 116 | rintro ⟨l, hl⟩ x hx |
| 117 | -- On rings, `γ` factors through `S ⧸ I`, where `x` is zero. |
| 118 | have h_factor : CommRingCat.ofHom (Ideal.Quotient.mk I) ≫ preimage l = CommRingCat.ofHom γ := |
| 119 | map_inj.1 (by simpa using hl) |
| 120 | simpa [eq_zero_iff_mem.2 hx] using (ConcreteCategory.congr_hom h_factor x).symm |
| 121 | |
| 122 | /-- For a closed immersion i: Z → X and a: Spec S → X, there is an ideal I of S, finitely |
| 123 | generated if i is of finite presentation, such that a∘Spec γ factors through Z exactly when |
| 124 | γ: S → B kills I. -/ |
| 125 | lemma exists_ideal_le_ker_iff_factors {S : Type} [CommRing S] {X Z : Scheme} (i : Z ⟶ X) |
| 126 | [IsClosedImmersion i] (a : Spec (of S) ⟶ X) : |
| 127 | ∃ I : Ideal S, |
| 128 | -- (a) finite generation |
| 129 | (LocallyOfFinitePresentation i → I.FG) ∧ |
| 130 | -- (b) the ring maps along which `a` lands in `Z` are those that kill `I` |
| 131 | ∀ ⦃B : Type⦄ [CommRing B] (γ : S →+* B), |
| 132 | I ≤ ker γ ↔ ∃ l : Spec (of B) ⟶ Z, l ≫ i = Spec.map (ofHom γ) ≫ a := by |
| 133 | -- The pull-back of `i` along `a` is a closed subscheme of `Spec S`, so it is `Spec (S ⧸ I)`. |
| 134 | obtain ⟨I, e, he⟩ : ∃ (I : Ideal S) (e : Limits.pullback i a ≅ Spec (of (S ⧸ I))), |
| 135 | snd i a = e.hom ≫ Spec.map (ofHom (mk I)) := |
| 136 | (IsClosedImmersion.Spec_iff (f := snd i a)).1 inferInstance |
| 137 | refine ⟨I, fun _ ↦ ?_, fun B _ γ ↦ le_ker_iff_factors.trans ⟨?_, ?_⟩⟩ |
| 138 | · -- `S ⧸ I` is of finite presentation over `S`, so the kernel `I` is finitely generated. |
| 139 | have h_scheme : LocallyOfFinitePresentation (map (ofHom (mk I))) := by |
| 140 | rw [← e.inv_comp_eq.2 he] |
| 141 | infer_instance |
| 142 | have : Algebra.FinitePresentation S (S ⧸ I) := HasRingHomProperty.Spec_iff.1 h_scheme |
| 143 | simpa using Algebra.FinitePresentation.ker_fG_of_surjective (mkₐ S I) mk_surjective |
| 144 | · -- A map to `Spec (S ⧸ I)` composes with the first projection of the pull-back. |
| 145 | rintro ⟨l, hl⟩ |
| 146 | exact ⟨l ≫ e.inv ≫ fst i a, by grind [condition]⟩ |
| 147 | · -- A map to `Z` that lifts `Spec γ ≫ a` gives a map to the pull-back, which is `Spec (S ⧸ I)`. |
| 148 | rintro ⟨l, hl⟩ |
| 149 | exact ⟨lift l _ hl ≫ e.hom, by grind [lift_snd]⟩ |
| 150 | |
| 151 | end New.Variety |
| 152 | |
| 153 | end FactorisationIdeal |
| 154 | |
| 155 | /-! ## Properness of the functor of points of a proper scheme -/ |
| 156 | |
| 157 | section ProperSchemes |
| 158 | |
| 159 | open CategoryTheory Limits AlgebraicGeometry CommRingCat Scheme Spec terminal Ideal TopologicalSpace |
| 160 | PrimeSpectrum Set Cofan.IsColimit IsOpenImmersion Fintype prod |
| 161 | |
| 162 | variable {X : Scheme} {R : CommRingCat} (s : X ⟶ Spec R) |
| 163 | |
| 164 | /-- If X is quasi-compact, there is a morphism a: Spec T → X, locally of finite type, through |
| 165 | which every morphism Spec O → X factors, for all rings O whose identity map satisfies |
| 166 | `New.Variety.IsComparableRing`: any two elements are comparable for divisibility after a partition |
| 167 | by an idempotent. -/ |
| 168 | lemma New.Variety.exists_locallyOfFiniteType_forall_factors (X : Scheme) [CompactSpace X] : |
| 169 | ∃ (T : CommRingCat) (a : Spec T ⟶ X), |
| 170 | LocallyOfFiniteType a ∧ |
| 171 | ∀ O : CommRingCat, |
| 172 | IsComparableRing (id : O → O) → |
| 173 | ∀ z : Spec O ⟶ X, ∃ u : T ⟶ O, Spec.map u ≫ a = z := by |
| 174 | -- Take the disjoint union of a finite affine open cover `𝒰` of `X`. Partition `Spec O` into |
| 175 | -- finitely many clopen pieces, each sent by the `O`-valued point `z` into one member of `𝒰`. |
| 176 | let 𝒰 : X.OpenCover := X.affineCover.finiteSubcover |
| 177 | have : LocallyOfFiniteType (Sigma.desc 𝒰.f) := |
| 178 | HasRingHomProperty.instIsZariskiLocalAtSource.sigmaDesc inferInstance |
| 179 | refine ⟨_, inv (toSpecΓ _) ≫ Sigma.desc 𝒰.f, locallyOfFiniteType_comp .., |
| 180 | fun O h_comparable z ↦ ?_⟩ |
| 181 | -- Around each prime `x` there is such a clopen piece: take a maximal ideal `m ⊇ x`, a basic open |
| 182 | -- `D(g) ∋ m` sent into one member, and an idempotent `e ∉ m` divisible by `g` (this is where |
| 183 | -- `h_comparable` is used). The clopen set `D(e)` contains `x` and lies in `D(g)`. |
| 184 | have h_local (x : Spec O) : |
| 185 | ∃ (C : Clopens (Spec O)) (i : 𝒰.I₀), x ∈ C ∧ ∀ y ∈ C, z y ∈ range (𝒰.f i) := by |
| 186 | obtain ⟨m, hm, hxm⟩ := exists_le_maximal x.asIdeal x.isPrime.ne_top |
| 187 | obtain ⟨j, hj⟩ : ∃ j : 𝒰.I₀, z ⟨m, hm.isPrime⟩ ∈ range (𝒰.f j) := ⟨_, 𝒰.covers _⟩ |
| 188 | obtain ⟨_, ⟨g, rfl⟩, hg, hg_sub⟩ := isTopologicalBasis_basic_opens.isOpen_iff.1 |
| 189 | (z ⁻¹ᵁ Hom.opensRange (𝒰.f j)).isOpen ⟨m, hm.isPrime⟩ hj |
| 190 | obtain ⟨e, hem, he, hge⟩ := exists_dvd_idempotent_of_notMem h_comparable hm hg |
| 191 | refine ⟨isIdempotentElemEquivClopens ⟨e, he⟩, j, fun hex ↦ hem (hxm hex), fun y hy ↦ ?_⟩ |
| 192 | exact hg_sub fun hgy ↦ hy (mem_of_dvd _ hge hgy) |
| 193 | choose C i mem_C hC using h_local |
| 194 | -- Finitely many pieces cover; shrink them to be disjoint, so that `Spec O` is their coproduct. |
| 195 | obtain ⟨t, ht⟩ := finite_cover_nhds fun x ↦ (C x).isOpen.mem_nhds (mem_C x) |
| 196 | obtain ⟨D, hD_le, hD_sup, hD_disj⟩ := exists_disjointed_le fun x : t ↦ C x |
| 197 | have hD_cover : ⨆ x : t, Scheme.Hom.opensRange (Opens.ι (D x).toOpens) = ⊤ := by |
| 198 | simp_all [Clopens.ext_iff, iUnion_subtype] |
| 199 | obtain ⟨c⟩ : Nonempty (IsColimit (Cofan.mk (Spec O) fun x ↦ Opens.ι (D x).toOpens)) := |
| 200 | nonempty_isColimit_cofanMk_of _ hD_cover (hD_disj.mono (by simp [← Opens.coe_disjoint])) |
| 201 | -- Lift `z` on each piece and glue along the coproduct `c`; equality is checked piece by piece. |
| 202 | let piece (x : t) : Opens.toScheme (D x).toOpens ⟶ 𝒰.X (i x) := |
| 203 | lift (𝒰.f (i x)) (Opens.ι _ ≫ z) (range_subset_iff.2 fun y ↦ hC x y.val (hD_le x y.property)) |
| 204 | let glued : Spec O ⟶ ∐ 𝒰.X := desc c fun x ↦ piece x ≫ Sigma.ι 𝒰.X (i x) |
| 205 | have h_glued : glued ≫ Sigma.desc 𝒰.f = z := |
| 206 | hom_ext c _ _ fun x ↦ by |
| 207 | rw [reassoc_of% (Cofan.IsColimit.fac c (fun x ↦ piece x ≫ Sigma.ι 𝒰.X (i x)) x)] |
| 208 | simp [piece] |
| 209 | exact ⟨preimage (glued ≫ toSpecΓ _), by simpa using h_glued⟩ |
| 210 | |
| 211 | /-- For two `A`-valued points of a separated scheme, pulling back the diagonal gives an ideal |
| 212 | of `A`. The points agree after a ring map exactly when it kills this ideal. -/ |
| 213 | private lemma exists_ideal_le_ker_iff_points_eq {X : Scheme.{0}} [X.IsSeparated] {A : CommRingCat} |
| 214 | (x y : Spec A ⟶ X) : |
| 215 | ∃ I : Ideal A, ∀ (B : CommRingCat) (f : A ⟶ B), Spec.map f ≫ x = Spec.map f ≫ y ↔ |
| 216 | I ≤ RingHom.ker f.hom := by |
| 217 | obtain ⟨I, -, hI⟩ := New.Variety.exists_ideal_le_ker_iff_factors (diag X) (lift x y) |
| 218 | exact ⟨I, fun B f ↦ by simp [hI, prod.hom_ext_iff]⟩ |
| 219 | |
| 220 | /-- If `s : X ⟶ Spec R` is a proper morphism of schemes, then the functor of points `A ↦ X(A)` with |
| 221 | its structure map `pointsToBase s` is proper over `R` (`New.Variety.IsProperOver`). The locus where |
| 222 | two points agree is cut out by an ideal. There are a ring `T` and a point `a ∈ X(T)` such that each |
| 223 | point of `X` in an algebraically closed field `K` that maps `R` into a valuation ring `O` of `K` is |
| 224 | the image of `a` under some `T → O ⊆ K`. -/ |
| 225 | lemma New.Variety.isProperOver_pointsToBase [IsProper s] : IsProperOver (pointsToBase s) := by |
| 226 | have : X.IsSeparated := Scheme.IsSeparated.of_isSeparated s |
| 227 | refine ⟨fun C ⟨x⟩ ⟨y⟩ ↦ ?_, ?_⟩ |
| 228 | · obtain ⟨I, hI⟩ := exists_ideal_le_ker_iff_points_eq x y |
| 229 | exact ⟨I, fun B f ↦ ULift.up_inj.trans (hI B f)⟩ |
| 230 | · -- A geometric point `z` whose ring map on `R` lands in the valuation ring `O` extends to |
| 231 | -- an `O`-point by the valuative criterion, and `O`-points factor through the atlas `a`, |
| 232 | -- as a valuation ring is a comparable ring. |
| 233 | have : CompactSpace X := QuasiCompact.compactSpace_of_compactSpace s |
| 234 | obtain ⟨T, a, -, ha⟩ := exists_locallyOfFiniteType_forall_factors X |
| 235 | refine ⟨T, ⟨a⟩, fun {K} _ _ O z hz ↦ ?_⟩ |
| 236 | let ρ₀ : R →+* O := (baseRingMap (pointsToBase s) z).hom.codRestrict O hz |
| 237 | obtain ⟨⟨⟨l, hl, -⟩⟩⟩ := (UniversallyClosed.eq_valuativeCriterion.le X (Spec R) s |
| 238 | inferInstance).1 ⟨O, K, z.down, Spec.map (ofHom ρ₀), |
| 239 | ⟨by rw [← map_preimage (z.down ≫ s), ← Spec.map_comp]; rfl⟩⟩ |
| 240 | obtain ⟨u, hu⟩ := ha (of O) isTest_of_preValuationRing.isComparableRing l |
| 241 | exact ⟨u, congrArg ULift.up <| by |
| 242 | change Spec.map (u ≫ ofHom (algebraMap O K)) ≫ a = z.down |
| 243 | rw [Spec.map_comp, Category.assoc, hu, hl]⟩ |
| 244 | |
| 245 | end ProperSchemes |
| 246 | |
| 247 | /-! |
| 248 | ## Separatedness, affine covers and étale atlases for points |
| 249 | |
| 250 | The passage from schemes to functors of points: for a scheme `W` over `Spec R` and an `R`-algebra |
| 251 | `k`, `New.Variety.algPointsOf k R W` sends a `k`-algebra `A` to `W(A)`. |
| 252 | |
| 253 | * `New.Variety.isOpenSubfunctor_of_landsIn`: the points that land in an open subset form an open |
| 254 | subfunctor. |
| 255 | -/ |
| 256 | |
| 257 | section ProperAtlas |
| 258 | |
| 259 | open CategoryTheory AlgebraicGeometry Limits PrimeSpectrum Spec pullback Over Category RingHom |
| 260 | CommAlgCat HasRingHomProperty ULift |
| 261 | |
| 262 | namespace New.Variety |
| 263 | |
| 264 | variable {k : Type} [CommRing k] {R : CommRingCat} [Algebra R k] {W : Over (Spec R)} |
| 265 | |
| 266 | /-- Every open subset `V` of `Spec A` has an ideal `I` of `A` such that, for a ring map |
| 267 | `φ : A → B`, the morphism `Spec φ` lands in `V` iff `φ(I)` generates the unit ideal of `B`. -/ |
| 268 | lemma exists_ideal_preimage_eq_top_iff {A : Type} [CommRing A] (V : (Spec (.of A)).Opens) : |
| 269 | ∃ I : Ideal A, ∀ (B : Type) [CommRing B] (φ : A →+* B), |
| 270 | specMap φ ⁻¹ᵁ V = ⊤ ↔ I.map φ = ⊤ := by |
| 271 | -- The complement of `V` is the zero locus of an ideal `I`. |
| 272 | let V' : Set (PrimeSpectrum A) := V.carrier |
| 273 | obtain ⟨I, hI⟩ : ∃ I : Ideal A, V'ᶜ = zeroLocus I := |
| 274 | (isClosed_iff_zeroLocus_ideal _).1 V.isOpen.isClosed_compl |
| 275 | refine ⟨I, fun B _ φ ↦ ?_⟩ |
| 276 | calc specMap φ ⁻¹ᵁ V = ⊤ |
| 277 | _ ↔ comap φ ⁻¹' V' = Set.univ := TopologicalSpace.Opens.ext_iff |
| 278 | _ ↔ comap φ ⁻¹' zeroLocus I = ∅ := by rw [← hI, Set.preimage_compl, Set.compl_empty_iff] |
| 279 | _ ↔ zeroLocus (I.map φ : Set B) = ∅ := by |
| 280 | rw [preimage_comap_zeroLocus, Ideal.map, zeroLocus_span] |
| 281 | _ ↔ I.map φ = ⊤ := zeroLocus_empty_iff_eq_top |
| 282 | |
| 283 | /-- Let `t` send points of `W` naturally to points of a scheme `Z` (`ht`). If a subfunctor `U` of |
| 284 | the points of `W` consists of the points whose image lands in an open subset `V` of `Z`, then `U` |
| 285 | is an open subfunctor. -/ |
| 286 | lemma isOpenSubfunctor_of_landsIn {Z : Scheme} |
| 287 | (t : ∀ {A : CommAlg k}, PointsIn (R := R) W A → (Spec ⟨A⟩ ⟶ Z)) |
| 288 | (ht : ∀ (A B : CommAlg k) (φ : A ⟶ B) (x : PointsIn W A), |
| 289 | t (PointsIn.map φ x) = specMap φ.hom ≫ t x) |
| 290 | {V : Z.Opens} (U : Subfunctor (algPointsOf k R W)) |
| 291 | (hU : ∀ (A : CommAlg k) (x : PointsIn W A), x ∈ U A ↔ LandsIn (t x) V) : |
| 292 | IsOpenSubfunctor U := by |
| 293 | intro A x |
| 294 | obtain ⟨I, hI⟩ := exists_ideal_preimage_eq_top_iff (t x ⁻¹ᵁ V) |
| 295 | refine ⟨I, fun B φ ↦ ?_⟩ |
| 296 | calc PointsIn.map φ x ∈ U B |
| 297 | _ ↔ LandsIn (specMap (φ.hom : A →+* B) ≫ t x) V := by rw [hU, ht] |
| 298 | _ ↔ specMap (φ.hom : A →+* B) ⁻¹ᵁ t x ⁻¹ᵁ V = ⊤ := eq_top_iff.symm |
| 299 | _ ↔ I.map (φ.hom : A →+* B) = ⊤ := hI B φ.hom |
| 300 | _ ↔ I.map φ.hom = ⊤ := by rw [Ideal.map_coe] |
| 301 | |
| 302 | /-- A point of `W` with values in a `k`-algebra `A` lies over the composite |
| 303 | `Spec A ⟶ Spec k ⟶ Spec R`, so it is also a point of the base change of `W` to `k`. -/ |
| 304 | lemma left_comp_hom {A : CommAlg k} (x : PointsIn W A) : |
| 305 | x.down.left ≫ W.hom = specMap (algebraMap k A) ≫ specMap (algebraMap R k) := |
| 306 | x.down.w.trans (Spec.map_comp (CommRingCat.ofHom _) (CommRingCat.ofHom _)) |
| 307 | |
| 308 | lemma PointsIn.eq_of_left_eq {A : CommAlg k} {x y : PointsIn W A} |
| 309 | (h_left : x.down.left = y.down.left) : x = y := |
| 310 | ULift.down_injective (OverMorphism.ext h_left) |
| 311 | |
| 312 | /-- The image of a point `x` under `φ : A → B` has underlying morphism `Spec φ ≫ x`. -/ |
| 313 | lemma PointsIn.map_left {A B : CommAlg k} (φ : A ⟶ B) (x : PointsIn W A) : |
| 314 | (x.map φ).down.left = specMap φ.hom ≫ x.down.left := rfl |
| 315 | |
| 316 | /-- A ring map `u : A → B` of `k`-algebras whose spectrum commutes with the structure maps to |
| 317 | `Spec k` induces the same morphism of spectra as some map of `k`-algebras `A → B`. -/ |
| 318 | lemma exists_hom_specMap_eq {A B : CommAlg k} (u : CommRingCat.of A ⟶ CommRingCat.of B) |
| 319 | (hu : Spec.map u ≫ specMap (algebraMap k A) = specMap (algebraMap k B)) : |
| 320 | ∃ φ : A ⟶ B, specMap (φ.hom : A →+* B) = Spec.map u := by |
| 321 | exact ⟨ofHom ⟨u.hom, ConcreteCategory.congr_hom (map_inj.1 ((Spec.map_comp ..).trans hu))⟩, rfl⟩ |
| 322 | |
| 323 | /-- If `W` is separated over `Spec R`, its functor of points on `k`-algebras is separated: the locus |
| 324 | where two points of `W` with values in `A` agree is cut out by an ideal of `A`. -/ |
| 325 | instance isSeparatedFunctor_algPointsOf [IsSeparated W.hom] : |
| 326 | IsSeparatedFunctor (algPointsOf k R W) := by |
| 327 | refine ⟨fun A ⟨x⟩ y ↦ ?_⟩ |
| 328 | -- the ideal that cuts out the coincidence of the underlying morphisms of schemes |
| 329 | have : W.left.IsSeparated := Scheme.IsSeparated.of_isSeparated W.hom |
| 330 | obtain ⟨I, hI⟩ := exists_ideal_le_ker_iff_points_eq x.left y.down.left |
| 331 | refine ⟨I, fun B φ ↦ Iff.trans ⟨fun h_eq ↦ ?_, fun h_eq ↦ ?_⟩ |
| 332 | (hI (.of B) (CommRingCat.ofHom (φ.hom : A →+* B)))⟩ |
| 333 | · exact congrArg (fun p : PointsIn W B ↦ p.down.left) h_eq |
| 334 | · exact PointsIn.eq_of_left_eq h_eq |
| 335 | |
| 336 | section SmoothAtlas |
| 337 | |
| 338 | /-- Let `f : Y ⟶ Spec k` be smooth of relative dimension `d`. Each point `z` of `Y` lies in the |
| 339 | image of an open immersion `Spec A ⟶ Y` over `k`, where the `k`-algebra `A` is étale over the |
| 340 | polynomial ring in `d` variables. -/ |
| 341 | lemma exists_etale_coordinates_of_smooth (d : ℕ) {Y : Scheme} (f : Y ⟶ Spec (.of k)) |
| 342 | [hf : SmoothOfRelativeDimension d f] (z : Y) : |
| 343 | ∃ (A : CommAlg k) (j : Spec (.of A) ⟶ Y) (_ : IsOpenImmersion j) (coord : Fin d → A), |
| 344 | z ∈ j.opensRange ∧ |
| 345 | j ≫ f = specMap (algebraMap k A) ∧ |
| 346 | (MvPolynomial.aeval (R := k) coord).toRingHom.Etale := by |
| 347 | obtain ⟨⟨V, (hV : IsAffineOpen V)⟩, hz, h_smooth⟩ := |
| 348 | SmoothOfRelativeDimension.exists_isStandardSmoothOfRelativeDimension_appLE_top f d z |
| 349 | let σ : CommRingCat.of k ⟶ Γ(Y, V) := (Scheme.ΓSpecIso (.of k)).inv ≫ f.appLE ⊤ V le_top |
| 350 | let : Algebra k Γ(Y, V) := σ.hom.toAlgebra |
| 351 | have hσ_smooth : σ.hom.IsStandardSmoothOfRelativeDimension d := |
| 352 | (isStandardSmoothOfRelativeDimension_respectsIso (n := d)).right _ |
| 353 | (Scheme.ΓSpecIso (.of k)).symm.commRingCatIsoToRingEquiv h_smooth |
| 354 | obtain ⟨g, hg⟩ : ∃ g : MvPolynomial (Fin d) k →ₐ[k] Γ(Y, V), g.Etale := |
| 355 | hσ_smooth.toAlgebra.exists_etale_mvPolynomial |
| 356 | have h_struct : hV.fromSpec ≫ f = Spec.map σ := hV.fromSpec_comp_eq_SpecMap f |
| 357 | refine ⟨.of k Γ(Y, V), hV.fromSpec, inferInstance, fun i ↦ g (MvPolynomial.X i), |
| 358 | by rwa [hV.opensRange_fromSpec], h_struct, ?_⟩ |
| 359 | rwa [MvPolynomial.aeval_unique g] at hg |
| 360 | |
| 361 | /-- Suppose the base change `Wₖ` of `W` to `k` is smooth of relative dimension `d`, and `t` sends |
| 362 | each point `x` of `W` with values in a `k`-algebra `A` (`PointsIn`) to the corresponding `A`-point |
| 363 | of `Wₖ`, naturally in `A` and compatibly with the two projections. Then each `z` in `Wₖ` has an open |
| 364 | neighbourhood `V` and an `EtaleChart` of `algPointsOf k R W`. Such a chart is a `k`-algebra `S` with |
| 365 | `d` étale coordinates together with a point `y` of `W` in `S` that embeds `Spec S` as an open |
| 366 | subfunctor. Its `locus` (the points `φ(y)` for `φ : S → A`) consists exactly of the `x` with `t x` |
| 367 | landing in `V` (`LandsIn`). -/ |
| 368 | lemma exists_etaleChart_of_smooth (d : ℕ) |
| 369 | [hW : SmoothOfRelativeDimension d (snd W.hom (specMap (algebraMap R k)))] |
| 370 | (t : ∀ {A : CommAlg k}, PointsIn (R := R) W A → |
| 371 | (Spec (.of A) ⟶ Limits.pullback W.hom (specMap (algebraMap R k)))) |
| 372 | (t_fst : ∀ {A : CommAlg k} (x : PointsIn W A), |
| 373 | t x ≫ fst W.hom (specMap (algebraMap R k)) = x.down.left) |
| 374 | (t_snd : ∀ {A : CommAlg k} (x : PointsIn W A), |
| 375 | t x ≫ snd W.hom (specMap (algebraMap R k)) = specMap (algebraMap k A)) |
| 376 | (t_map : ∀ (A B : CommAlg k) (φ : A ⟶ B) (x : PointsIn W A), |
| 377 | t (x.map φ) = specMap φ.hom ≫ t x) |
| 378 | (z : (Limits.pullback W.hom (specMap (algebraMap R k)) : Scheme)) : |
| 379 | ∃ V : (Limits.pullback W.hom (specMap (algebraMap R k))).Opens, z ∈ V ∧ |
| 380 | ∃ a : EtaleChart d (algPointsOf k R W), |
| 381 | ∀ (A : CommAlg k) (x : PointsIn W A), x ∈ a.locus.obj A ↔ LandsIn (t x) V := by |
| 382 | let b : Spec (.of k) ⟶ Spec R := specMap (algebraMap R k) |
| 383 | obtain ⟨B, j, _, coord, hz, hj, h_etale⟩ := exists_etale_coordinates_of_smooth d (snd W.hom b) z |
| 384 | -- The point `y` of the chart is the open immersion `j : Spec B ⟶ Wₖ`, read in `W`. |
| 385 | have h_w : (j ≫ fst W.hom b) ≫ W.hom = specMap (algebraMap k B) ≫ b := by |
| 386 | rw [assoc, condition, reassoc_of% hj] |
| 387 | let y : PointsIn (R := R) W B := ⟨homMk (j ≫ fst W.hom b) (h_w.trans (Spec.map_comp ..).symm)⟩ |
| 388 | have hy : t y = j := hom_ext (t_fst y) ((t_snd y).trans hj.symm) |
| 389 | have t_inj {A : CommAlg k} {x x' : PointsIn W A} (h_eq : t x = t x') : x = x' := |
| 390 | PointsIn.eq_of_left_eq (by rw [← t_fst, h_eq, t_fst]) |
| 391 | -- A point is the image of `y` under an algebra map iff it factors through `j`. |
| 392 | have h_range (A : CommAlg k) (x : PointsIn W A) : |
| 393 | x ∈ (Subfunctor.range (pointMap y)).obj A ↔ LandsIn (t x) j.opensRange := by |
| 394 | rw [landsIn_opensRange] |
| 395 | constructor |
| 396 | · rintro ⟨⟨φ⟩, hφ : y.map φ = x⟩ |
| 397 | exact ⟨CommRingCat.ofHom (φ.hom : B →+* A), by rw [← hφ, t_map, hy]⟩ |
| 398 | · rintro ⟨u, hu⟩ |
| 399 | obtain ⟨φ, hφ⟩ : ∃ φ : B ⟶ A, specMap (φ.hom : B →+* A) = Spec.map u := |
| 400 | exists_hom_specMap_eq u (by rw [← hj, reassoc_of% hu, t_snd]) |
| 401 | exact ⟨⟨φ⟩, t_inj (x := y.map φ) (by rw [t_map, hy, hφ, hu])⟩ |
| 402 | have h_inj (A : CommAlg k) : Function.Injective fun φ : B ⟶ A ↦ y.map φ := by |
| 403 | intro φ ψ (h_eq : y.map φ = y.map ψ) |
| 404 | have h_spec : specMap (φ.hom : B →+* A) ≫ j = specMap (ψ.hom : B →+* A) ≫ j := by |
| 405 | rw [← hy, ← t_map, ← t_map, h_eq] |
| 406 | simpa [cancel_mono, map_inj, ConcreteCategory.hom_ext_iff] using h_spec |
| 407 | let chart : EtaleChart d (algPointsOf k R W) := |
| 408 | { coordRing := B, point := y, coordinate := coord, etale := h_etale, injective := h_inj |
| 409 | isOpenSubfunctor := isOpenSubfunctor_of_landsIn t t_map _ h_range } |
| 410 | exact ⟨j.opensRange, hz, chart, h_range⟩ |
| 411 | |
| 412 | /-- If `W` is proper over `Spec R` and its base change to `k` is smooth of relative dimension `d`, |
| 413 | the functor of points of `W` on `k`-algebras has an atlas of dimension `d`: it is separated, and |
| 414 | finitely many charts with `d` étale coordinates contain all its field-valued points. -/ |
| 415 | lemma hasAtlas_algPointsOf (d : ℕ) [IsProper W.hom] |
| 416 | [hW : SmoothOfRelativeDimension d (snd W.hom (specMap (algebraMap R k)))] : |
| 417 | HasAtlas d (algPointsOf k R W) := by |
| 418 | -- A point `x` of `W` with values in a `k`-algebra is a point `t x` of the base change `Wₖ`. Each |
| 419 | -- point of `Wₖ` has a standard smooth affine neighbourhood, which is a chart; `Wₖ` is compact. |
| 420 | let b : Spec (.of k) ⟶ Spec R := specMap (algebraMap R k) |
| 421 | let t {A : CommAlg k} (x : PointsIn W A) : Spec (.of A) ⟶ Limits.pullback W.hom b := |
| 422 | lift x.down.left (specMap (algebraMap k A)) (left_comp_hom x) |
| 423 | have t_fst {A : CommAlg k} (x : PointsIn W A) : t x ≫ fst W.hom b = x.down.left := lift_fst .. |
| 424 | have t_snd {A : CommAlg k} (x : PointsIn W A) : |
| 425 | t x ≫ snd W.hom b = specMap (algebraMap k A) := lift_snd .. |
| 426 | have t_map (A B : CommAlg k) (φ : A ⟶ B) (x : PointsIn W A) : |
| 427 | t (x.map φ) = specMap φ.hom ≫ t x := by |
| 428 | apply pullback.hom_ext |
| 429 | · rw [assoc, t_fst, t_fst, PointsIn.map_left] |
| 430 | · -- `φ` commutes with the structure maps from `k`. |
| 431 | rw [assoc, t_snd, t_snd, ← φ.hom.comp_algebraMap] |
| 432 | exact Spec.map_comp (CommRingCat.ofHom _) (CommRingCat.ofHom _) |
| 433 | -- An open neighbourhood `V z` of each `z`, and a chart `a z` for the points that land in it. |
| 434 | choose V hV a ha using exists_etaleChart_of_smooth d t t_fst t_snd t_map |
| 435 | obtain ⟨T, hT⟩ := finite_cover_nhds fun z ↦ (V z).isOpen.mem_nhds (hV z) |
| 436 | refine ⟨T.card, fun i ↦ a (T.equivFin.symm i), fun K hK x ↦ ?_⟩ |
| 437 | -- A point with values in a field lies in an open set as soon as its closed point does. |
| 438 | let : Field K := hK.toField |
| 439 | obtain ⟨z, hzT, hz⟩ : ∃ z ∈ T, t x (IsLocalRing.closedPoint K) ∈ V z := by |
| 440 | simpa using Set.eq_univ_iff_forall.1 hT (t x (IsLocalRing.closedPoint K)) |
| 441 | have h_mem : x ∈ (a z).locus.obj K := by rwa [ha, landsIn_iff_mem] |
| 442 | exact ⟨T.equivFin ⟨z, hzT⟩, by simpa using h_mem⟩ |
| 443 | |
| 444 | end SmoothAtlas |
| 445 | |
| 446 | /-- Let `ι` be a functor to `k`-algebras whose values are comparable rings |
| 447 | (`New.Variety.IsComparableRing`). If `W` is proper over `Spec R`, its functor of points is |
| 448 | separated, and one point with values in a `k`-algebra `B` gives, along the maps `B → ι c`, all the |
| 449 | points of `W` with values in each `ι c` (`New.Variety.IsAffinelyCovered`). -/ |
| 450 | lemma isAffinelyCovered_algPointsOf {C : Type 1} [Category C] {ι : C ⥤ CommAlg k} |
| 451 | (h_comparable : ∀ c : C, IsComparableRing (id : ι c → ι c)) (W : Over (Spec R)) |
| 452 | [IsProper W.hom] : IsAffinelyCovered ι (algPointsOf k R W) := by |
| 453 | -- Take the affine scheme `Spec T` of `exists_locallyOfFiniteType_forall_factors` for the base |
| 454 | -- change of `W` to `k`: every point with values in a comparable ring factors through `t`. |
| 455 | let b : Spec (.of k) ⟶ Spec R := specMap (algebraMap R k) |
| 456 | have : CompactSpace (Limits.pullback W.hom b : Scheme) := |
| 457 | QuasiCompact.compactSpace_of_compactSpace (snd W.hom b) |
| 458 | obtain ⟨T, t, -, h_lift⟩ := exists_locallyOfFiniteType_forall_factors (Limits.pullback W.hom b) |
| 459 | obtain ⟨ρ, hρ⟩ : ∃ ρ : CommRingCat.of k ⟶ T, Spec.map ρ = t ≫ snd W.hom b := map_surjective _ |
| 460 | let : Algebra k T := ρ.hom.toAlgebra |
| 461 | -- `t` followed by the first projection is a `T`-point of `W` over `Spec R`. |
| 462 | have h_w : (t ≫ fst W.hom b) ≫ W.hom = Spec.map (CommRingCat.ofHom (algebraMap R k) ≫ ρ) := by |
| 463 | rw [Spec.map_comp, hρ, assoc, assoc, condition] |
| 464 | let y : PointsIn (R := R) W (.of k T) := ⟨homMk (t ≫ fst W.hom b) h_w⟩ |
| 465 | refine ⟨isSeparatedFunctor_algPointsOf, .of k T, y, fun c (x : PointsIn W (ι c)) ↦ ?_⟩ |
| 466 | -- A point `x` gives a point `x'` of the base change, which factors through `t` along some `u`. |
| 467 | obtain ⟨x', hx'_fst, hx'_snd⟩ : ∃ x' : Spec (.of (ι c)) ⟶ Limits.pullback W.hom b, |
| 468 | x' ≫ fst W.hom b = x.down.left ∧ x' ≫ snd W.hom b = specMap (algebraMap k (ι c)) := |
| 469 | exists_lift _ _ _ _ (left_comp_hom x) |
| 470 | obtain ⟨u, hu⟩ : ∃ u : T ⟶ .of (ι c), Spec.map u ≫ t = x' := h_lift _ (h_comparable c) x' |
| 471 | -- Second projection: `u` is a map of `k`-algebras. |
| 472 | have h_snd : Spec.map u ≫ Spec.map ρ = specMap (algebraMap k (ι c)) := by |
| 473 | rw [hρ, reassoc_of% hu, hx'_snd] |
| 474 | obtain ⟨φ, hφ⟩ := exists_hom_specMap_eq (A := .of k T) u h_snd |
| 475 | -- First projection: it sends `y` to `x`. |
| 476 | have h_fst : specMap (φ.hom : T →+* ι c) ≫ t ≫ fst W.hom b = x.down.left := by |
| 477 | rw [hφ, reassoc_of% hu, hx'_fst] |
| 478 | exact ⟨⟨φ⟩, PointsIn.eq_of_left_eq (x := y.map φ) h_fst⟩ |
| 479 | |
| 480 | end New.Variety |
| 481 | |
| 482 | end ProperAtlas |
| 483 | |
| 484 | /-! |
| 485 | ## Homomorphisms from relations total on an fpqc cover |
| 486 | |
| 487 | `New.Variety.exists_hom_of_rel` uses that representable functors are sheaves for the fpqc topology. |
| 488 | -/ |
| 489 | |
| 490 | section RelationDescent |
| 491 | |
| 492 | open CategoryTheory GrothendieckTopology Sheaf Precoverage CartesianMonoidalCategory AddGrpObj |
| 493 | |
| 494 | /-- Let `R` relate points of `W` and of `A`, stable under pull-back and subtraction, with |
| 495 | `x ≫ f = 0` whenever `x` is related to `0`. If the points of `A` related to some point of `W` |
| 496 | form a sieve `D` covering `A` for the canonical topology, then there is `F : A ⟶ B` with |
| 497 | `y ≫ F = x ≫ f` whenever `x` is related to `y`. -/ |
| 498 | private lemma New.Variety.exists_comp_eq_of_rel {S : AlgebraicGeometry.Scheme} |
| 499 | {A B W : Over S} [AddObj A] [AddObj B] [AddObj W] (f : W ⟶ B) [IsAdditive f] |
| 500 | (R : ∀ {T : Over S}, (T ⟶ W) → (T ⟶ A) → Prop) |
| 501 | (h_nat : ∀ {T' T : Over S} {x : T ⟶ W} {y : T ⟶ A} (a : T' ⟶ T), |
| 502 | R x y → R (T := T') (a ≫ x) (a ≫ y)) |
| 503 | (h_sub : ∀ {T : Over S} {x : T ⟶ W} {y : T ⟶ A} {x' : T ⟶ W} {y' : T ⟶ A}, |
| 504 | R x y → R x' y' → R (x - x') (y - y')) |
| 505 | (h_ker : ∀ {T : Over S} (x : T ⟶ W), R x 0 → x ≫ f = 0) (D : Sieve A) |
| 506 | (hD : D ∈ canonicalTopology (Over S) A) |
| 507 | (hDR : ∀ {T : Over S} (y : T ⟶ A), D.arrows y ↔ ∃ x, R x y) : |
| 508 | ∃ F : A ⟶ B, ∀ (T : Over S) (x : T ⟶ W) (y : T ⟶ A), R x y → y ≫ F = x ≫ f := by |
| 509 | -- Two points related to the same `y` differ by a point related to `0`. |
| 510 | have same_value {T : Over S} (x x' : T ⟶ W) (y : T ⟶ A) (hx : R x y) (hx' : R x' y) : |
| 511 | x ≫ f = x' ≫ f := by |
| 512 | have h_zero : R (x - x') 0 := by simpa using h_sub hx hx' |
| 513 | rw [← sub_eq_zero, ← sub_comp, h_ker _ h_zero] |
| 514 | -- The values `x ≫ f`, for a chosen `x` related to `y`, form a compatible family on `D`. |
| 515 | let values : Presieve.FamilyOfElements (yoneda.obj B) D.arrows := |
| 516 | fun _ y hy ↦ ((hDR y).1 hy).choose ≫ f |
| 517 | have h_compatible : values.Compatible := fun T₁ T₂ U a₁ a₂ y₁ y₂ hy₁ hy₂ h_eq ↦ by |
| 518 | have h_rel : R (a₂ ≫ ((hDR y₂).1 hy₂).choose) (a₁ ≫ y₁) := by |
| 519 | simpa only [h_eq] using h_nat a₂ ((hDR y₂).1 hy₂).choose_spec |
| 520 | simpa [values, ← Category.assoc] using |
| 521 | same_value _ _ _ (h_nat a₁ ((hDR y₁).1 hy₁).choose_spec) h_rel |
| 522 | obtain ⟨F, hF⟩ : ∃ F : A ⟶ B, ∀ (T : Over S) (y : T ⟶ A) (hy : D.arrows y), |
| 523 | y ≫ F = ((hDR y).1 hy).choose ≫ f := |
| 524 | (isSheaf_yoneda_obj B D hD values h_compatible).exists |
| 525 | refine ⟨F, fun T x y hxy ↦ ?_⟩ |
| 526 | have hy : D.arrows y := (hDR y).2 ⟨x, hxy⟩ |
| 527 | exact (hF T y hy).trans (same_value _ x y ((hDR y).1 hy).choose_spec hxy) |
| 528 | |
| 529 | /-- fpqc descent: let f : W → B be a homomorphism of commutative group objects over S and R a |
| 530 | relation between T-points of W and of A. Suppose R is stable under pull-back and under subtraction, |
| 531 | and x ≫ f = 0 whenever x is related to 0. If every member of an fpqc cover P of A is related to |
| 532 | some point of W, then there is a homomorphism F : A → B with y ≫ F = x ≫ f whenever x is related |
| 533 | to y. -/ |
| 534 | lemma New.Variety.exists_hom_of_rel {S : AlgebraicGeometry.Scheme} {A B W : Over S} [AddObj A] |
| 535 | [AddObj B] [AddObj W] (f : W ⟶ B) [IsAdditive f] (R : ∀ {T : Over S}, (T ⟶ W) → (T ⟶ A) → Prop) |
| 536 | (h_nat : ∀ {T' T : Over S} {x : T ⟶ W} {y : T ⟶ A} (a : T' ⟶ T), |
| 537 | R x y → R (T := T') (a ≫ x) (a ≫ y)) |
| 538 | (h_sub : ∀ {T : Over S} {x : T ⟶ W} {y : T ⟶ A} {x' : T ⟶ W} {y' : T ⟶ A}, |
| 539 | R x y → R x' y' → R (x - x') (y - y')) |
| 540 | (h_ker : ∀ {T : Over S} (x : T ⟶ W), R x 0 → x ≫ f = 0) (P : Presieve A.left) |
| 541 | (hP : P ∈ AlgebraicGeometry.Scheme.fpqcPrecoverage A.left) |
| 542 | (h_total : ∀ (Z : AlgebraicGeometry.Scheme) (g : Z ⟶ A.left), |
| 543 | @P Z g → ∃ x : Over.mk (g ≫ A.hom) ⟶ W, R x ((Over.mk (g ≫ A.hom)).homMk g)) : |
| 544 | ∃ F : A ⟶ B, IsAdditive F ∧ |
| 545 | ∀ (T : Over S) (x : T ⟶ W) (y : T ⟶ A), R x y → y ≫ F = x ≫ f := by |
| 546 | -- The points of `A` related to some point of `W` form a sieve `D`. It contains the fpqc cover, so |
| 547 | -- it covers for the canonical topology, for which `B` is a sheaf: the values of `f` glue to `F`. |
| 548 | let D : Sieve A := |
| 549 | { arrows _ y := ∃ x, R x y, downward_closed := fun ⟨x, hx⟩ a ↦ ⟨a ≫ x, h_nat a hx⟩ } |
| 550 | have hD_fpqc : Sieve.overEquiv A D ∈ AlgebraicGeometry.Scheme.fpqcTopology A.left := |
| 551 | mem_toGrothendieck_iff_of_isStableUnderComposition.2 |
| 552 | ⟨P, hP, fun Z g hg ↦ ⟨_, _, 𝟙 _, h_total Z g hg, rfl⟩⟩ |
| 553 | have hD : D ∈ canonicalTopology (Over S) A := le_canonical _ _ ((mem_over_iff _ D).2 hD_fpqc) |
| 554 | -- Points related to the same `y` have the same image under `f`, so these values glue to `F`. |
| 555 | obtain ⟨F, hF_spec⟩ := exists_comp_eq_of_rel f R h_nat h_sub h_ker D hD fun _ ↦ Iff.rfl |
| 556 | refine ⟨F, isAdditive_of_universal ?_, hF_spec⟩ |
| 557 | -- Additivity on the projections `p`, `q` is local on `A × A`: test it on the points at which |
| 558 | -- `p + q` is related to some `x` and `q` to some `x'`; there `p` is related to `x - x'`. |
| 559 | have h_cover : D.pullback (fst A A + snd A A) ⊓ D.pullback (snd A A) ∈ |
| 560 | canonicalTopology (Over S) _ := |
| 561 | intersection_covering _ (pullback_stable _ _ hD) (pullback_stable _ _ hD) |
| 562 | refine ((isSheaf_yoneda_obj B).isSeparated _ h_cover).ext fun T a ⟨⟨x, hx⟩, x', hx'⟩ ↦ ?_ |
| 563 | have h_diff : R (x - x') (a ≫ fst A A) := by simpa [comp_add] using h_sub hx hx' |
| 564 | calc a ≫ (fst A A + snd A A) ≫ F |
| 565 | _ = x ≫ f := by rw [← Category.assoc, hF_spec T x _ hx] |
| 566 | _ = (x - x') ≫ f + x' ≫ f := by simp [sub_comp] |
| 567 | _ = a ≫ (fst A A ≫ F + snd A A ≫ F) := by |
| 568 | simp [← hF_spec T _ _ h_diff, ← hF_spec T _ _ hx', comp_add] |
| 569 | |
| 570 | end RelationDescent |