module public import Mathlib.RingTheory.Etale.StandardEtale import Mathlib.Algebra.Polynomial.Identities import Mathlib.CategoryTheory.EffectiveEpi.Comp import Mathlib.CategoryTheory.ExtremalEpi public import Lib.Cohomology.ProjectiveLine.TiltedLineFormula public import Lib.PadicComparison.Duality.LineIntegration import Lib.Cohomology.Etale.DenseSubfunctors import Lib.PadicComparison.Descent.TestCovers /-! # Good pairs: excision, Thom retraction and Alexander duality for principal opens Spaces are set-valued functors on the tests over `A` (`New.Variety.TestOver`, the full subcategory of `A`-algebras satisfying `IsTest`). A pair `(Y, U)` is the functor `New.Variety.relFreeAb U = ℤ[Y] / ℤ[U]`. The pair is good, `New.Variety.ComparedTheory.IsFiniteLerayHirsch D`, if its cohomology with locally constant `ℤ/ℓ`-coefficients is finite and compares bijectively with the theory `D`. Here `New.Variety.offClosedFiber Y` is the part of `Y` on tests where the maximal ideal of `A` generates the unit ideal. * `New.Variety.ComparedTheory.isFiniteLerayHirsch_iff_of_locally_bijective`: excision along a map that is Zariski-locally bijective on pairs. * `New.Variety.ComparedTheory.isFiniteLerayHirsch_of_prod_projLine`: goodness descends from the product with `(ℙ¹, ℙ¹ ∖ (0 : 1))`. * `New.Variety.ComparedTheory.isFiniteLerayHirsch_principal_open`: principal opens of affine space inside `(ℙ¹)^d`, by Alexander duality. * `New.Variety.ComparedTheory.isFiniteLerayHirsch_standard_etale`: standard étale charts, by two excisions. Notions from other files: * `New.Variety.projLine.unimodularRow`: homogeneous coordinates (1 + uv, v) of a point of P¹(B) with chosen representative (u, v); `New.Variety.projLine.affinePt x` is the point (x : 1). * `New.Variety.ComparedTheory`: a theory along g with morphisms to its coefficient from the locally constant ℤ/ℓ-valued functions, such that it and `New.Variety.Theory.locallyConstant` satisfy the projective line formula. * `New.Variety.IsZariskiLocallyTop ι U`: every point of `Y` lies in `U` after inverting some element outside any given maximal ideal, that is, `U` is all of `Y` Zariski-locally. ## Relation to the literature Known result: Comparison of cohomology theories by duality, via a diagonal kernel on products of P¹. This step is common to several comparison theorems. It concerns torsion coefficient theories in which the projective line is computed. In these theories, a class supported on the diagonal of (P¹)^d carries finiteness and comparison from the point to standard étale charts over affine space. Sources for the theorems: SGA 4 XVI, SGA 4½ Finitude/Dualité; Faltings, Scholze primitive comparison. The proof is in the spirit of Dold–Puppe dualisability. -/ @[expose] public section noncomputable section namespace New.Variety open CategoryTheory MonoidalCategory CartesianMonoidalCategory Finset IsLocalRing CommAlgCat TotalH projLine Ideal Subfunctor relFreeAb open Polynomial hiding comp variable {Γ : Type 1} [Category Γ] {ℓ d : ℕ} {A B R T : Type} [CommRing A] {g : Γ ⥤ TestOver A} [CommRing B] [CommRing R] {E Y : TestOver A ⥤ Type 1} {U V : Subfunctor Y} [CommRing T] [Algebra A T] (e : MvPolynomial (Fin d) A ≃ₐ[A] T) /-! ### Points of the line, principal open sets and the ideal of their complement -/ /-- The ideal of `B` generated by the image of `J` under `φ` and by the multihomogeneous form of `Φ` (of degree `Φ.degreeOf i` in the `i`-th pair of coordinates) evaluated at the rows `r i`, times the product of the second entries of the rows. -/ def multihomogeneousIdeal (Φ : MvPolynomial (Fin d) A) (J : Ideal A) (φ : A →+* B) (r : Fin d → B × B) : Ideal B := span {(∑ m ∈ Φ.support, φ (Φ.coeff m) * ∏ i : Fin d, (r i).1 ^ m i * (r i).2 ^ (Φ.degreeOf i - m i)) * ∏ i : Fin d, (r i).2} ⊔ Ideal.map φ J /-- The ideals `multihomogeneousIdeal` are compatible with ring maps that carry the rows `r i` to unit multiples of the rows `r' i`. -/ lemma map_multihomogeneousIdeal (Φ : MvPolynomial (Fin d) A) {J : Ideal A} {φ : A →+* B} (f : B →+* R) {r : Fin d → B × B} {r' : Fin d → R × R} {l : Fin d → Rˣ} (h_row : ∀ i : Fin d, (r i).map f f = (l i : R) • r' i) : (multihomogeneousIdeal Φ J φ r).map f = multihomogeneousIdeal Φ J (f.comp φ) r' := by -- The generator is homogeneous of degree `Φ.degreeOf i + 1` in the `i`-th row, so rescaling the -- rows by the units `l i` multiplies it by a unit, which does not change the ideal. rw [multihomogeneousIdeal, multihomogeneousIdeal, Ideal.map_sup, Ideal.map_map, map_span, Set.image_singleton] conv_rhs => rw [← span_singleton_mul_right_unit (∏ i, l i * l i ^ Φ.degreeOf i).isUnit] congr 3 have h_fst (i : Fin d) : f (r i).1 = l i * (r' i).1 := congrArg Prod.fst (h_row i) have h_snd (i : Fin d) : f (r i).2 = l i * (r' i).2 := congrArg Prod.snd (h_row i) simp only [map_mul, map_sum, map_prod, map_pow, RingHom.comp_apply, h_fst, h_snd, sum_mul, Units.coe_prod, Units.val_mul, Units.val_pow_eq_pow_val, mul_assoc, ← prod_mul_distrib] -- Compare the generators monomial by monomial and row by row. refine sum_congr rfl fun m hm ↦ congrArg _ (prod_congr rfl fun i _ ↦ ?_) rw [← pow_mul_pow_sub (l i : R) (Φ.monomial_le_degreeOf i hm)] ring /-- For an A-algebra T, its functor of points c ↦ Hom_A(T, c) on tests over A. -/ abbrev testSpec (A T : Type) [CommRing A] [CommRing T] [Algebra A T] : (ObjectProperty.FullSubcategory fun (x : CommAlg A) ↦ IsTest x) ⥤ Type 1 := (ObjectProperty.ι _ : TestOver A ⥤ CommAlg A) ⋙ reprBy (of A T) /-- A point ψ of Spec T with values in a test A-algebra c, viewed as an A-algebra homomorphism T → c. -/ abbrev testSpec.asAlgHom {c : ObjectProperty.FullSubcategory fun (x : CommAlg A) ↦ IsTest x} (ψ : testSpec A T c) : T →ₐ[A] c.obj := ψ.down.hom /-- For a in T, the subfunctor of Spec T (on tests over A) of the points ψ at which ψ(a) is a unit. -/ def testUnitLocus (a : T) : Subfunctor (testSpec A T) where obj _ := {ψ | IsUnit (testSpec.asAlgHom ψ a)} map f _ h_unit := h_unit.map f.hom.hom /-- The unit locus of a product is the intersection of the unit loci of its factors. -/ lemma testUnitLocus_mul (a b : T) : (testUnitLocus (a * b) : Subfunctor (testSpec A T)) = testUnitLocus a ⊓ testUnitLocus b := by ext c ψ simp [testUnitLocus, IsUnit.mul_iff] open IsLocalization Away Algebra in /-- Let `L` be a localization of `T` away from `a` (`Localization.Away a` unless `L` is given). Then the functor of points of `L` on tests over `A` is isomorphic to the unit locus `testUnitLocus a` of `a` in Spec `T`. -/ lemma testUnitLocus.nonempty_iso_away (a : T) (L : Type := Localization.Away a) [CommRing L] [Algebra A L] [Algebra T L] [IsScalarTower A T L] [IsLocalization.Away a L] : Nonempty (testSpec A L ≅ (testUnitLocus a).toFunctor) := -- The universal property of the localization: a map out of `L` is the same as a map out of `T` -- that sends `a` to a unit. ⟨NatIso.ofComponents fun c ↦ Equiv.toIso { toFun φ := ⟨⟨ofHom (algHom A T L) ≫ φ.down⟩, (algebraMap_isUnit a).map φ.down.hom⟩ invFun ψ := ⟨ofHom (liftAlgHom a ψ.property)⟩ -- Two maps out of `L` that agree on `T` are equal. left_inv φ := ULift.down_injective <| CommAlgCat.hom_ext <| algHom_ext (.powers a) (AlgHom.ext (lift_eq (S := L) _)) right_inv ψ := Subtype.ext <| ULift.down_injective <| CommAlgCat.hom_ext <| AlgHom.ext fun t ↦ IsLocalization.lift_eq .. }⟩ /-- For e: A[X_1,…,X_d] ≅ T, the map from Spec T to (P¹)^d on tests over A sending ψ to the points (ψ(e X_i) : 1). -/ def affineToLines : testSpec A T ⟶ ringOf (𝟭 _) ⋙ projLinePow (Fin d) where app _c := ↾fun ψ i ↦ affinePt (testSpec.asAlgHom ψ (e (.X i))) -- A ring map sends the point `(x : 1)` to the point `(f x : 1)`. naturality _ _ _ := congr(↾fun _ _ ↦ $(.symm (map_affinePt ..))) /-- `affineToLines e` is a monomorphism: a point of Spec `T` is determined by its values at the generators `e (X i)`. -/ instance : Mono (affineToLines e) := mono_of_app_injective fun c ψ χ h_app_eq ↦ by -- Two points with the same image agree on the generators `e (X i)` of `T`. refine ULift.down_injective ((cancel_epi (CommAlgCat.isoMk e).hom).mp ?_) ext i exact affinePt_injective (congrFun h_app_eq i) /-- At a point `ψ` of the affine space `testSpec A T` over the test `c`, the ideal `multihomogeneousIdeal (e.symm a) ⊥` of the rows of `affineToLines e` at `ψ` is the unit ideal exactly when `ψ` lies in `testUnitLocus a`: up to units the rows are `(ψ (e (X i)), 1)`, so the ideal is generated by `ψ a`. -/ private lemma multihomogeneousIdeal_affineToLines_eq_top_iff {a : T} {c : TestOver A} (ψ : testSpec A T c) : multihomogeneousIdeal (e.symm a) ⊥ (algebraMap A c.obj) (fun i ↦ unimodularRow ((affineToLines e).app c ψ i)) = ⊤ ↔ ψ ∈ (testUnitLocus a).obj c := by -- By `map_multihomogeneousIdeal` the ideal is the image under `χ` of the one for the rows -- `(X i, 1)`. let χ : MvPolynomial (Fin d) A →+* c.obj := ((testSpec.asAlgHom ψ).comp e.toAlgHom).toRingHom have h_row (i : Fin d) : ∃ ε : ((ringOf (𝟭 (TestOver A))).obj c)ˣ, (MvPolynomial.X i, 1).map χ χ = ε.val • unimodularRow ((affineToLines e).app c ψ i) := by refine (exists_unit_smul_unimodularRow (B := (ringOf (𝟭 (TestOver A))).obj c) ((χ (.X i) - 1 : c.obj), 1)).imp fun ε hε ↦ ?_ change (MvPolynomial.X i, 1).map χ χ = ε.val • unimodularRow (affinePt (B := (ringOf (𝟭 (TestOver A))).obj c) (χ (.X i))) dsimp only [affinePt] rw [Prod.map_apply, map_one] refine Eq.trans ?_ hε exact Prod.ext (by change (χ (.X i) : c.obj) = 1 + (χ (.X i) - 1) * 1; ring) rfl choose ε hε using h_row have h_alg : χ.comp (algebraMap A (MvPolynomial (Fin d) A)) = algebraMap A c.obj := ((testSpec.asAlgHom ψ).comp e.toAlgHom).comp_algebraMap rw [← h_alg, ← map_multihomogeneousIdeal (J := ⊥) (e.symm a) χ hε] -- Over `A[X]` the generator is `e.symm a` itself, and `χ (e.symm a) = ψ a`. simp [χ, multihomogeneousIdeal, ← MvPolynomial.eval₂_eq', map_span, testUnitLocus] /-- For `a : T` and a point `q` of `(ℙ¹)^d` over the test `c`, consider the ideal of `c` generated by the multihomogeneous form of `e.symm a`, evaluated at the rows `unimodularRow (q i)` and multiplied by the product of their second entries (the `⊥` adds no other generators). This ideal is the unit ideal exactly when `q` is the image under `affineToLines e` of a point of `testUnitLocus a`, i.e. when `q` lies in the affine space and `a` is a unit there. -/ lemma multihomogeneousIdeal_eq_top_iff {a : T} {c : TestOver A} {q : (ringOf (𝟭 (TestOver A)) ⋙ projLinePow (Fin d)).obj c} : multihomogeneousIdeal (e.symm a) ⊥ (algebraMap A c.obj) (fun i : Fin d ↦ unimodularRow (q i)) = ⊤ ↔ q ∈ Subfunctor.range ((testUnitLocus a).ι ≫ affineToLines e) c := by constructor · intro h_top -- The ideal is spanned by one element, which is then a unit. The second entries of the rows -- divide it, so they are units, and every `q i` is an affine point `affinePt (x i)`. have h_snd (i : Fin d) : IsUnit (unimodularRow (q i)).2 := by unfold multihomogeneousIdeal at h_top rw [Ideal.map_bot, sup_bot_eq, Ideal.span_singleton_eq_top] at h_top exact isUnit_of_dvd_unit (dvd_mul_of_dvd_right (dvd_prod_of_mem (fun j ↦ (unimodularRow (q j)).2) (mem_univ i)) _) h_top have h_affine (i : Fin d) : ∃ x : c.obj, affinePt (B := (ringOf (𝟭 (TestOver A))).obj c) x = projLine.map (𝟙 _) (q i) := (h_snd i).dvd.imp (affinePt_eq_map (𝟙 _) (q := q i)) choose x hx using h_affine have h_pt : (affineToLines e).app c ⟨ofHom (.comp (MvPolynomial.aeval x) e.symm)⟩ = q := by funext i change affinePt (B := (ringOf (𝟭 (TestOver A))).obj c) (MvPolynomial.aeval x (e.symm (e (.X i)))) = q i rw [AlgEquiv.symm_apply_apply, MvPolynomial.aeval_X] simpa using hx i subst h_pt exact ⟨⟨_, (multihomogeneousIdeal_affineToLines_eq_top_iff e _).mp h_top⟩, rfl⟩ · rintro ⟨⟨ψ, hψ⟩, rfl⟩ -- A point of the unit locus: `multihomogeneousIdeal_affineToLines_eq_top_iff`. exact (multihomogeneousIdeal_affineToLines_eq_top_iff e ψ).mpr hψ /-- At a point `(q, φ)` of `(ℙ¹)^d × Spec A`, the ideal `multihomogeneousIdeal Φ J` for the ring map `φ` and the unimodular rows of `q`. It is an `IdealFamily` on the elements `(B, q, φ)` over rings `B`: one ideal of `B` for each element, compatible with ring maps (`map_eq`). -/ def multihomFamily (Φ : MvPolynomial (Fin d) A) (J : Ideal A) : IdealFamily (elementsProj (projLinePow (Fin d) ⊗ reprBy (CommRingCat.of A))) where ideal x := multihomogeneousIdeal Φ J x.val.2.down.hom fun i ↦ unimodularRow (x.val.1 i) map_eq := by rintro @⟨B, q, ⟨φ⟩⟩ @⟨B', x⟩ ⟨f : B ⟶ B', hf⟩ obtain rfl : (projLinePow (Fin d) ⊗ reprBy (CommRingCat.of A)).map f (q, ⟨φ⟩) = x := hf exact map_multihomogeneousIdeal Φ f.hom fun i ↦ unimodularRow_map f (q i) variable [InvertsPrime A ℓ] (D : ComparedTheory g) /-- The part of `Y` on the tests in which the maximal ideal of `A` generates the unit ideal, that is the part away from the special fibre. -/ abbrev offClosedFiber (Y : TestOver A ⥤ Type 1) : Subfunctor Y := (IdealFamily.ofMaximalIdeal (A := A)).topLocus.preimage (toUnit Y) /-- The pairs of points of `E` with the same image under `u` that have the same class in `ℤ E / ℤ (u⁻¹ U)`. -/ def sameClassLocus (u : E ⟶ Y) (U : Subfunctor Y) : Subfunctor (fiberProd u u) where obj c := {x : (fiberProd u u).obj c | relFreeAb.mk (U.preimage u) ((fiberProd.fst u u).app c x) = relFreeAb.mk (U.preimage u) ((fiberProd.snd u u).app c x)} map f _ := congrArg ((relFreeAb (U.preimage u)).map f) /-- If `u` is injective on every test, then two points of `E` with the same image under `u` are equal, so they have the same class and the locus `sameClassLocus u U` is all of `fiberProd u u`; in particular it is everything Zariski-locally. -/ lemma isZariskiLocallyTop_sameClassLocus_of_injective (u : E ⟶ Y) (U : Subfunctor Y) (hu : ∀ c : TestOver A, Function.Injective (u.app c)) : IsZariskiLocallyTop (ringOf (𝟭 (TestOver A))) (sameClassLocus u U) := by rintro c ⟨⟨a, b⟩, h_image⟩ m hm obtain rfl : a = b := hu c h_image exact ⟨1, m.one_notMem, fun B f _ ↦ rfl⟩ namespace ComparedTheory /-! ### Excision and the Thom retraction -/ /-- Excision along a locally bijective map of pairs. Locally every point of `Y` lies in the image of `u` or in `U` (`h_surj`), and locally two points of `E` with the same image have the same class modulo the preimage of `U` (`h_inj`). Then the pair `(E, u⁻¹ U)` is good for the compared theory `D` iff `(Y, U)` is. Here `E` and `Y` are set-valued functors on the tests over `A`, `u : E ⟶ Y` and `U` is a subfunctor of `Y`. -/ lemma isFiniteLerayHirsch_iff_of_locally_bijective (u : E ⟶ Y) (h_surj : IsZariskiLocallyTop (ringOf (𝟭 (TestOver A))) (Subfunctor.range u ⊔ U)) (h_inj : IsZariskiLocallyTop (ringOf (𝟭 (TestOver A))) (sameClassLocus u U)) : D.IsFiniteLerayHirsch (relFreeAb (U.preimage u)) ↔ D.IsFiniteLerayHirsch (relFreeAb U) := by -- Under Zariski descent it suffices that the kernel and cokernel of `relFreeAb.map u` are -- locally zero. exact D.isFiniteLerayHirsch_iff_of_isCohomEquiv (relFreeAb.map u le_rfl) fun g' h_zar ↦ LocalIso.isCohomEquiv ⟨fun _ ↦ Quot.ind <| relFreeAb.mem_of_map_eq_zero u (relFreeAb.π _) _ (fun x y hxy ↦ (h_zar (h_inj.whisker g')).of_preimage_le (pointMap ⟨(x, y), hxy⟩) fun _ _ ↦ sub_eq_zero.mpr) fun x hx ↦ (show (relFreeAb.π (U.preimage u)).app _ _ = 0 from relFreeAb.mk_eq_zero hx).symm ▸ zero_mem _, fun _ ↦ relFreeAb.mem_of_mk_mem (U := U.whisker g') (.comap _ (locallyZero ..)) fun y ↦ (h_zar (h_surj.whisker g')).of_preimage_le (pointMap y) fun _ _ h ↦ (QuotientAddGroup.eq_zero_iff _).mpr <| Or.elim h (fun ⟨x, hx⟩ ↦ ⟨relFreeAb.mk (U.preimage u) x, congrArg (relFreeAb.mk U) hx⟩) fun hU ↦ ⟨0, (relFreeAb.mk_eq_zero hU).symm⟩⟩ /-- For a flat functor `N`, a class `ξ` in the total Ext from `P` to the Tate module, a map `p : N' ⟶ N ⊗ P` and a map `π : N ⟶ K`: the operation `y ↦ p^*((π^* y) · ξ)` from the total Ext of `K ∘ g` to that of `N' ∘ g`, with coefficients in a theory `Θ` along `g`, natural in `Θ`. -/ def mulClassOp {N N' K P : AbFunctor (TestOver A)} [HasFlatValues N] (ξ : TotalH P (tateModule (𝟭 (TestOver A)))) (p : N' ⟶ abTensor N P) (π : N ⟶ K) : NaturalOp 0 K N' where -- pull back along `π`, multiply by `ξ`, pull back along `p` app t := (pullbackAlong (t.toTestOver.whiskerLeft p)).comp -- `S` is named: the product is composed with the pull-back along `π` before it is applied, -- and only that pull-back determines `S`. ((t.theory.mulClass (S := t.toTestOver ⋙ N) (TotalH.map (restrictAlong t.toTestOver) ξ)).comp (pullbackAlong (t.toTestOver.whiskerLeft π))) naturality := by intro C _ t φ Θ l b x let ξt : TotalH (t.toTestOver ⋙ P) (tateModule t.toTestOver) := TotalH.map (restrictAlong t.toTestOver) ξ let ξφ : TotalH ((φ ⋙ t.toTestOver) ⋙ P) (tateModule (φ ⋙ t.toTestOver)) := TotalH.map (restrictAlong (φ ⋙ t.toTestOver)) ξ let y := pullbackAlong (t.toTestOver.whiskerLeft π) x change mapThenComp (restrictAlong φ) b (pullbackAlong (t.toTestOver.whiskerLeft p) (t.theory.mulClass ξt y)) = pullbackAlong ((φ ⋙ t.toTestOver).whiskerLeft p) (Θ.mulClass ξφ (pullbackAlong ((φ ⋙ t.toTestOver).whiskerLeft π) (mapThenComp (restrictAlong φ) b x))) refine (mapThenComp_comp map_homClass).trans ?_ refine congrArg (pullbackAlong ((φ ⋙ t.toTestOver).whiskerLeft p)) ?_ refine (t.theory.mulClass_naturality φ Θ.toTorsionCoeff b ξt y).trans ?_ have hξ : (TotalH.map (restrictAlong φ)) ξt = ξφ := map_restrictAlong_restrictAlong _ _ ξ rw [hξ] exact congrArg (Θ.mulClass ξφ) (mapThenComp_comp map_homClass) -- Keeps definitional checks from unfolding the Ext groups. seal CategoryTheory.Abelian.Ext in /-- A pair is a retract of its product with `(ℙ¹, S)`, where `S ≅ 𝔸¹` is the complement `affineChart` of `(0 : 1)`. Let `V` be a subfunctor of `Y`. If the product pair `(Y × ℙ¹, V × ℙ¹ ∪ Y × S)` is good for the compared theory `D` (`h_prod`), so is `(Y, V)`. -/ lemma isFiniteLerayHirsch_of_prod_projLine (h_prod : D.IsFiniteLerayHirsch (relFreeAb (V.preimage (fst Y (ringOf (𝟭 (TestOver A)) ⋙ projLine)) ⊔ (affineChart.whisker (ringOf (𝟭 (TestOver A)))).preimage (snd Y (ringOf (𝟭 (TestOver A)) ⋙ projLine))))) : D.IsFiniteLerayHirsch (relFreeAb V) := by -- Let `N'` be the pair of the product. Multiplying by a relative lift `ξ` of `etaClass` (the -- Chern class of `O(1)`), restricting to the graph of the tautological point of the line and -- integrating over the line sends a class on the quotient of `relFreeAb V` by `ℓ` to its -- pull-back to `relFreeAb V`, so `isFiniteLerayHirsch_of_retract` applies. let S' : Subfunctor (projLineAlong (𝟭 (TestOver A))) := affineChart.whisker _ let N' : AbFunctor (TestOver A) := relFreeAb (V.preimage (fst Y (projLineAlong (𝟭 _))) ⊔ S'.preimage (snd Y (projLineAlong (𝟭 _)))) -- `etaClass` dies on `S'`, where the first entry of the row is a unit, so it comes from the pair. obtain ⟨w, h_short⟩ := relFreeAb.shortExact S' obtain ⟨h_exact_mid, -, -⟩ := TotalH.exact_triangle h_short (tateModule (𝟭 (TestOver A))) obtain ⟨ξ, hξ⟩ : ∃ ξ : TotalH (relFreeAb S') (tateModule (𝟭 _)), pullbackAlong (relFreeAb.π S') ξ = (etaClass (𝟭 _)).toTotalH := (h_exact_mid _).mp (pullbackAlong_etaClass_eq_zero_of_isUnit S'.ι fun c x ↦ x.property) -- restriction along `y ↦ (y, points)` for the parameter `points` in the line let restrict : NaturalOp 1 N' (relFreeAb V) := { app t := pullbackAlong (relFreeAb.map (U := .whisker (_ ⊔ _) t.toTestOver) (U' := V.whisker t.toTestOver) (lift (𝟙 _) (toUnit _ ≫ sectionMap (projLinePow.component t.points 0))) fun _ _ ↦ .inl) naturality := by intros exact mapThenComp_comp map_homClass } refine D.isFiniteLerayHirsch_of_retract ![mulClassOp ξ (relFreeAb.prod V S') (abCoker.π _)] ![restrict.integrate] (fun t x ↦ ?_) h_prod -- The integral of `y · eta` is `y` (`integrate_mul_cupClass`), so it is enough to show that the -- integrand is the pull-back of `x` times `eta`. rw [Fin.sum_univ_one] refine .trans (congrArg t.line_formula.integrate ?_) (t.line_formula.integrate_mul_cupClass _ 0) refine (congrArg _ map_pullbackAlong).trans ?_ -- Write the product with `eta` as `sliceEquiv` of the product with `etaClass`, and `etaClass` in -- terms of `ξ`. rw [map_zero, add_zero] refine .trans ?_ (t.theory.toTorsionCoeff.sliceEquiv_mulClass _) let ξt : TotalH (t.toTestOver ⋙ relFreeAb S') (tateModule t.toTestOver) := TotalH.map (restrictAlong t.toTestOver) ξ let y := pullbackAlong (t.toTestOver.whiskerLeft (abCoker.π (ℓ • 𝟙 (relFreeAb V)))) x have hη : (etaClass t.toTestOver).toTotalH = pullbackAlong ((restrictAlong t.toTestOver).map (π S')) ξt := (map_restrictAlong_etaClass (g := 𝟭 (TestOver A)) t.toTestOver).symm.trans ((congrArg (TotalH.map (restrictAlong t.toTestOver)) hξ.symm).trans map_pullbackAlong) have h_mul : t.theory.mulClass (etaClass t.toTestOver).toTotalH y = pullbackAlong ((abTensor _).map ((restrictAlong t.toTestOver).map (π S'))) (t.theory.mulClass ξt y) := (congrArg (t.theory.mulClass · y) hη).trans ((congrArg (comp · _) map_pullbackAlong).trans (TotalH.comp_assoc ..)) refine .trans ?_ (congrArg sliceEquiv h_mul.symm) have h_res := map_pullbackAlong (Φ := restrictAlong (elementsProj (projLineAlong t.toTestOver))) (f := (abTensor _).map ((restrictAlong t.toTestOver).map (π S'))) (x := t.theory.mulClass ξt y) refine .trans ?_ (congrArg (fun z ↦ comp (homClass ((tensorPoint (freeAbMap tautologicalSection)).app _)) z) h_res.symm) refine TotalH.comp_assoc_of_sq ?_ _ -- What remains is a square of morphisms of functors, which commutes on generators. exact (homClass_comp ..).symm.trans ((congrArg homClass (relFreeAb.hom_ext (U := .whisker ..))).trans (homClass_comp ..)) variable [Algebra A R] (P : StandardEtalePair R) open AdjoinRoot Ideal.Quotient testSpec Finsupp /-! ### Standard étale charts -/ /-- For a standard étale pair `P = (f, g)` over `R`, the pairs `(w, ψ)` of a point `w` of `Spec (R[X] / f)[1 / g]` and a point `ψ` of `Spec R[X][1 / g]` that agree on `R` and such that `f x` is an associate of `x - y`, where `y = w (root f)` and `x = ψ X`. So `y` is a root of `f`, and `g` is a unit at `y` and at `x`. -/ def rootPairs : Subfunctor ((testUnitLocus (A := A) (AdjoinRoot.mk P.f P.g)).toFunctor ⊗ (testUnitLocus P.g).toFunctor) where obj _ := Set.ofPred fun (w, ψ) ↦ Associated (asAlgHom ψ.val P.f) (asAlgHom ψ.val X - asAlgHom w.val (root P.f)) ∧ ∀ r : R, asAlgHom w.val (AdjoinRoot.of P.f r) = asAlgHom ψ.val (C r) map f := by rintro ⟨w, ψ⟩ ⟨h_assoc, h_const⟩ refine ⟨?_, fun r ↦ congrArg f.hom.hom (h_const r)⟩ change Associated (f.hom.hom (asAlgHom ψ.val P.f)) (f.hom.hom (asAlgHom ψ.val X) - f.hom.hom (asAlgHom w.val (root P.f))) simpa only [map_sub] using h_assoc.map f.hom.hom /-- Taylor expansion at a root of `P.f`, to first order. Let `w` be a root of `P.f` and `ψ` a point of `Spec R[X]` with values in the same ring that agree on `R` (`hC`), with `ψ X = w (root P.f) + t` (`hX`) and `t ∈ m`. Then every `ψ p` is `w p + s * t` for some `s` that is congruent to `ψ p'` modulo `m`. -/ private lemma exists_eq_add_mul_and_sub_derivative_mem {P : StandardEtalePair R} {c : TestOver A} {t : c.obj} {m : Ideal c.obj} (w : AdjoinRoot P.f →ₐ[A] c.obj) (ψ : R[X] →ₐ[A] c.obj) (ht : t ∈ m) (hX : ψ X = w (root P.f) + t) (hC : ∀ r : R, w r = ψ (C r)) (p : R[X]) : ∃ s : c.obj, ψ p = w (AdjoinRoot.mk P.f p) + s * t ∧ s - ψ (derivative p) ∈ m := by let coeff := ψ.toRingHom.comp C have eval_at (φ : R[X] →+* c.obj) (hφ : φ.comp C = coeff) (q : R[X]) : (q.map coeff).eval (φ X) = φ q := by rw [eval_map, ← hφ, ← hom_eval₂, eval₂_C_X] have eval_ψ (q : R[X]) : (q.map coeff).eval (ψ X) = ψ q := eval_at ψ.toRingHom rfl q have eval_w : (p.map coeff).eval (w (root P.f)) = w (AdjoinRoot.mk P.f p) := eval_at (w.toRingHom.comp (AdjoinRoot.mk P.f)) (RingHom.ext hC) p obtain ⟨k, hk⟩ := (p.map coeff).binomExpansion (ψ X) (-t) simp only [show ψ X + -t = w (root P.f) by simp [hX], eval_w, derivative_map, eval_ψ] at hk refine ⟨ψ (derivative p) - k * t, ?_, ?_⟩ · linear_combination -hk · simpa using m.neg_mem (m.mul_mem_left k ht) /-- Near the prime `m` of the test ring, the pair `(w, ψ)` lies in `rootPairs P`: `w` is a root of `P.f`, `ψ` a point of `Spec R[X]`, they agree on `R` (`hC`), `ψ X = w (root P.f) + t` with `t ∈ m` (`hX`), and `P.g` is a unit at `w` or at `ψ`. So if a property `S` of maps `f` out of `c` holds wherever `ε ∉ m` is a unit and `f` sends `(w, ψ)` into `rootPairs P` (`hS`), then there is `a ∉ m` such that `S` holds along every `f` that makes `a` a unit. -/ lemma exists_notMem_of_rootPairs {P : StandardEtalePair R} {c : TestOver A} {t : c.obj} {m : Ideal c.obj} {ε : c.obj} (w : AdjoinRoot P.f →ₐ[A] c.obj) (ψ : R[X] →ₐ[A] c.obj) [IsPrime m] (h_unit : IsUnit (w (AdjoinRoot.mk P.f P.g)) ∨ IsUnit (ψ P.g)) {S : ∀ d : TestOver A, (c ⟶ d) → Prop} (hε : ε ∉ m) (ht : t ∈ m) (hS : ∀ (d : TestOver A) (f : c ⟶ d) (hw : ⟨ofHom w ≫ f.hom⟩ ∈ (testUnitLocus (AdjoinRoot.mk P.f P.g)).obj d) (hψ : ⟨ofHom ψ ≫ f.hom⟩ ∈ (testUnitLocus P.g).obj d), IsUnit (f.hom.hom ε) → (⟨⟨ofHom w ≫ f.hom⟩, hw⟩, ⟨⟨ofHom ψ ≫ f.hom⟩, hψ⟩) ∈ rootPairs P d → S d f) (hX : ψ X = w (root P.f) + t) (hC : ∀ r : R, w r = ψ (C r)) : ∃ a ∉ m, ∀ (d : TestOver A) (f : c ⟶ d), IsUnit (f.hom.hom a) → S d f := by -- Write `ψ P.f = r * t`. The étale condition shows `r ∉ m`, and where `r`, `ε` and both values of -- `P.g` are units the pair `(w, ψ)` lies in `rootPairs P`, so that `hS` applies. obtain ⟨r, h_f_taylor, h_r_slope⟩ := exists_eq_add_mul_and_sub_derivative_mem w ψ ht hX hC P.f obtain ⟨r', h_g_taylor, -⟩ := exists_eq_add_mul_and_sub_derivative_mem w ψ ht hX hC P.g -- The étale condition: `f'` and `f` generate a power of `g`. obtain ⟨p₁, p₂, N, h_etale⟩ : ∃ (p₁ p₂ : R[X]) (N : ℕ), derivative P.f * p₁ + P.f * p₂ = P.g ^ N := P.cond have hg_notMem : w (.mk _ P.g) ∉ m ∨ ψ P.g ∉ m := h_unit.imp m.notMem_of_isUnit m.notMem_of_isUnit refine ⟨w (.mk _ P.g) * ψ P.g * ε * r, fun h_mem ↦ ?_, fun d f ha ↦ ?_⟩ · -- Modulo the prime `m` the two values of `P.g` agree, so neither lies in `m`. And `r ∉ m`: -- else `ψ (derivative P.f) ∈ m` and `ψ P.f = r * t ∈ m` would put `ψ P.g ^ N` in `m`. have h_g_sub : ψ P.g - w (AdjoinRoot.mk P.f P.g) ∈ m := by simpa [h_g_taylor] using m.mul_mem_left r' ht obtain ⟨h_wg, h_ψg⟩ : w (AdjoinRoot.mk P.f P.g) ∉ m ∧ ψ P.g ∉ m := hg_notMem.elim (fun h ↦ ⟨h, fun h' ↦ h ((m.sub_mem_iff_right h').mp h_g_sub)⟩) (fun h ↦ ⟨fun h' ↦ h ((m.sub_mem_iff_left h').mp h_g_sub), h⟩) have h_r : r ∉ m := fun h_r ↦ h_ψg <| IsPrime.mem_of_pow_mem inferInstance N <| by have h_deriv : ψ (derivative P.f) ∈ m := (m.sub_mem_iff_right h_r).mp h_r_slope have h_f : ψ P.f ∈ m := by simpa [h_f_taylor] using m.mul_mem_left r ht rw [← map_pow, ← h_etale, map_add, map_mul, map_mul] exact m.add_mem (m.mul_mem_right _ h_deriv) (m.mul_mem_right _ h_f) have h_prime : m.IsPrime := inferInstance exact h_prime.mul_notMem (h_prime.mul_notMem (h_prime.mul_notMem h_wg h_ψg) hε) h_r h_mem · -- Where `a` is a unit, so are its four factors, and `(w, ψ)` lies in `rootPairs P`. simp only [map_mul, IsUnit.mul_iff] at ha obtain ⟨⟨⟨hw, hψ⟩, hε_unit⟩, hr_unit⟩ := ha have h_assoc : Associated (f.hom.hom (ψ P.f)) (f.hom.hom (ψ X) - f.hom.hom (w (root P.f))) := by simp [h_f_taylor, hX, hr_unit, associated_unit_mul_left] exact hS d f hw hψ hε_unit ⟨h_assoc, fun r₀ ↦ congrArg f.hom.hom (hC r₀)⟩ /-- For a standard étale pair `P = (f, g)` over `R`, the map from `rootPairs P` to `Y × ℙ¹`, where `Y = Spec (R[X] / f)[1 / g]`, that sends a pair `(y, x)` to `(y, (x - y : 1))`. -/ private def rootPairsToProdLine : (rootPairs P).toFunctor ⟶ (testUnitLocus (A := A) (AdjoinRoot.mk P.f P.g)).toFunctor ⊗ projLineAlong (𝟭 (TestOver A)) where app c := ↾fun ⟨(w, ψ), _⟩ ↦ (w, affinePt (asAlgHom ψ.val X - asAlgHom w.val (root _))) naturality _ _ f := by refine congr(↾fun _ ↦ (_, $(?_))) -- The component of the map of tests matches `map_affinePt` only after unfolding. exact .symm ((map_affinePt ..).trans (congrArg affinePt (map_sub ..))) /-- The map `(y, x) ↦ (y, (x - y : 1))` from `rootPairs P` to `Y × ℙ¹` is injective on every test: `y` and `x - y` determine `x`. -/ private lemma rootPairsToProdLine_app_injective (c : TestOver A) : Function.Injective ((rootPairsToProdLine P).app c) := by rintro ⟨⟨w, ψ, _⟩, _, hψ⟩ ⟨⟨w', χ, _⟩, _, hχ⟩ h obtain rfl : w = w' := congrArg Prod.fst h congr -- `ψ` and `χ` agree on `R`, and on `X` since `x - y` and `y` determine `x`. have h_X : asAlgHom ψ X = asAlgHom χ X := sub_left_inj.mp (affinePt_injective (congrArg Prod.snd h)) exact ULift.down_injective (CommAlgCat.hom_ext (algHom_ext' (AlgHom.ext fun r ↦ (hψ r).symm.trans (hχ r)) h_X)) /-- For a standard étale pair `P = (f, g)` over `R`, locally every point `(y, q)` of `Y × ℙ¹`, `Y = Spec (R[X] / f)[1 / g]`, is the image `(y, (x - y : 1))` of a pair of `rootPairs P`, or lies in `offClosedFiber Y × ℙ¹` or in `Y × (ℙ¹ ∖ (0 : 1))`. -/ private lemma isZariskiLocallyTop_range_rootPairsToProdLine_sup : IsZariskiLocallyTop (ringOf (𝟭 (TestOver A))) (.range (rootPairsToProdLine P) ⊔ ((offClosedFiber (testUnitLocus (A := A) (AdjoinRoot.mk P.f P.g)).toFunctor).preimage (fst ..) ⊔ (affineChart.whisker (ringOf (𝟭 (TestOver A)))).preimage (snd ..))) := by rintro c ⟨w, q : projLine (.of c.obj)⟩ m hm let m' : Ideal c.obj := m have hm' : m'.IsMaximal := hm have : m'.IsPrime := hm'.isPrime obtain h_fst | h_fst := em' ((unimodularRow q).1 ∈ m') · exact ⟨_, h_fst, fun _ _ h ↦ .inr (.inr (isUnit_fst_unimodularRow_map _ _ h))⟩ -- Otherwise `q = (t : 1)` with `t ∈ m` where an idempotent `ε ∉ m` is a unit; take `x = y + t`. have h_snd : (unimodularRow q).2 ∉ m' := fun h₂ ↦ hm'.ne_top <| (Ideal.eq_top_iff_one m').mpr <| by have h1 : (1 : c.obj) = (unimodularRow q).1 - q.down.out.1 * (unimodularRow q).2 := by simp [unimodularRow] rw [h1] exact m'.sub_mem h_fst (m'.mul_mem_left _ h₂) obtain ⟨ε, hε, h_idem, z, hz⟩ := exists_dvd_idempotent_of_notMem c.property.isComparableRing hm' h_snd let ψ : R[X] →ₐ[A] c.obj := aevalTower ((asAlgHom w.val).comp (ofAlgHom ..)) (asAlgHom w.val (root _) + z * (unimodularRow q).1) have hψ_X : ψ X = asAlgHom w.val (root P.f) + z * (unimodularRow q).1 := by simp [ψ] refine exists_notMem_of_rootPairs _ ψ (.inl w.property) hε (m'.mul_mem_left z h_fst) (fun _d f _hw _hψ h_unit h_mem ↦ ?_) hψ_X (by simp [ψ]) -- Where `ε` is a unit, `f q₁ = f q₂ * (x - y)`, so `(x - y : 1)` is the image of `q`. have h_one : f.hom.hom ε = 1 := h_unit.mul_eq_left.mp (h_idem.map _) have h_row : f.hom.hom (unimodularRow q).1 = f.hom.hom (unimodularRow q).2 * (f.hom.hom (ψ X) - f.hom.hom (asAlgHom w.val (root P.f))) := by rw [hψ_X, map_add, add_sub_cancel_left, map_mul, ← mul_assoc, ← map_mul f.hom.hom, ← hz, h_one, one_mul] exact .inl ⟨⟨_, h_mem⟩, Prod.ext rfl (affinePt_eq_map _ _ _ h_row)⟩ /-! ### Principal open sets of affine space and standard étale charts -/ /-- Alexander duality for a principal open set of `Spec T ⊆ (ℙ¹)^d`, embedded by the presentation `e` of `T` as a polynomial ring. `D.IsFiniteLerayHirsch N` requires, among other things, that `w ↦ ∑ i, (w i restricted along g) · D.comparison i` be a bijection from families in total Ext(`N`, locally constant `ℤ/ℓ`) onto total Ext(`g ⋙ N`, coefficient of `D`). If this holds for ℤ[pt]/ℤ[pt away from the special fibre] (`L`), it holds for ℤ[(ℙ¹)^d]/ℤ[`Spec T[1/a]` ∪ complement of the special fibre]. -/ lemma isFiniteLerayHirsch_principal_open (L : D.IsFiniteLerayHirsch (relFreeAb (IdealFamily.ofMaximalIdeal (A := A)).topLocus)) (a : T) : D.IsFiniteLerayHirsch (relFreeAb (Subfunctor.range ((testUnitLocus a).ι ≫ affineToLines e) ⊔ offClosedFiber (ringOf (𝟭 (TestOver A)) ⋙ projLinePow (Fin d)))) := by classical -- Up to Zariski descent the open set `U` of the statement is `W.topPoints`, the complement in -- `(ℙ¹)^d` of the zeros of the generator of `multihomogeneousIdeal` that lie in the special -- fibre. By duality (`isFiniteLerayHirsch_topPoints_of_surjective`) it suffices to find classes -- `θ` from `G` to `F` whose Leray–Hirsch map is onto at `relFreeAb W.topPoints` (proper base -- change provides them), and to show `D.IsFiniteLerayHirsch G` (it follows from `L`). let I (J : Ideal A) := multihomFamily (e.symm a) J let Q := IdealFamily.ofMaximalIdeal (A := A) let X := ringOf (𝟭 (TestOver A)) ⋙ projLinePow (Fin d) let p := testOfPoint A (projLinePow (Fin d)) let W := (I (maximalIdeal A)).pullToTests -- `F`: locally constant functions restricted to that zero set; `G`: the same for the special -- fibre of `Spec A`. let F := W.zerosCoeff (Theory.locallyConstant.onElements (X := X)).functor let G := Q.zerosCoeff (locConstAlong (𝟭 (TestOver A))) have dense_zeros : IsCohomDense F W.botLocus := Theory.locallyConstant.onElements.isCohomDense_botLocus W have dense_fibre : IsCohomDense F (Q.botLocus.whisker p) := dense_zeros.mono fun _ _ ↦ eq_bot_mono le_sup_right -- Proper base change gives classes whose Leray–Hirsch map is bijective at tests killing `𝔪_A`. obtain ⟨ι, -, h_basis⟩ := exists_isLerayHirschBasis_of_isCohomDense (Theory.locallyConstant.onElements.onZeros W) ((I _).isDetectedAtPoints_of_proper (isProperOver_projLinePow _) _ (IdealFamily.bijective_toZerosCoeff _ _) dense_zeros) dense_fibre ⟨0, 0⟩ -- They come from classes `θ` with source `G`, since `Q.toZerosCoeff` is bijective on the special -- fibre. have h_quot : IsCohomEquiv F ((restrictAlong p).map (Q.toZerosCoeff (locConstAlong (𝟭 _)))) := dense_fibre.isCohomEquiv_of_bijective_on fun _ ↦ Q.bijective_toZerosCoeff _ _ choose θ hθ using fun i : ι ↦ (h_quot _).2 i.val.2 -- Source and target of `lerayHirsch θ` only see the special fibre. have transfer {E Y : TestOver A ⥤ Type 1} (u : E ⟶ Y) (hu : ∀ c, Q.ideal c = ⊥ → Function.Bijective (u.app c)) : IsLerayHirschBasis θ (freeAb E) → IsLerayHirschBasis θ (freeAb Y) := by have hZ (c : TestOver A) (hc : Q.ideal c = ⊥) : Function.Bijective ((freeAb.map u).app c) := (FreeAddCommGroup.equivOfEquiv (.ofBijective _ (hu c hc))).bijective have h_source : IsCohomEquiv G (freeAb.map u) := (Theory.locallyConstant.isCohomDense_botLocus Q).isCohomEquiv_of_bijective_on hZ have h_target : IsCohomEquiv F ((restrictAlong p).map (freeAb.map u)) := dense_fibre.isCohomEquiv_of_bijective_on fun _ ↦ hZ _ exact (Comparison.bijective_iff_of_comm_sq (lerayHirsch_mapRange_comp θ map_homClass) (mapRange_bijective _ _ h_source.bijective_pullbackAlong) h_target.bijective_pullbackAlong).2 have lh_fibre (c : TestOver A) (hc : Q.ideal c = ⊥) : IsLerayHirschBasis θ (freeAb (reprBy c)) := by -- The bijective map of `h_basis` factors as `lerayHirsch θ` after a surjection `r`. let r : TotalH (freeAb (reprBy c)) (locConstAlong (𝟭 _)) →+ TotalH (freeAb (reprBy c)) G := comp.flip (.homClass (Q.toZerosCoeff _)) have hr : Function.Surjective r := by refine (sectionEquiv ..).surjective.forall.2 (Quot.ind fun s ↦ ⟨sectionEquiv _ _ s, ?_⟩) exact (of_comp_homClass ..).trans (congrArg _ (push_homReprEquiv_symm ..)) have factor : lerayHirsch θ _ ∘ mapRange r r.map_zero = lerayHirsch (fun i : ι ↦ i.1.2) _ := by refine _root_.funext (lerayHirsch_naturality _ r (r' := .id _) fun i x ↦ ?_) let Φ : AbFunctor (TestOver A) ⥤ AbFunctor X.Elements := restrictAlong p let π := Q.toZerosCoeff (locConstAlong (𝟭 (TestOver A))) change comp (TotalH.map Φ (comp x (homClass π))) (θ i).toTotalH = comp (TotalH.map Φ x) i.val.2.toTotalH refine (map_comp_assoc Φ (θ i).toTotalH).trans (congrArg (comp (TotalH.map Φ x)) ?_) refine (congrArg (fun y ↦ comp y (θ i).toTotalH) (map_homClass (f := π) (Φ := Φ))).trans ?_ exact (pullbackAlong_of (f := Φ.map π) (θ i)).trans (congrArg (DirectSum.of _ _) (hθ i)) have h_comp : (lerayHirsch θ _ ∘ mapRange r r.map_zero).Bijective := by rw [factor] exact h_basis c hc exact ⟨h_comp.1.of_comp_right (mapRange_surjective _ _ hr), h_comp.2.of_comp⟩ have lh_rep (c : TestOver A) : IsLerayHirschBasis θ (freeAb (reprBy c)) := by -- Pass to the reduced quotient `q : c ⟶ c'` by `𝔪_A`, which has the same points in the fibre. obtain ⟨c', q, -, -, h_univ, hq⟩ := TestOver.exists_quotient c (Q.ideal c) have hc' : Q.ideal c' = ⊥ := (Q.map_eq q).symm.trans hq refine transfer (reprFunctor.map q.op) (fun _ h ↦ ULift.map_bijective.2 ?_) (lh_fibre c' hc') exact (Function.bijective_iff_existsUnique _).2 fun f ↦ h_univ _ f ((Q.map_eq f).trans h) -- By dévissage `lerayHirsch θ` is then bijective on every functor covered by affine schemes. have lh_qc {Y} (hY : IsAffinelyCovered (ObjectProperty.ι _ : TestOver A ⥤ _) Y) : IsLerayHirschBasis θ (freeAb (ObjectProperty.ι _ ⋙ Y)) := isLerayHirschBasis_iff_allBijective_truncMap.2 (IsAffinelyCovered.devissage_bijective lerayHirsch.devissage (fun c ↦ isLerayHirschBasis_iff_allBijective_truncMap.1 (lh_rep c)) hY) let U : Subfunctor X := .range ((testUnitLocus a).ι ≫ affineToLines e) ⊔ offClosedFiber X have h_le : U ≤ W.topPoints := by rintro c q (hq | hq) · exact eq_top_mono (sup_le_sup_left (map_mono bot_le) _) ((multihomogeneousIdeal_eq_top_iff ..).2 hq) · exact eq_top_mono le_sup_right hq -- Zariski-locally the reverse inclusion holds: near `m` either `𝔪_A` generates the unit ideal, -- or the generator of `multihomogeneousIdeal` becomes a unit. have h_descent : D.IsFiniteLerayHirsch (relFreeAb U) ↔ D.IsFiniteLerayHirsch (relFreeAb W.topPoints) := by refine D.isFiniteLerayHirsch_iff_of_isCohomEquiv (relFreeAb.map (𝟙 _) h_le) fun g h_zar ↦ relFreeAb.isCohomEquiv_of_le (U := W.topPoints.whisker g) (U' := U.whisker g) (fun _ ↦ h_le _) (h_zar fun c q m hm ↦ ?_) by_cases h_fibre : (Q.whisker g).ideal c ≤ m · have h_form : ¬(I ⊥).pullToTests.ideal (.mk (obj := g.obj c) q.val) ≤ m := fun h ↦ hm.ne_top (eq_top_mono (sup_le (le_sup_left.trans h) h_fibre) q.property) obtain ⟨b, hb, h_unit⟩ := (I ⊥).pullToTests.exists_notMem_eq_top h_form exact ⟨b, hb, fun c' f hf ↦ .inl ((multihomogeneousIdeal_eq_top_iff ..).1 (h_unit (.mk (obj := g.obj c') _) ⟨g.map f, rfl⟩ hf))⟩ · obtain ⟨b, hb, h_top⟩ := (Q.whisker g).exists_notMem_eq_top h_fibre exact ⟨b, hb, fun c' f hf ↦ .inr (h_top c' f hf)⟩ -- `lerayHirsch θ` is bijective at `Spec T[1/a]`, hence at `W.topPoints`: they agree on the -- special fibre. have lh_open : IsLerayHirschBasis θ (freeAb W.topPoints.toFunctor) := by refine transfer (homOfLe (le_sup_left.trans h_le)) (fun c hc ↦ ⟨injective_of_mono _, fun q ↦ ⟨⟨_, (multihomogeneousIdeal_eq_top_iff ..).1 ?_⟩, rfl⟩⟩) ?_ · exact eq_top_mono (sup_le le_sup_left (hc.trans_le bot_le)) q.property · obtain ⟨iso⟩ := testUnitLocus.nonempty_iso_away (A := A) a exact (isClosedClass_isLerayHirschBasis.iff_of_isIso (freeAb.map (iso.hom ≫ toRange _))).1 (lh_qc (isAffinelyCovered_reprBy _)) have lh_lines : IsLerayHirschBasis θ (freeAb X) := (lh_qc isAffinelyCovered_projLinePow :) have lh_rel : IsLerayHirschBasis θ (relFreeAb W.topPoints) := (isClosedClass_isLerayHirschBasis.2 _ (relFreeAb.shortExact _).2 lh_open).1 lh_lines -- `G` is equivalent to `(ℤ[pt] / ℤ[Q.topLocus]) / ℓ`, which is good by `L`. have hG : D.IsFiniteLerayHirsch G := (D.isFiniteLerayHirsch_iff_of_isCohomEquiv Q.constToZeros fun g ↦ Q.isCohomEquiv_constToZeros g .locallyConstant rfl).1 ((D.isClosedClass_isFiniteLerayHirsch.2 _ (shortExact_nsmul_abCoker (N := relFreeAb _)).2 L).1 L) exact h_descent.2 (D.isFiniteLerayHirsch_topPoints_of_surjective W lh_rel.2 hG) /-- Assume `L`: the pair of the point and its part away from the special fibre is good for `D`. Let `e` present `R[X]` as the polynomial ring in `d` variables over `A`, and let `P = (f, g)` be a standard étale pair over `R`. In `Spec R[X][1 / g]`, let `U` be the union of the part where `f` is a unit and the part `offClosedFiber` away from the special fibre. Then the pair of `Spec R[X][1 / g]` and `U` is good for `D`. -/ lemma isFiniteLerayHirsch_offClosedFiber_sup_testUnitLocus_preimage (L : D.IsFiniteLerayHirsch (relFreeAb (IdealFamily.ofMaximalIdeal (A := A)).topLocus)) (P : StandardEtalePair R) (e : MvPolynomial (Fin d) A ≃ₐ[A] R[X]) : D.IsFiniteLerayHirsch (relFreeAb ((offClosedFiber (testSpec A R[X]) ⊔ testUnitLocus P.f).preimage (testUnitLocus (A := A) P.g).ι)) := by -- Embed everything in the product of lines. With `W x` the union of `testUnitLocus x` and -- `offClosedFiber`, the pairs given by `W (g * f)` and `W g` are good by -- `isFiniteLerayHirsch_principal_open`, hence so is the first term of the short exact sequence -- `relFreeAb.shortExact_triple`, which is the pair of the statement. let j (x : R[X]) : (testUnitLocus (A := A) x).toFunctor ⟶ ringOf (𝟭 (TestOver A)) ⋙ projLinePow (Fin d) := (testUnitLocus x).ι ≫ affineToLines e let W (x : R[X]) : Subfunctor (ringOf (𝟭 (TestOver A)) ⋙ projLinePow (Fin d)) := Subfunctor.range (j x) ⊔ offClosedFiber (ringOf (𝟭 _) ⋙ projLinePow (Fin d)) have h_range_le : Subfunctor.range (j (P.g * P.f)) ≤ Subfunctor.range (j P.g) := by simp only [j, range_comp, range_ι, testUnitLocus_mul] exact fun _ _ ⟨ψ, hψ, h_eq⟩ ↦ ⟨ψ, hψ.1, h_eq⟩ have h_sup : Subfunctor.range (j P.g) ⊔ W (P.g * P.f) = W P.g := by simp only [W, ← sup_assoc, sup_eq_left.2 h_range_le] have h_pre : (W (P.g * P.f)).preimage (j P.g) = (offClosedFiber (testSpec A R[X]) ⊔ testUnitLocus P.f).preimage (testUnitLocus (A := A) P.g).ι := by ext c ⟨ψ, hψg⟩ simp only [W, j, range_comp, range_ι, testUnitLocus_mul] constructor · rintro (⟨ψ', ⟨_, hψ'f⟩, h_eq⟩ | h) · have hψ_eq : ψ' = ψ := injective_of_mono ((affineToLines e).app c) h_eq exact .inr (hψ_eq ▸ hψ'f) · exact .inl h · rintro (h | hψf) · exact .inr h · exact .inl ⟨ψ, ⟨hψg, hψf⟩, rfl⟩ rw [← h_pre] -- Elaborated without the goal, whose unification with the result unfolds the cokernels. exact (D.isFiniteLerayHirsch_of_shortExact (relFreeAb.shortExact_triple (j P.g) (W (P.g * P.f))).2 (D.isFiniteLerayHirsch_principal_open e L (P.g * P.f)) (by simpa only [h_sup, W] using D.isFiniteLerayHirsch_principal_open e L P.g) :) /-- Standard étale charts are good. A pair `U ⊆ Y` is good for the compared theory `D` if `D.IsFiniteLerayHirsch` holds for `ℤ[Y]/ℤ[U]`: in particular `w ↦ ∑ i, (w i restricted along g) · D.comparison i` is bijective on total Ext. Let `e` present `R[X]` as the polynomial ring in `d` variables over `A`, and let `P = (f, g)` be a standard étale pair over `R`. Assume `L`: the pair of the point and its part `offClosedFiber` away from the special fibre is good for `D`. Then the pair of `Y = Spec (R[X] / f)[1 / g]` and `offClosedFiber Y` is good. -/ lemma isFiniteLerayHirsch_standard_etale (L : D.IsFiniteLerayHirsch (relFreeAb (IdealFamily.ofMaximalIdeal (A := A)).topLocus)) (P : StandardEtalePair R) (e : MvPolynomial (Fin d) A ≃ₐ[A] R[X]) : D.IsFiniteLerayHirsch (relFreeAb (offClosedFiber (testUnitLocus (AdjoinRoot.mk P.f P.g)).toFunctor)) := by -- The pairs `(y, x)` of `rootPairs P` map by `u` to the points `x` of `Spec R[X][1/g]` and by `v` -- to the points `(y, x - y)` of `Y × ℙ¹`. Both maps satisfy excision -- (`isFiniteLerayHirsch_iff_of_locally_bijective`), for subfunctors `U`, `V` with the same -- preimage; `U` is handled by `isFiniteLerayHirsch_offClosedFiber_sup_testUnitLocus_preimage`, -- and `isFiniteLerayHirsch_of_prod_projLine` descends from `V` to `Y`. let Y : TestOver A ⥤ Type 1 := (testUnitLocus (A := A) (AdjoinRoot.mk P.f P.g)).toFunctor let G : Subfunctor (testSpec A R[X]) := testUnitLocus P.g let U : Subfunctor G.toFunctor := (offClosedFiber _ ⊔ testUnitLocus P.f).preimage G.ι let V : Subfunctor (Y ⊗ projLineAlong (𝟭 _)) := (offClosedFiber Y).preimage (fst ..) ⊔ (affineChart.whisker (ringOf (𝟭 _))).preimage (snd ..) let u : (rootPairs P).toFunctor ⟶ G.toFunctor := (rootPairs P).ι ≫ snd .. let v : (rootPairs P).toFunctor ⟶ Y ⊗ projLineAlong (𝟭 _) := rootPairsToProdLine P have u_surj : IsZariskiLocallyTop (ringOf (𝟭 _)) (.range u ⊔ U) := by intro c ψ m hm let m' : Ideal c.obj := m have hm' : m'.IsMaximal := hm have : m'.IsPrime := hm'.isPrime obtain hf | hf := em' (asAlgHom ψ.val P.f ∈ m') · exact ⟨_, hf, fun _ _ h_unit ↦ .inr (.inr h_unit)⟩ -- Otherwise `x` is a root of `f` modulo `m`, and it lifts to a root `y` in the test ring. have h_root_mod : (P.f.map ((asAlgHom ψ.val).comp CAlgHom).toRingHom).eval₂ (Ideal.Quotient.mk m') (Ideal.Quotient.mk m' (asAlgHom ψ.val X)) = 0 := by rw [eval₂_map, ← hom_eval₂] change Ideal.Quotient.mk m' (P.f.eval₂ ((asAlgHom ψ.val).toRingHom.comp C) ((asAlgHom ψ.val).toRingHom X)) = 0 rw [← hom_eval₂, eval₂_C_X] exact eq_zero_iff_mem.mpr hf obtain ⟨y, hy, h_lift⟩ := c.property.exists_root_map_eq (f := Ideal.Quotient.mk m') (x := Ideal.Quotient.mk m' (asAlgHom ψ.val X)) (P.monic_f.map ((asAlgHom ψ.val).comp CAlgHom).toRingHom) h_root_mod let w := liftAlgHom P.f ((asAlgHom ψ.val).comp CAlgHom) y ((eval₂_eq_eval_map _).trans hy) exact exists_notMem_of_rootPairs w (asAlgHom ψ.val) (.inr ψ.property) m'.one_notMem ((Ideal.Quotient.eq (I := m')).mp h_lift.symm) (fun _d _f _hw _hψ _h_unit h_mem ↦ .inl ⟨⟨_, h_mem⟩, rfl⟩) (by simp [w]) (by simp [w]) -- On `rootPairs P`, `f x` is a unit exactly when `x - y` is. have h_preimage : V.preimage v = U.preimage u := by ext c ψ exact or_congr_right (isUnit_unimodularRow_affinePt_iff.trans ψ.property.1.isUnit_iff.symm) have excision_u : D.IsFiniteLerayHirsch (relFreeAb (U.preimage u)) ↔ D.IsFiniteLerayHirsch (relFreeAb U) := by -- `u` is locally injective: two roots `y`, `y'` paired with the same `x` agree near `m`, unless -- `f x ∉ m`, when both pairs are locally in `U`. refine D.isFiniteLerayHirsch_iff_of_locally_bijective u u_surj fun c ⟨⟨⟨(w, ψ), hw, hw_C⟩, (χ, _), hχ, hχ_C⟩, rfl⟩ m hm ↦ ?_ let m' : Ideal c.obj := m have hm' : m'.IsMaximal := hm have : m'.IsPrime := hm'.isPrime obtain hf | hf := em' (asAlgHom ψ.val P.f ∈ m') · exact ⟨_, hf, fun _ _ h ↦ .trans (relFreeAb.mk_eq_zero (.inr h)) (.symm (relFreeAb.mk_eq_zero (.inr h)))⟩ have h_diff : asAlgHom w.val (root _) - asAlgHom (c := c) χ.val (root _) ∈ m' := by -- `f x` divides both `x - y` and `x - y'`, and `f x ∈ m`. simpa using m'.mem_of_dvd (hχ.dvd.sub hw.dvd) hf refine exists_notMem_of_rootPairs (asAlgHom χ.val) ((asAlgHom w.val).comp ((mkₐ P.f).restrictScalars A)) (.inl χ.property) m'.one_notMem h_diff (fun _d f _hw _hψ _h_unit ⟨h_assoc, h_const⟩ ↦ ?_) (by simp) (fun r ↦ by simpa using (hχ_C r).trans (hw_C r).symm) -- `(y', y)` is locally in `rootPairs P`, so `f y = 0` divides `y - y'`: after `f` the roots -- `y`, `y'` agree, hence so do the two pairs and their classes. have h_roots_eq : f.hom.hom.comp (asAlgHom w.val) = f.hom.hom.comp (asAlgHom χ.val) := by refine algHom_ext' (AlgHom.ext fun r ↦ (h_const r).symm) ?_ have h_f_zero : f.hom.hom (asAlgHom w.val (AdjoinRoot.mk P.f P.f)) = 0 := by simp exact sub_eq_zero.mp (h_assoc.eq_zero_iff.mp h_f_zero) exact congr(relFreeAb.mk _ ⟨(⟨⟨ofHom $h_roots_eq⟩, _⟩, _), _⟩) have excision_v : D.IsFiniteLerayHirsch (relFreeAb (V.preimage v)) ↔ D.IsFiniteLerayHirsch (relFreeAb V) := D.isFiniteLerayHirsch_iff_of_locally_bijective v (isZariskiLocallyTop_range_rootPairsToProdLine_sup P) (isZariskiLocallyTop_sameClassLocus_of_injective v V (rootPairsToProdLine_app_injective P)) refine D.isFiniteLerayHirsch_of_prod_projLine (excision_v.mp ?_) rw [h_preimage, excision_u] exact D.isFiniteLerayHirsch_offClosedFiber_sup_testUnitLocus_preimage L P e end ComparedTheory end New.Variety end