module public import Mathlib.GroupTheory.Nilpotent import Mathlib.RingTheory.Coalgebra.IsFrobenius public import Lib.Cohomology.Etale.FilteredLimits public import Lib.PadicComparison.Completion /-! # β„“-adic cohomology with its Galois action; finiteness and bijectivity from coefficients mod β„“ `β„“`-adic cohomology is defined as `Ext` on test rings, with coefficients in the Witt vectors of the locally constant `𝔽_β„“`-valued functions on the spectrum. * `New.Variety.ellAdicCoeff`: the coefficient `β„€_β„“`; `New.Variety.ellAdicPull`: pull-back on cohomology, over `β„š_β„“`. * `New.Variety.ellAdicCohom`, `New.Variety.ellAdicCohom.galoisAction`: cohomology of the base change to `Ξ©`, and the action of `Ξ“`. * `New.Variety.exists_ellAdicCoeff_modShortExact_pow`, `New.Variety.exists_ellAdicCoeff_modShortExact`: reduction modulo `β„“ ^ k` and `β„“`; completeness. * `New.Variety.finite_H_ellAdicCoeff`, `New.Variety.IsCohomEquiv.bijective_ellAdicPull`: finiteness and bijectivity lift from `𝔽_β„“`. Notions from other files: * `New.Variety.ModShortExact`: `ModShortExact a q` says that `0 β†’ Ξ¦ β†’ Ξ¦ β†’ G β†’ 0`, formed by multiplication by `a` and by `q`, is short exact. * `New.Variety.TestRing`: The category of test rings (`New.Variety.IsTest`), as a full subcategory of commutative rings; `New.Variety.testIncl` is its inclusion functor. ## Relation to the literature Known; see `Lib.Cohomology.Etale.FilteredLimits`, `Lib.PadicComparison.Completion` and `Lib.PadicComparison.Primitive.ComparisonTheorem` for sources. -/ @[expose] public section noncomputable section namespace New.Variety open CategoryTheory AlgebraicGeometry CommRingCat LocallyConstant WittVector Function AddCommGrpCat TensorProduct Pi variable {β„“ : β„•} [ThePrime β„“] {n : β„•} (R : CommRingCat) (Ξ© : Type) [CommRing Ξ©] [Algebra R Ξ©] (Ξ“ : Type*) [Group Ξ“] [MulSemiringAction Ξ“ Ξ©] [SMulCommClass Ξ“ R Ξ©] /-! ### Definitions -/ /-- The coefficient `β„€_β„“`: a test ring `A` goes to the Witt vectors of the ring of locally constant functions `Spec A β†’ 𝔽_β„“`. -/ abbrev ellAdicCoeff : AbFunctor TestRing := moduleCoeff (asModules ((testIncl β‹™ locConstAlg) β‹™ wittFunctor β„€_[β„“])) /-- Pull-back along `Ξ± : M ⟢ N` on `β„š_β„“ βŠ— Ext^n(-, β„€_β„“)`, as an additive function of `Ξ±`. -/ def ellAdicPull (n : β„•) {M N : AbFunctor TestRing} : (M ⟢ N) β†’+ β„š_[β„“] βŠ—[β„€_[β„“]] H N ellAdicCoeff n β†’β‚—[β„š_[β„“]] β„š_[β„“] βŠ—[β„€_[β„“]] H M ellAdicCoeff n := AddMonoidHom.mk' (fun Ξ± : M ⟢ N ↦ (H.mapβ‚— β„€_[β„“] ellAdicCoeff Ξ± n).baseChange β„š_[β„“]) fun Ξ± Ξ² ↦ LinearMap.restrictScalars_injective β„€_[β„“] <| TensorProduct.ext' fun r x ↦ by change r βŠ—β‚œ H.map ellAdicCoeff (Ξ± + Ξ²) n x = r βŠ—β‚œ H.map ellAdicCoeff Ξ± n x + r βŠ—β‚œ H.map ellAdicCoeff Ξ² n x rw [← tmul_add] exact congrArg (r βŠ—β‚œ Β·) (DFunLike.congr_fun ((H.mapHom ellAdicCoeff M N n).map_add Ξ± Ξ²) x) /-- Pulling back along `Ξ²` and then along `Ξ±` is pulling back along `Ξ± ≫ Ξ²`. -/ lemma ellAdicPull.comp {M N K : AbFunctor TestRing} (Ξ± : M ⟢ N) (Ξ² : N ⟢ K) (x : β„š_[β„“] βŠ—[β„€_[β„“]] H K ellAdicCoeff n) : ellAdicPull (β„“ := β„“) n Ξ± (ellAdicPull n Ξ² x) = ellAdicPull n (Ξ± ≫ Ξ²) x := by induction x with | tmul r y => simp [ellAdicPull, H.mapβ‚—, H.map_comp] | add x y hx hy => simp [hx, hy] /-- The functor of points (a functor from commutative rings to types, `PointFunctor`) of the base change `X Γ—_R Ξ©` of a scheme `X` over `R`. -/ def geomPoints : Over (Spec R) β₯€ PointFunctor where obj X := baseChangeOf (pointsToBase X.hom) (ofHom (algebraMap R Ξ©)) -- a point is a pair (point of `X`, ring map out of `Ξ©`); compose the first with `f` map {X Y} f := { app B := β†Ύfun x ↦ ⟨(ULift.up (x.1.1.1 ≫ f.1), x.1.2), by -- `f` is a map over `Spec R`, so the new point lies over the same map out of `R` have h_over : (x.1.1.1 ≫ f.1) ≫ Y.hom = x.1.1.1 ≫ X.hom := (Category.assoc ..).trans (congrArg (x.val.1.down ≫ Β·) f.w) exact (congrArg (fun h ↦ ULift.up (Spec.preimage h)) h_over).trans x.property⟩ naturality _ _ _ := by ext x exact baseChangeOf.ext (congrArg ULift.up (Category.assoc ..)) fun _ ↦ rfl } map_id _ := by ext B x exact baseChangeOf.ext (congrArg ULift.up (Category.comp_id _)) fun _ ↦ rfl map_comp _ _ := by ext B x exact baseChangeOf.ext (congrArg ULift.up (Category.assoc ..).symm) fun _ ↦ rfl /-- Geometric `β„“`-adic cohomology in degree `n`: `X ↦ β„š_β„“ βŠ— H^n(X Γ—_R Ξ©, β„€_β„“)`. -/ def ellAdicCohom (n : β„•) : (Over (Spec R))α΅’α΅– β₯€ ModuleCat β„š_[β„“] := (geomPoints R Ξ©).op β‹™ { obj X := ModuleCat.of β„š_[β„“] (β„š_[β„“] βŠ—[β„€_[β„“]] H (freeAb.obj (testIncl β‹™ X.unop)) ellAdicCoeff n) map u := ModuleCat.ofHom (ellAdicPull n (freeAb.map (mapOnTests u.unop))) map_id X := ModuleCat.hom_ext <| LinearMap.restrictScalars_injective β„€_[β„“] <| TensorProduct.ext' fun r x ↦ by change r βŠ—β‚œ H.map ellAdicCoeff (freeAb.map (mapOnTests (πŸ™ X.unop))) n x = r βŠ—β‚œ x rw [show mapOnTests (πŸ™ X.unop) = πŸ™ _ from Functor.whiskerLeft_id testIncl, freeAb.map_id, H.map_id] map_comp f g := ModuleCat.hom_ext <| LinearMap.ext fun x ↦ (congrArg (fun u ↦ ellAdicPull n u x) <| by dsimp only [mapOnTests] rw [unop_comp, Functor.whiskerLeft_comp, freeAb.map_comp]).trans (ellAdicPull.comp _ _ x).symm } /-- The action on `H^n(X Γ—_R Ξ©)` of a group `Ξ“` acting on `Ξ©` by `R`-algebra automorphisms. -/ def ellAdicCohom.galoisAction (X : Over (Spec R)) (n : β„•) : Representation β„š_[β„“] Ξ“ (ellAdicCohom R Ξ© n ⟨X⟩) := -- an `R`-automorphism `g` of `Ξ©` acts on the points over `Ξ©`, hence on their cohomology MonoidHom.comp { toFun (g : Ξ© ≃ₐ[R] Ξ©) := ellAdicPull n (freeAb.map (mapOnTests (baseChangeTransition _ (CommRingCat.ofHom g) (by ext r; exact g.commutes r)))) map_one' := congr($((ellAdicCohom R Ξ© n).map_id (Opposite.op X)).hom) map_mul' g g' := LinearMap.ext fun x ↦ by let tr (h : Ξ© ≃ₐ[R] Ξ©) : ((geomPoints R Ξ©).op.obj ⟨X⟩).unop ⟢ ((geomPoints R Ξ©).op.obj ⟨X⟩).unop := baseChangeTransition (pointsToBase X.hom) (CommRingCat.ofHom h) (by ext r; exact h.commutes r) have h_tr : tr g ≫ tr g' = tr (g * g') := by ext B z exact baseChangeOf.ext rfl fun _ ↦ rfl have h_free : freeAb.map (mapOnTests (tr (g * g'))) = freeAb.map (mapOnTests (tr g)) ≫ freeAb.map (mapOnTests (tr g')) := by dsimp only [mapOnTests] rw [← freeAb.map_comp, ← Functor.whiskerLeft_comp, h_tr] exact (congrArg (fun u ↦ ellAdicPull n u x) h_free).trans (ellAdicPull.comp (freeAb.map (mapOnTests (tr g))) (freeAb.map (mapOnTests (tr g'))) x).symm } (MulSemiringAction.toAlgAut Ξ“ R Ξ©) /-- Pull-back along a map `f : X ⟢ Y` of `R`-schemes commutes with the action of `Ξ“`. -/ lemma ellAdicCohom.map_galoisAction {X Y : Over (Spec R)} (f : X ⟢ Y) (g : Ξ“) (x : ((ellAdicCohom R Ξ© n).obj (Opposite.op Y))) : (ellAdicCohom R Ξ© n).map f.op (galoisAction R Ξ© Ξ“ Y n g x) = galoisAction R Ξ© Ξ“ X n g ((ellAdicCohom R Ξ© n).map f.op x) := by -- both sides are pull-backs along a composite, and the two composites are the same map let g_aut := MulSemiringAction.toAlgAut Ξ“ R Ξ© g let fm : ((geomPoints R Ξ©).op.obj ⟨X⟩).unop ⟢ ((geomPoints R Ξ©).op.obj ⟨Y⟩).unop := ((geomPoints R Ξ©).op.map f.op).unop let tr (Z : Over (Spec R)) : ((geomPoints R Ξ©).op.obj ⟨Z⟩).unop ⟢ ((geomPoints R Ξ©).op.obj ⟨Z⟩).unop := baseChangeTransition (pointsToBase Z.hom) (CommRingCat.ofHom g_aut) (by ext r; exact g_aut.commutes r) have h_comm : fm ≫ tr Y = tr X ≫ fm := by ext B z exact baseChangeOf.ext rfl fun _ ↦ rfl have h_free : freeAb.map (mapOnTests fm) ≫ freeAb.map (mapOnTests (tr Y)) = freeAb.map (mapOnTests (tr X)) ≫ freeAb.map (mapOnTests fm) := by dsimp only [mapOnTests] rw [← freeAb.map_comp, ← freeAb.map_comp, ← Functor.whiskerLeft_comp, ← Functor.whiskerLeft_comp, h_comm] exact (ellAdicPull.comp (freeAb.map (mapOnTests fm)) (freeAb.map (mapOnTests (tr Y))) x).trans <| (congrArg (fun u ↦ ellAdicPull n u x) h_free).trans (ellAdicPull.comp (freeAb.map (mapOnTests (tr X))) (freeAb.map (mapOnTests fm)) x).symm /-! ### Comparison with finite coefficients -/ /-- There is an exact sequence `0 β†’ β„€_β„“ β†’ β„€_β„“ β†’ W_k(𝔽_β„“) β†’ 0` of coefficients whose first map is `β„“ ^ k`, where the third term is the locally constant functions with values in `W_k(𝔽_β„“)`, the Witt vectors of length `k`. -/ lemma exists_ellAdicCoeff_modShortExact_pow (k : β„•) : βˆƒ q : ellAdicCoeff ⟢ locConstCoeff ⟨TruncatedWittVector β„“ k (ZMod β„“)⟩, ModShortExact ↑(β„“ ^ k) q := by -- A truncated Witt vector of locally constant functions is a locally constant function with -- values in truncated Witt vectors (`unflip`); `q` is truncation followed by this. let C (A : TestRing) := LocallyConstant (PrimeSpectrum (testIncl.obj A)) (ZMod β„“) let tr (A : TestRing) : WittVector β„“ (C A) β†’+ LocallyConstant (PrimeSpectrum (testIncl.obj A)) (TruncatedWittVector β„“ k (ZMod β„“)) := .mk' (fun x ↦ unflip (truncate k x)) fun x y ↦ LocallyConstant.ext fun a ↦ ((truncate k).comp (map (evalRingHom a : C A β†’+* ZMod β„“))).map_add x y refine ⟨_, modShortExact_of_isReductionMod (q := .mk fun A ↦ AddCommGrpCat.ofHom (tr A)) fun A ↦ ?_⟩ -- `W(C A)` has no `β„“`-torsion (`h_torsion_free`), and the first `k` coordinates of a Witt vector -- vanish exactly when it is a multiple of `β„“ ^ k` (`h_coeff_iff`) obtain ⟨-, h_torsion_free, -, h_coeff_iff⟩ := isReductionMod_constantCoeff_and_isCompleteTorsionFree (p := β„“) (ZMod β„“) (locConstAlg.obj (testIncl.obj A)) -- to show: no `β„“ ^ k`-torsion, `tr A` is onto, and its kernel is the multiples of `β„“ ^ k` refine ⟨h_torsion_free.regular.pow k, fun y ↦ ?_, fun x ↦ Iff.trans ?_ (h_coeff_iff k x)⟩ Β· obtain ⟨x, hx⟩ := truncate_surjective β„“ k (C A) y.flip exact ⟨x, congrArg unflip hx⟩ Β· -- `tr A x = 0` says that the first `k` coordinates of `x` vanish have h_tr_zero : tr A x = 0 ↔ truncate k x = 0 := by simpa only [map_zero] using (⟨congrArg LocallyConstant.flip, congrArg unflip⟩ : tr A x = tr A 0 ↔ truncate k x = truncate k 0) exact h_tr_zero.trans (mem_ker_truncate k x) /-- Two facts on the coefficient `β„€_β„“`: (a) there is a map `q` to `𝔽_β„“` with `0 β†’ β„€_β„“ β†’ β„€_β„“ β†’ 𝔽_β„“ β†’ 0` exact, the first map being `β„“`; (b) every `Ext^n(N, β„€_β„“)` is derived `β„“`-complete (`IsDerivedComplete`; `β„“`-adic completeness implies it, and it allows solving by successive approximation) (this does not involve `q`). -/ lemma exists_ellAdicCoeff_modShortExact : βˆƒ q : ellAdicCoeff ⟢ locConstCoeff ⟨ZMod β„“βŸ©, ModShortExact ↑ℓ q ∧ βˆ€ (N : AbFunctor TestRing) (n : β„•), IsDerivedComplete (β„“ : β„€_[β„“]) (H N ellAdicCoeff n) := by -- `q` is the zeroth Witt coordinate; both claims are checked at each test ring. let C (A : TestRing) : CommAlg (ZMod β„“) := (locConstAlg (p := β„“)).obj (testIncl.obj A) refine ⟨_, modShortExact_of_isReductionMod (q := .mk fun _ ↦ AddCommGrpCat.ofHom constantCoeff.toAddMonoidHom) fun A ↦ ?_, ?_⟩ Β· -- at a test ring `A`, the zeroth coordinate is reduction modulo `β„“` on an `β„“`-torsion-free ring obtain ⟨h_red, h_complete, -, -⟩ := isReductionMod_constantCoeff_and_isCompleteTorsionFree (ZMod β„“) (C A) exact ⟨h_complete.regular, h_red⟩ Β· -- the coefficients are `β„“`-adically complete and `β„“`-torsion-free at every test ring, hence -- derived `β„“`-complete, and so their cohomology is derived `β„“`-complete refine IsDerivedComplete.cohomology fun A ↦ ?_ obtain ⟨-, h_complete, -, -⟩ := isReductionMod_constantCoeff_and_isCompleteTorsionFree (ZMod β„“) (C A) exact IsCompleteTorsionFree.isDerivedComplete (B := (wittFunctor _).obj _) h_complete /-- If `Ext^n(N, 𝔽_β„“)` is finite, then `Ext^n(N, β„€_β„“)` is a finitely generated `β„€_β„“`-module. -/ lemma finite_H_ellAdicCoeff {N : AbFunctor TestRing} (h_finite : Finite (H N (locConstCoeff ⟨ZMod β„“βŸ©) n)) : Module.Finite β„€_[β„“] (H N ellAdicCoeff n) := by -- Write `H = Ext^n(N, β„€_β„“)` and `q` for its reduction modulo `β„“`. Choose lifts (`invFun q`) of -- the classes in the image of `q`: they give a map `f` to `H` from the free module on the finite -- set `Ext^n(N, 𝔽_β„“)` with `H = im f + β„“ H`, and completeness of both sides makes `f` onto. obtain ⟨c, h_exact, h_complete⟩ := exists_ellAdicCoeff_modShortExact (β„“ := β„“) let q : H N ellAdicCoeff n β†’+ H N (locConstCoeff ⟨ZMod β„“βŸ©) n := H.push N c n let b := basisFun β„€_[β„“] (H N (locConstCoeff ⟨ZMod β„“βŸ©) n) let f : (H N (locConstCoeff ⟨ZMod β„“βŸ©) n β†’ β„€_[β„“]) β†’β‚—[β„€_[β„“]] H N ellAdicCoeff n := b.constr β„• (invFun q) have hZ : IsDerivedComplete (β„“ : β„€_[β„“]) β„€_[β„“] := .of_isAdicComplete <| by rw [← PadicInt.maximalIdeal_eq_span_p] infer_instance -- successive approximation: it is enough to write each `y` as an element of `im f` plus `β„“ β€’ z` refine .of_surjective f ((h_complete N n).exists_apply_eq_of_approx hZ.pi f id fun y ↦ ?_) -- `y` and the chosen lift of `q y` have the same reduction, so they differ by a multiple of `β„“` have h_push_zero : H.push N c n (y - invFun q (q y)) = 0 := by simp [q, invFun_eq] obtain ⟨z, hz⟩ := h_exact.exists_smul_eq_of_push_eq_zero (y - invFun q (q y)) h_push_zero have h_approx : y = f (b (q y)) + (β„“ : β„€_[β„“]) β€’ z := by simp [f, hz] exact ⟨b (q y), z, h_approx⟩ /-- An equivalence for `𝔽_β„“`-coefficients induces bijections on `β„“`-adic cohomology. -/ lemma IsCohomEquiv.bijective_ellAdicPull {M N : AbFunctor TestRing} {Ξ± : M ⟢ N} (h_equiv : IsCohomEquiv (locConstCoeff ⟨ZMod β„“βŸ©) Ξ±) : Bijective (ellAdicPull (β„“ := β„“) n Ξ±) := by obtain ⟨q, h_exact, h_complete⟩ := exists_ellAdicCoeff_modShortExact (β„“ := β„“) -- Bijective modulo `β„“` and derived `β„“`-complete on both sides, so bijective over `β„€_β„“`: `of_mod` -- applied to the identity map of coefficients. have hZ : IsCohomEquiv ellAdicCoeff Ξ± := (h_equiv.bij.of_mod (Ξ² := πŸ™ (𝟭 _ β‹™ _)) h_exact h_exact rfl (fun m _ ↦ h_complete N m) (h_complete M)).eqv -- `ellAdicPull` is the base change of this map to `β„š_β„“` exact map_bijective (f := 1) bijective_id (hZ n) end New.Variety end