import Lib.Cohomology.Etale.FilteredLimits import Lib.General.Algebra.CohomologyBaseChange import Lib.General.Geometry.EtaleCharts /-! # p-adic tests: tilts, Fontaine's map, covers by tests and flat base change A cell is a p-complete, absolutely integrally closed valuation ring in which p is neither zero nor a unit. A p-adic test c is a non-empty product S = `c.ProdRing` of cells over O_C. Its tilt is S♭ = `c.TiltRing`. ξ generates the kernel of Fontaine's map θ : W(S♭) → S, and π = `New.Variety.pFlat` is ξ mod p. The file computes the tilt and the kernel of θ for tests. For perfect b, it identifies algebra maps b → S♭ with algebra maps O_C ⊗ W(b) → S (`wittFunctor` sends b to W(b) over A_inf, and `algBaseChange OC` is O_C ⊗_{A_inf} –), so tilting is fully faithful on tests. It also produces cells over primes and covers by tests, and proves flat base change for ℤ[Y∘ι], for ι full, faithful and with covering points, when Y is affinely covered. ## Main definitions and results * `New.Variety.PadicTest.tiltPiEquiv`, `New.Variety.PadicTest.isPerfectTorsionFree_tilt`: S♭ is the product of the tilts of the cells; it is perfect and has no π-torsion. * `New.Variety.PadicTest.ker_theta`: the kernel of Fontaine's θ : W(S♭) → S is generated by ξ. * `New.Variety.PadicTest.thetaIso`: O_C ⊗_{A_inf} W(S♭) ≅ S, naturally in the test. * `New.Variety.homTiltIso`: for perfect `b`, algebra maps `b → c.TiltRing` correspond to algebra maps `O_C ⊗ W(b) → c.ProdRing` by `f ↦ θ ∘ W(f)`, naturally in the test `c`. * `New.Variety.hasCoveringPoints_padic`: if an algebra has a point in some test, then all its points in tests factor through a single point. * `New.Variety.IsAffinelyCovered.hasFlatBaseChange`, `New.Variety.hasFlatBaseChange_of_iso_reprBy`: ℤ[Y∘ι] has flat base change (`New.Variety.HasFlatBaseChange`: its base change maps are bijective in all degrees) for affinely covered Y, when ι is full, faithful and has covering points. ℤ[Y] has flat base change for Y isomorphic to the points of an O_C-algebra. Notions from other files: * `New.OC`: The ring of integers O_C of the field C_p of p-adic complex numbers. * `New.Variety.PadicTest.algFunctor`: The functor from p-adic tests to commutative O_C-algebras sending a test to its product ring S with its structure map; `reprBy B` is the functor of points R ↦ (algebra maps B → R), and `Sigma F` is the type of pairs (c, point of `F c`). * `New.Variety.freeAb`: The functor sending a set-valued functor Y to Z[Y], whose value at A is the free abelian group on Y(A). * `New.Variety.IsAffinelyCovered`: `X` is separated and, after restriction along `ι`, covered by one affine: there are a `k`-algebra `B` and a point `y` of `X(B)` such that, for every object `c`, each point of `X(ι c)` is the image of `y` under some map `B → ι c`. ## Relation to the literature Known result: Tilting and untilting for products of perfectoid valuation rings over O_C. Only products of p-complete absolutely integrally closed valuation rings over O_C are treated, and such a ring is recovered from the Witt vectors of its tilt. Tilting is fully faithful, and maps from a perfect algebra to the tilt are maps from its untilt. Source: B. Bhatt, M. Morrow, P. Scholze, Integral p-adic Hodge theory, Publ. Math. IHES 128 (2018), Lemma 3.10; P. Scholze, Perfectoid spaces, Publ. Math. IHES 116 (2012), Theorem 5.2. See also `Lib.PadicComparison.Descent.AlmostDescent` and `Lib.Cohomology.Etale.FilteredLimits`. -/ noncomputable section namespace New.Variety /-! ## Tilts of tests and the kernel of Fontaine's map * `New.Variety.PadicTest.exists_isQuotientByElem`: the quotient of S by an idempotent e ≠ 1 is again a test. -/ section TestProperties open CategoryTheory TensorProduct Function Ideal Period ConcreteCategory Perfection WittVector RingHom variable {p : ℕ} [ThePrime p] (c : PadicTest) /-- For ring maps y_i from an O_C-algebra B to a non-empty family of cells W_i, this is the p-adic test ∏ W_i with structure map O_C → B → ∏ W_i, together with the point (y_i) : B → ∏ W_i. -/ def cellPoint (B : CommAlg OC) {I : Type} [n : Nonempty I] {W : I → Type} [∀ i, CommRing (W i)] [∀ i, IsCell p (W i)] (y : ∀ i : I, B.1 →+* W i) : Sigma (PadicTest.algFunctor ⋙ reprBy B) where fst := { Index := I, Cell := W, structureMap := (RingHom.pi y).comp (algebraMap OC B) } snd := ⟨ofHom { toRingHom := RingHom.pi y, commutes' := fun _ ↦ rfl }⟩ namespace PadicTest /-- The product ring of a p-adic test c is a test ring: reduced, absolutely integrally closed, and any a, b admit an idempotent e with a ∣ eb and b ∣ (1 − e)a. -/ lemma isTest : IsTest c.ProdRing := IsTest.pi fun _ ↦ isTest_of_preValuationRing instance : IsAbsIntegrallyClosed c.ProdRing := c.isTest.toIsAbsIntegrallyClosed /-- Multiplication by `p` is injective on the ring of a p-adic test: each cell is a domain in which `p ≠ 0`. -/ lemma isLeftRegular_p : IsLeftRegular (p : c.ProdRing) := Pi.isLeftRegular_iff.2 fun i ↦ by simp [isRegular_iff_ne_zero, IsCell.p_ne_zero] /-- For a p-adic test with cells W_i, the ring isomorphism from the tilt of ∏ W_i to the product of the tilts W_i^♭ induced by the projections. -/ def tiltPiEquiv : Perfection (((i : c.Index) → c.Cell i) ⧸ span {(p : (i : c.Index) → c.Cell i)}) p ≃+* ((a : c.Index) → Perfection (c.Cell a ⧸ span {(p : c.Cell a)}) p) := RingEquiv.ofBijective (RingHom.pi fun i ↦ tiltMap (p := p) (Pi.evalRingHom c.Cell i)) <| -- The tilt of a complete ring is the set of its sequences of compatible `p`-th roots -- (`quotientMulEquiv`), and such a sequence in a product is a family of such sequences. ((quotientMulEquiv ..).bijective_comp _).1 <| let split : Perfection (∀ i : c.Index, c.Cell i) p ≃ ∀ i : c.Index, Perfection (c.Cell i) p := ((Equiv.piComm fun _ ↦ c.Cell).subtypeEquiv (by simp [funext_iff, forall_comm (α := ℕ)])).trans Equiv.subtypePiEquivPi (split.trans (Equiv.piCongrRight fun _ ↦ (quotientMulEquiv ..).1)).bijective /-- Divisibility in the tilt of a test can be checked after untilting. -/ lemma dvd_of_untilt_dvd {x y : c.TiltRing} (h : x.untilt ∣ y.untilt) : x ∣ y := by -- Divisibility is tested in each cell, where it is `untilt_dvd_iff`. refine (map_dvd_iff c.tiltPiEquiv).mp (pi_dvd_iff.mpr fun i ↦ untilt_dvd_iff.mp ?_) -- The `i`-th component of the tilt of `z` untilts to the `i`-th component of `z.untilt`. have h_comp (z : c.TiltRing) : PreTilt.untilt (c.tiltPiEquiv z i) = z.untilt i := untilt_tiltMap (Pi.evalRingHom c.Cell i) z simpa [h_comp] using pi_dvd_iff.mp h i /-- The tilt of a p-adic test c is a perfect O^♭-algebra without `pFlat`-torsion, in the sense of `New.Variety.IsPerfectTorsionFree`. -/ lemma isPerfectTorsionFree_tilt : IsPerfectTorsionFree (tilt c) := by -- If `pFlat • y = 0` then `p * y.untilt = p * (0 : c.TiltRing).untilt`, as the untilt of `pFlat` -- divides `p`; cancel `p`. change IsPerfectTorsionFree (.of _ c.TiltRing) refine ⟨inferInstance, .of_right_eq_zero_of_smul fun y hy ↦ ?_⟩ obtain ⟨e, he⟩ : ∃ e : OC, (p : OC) = e * xi.constantCoeff.untilt := exists_eq_mul_left_of_dvd untilt_constantCoeff_xi_dvd_p have h_mul (z : c.TiltRing) : (p : c.ProdRing) * z.untilt = c.structureMap e * PreTilt.untilt (pFlat • z) := by rw [← map_natCast c.structureMap, he, map_mul, ← untilt_tiltMap, mul_assoc, ← map_mul] rfl have h_untilt : (0 : c.TiltRing).untilt = y.untilt := c.isLeftRegular_p (by simp [h_mul, hy]) exact zero_dvd_iff.mp (c.dvd_of_untilt_dvd h_untilt.dvd) /-- Let S be the ring of a p-adic test, that is, the product of its family of valuation rings, with its ring map from O_C. Then the kernel of Fontaine's map θ: W(S^♭) → S is the principal ideal generated by the image of ξ = ∑_{0 ≤ i < p} [ε^{1/p}]^i ∈ A_inf = W(O^♭) under the map W(O^♭) → W(S^♭) induced by the algebra map O^♭ → S^♭, where O^♭ is the tilt of O_C. -/ @[simp] lemma ker_theta : ker (fontaineTheta c.ProdRing p) = span {xi.map (algebraMap OFlat (PreTilt c.ProdRing p))} := by -- `θ` kills `ξ`: it commutes with `tiltMap`, and `θ ξ = 0` over `O_C`. have hξ : xi.map (algebraMap OFlat c.TiltRing) ∈ ker (fontaineTheta c.ProdRing p) := mem_ker.mpr ((fontaineTheta_map_tiltMap c.structureMap xi).trans (by rw [theta_xi, map_zero])) -- A `p`-saturated ideal of Witt vectors is generated by any of its elements whose zeroth -- coordinate divides the zeroth coordinates of all its elements -- (`Witt.dvd_of_mem_of_constantCoeff_dvd`). refine le_antisymm (fun w hw ↦ mem_span_singleton.mpr (Witt.dvd_of_mem_of_constantCoeff_dvd hξ ?_ ?_ w hw)) ((span_singleton_le_iff_mem _).mpr hξ) · -- the kernel is `p`-saturated, since `p` is regular in `c.ProdRing` simp [c.isLeftRegular_p.mul_left_eq_zero_iff] · -- divisibility of zeroth coordinates is read off after untilting: `ξ₀♯ ∣ p ∣ a₀♯` refine fun a ha ↦ c.dvd_of_untilt_dvd ?_ calc _ = c.structureMap xi.constantCoeff.untilt := untilt_tiltMap .. _ ∣ c.structureMap p := map_dvd _ untilt_constantCoeff_xi_dvd_p _ ∣ a.constantCoeff.untilt := by -- modulo `p`, `a₀♯` is `θ a = 0` simp [← Quotient.eq_zero_iff_dvd, ← mk_fontaineTheta, mem_ker.mp ha] /-- For an idempotent e ≠ 1 in the ring of a p-adic test c, there is a map of tests f: c → d that is universal among maps killing e and is the quotient by the ideal (e). -/ lemma exists_isQuotientByElem (e : c.ProdRing) (he : IsIdempotentElem e) (he_ne : e ≠ 1) : ∃ (d : PadicTest) (f : c ⟶ d), IsQuotientByElem (B := d) ringFunctor e f := by -- project onto the cells where `e i ≠ 1`, that is, where the idempotent `e i` is `0` let d := cellPoint (.of OC c.ProdRing) (I := {i // e i ≠ 1}) (n := nonempty_subtype.mpr (ne_iff.mp he_ne)) fun i ↦ Pi.evalRingHom c.Cell i let f : c.ProdRing →ₐ[OC] d.fst.ProdRing := d.snd.down.hom have hf_surj : Surjective f := Subtype.surjective_restrict fun i ↦ e i ≠ 1 have hf_zero : f e = 0 := funext fun i ↦ eq_zero_of_mul_eq_self_left i.property (congrFun he i.val) have hf_ker : ker f ≤ span {e} := by -- `x ∈ ker f` vanishes on the cells where `e` is not `1`, so `x = x * e` refine fun x hx ↦ mem_span_singleton'.mpr ⟨x, ?_⟩ have hx_zero (i : c.Index) (hi : e i ≠ 1) : x i = 0 := congrFun hx ⟨i, hi⟩ simpa [funext_iff, mul_right_eq_self₀, or_iff_not_imp_left] using hx_zero refine ⟨d.fst, f, hf_zero, fun d' (g : c.ProdRing →ₐ[OC] d'.ProdRing) hg ↦ ?_, hf_surj, hf_ker⟩ -- a map `g` that kills `e` kills `ker f`, so factors uniquely through the surjection `f` obtain ⟨g₀, h_fac⟩ : ∃ g₀ : d.fst.ProdRing →ₐ[OC] d'.ProdRing, g₀.comp f = g := ⟨_, f.liftOfSurjective_comp hf_surj g (hf_ker.trans ((span_singleton_le_iff_mem _).mpr hg))⟩ exact ⟨g₀, h_fac, fun g' hg' ↦ (AlgHom.cancel_right hf_surj).mp (hg'.trans h_fac.symm)⟩ /-- The natural isomorphism O_C ⊗_{A_inf} W(S^♭) ≅ S of O_C-algebras on p-adic tests S, induced by Fontaine's map θ. -/ def thetaIso : tilt ⋙ wittFunctor ⋙ algBaseChange OC ≅ algFunctor := isoOfAppBijective ((baseChangeTranspose (tilt ⋙ wittFunctor) algFunctor).invFun { app c := ofHom { toRingHom := fontaineTheta c.ProdRing p, commutes' := fontaineTheta_map_tiltMap c.structureMap } naturality _ _ f := ext_apply (fontaineTheta_map_tiltMap f.toRingHom) }) fun c ↦ by constructor · -- As `theta` is onto, every element is some `1 ⊗ x`. If `θ x = 0` then `x = ξ • y` -- (`ker_theta`), and `1 ⊗ ξ • y = θ ξ • (1 ⊗ y) = 0`. refine (injective_iff_map_eq_zero _).mpr ((mk_surjective _ _ _ theta_surjective).forall.mpr ?_) intro x hx obtain ⟨y, rfl⟩ : xi.map (algebraMap OFlat (PreTilt c.ProdRing p)) ∣ x := mem_span_singleton.mp (c.ker_theta.le ((one_smul OC _).symm.trans hx)) -- `erw`: the base change of the Witt functor of the tilt is `OC ⊗ W(c.TiltRing)` only after -- unfolding. erw [map_smul _ xi, ← algebraMap_smul OC, theta_xi, zero_smul] rfl · -- θ is onto, as the ring is absolutely integrally closed and p-complete intro z obtain ⟨x, hx⟩ := fontaineTheta_surjective_of_isAbsIntegrallyClosed (p := p) (R := c.ProdRing) z exact ⟨1 ⊗ₜ x, (one_smul OC _).trans hx⟩ /-- The isomorphism `thetaIso` sends `1 ⊗ x` to `θ x`. -/ lemma thetaIso_hom_one_tmul (x : (wittFunctor (WittVector p OFlat)).obj (tilt.obj c)) : thetaIso.hom c (1 ⊗ₜ x) = x.fontaineTheta c.ProdRing p := one_smul OC _ end PadicTest end TestProperties /-! ## Maps into the tilt and full faithfulness of tilting -/ section TiltAdjunction open NeZero CategoryTheory Functor Function ConcreteCategory WittVector Perfection PadicTest Period CharP variable {p : ℕ} [ThePrime p] /-- For a perfect ring `R` of characteristic `p` and a p-adic test `c` (a non-empty family of cells with a ring map from O_C to their product `c.ProdRing`), ring maps from `R` to the tilt of `c.ProdRing` correspond bijectively to ring maps `W(R) → c.ProdRing`, by `f ↦ θ ∘ W(f)`, where θ is Fontaine's map. -/ lemma theta_comp_bijective {R : Type*} {c : PadicTest} [CommRing R] [CharP R p] [PerfectRing R p] : Bijective fun f : R →+* PreTilt c.ProdRing p ↦ (fontaineTheta c.ProdRing p).comp (WittVector.map f) := by constructor · -- Modulo `p`, the value at the Teichmüller lift of `x` is the zeroth coordinate of `f x`, and a -- map from a perfect ring to the tilt is determined by its zeroth coordinate. intro f g h_eq refine hom_ext p fun x ↦ ?_ -- `θ [y]` reduces modulo `p` to the zeroth coordinate of `y` show PreTilt.coeff 0 (f x) = PreTilt.coeff 0 (g x) simpa using congrArg (algebraMap c.ProdRing (ModP c.ProdRing p)) (RingHom.congr_fun h_eq (teichmuller p x)) · -- Reduce `g` modulo `p` to a map `g₀` on `R = W(R) / p` and lift `g₀` to the tilt. intro g let g₀ : R →+* ModP c.ProdRing p := constantCoeff.liftOfRightInverse (teichmuller p) .refl ⟨.comp (algebraMap _ _) g, by simp [cast_eq_zero, ker_constantCoeff]⟩ -- It is enough to compare values at Teichmüller lifts -- (`wittVector_ringHom_ext_of_teichmuller`). refine ⟨Perfection.lift p R _ g₀, wittVector_ringHom_ext_of_teichmuller fun x ↦ ?_⟩ rw [RingHom.comp_apply] -- `Perfection.lift` lands in `Perfection (ModP _) p`, which is `PreTilt` only after unfolding, -- so `map_teichmuller` is applied through `congrArg`. refine (congrArg (fontaineTheta c.ProdRing p) (map_teichmuller _ _ x)).trans ?_ -- `θ [y]` is the untilt of `y`, the Teichmüller map of `c.ProdRing`: its value is fixed by -- `teichmuller_spec`, as the `n`-th coordinate lifts to `g [x ^ (1 / p ^ n)]`, whose -- `p ^ n`-th power is `g [x]`. rw [fontaineTheta_teichmuller] exact teichmuller_spec fun n ↦ ⟨_, rfl, by simp [← map_pow]⟩ /-- For a perfect algebra `b` over the tilt `OFlat` of `OC`: algebra maps `b → c.TiltRing` over `OFlat` correspond to algebra maps `OC ⊗ W(b) → c.ProdRing` over `OC` (tensor product over `W(OFlat)`), naturally in the `p`-adic test `c`. The map `f` goes to the map induced by `θ ∘ W(f)`. -/ noncomputable def homTiltIso {b : CommAlg OFlat} [PerfectRing b p] : tilt ⋙ reprBy b ≅ algFunctor ⋙ reprBy ((wittFunctor ⋙ algBaseChange OC) b) := isoOfAppBijective (whiskerLeft tilt (pointMap (Y := wittFunctor (WittVector p OFlat) ⋙ algBaseChange OC ⋙ reprBy _) ⟨𝟙 _⟩) ≫ whiskerRight thetaIso.hom (reprBy _)) fun c ↦ by -- By the adjunction `algBaseChangeAdj` a map from `OC ⊗ W(b)` is an algebra map -- `g : W(b) → c.ProdRing`; in these terms the transformation sends `f` to `θ ∘ W(f)`. -- `erw`: the points of the base change match the adjunction's hom-set only after unfolding. erw [← (Equiv.ulift.trans (algBaseChangeAdj.homEquiv ..)).comp_bijective, bijective_iff_existsUnique] rintro ⟨g : WittVector p b →+* c.ProdRing, hg⟩ -- `b` is not zero, as `W(b)` maps to the nonzero `c.ProdRing`, so it has characteristic `p`. have h_nontrivial : Nontrivial b := domain_nontrivial (fun x ↦ g (teichmuller p x)) (by simp) (by simp) have h_charP : CharP b p := of_ringHom_of_ne_zero (algebraMap OFlat b) p out obtain ⟨f, rfl, h_unique⟩ := theta_comp_bijective.existsUnique g -- `f` is a map of algebras, since that may be tested after applying `θ ∘ W(–)`. have h_alg : f.comp (algebraMap OFlat b) = tiltMap c.structureMap := theta_comp_bijective.injective (RingHom.ext fun x ↦ (hg x).trans (fontaineTheta_map_tiltMap c.structureMap x).symm) refine ⟨⟨ofHom ⟨f, (f.comp _).congr_fun h_alg⟩⟩, ?_, fun ⟨f'⟩ hf' ↦ ?_⟩ · exact ext_apply fun _ ↦ c.thetaIso_hom_one_tmul _ · -- `f'` and `f` have the same image under `θ ∘ W(–)`, read off from `hf'` at `1 ⊗ x`. have h_eq : f'.hom.toRingHom = f := h_unique _ <| RingHom.ext fun x ↦ (c.thetaIso_hom_one_tmul _).symm.trans (congrArg (fun φ ↦ φ.hom x) hf') exact congrArg _ (ext_apply (RingHom.congr_fun h_eq)) /-- Tilting is full: every map between the tilts of two tests is the tilt of a map of tests. -/ instance : tilt.Full where map_surjective {X Y} f := by -- Conjugating `OC ⊗ W(f)` by `thetaIso` gives a map `g` of tests. By naturality `tilt.map g` -- and `f` have the same image under the bijection `homTiltIso`. let g : X ⟶ Y := (thetaIso.inv.app X ≫ (wittFunctor ⋙ algBaseChange _).map f ≫ thetaIso.hom.app Y).hom have h_same_image : (wittFunctor ⋙ algBaseChange OC).map (tilt.map g) ≫ thetaIso.hom.app Y = (wittFunctor ⋙ algBaseChange OC).map f ≫ thetaIso.hom.app Y := (thetaIso.hom.naturality g).trans (thetaIso.hom_inv_id_app_assoc ..) exact ⟨g, congrArg ULift.down <| (homTiltIso (b := .of OFlat (PreTilt X.ProdRing p))).app Y |>.toEquiv.injective (congrArg ULift.up h_same_image)⟩ instance : algFunctor.Faithful := ⟨congrArg hom⟩ instance : tilt.Faithful := .of_comp_iso thetaIso end TiltAdjunction /-! ## Cells over primes, covers by tests and flat base change * `New.Variety.IsAffinelyCovered.devissage_bijective`: dévissage from representable to affinely covered functors. -/ section TestCover open CategoryTheory Ideal ValuationRing Pi Filter Germ Envelope Quot Adic IsLocalization Function HasBaseChange PadicTest variable {p : ℕ} /-- An ultrapower of a ring in which divisibility is total, along the hyperfilter on `ℕ`, is again such a ring (`PreValuationRing`): of two germs, one divides the other at almost all indices. -/ lemma preValuationRing_hyperfilter_germ {R : Type} [CommRing R] [PreValuationRing R] : PreValuationRing ((hyperfilter ℕ).Germ R) := by let γ : (ℕ → R) →+* (hyperfilter ℕ).Germ R := coeRingHom _ have hγ : Surjective γ := exists_rep refine ⟨hγ.forall₂.mpr fun a b ↦ ?_⟩ choose c hc using fun n ↦ cond (a n) (b n) have h_ae : (∀ᶠ n in hyperfilter ℕ, a n * c n = b n) ∨ ∀ᶠ n in hyperfilter ℕ, b n * c n = a n := Ultrafilter.eventually_or.mp (Filter.Eventually.of_forall hc) exact ⟨γ c, h_ae.imp sound sound⟩ /-- In an ultrapower along the hyperfilter on `ℕ`, every system `x j - a * x (j + 1) = c j` is solvable (`shiftDiff`), for a natural number `a`. -/ lemma surjective_shiftDiff_hyperfilter_germ {R : Type} [CommRing R] (a : ℕ) : Surjective (shiftDiff ((hyperfilter ℕ).Germ R) (a : (hyperfilter ℕ).Germ R)) := by let γ : (ℕ → R) →+* (hyperfilter ℕ).Germ R := coeRingHom _ have hγ : Surjective γ := exists_rep refine hγ.comp_left.forall.mpr fun c ↦ ?_ -- At index `k`, the finite sum `c j + a * c (j + 1) + ⋯ + a ^ (k - 1 - j) * c (k - 1)` solves -- the equations with `j < k`. let x : ℕ → ℕ → R := fun j k ↦ (List.Ico j k).foldr (fun i z ↦ c i k + a * z) 0 refine ⟨fun j ↦ γ (x j), funext fun j ↦ sound (Nat.hyperfilter_le_atTop ?_)⟩ exact (eventually_gt_atTop j).mono fun k hk ↦ by simp [x, List.Ico.eq_cons hk] /-! ### Cells and universal covers -/ /-- If B is p-torsion-free and m is a prime ideal of B containing p, there are a cell W (`New.Variety.IsCell`) and a ring map B → W sending every element of m to a non-unit. -/ lemma exists_cell_over {B : Type} [CommRing.{0} B] {m : Ideal B} (hm_prime : IsPrime m) (hp_reg : IsSMulRegular B p) (hp : ↑p ∈ m) : ∃ W : Type, ∃ (_ : CommRing W) (_ : IsCell p W) (y : B →+* W), ∀ z ∈ m, ¬IsUnit (y z) := by -- Take an absolutely integrally closed valuation ring `U` with centre `m` in which `p ≠ 0`, and -- its ultrapower `G`. Then `G` maps onto its `p`-adic completion `W`, which is the cell. let L : Type := Localization.AtPrime m let K : Type := AlgebraicClosure (Classical.arbitrary (PrimeSpectrum (FractionRing L))).asIdeal.ResidueField -- `K` is an algebraically closed field with a map from `FractionRing L`, and `U ⊆ K` a -- valuation subring that receives `L` by a local map obtain ⟨U, hU, hU_local⟩ : ∃ (U : ValuationSubring K) (hU : ∀ x, algebraMap L K x ∈ U.toSubring), IsLocalHom ((algebraMap L K).codRestrict U.toSubring hU) := IsLocalRing.exists_factor_valuationRing _ let G : Type := (hyperfilter ℕ).Germ U let γ : (ℕ → U) →+* G := coeRingHom _ have hγ : Surjective γ := exists_rep let φ : B →+* G := γ.comp (.pi fun _ ↦ .comp (.codRestrict _ U.toSubring hU) (algebraMap B L)) -- An inverse of `φ z` in `G` gives an inverse in `U` at some index, and `L → U` is local. have hφ (z : B) (hz : z ∈ m) : ¬φ z ∣ 1 := by intro h_dvd obtain ⟨w, hw⟩ := hγ.exists.mp h_dvd obtain ⟨n, hn⟩ := (coe_eq.mp hw).exists have h_unit : IsUnit ((algebraMap L K).codRestrict U.toSubring hU (algebraMap B L z)) := isUnit_of_dvd_one ⟨w n, hn⟩ exact (AtPrime.isUnit_to_map_iff L m z).mp (hU_local.map_nonunit _ h_unit) hz have hG_val : PreValuationRing G := preValuationRing_hyperfilter_germ have h_precomplete : IsPrecomplete (span {(p : G)}) G := by simpa using isPrecomplete_of_shiftDiff_surjective (surjective_shiftDiff_hyperfilter_germ p) (surjective_shiftDiff_hyperfilter_germ p) let W : Type := PrincipalCompletion G p let π : G →+* W := algebraMap G W have hπ : Surjective π := AdicCompletion.of_surjective_iff.mpr h_precomplete -- `p` is regular in `B`, so also in `L`; hence it is a unit in `FractionRing L` and in `K`. have hp_mem : (p : B) ∈ nonZeroDivisors B := mem_nonZeroDivisors_iff_left.mpr fun x hx ↦ hp_reg.right_eq_zero_of_smul (by simpa using hx) have hp_nzd : algebraMap B L p ∈ nonZeroDivisors L := map_nonZeroDivisors_le m.primeCompl L ⟨p, hp_mem, rfl⟩ have hp_unit : IsUnit (p : K) := by simpa using (map_units (FractionRing L) ⟨_, hp_nzd⟩).map (algebraMap _ K) have hG_reg : IsSMulRegular G p := by refine hγ.forall₂.mpr fun a b hab ↦ sound ((coe_eq.mp hab).mono fun n hn ↦ ?_) -- In `K`, cancel the unit `p`. exact Subtype.ext (hp_unit.mul_left_cancel (by simpa using congrArg Subtype.val hn)) have h_reg : IsSMulRegular W p := isSMulRegular_completion (R := G) hG_reg -- `W` is nontrivial: `π p = 1` would make `φ p` divide `1`. have hW_nontrivial : Nontrivial W := nontrivial_of_ne (π p ^ 1) (π 1) fun h_eq ↦ hφ p hp (by simpa using pow_dvd_iff.mp h_eq.dvd) have hW_val : PreValuationRing W := hπ.preValuationRing π.toMulHom -- Let `a * b = 0`, `b ≠ 0`. If `a ∣ p ^ n` then `p ^ n * b = 0`, which is impossible; so all -- powers of `p` divide `a`, and `a = 0` in the completion. have hW_nzd : NoZeroDivisors W := by refine ⟨fun {a b} hab ↦ or_iff_not_imp_right.mpr fun hb ↦ eq_zero_of_forall_pow_dvd fun n ↦ ?_⟩ refine (dvd_total _ a).resolve_right ?_ rintro ⟨d, hd⟩ refine hb (h_reg.pow n ?_) have h_pow : (p : W) ^ n = a * d := by rwa [← map_natCast π] simp [h_pow, mul_right_comm, hab] have hW_domain : IsDomain W := NoZeroDivisors.to_isDomain W -- `U` is absolutely integrally closed as `K` is; so are `ℕ → U` and its quotients have h_test : IsTest (ℕ → U) := IsTest.pi fun _ ↦ isTest_of_preValuationRing have h_cell : IsCell p W := { toIsAdicComplete := isAdicComplete toIsAbsIntegrallyClosed := (h_test.of_surjective hγ).of_surjective hπ p_ne_zero := by simpa using h_reg.ne one_ne_zero } -- the elements of `m` go to non-units, as `π` is local exact ⟨W, inferInstance, h_cell, π.comp φ, fun z hz hu ↦ hφ z hz (hπ.isLocalHom.map_nonunit _ hu).dvd⟩ /-- A subring `g : W → V` of a cell is again a cell if every equation `IsSolution` with coefficients in `W` that is solvable in `V` is solvable in `W` (`New.Variety.Envelope.IsSolutionClosed`). -/ lemma isCell_of_isSolutionClosed {W V : Type} [CommRing W] [CommRing V] {g : W →+* V} (hg : Envelope.IsSolutionClosed g) [hV : IsCell p V] : IsCell p W := by -- `g` is injective and reflects divisibility, so most properties are read off in `V`. The `↓` -- lets `smodEq_span_pow_iff_dvd` rewrite before `simp` unfolds the `SMOD` relation. have hW_domain : IsDomain W := hg.1.isDomain have hW_val : ValuationRing W := iff_dvd_total.mpr ⟨by simp [← hg.map_dvd_iff, dvd_total]⟩ refine { haus' := by simp_all [← hg.1.eq_iff, ← hg.map_dvd_iff, hV.haus, ↓ smodEq_span_pow_iff_dvd] prec' f hf := ?_ toIsAbsIntegrallyClosed := (hg.isTest isTest_of_preValuationRing).toIsAbsIntegrallyClosed p_ne_zero := by simp [← hg.1.eq_iff, hV.p_ne_zero] } -- `g ∘ f` is again Cauchy in `V`, as `g` reflects divisibility. have h_cauchy {m n : ℕ} (h_le : m ≤ n) : g (f m) ≡ g (f n) [SMOD (span {(p : V)} ^ m • ⊤ : Submodule V V)] := by simp_all [← hg.map_dvd_iff, ↓ smodEq_span_pow_iff_dvd] -- the limit is a solution of equation `1`, `∀ n, a 0 ^ n ∣ a (n + 1) - x`, with coefficients -- `a = p, f 0, f 1, …` let a : ℕ → W := fun n ↦ n.casesOn (p : W) f have h_lim : ∃ x : V, IsSolution (g ∘ a) x 1 := by simpa [a, IsSolution, ↓ smodEq_span_pow_iff_dvd] using hV.prec' (g ∘ f) h_cauchy -- the solution `x` in `W` is the limit: `p ^ n ∣ f n - x` for every `n`, read back along `g` obtain ⟨x, hx⟩ := hg.2 1 a h_lim exact ⟨x, by simpa [a, IsSolution, ← hg.map_dvd_iff, ↓ smodEq_span_pow_iff_dvd] using hx⟩ variable [ThePrime p] /-- Universal cover by a test: `New.Variety.PadicTest.algFunctor` has covering points (`New.Variety.HasCoveringPoints`). If the O_C-algebra B has a point (an O_C-algebra map to the ring of the test) in some p-adic test, then there are a test c and a point y of B in c through which every point of B in any test d factors by a map of tests c → d. -/ instance hasCoveringPoints_padic : HasCoveringPoints algFunctor := .mk fun B c z₀ ↦ by -- Every map from `B` to a cell factors through a cell that is a quotient of one fixed -- polynomial ring over `B`. The product of all such quotients is the covering test. `φ d z j` -- extends the `j`-th component of the point `z` to the polynomial ring (`hφ`), and its image -- holds solutions of all equations solvable in the cell (`hφ_clo`) have h_ext (d : PadicTest) (z : B →+* PadicTest.ProdRing d) (j : d.Index) : ∃ g : MvPolynomial (SolutionName B) B →+* d.Cell j, g.comp MvPolynomial.C = (evalRingHom d.Cell j).comp z ∧ IsSolutionClosed g.kerLift := exists_isSolutionClosed ((evalRingHom d.Cell j).comp z) choose φ hφ hφ_clo using h_ext let Idx : Type := {q : Ideal (MvPolynomial (SolutionName B) B) // IsCell p (_ ⧸ q)} let idx (d : PadicTest) (z : B →+* d.ProdRing) (j : d.Index) : Idx := ⟨RingHom.ker (φ d z j), isCell_of_isSolutionClosed (hφ_clo d z j) (hV := d.isCell j)⟩ have h_cell (q : Idx) : IsCell p (MvPolynomial (SolutionName B) B ⧸ q.val) := q.property let y := cellPoint B (n := ⟨idx c z₀.down.hom.toRingHom c.nonempty.some⟩) fun q : Idx ↦ algebraMap B (_ ⧸ q.val) refine ⟨y.fst, y.snd, fun d z ↦ ?_⟩ -- the map to the `j`-th cell of `d`: project to the quotient by `ker (φ d z j)`, then embed let ψ : y.fst.ProdRing →+* d.ProdRing := .pi fun j ↦ (φ d z.down.hom.toRingHom j).kerLift.comp (evalRingHom (fun q : Idx ↦ _ ⧸ q.val) (idx d z.down.hom.toRingHom j)) have hψ (x : B) : ψ (y.snd.down.hom x) = z.down.hom x := funext fun j ↦ RingHom.congr_fun (hφ d z.down.hom.toRingHom j) x exact ⟨⟨⟨ψ, fun a ↦ (hψ _).trans (z.down.hom.commutes a)⟩⟩, congrArg ULift.up (ConcreteCategory.ext_apply hψ)⟩ /-- The functor `New.Variety.PadicTest.algFunctor` is full: maps of tests are by definition the `O_C`-algebra maps between their product rings. -/ instance : algFunctor.Full := ⟨by tauto⟩ variable {C : Type _} [Category C] {A : Type} [CommRing A] {ι : C ⥤ CommAlg A} /-! ### Flat base change for affinely covered functors -/ /-- Flat base change (`New.Variety.HasFlatBaseChange`) defines a closed class of functors from C to abelian groups: it contains 0, and for M' ⊂ M with M' in the class, M is in it exactly when M/M' is. -/ lemma HasFlatBaseChange.isClosedClass : IsClosedClass (D := C) HasFlatBaseChange := by simp_all [IsClosedClass, HasFlatBaseChange, AllBijective, devissage.isClosedClass.1, devissage.isClosedClass.2] /-- The functor of points of an A-algebra B in the algebras ι(c) is affinely covered. -/ lemma isAffinelyCovered_reprBy (B : CommAlg A) : IsAffinelyCovered ι (reprBy B) := by refine ⟨⟨fun R x y ↦ ?_⟩, B, ⟨𝟙 B⟩, by tauto⟩ -- a map equalises two points `x y : B ⟶ R` if and only if it kills all differences `x a - y a` refine ⟨⨆ a, span {x.down.hom a - y.down.hom a}, fun _ _ ↦ ULift.up_inj.trans ?_⟩ simp [ConcreteCategory.hom_ext_iff, sub_eq_zero] variable [ι.Full] [ι.Faithful] [HasCoveringPoints ι] {Y : CommAlg A ⥤ Type 1} open Limits CommAlgCat Quotient Subfunctor ShortComplex omit [ι.Full] [ι.Faithful] [HasCoveringPoints ι] in /-- Let `ι` be any functor from `C` to `A`-algebras, and let `X` be a separated functor on `A`-algebras, meaning that for any two points of X(B) there is an ideal J of B such that a map φ : B → B' makes them equal exactly when φ kills J. Let `y` be a point of `X` over `B` and `η : B ⟶ T`. Then the fibre powers (`New.Variety.cech`, `m + 1` factors) of the composite h_T → h_B → X, given by `η` and `y`, are affinely covered relative to `ι`: each is separated and has a single point over some `A`-algebra from which every point over every `ι c` is obtained by some map (`New.Variety.IsAffinelyCovered`). -/ lemma isAffinelyCovered_cech {X : CommAlg A ⥤ Type 1} (hX : IsSeparatedFunctor X) {T B : CommAlg A} (η : B ⟶ T) (y : X.obj B) (m : ℕ) : IsAffinelyCovered ι (cech (reprMap η ≫ pointMap y) m) := by constructor · -- two tuples agree exactly where the differences of their coordinates vanish refine ⟨fun _ x x' ↦ ⟨⨆ (i) (a), span {(x.val i).down.hom a - (x'.val i).down.hom a}, ?_⟩⟩ simp +instances [cech, funext_iff, reprFunctor, ConcreteCategory.hom_ext_iff, sub_eq_zero] -- On the tensor power of `T`, with coprojections `e i`, the images of `y` along `e i` and `e j` -- become equal exactly when an ideal `J i j` is killed, because `X` is separated. let e : Fin (m + 1) → (T ⟶ ∐ fun _ ↦ T) := Sigma.ι fun _ ↦ T choose J hJ_raw using fun i j ↦ hX.exists_ideal _ (X.map (η ≫ e i) y) (X.map (η ≫ e j) y) have hJ : ∀ (i j : Fin (m + 1)) (B' : CommAlg A) (φ : (∐ fun _ ↦ T) ⟶ B'), X.map (η ≫ Sigma.ι (fun _ ↦ T) i ≫ φ) y = X.map (η ≫ Sigma.ι (fun _ ↦ T) j ≫ φ) y ↔ J i j ≤ RingHom.ker φ.hom := by simpa [e, ← X.map_comp_apply, -Functor.map_comp] using hJ_raw -- so the universal tuple over the quotient by all `J i j` lies in the fibre power let π : (∐ fun _ : Fin (m + 1) ↦ T) ⟶ of A ((↑(∐ fun _ ↦ T) : Type) ⧸ iSup (uncurry J)) := ofHom (mkₐ A (iSup J.uncurry)) refine ⟨_, ⟨fun i ↦ ⟨e i ≫ π⟩, fun i j ↦ ?_⟩, fun d x ↦ ?_⟩ · exact (hJ i j _ π).mpr ((le_iSup J.uncurry (i, j)).trans mk_ker.ge) -- and every point `x` of the fibre power kills all `J i j`, so it factors through the quotient let σ : (∐ fun _ ↦ T) ⟶ ι.obj d := Limits.Sigma.desc fun i : Fin (m + 1) ↦ (x.val i).down have h_agree (i j : Fin (m + 1)) : X.map (η ≫ Sigma.ι (fun _ ↦ T) i ≫ σ) y = X.map (η ≫ Sigma.ι (fun _ ↦ T) j ≫ σ) y := by -- `using!`: the maps `pointMap y` and `reprMap η` unfold to `X.map` only by definition. simpa [σ, -Functor.map_comp] using! x.prop i j have h_kill : iSup J.uncurry ≤ RingHom.ker σ.hom := iSup_le fun ⟨i, j⟩ ↦ (hJ i j (ι.obj d) σ).mp (h_agree i j) -- coordinate `i` of the factored tuple is `Sigma.ι i ≫ σ`, which is `x.val i` exact ⟨⟨ofHom (liftₐ _ _ h_kill)⟩, Subtype.ext <| funext fun i ↦ congrArg ULift.up (Sigma.ι_comp_desc (fun i ↦ (x.val i).down) i)⟩ /-- Let ι from C to A-algebras be fully faithful, and suppose that each A-algebra B with a point in some ι(c) has one point through which all its points factor (`New.Variety.HasCoveringPoints`). Let `f` be a family of maps `M N' n → N N' n`, indexed by functors `N'` from C to abelian groups and degrees n. Suppose it satisfies the five and four lemmas like a map of contravariant δ-functors (`New.Variety.Devissage`). If f is bijective in all degrees at ℤ[h_c] for every object c of C, then it is so at ℤ[Y∘ι] for every affinely covered Y. Here Y is separated and has one point y ∈ Y(B) of which every point of each Y(ι c) is an image (`New.Variety.IsAffinelyCovered`). -/ lemma IsAffinelyCovered.devissage_bijective {M N : C ⥤ Ab → ℕ → Type _} {f : (N' : C ⥤ Ab) → (n : ℕ) → M N' n → N N' n} (h : Devissage (D := C) (A := M) (B := N) f) (h_rep : ∀ c : C, AllBijective (f (freeAb.obj (reprBy c)))) (hY : IsAffinelyCovered ι Y) : AllBijective (f (freeAb.obj (ι ⋙ Y))) := by -- Induction on the number `r` of conditions in `BijectiveUpTo`, for all affinely covered `Y`. refine allBijective_iff_forall_bijectiveUpTo.mpr fun r ↦ ?_ induction r generalizing Y with | zero => simp [BijectiveUpTo] | succ r ih => obtain ⟨d, ⟨w⟩⟩ | h_empty := em (∃ d, Nonempty ((ι ⋙ Y).obj d)) swap · -- without points, `freeAb.obj (ι ⋙ Y)` is zero have h_id_zero : 𝟙 (freeAb.obj (ι ⋙ Y)) = 0 := freeAb.hom_ext fun d w ↦ (h_empty ⟨d, ⟨w⟩⟩).elim exact allBijective_iff_forall_bijectiveUpTo.mp (h.isClosedClass.1 _ h_id_zero) _ -- cover `ι ⋙ Y` by a representable functor obtain ⟨hY_sep, B, y, hy⟩ := hY obtain ⟨c, ⟨η⟩, hη⟩ := HasCoveringPoints.exists_surjective_point B (hy d w).choose let q := reprMap η ≫ pointMap y let Q : Subfunctor (ι ⋙ Y) := range (ι.whiskerLeft q) -- the image `Q` is all of `ι ⋙ Y`, as every point of `Y` comes from `y` and `η` have h_iso : IsIso Q.ι := by refine Q.eq_top_iff_isIso.mp (top_unique fun d x _ ↦ ?_) obtain ⟨a, ha⟩ := (hy d).comp (hη d) x exact ⟨⟨ι.map a.down⟩, ha⟩ -- Čech descent: `r + 1` conditions on the cover and `r` on its fibre powers give `r + 1` on the -- image, which is all of `ι ⋙ Y` have h_cover : AllBijective (f (freeAb.obj (ι ⋙ reprBy (ι.obj c)))) := h.isClosedClass.freeAb_of_bijective _ (pointMap_id_bijective_of_fullyFaithful ι c) (h_rep c) have h_range : BijectiveUpTo (f (freeAb.obj Q.toFunctor)) (r + 1) := cech_descent_step _ h.toStepwiseFourLemma (allBijective_iff_forall_bijectiveUpTo.mp h_cover _) fun m ↦ ih (isAffinelyCovered_cech hY_sep η y m) -- pass along the isomorphism from the image, whose kernel is zero have h_ker : AllBijective (f (kernel (freeAb.map Q.ι))) := h.isClosedClass.1 _ ((isZero_kernel_of_mono _).eq_of_src _ _) exact h.bijectiveUpTo_quotient ⟨exact_kernel (freeAb.map Q.ι)⟩ h_range (allBijective_iff_forall_bijectiveUpTo.mp h_ker _) /-- Let ι from C to A-algebras be fully faithful, and suppose each A-algebra B with a point in some ι(c) has one point through which all its points factor (`New.Variety.HasCoveringPoints`). If Y is affinely covered (`New.Variety.IsAffinelyCovered`), then ℤ[Y∘ι] has flat base change. -/ lemma IsAffinelyCovered.hasFlatBaseChange (hY : IsAffinelyCovered ι Y) : HasFlatBaseChange (freeAb (ι ⋙ Y)) := by simp_all [HasFlatBaseChange, devissage_bijective devissage HasBaseChange.baseChangeMap_bijective_freeAb_reprBy] /-- If a functor Y on p-adic tests is isomorphic to the points of an O_C-algebra B, then ℤ[Y] has flat base change. -/ lemma hasFlatBaseChange_of_iso_reprBy {B : CommAlg OC} {Y : PadicTest ⥤ Type 1} (e : algFunctor ⋙ reprBy B ≅ Y) : HasFlatBaseChange (freeAb Y) := (HasFlatBaseChange.isClosedClass.iff_of_isIso (freeAb.map e.hom)).mp (isAffinelyCovered_reprBy B).hasFlatBaseChange end TestCover end New.Variety end