import OAI.AlgebraicGeometry.Resolution.Blowups.Etale.Derivation import OAI.AlgebraicGeometry.Resolution.Blowups.DifferentialBlowupTransform /-! # Differential Blowup -/ namespace OAI.AlgebraicGeometry.Resolution.Blowups.Relative.DifferentialBlowup.Construction noncomputable section section /-! Differential ideals relative to the fixed coefficient ring. -/ variable (k : Type*) {R : Type*} [CommRing k] [CommRing R] [Algebra k R] /-- Adjoin every first derivative over the fixed coefficient ring. -/ def firstRelativeDifferentialIdeal (J : Ideal R) : Ideal R := J ⊔ Ideal.span (Set.range (fun t : Derivation k R R × J => t.1 t.2.val)) def iteratedRelativeDifferentialIdeal (J : Ideal R) : ℕ → Ideal R | 0 => J | n + 1 => iteratedRelativeDifferentialIdeal (firstRelativeDifferentialIdeal k J) n theorem le_firstRelativeDifferentialIdeal (J : Ideal R) : J ≤ firstRelativeDifferentialIdeal k J := le_sup_left theorem relative_derivation_mem_first (J : Ideal R) (D : Derivation k R R) {p : R} (hp : p ∈ J) : D p ∈ firstRelativeDifferentialIdeal k J := Submodule.mem_sup_right (Ideal.subset_span ⟨⟨D, ⟨p, hp⟩⟩, rfl⟩) theorem firstRelativeDifferentialIdeal_mono {J L : Ideal R} (h : J ≤ L) : firstRelativeDifferentialIdeal k J ≤ firstRelativeDifferentialIdeal k L := by apply sup_le · exact h.trans (le_firstRelativeDifferentialIdeal k L) · apply Ideal.span_le.mpr rintro x ⟨⟨D, p⟩, rfl⟩ exact relative_derivation_mem_first k L D (h p.property) theorem firstRelativeDifferentialIdeal_le_ordinary (J : Ideal R) : firstRelativeDifferentialIdeal k J ≤ DifferentialIdealTransform.Construction.firstDifferentialIdeal J := by apply sup_le · exact DifferentialIdealTransform.Construction.le_firstDifferentialIdeal J · apply Ideal.span_le.mpr rintro x ⟨⟨D, p⟩, rfl⟩ exact DifferentialIdealTransform.Construction.derivation_mem_firstDifferentialIdeal J (D.restrictScalars ℤ) p.property theorem iteratedRelativeDifferentialIdeal_mono (n : ℕ) {J L : Ideal R} (h : J ≤ L) : Construction.iteratedRelativeDifferentialIdeal k J n ≤ Construction.iteratedRelativeDifferentialIdeal k L n := by induction n generalizing J L with | zero => exact h | succ n ih => exact ih (firstRelativeDifferentialIdeal_mono k h) /-- The relative differential ideals obey the same order-lowering bound as the previously proved integer-relative differential ideals. -/ theorem iteratedRelativeDifferentialIdeal_le_ordinary (J : Ideal R) (n : ℕ) : Construction.iteratedRelativeDifferentialIdeal k J n ≤ DifferentialIdealTransform.Construction.iteratedDifferentialIdeal J n := by induction n generalizing J with | zero => exact le_rfl | succ n ih => exact (ih (firstRelativeDifferentialIdeal k J)).trans (DifferentialIdealTransform.Construction.iteratedDifferentialIdeal_mono n (firstRelativeDifferentialIdeal_le_ordinary k J)) variable {ι : Type*} /-- Derivatives of any generated ideal are generated by its original sections and the derivatives of the specified generators. -/ theorem relative_derivation_of_span (D : Derivation k R R) (p : ι → R) {x : R} (hx : x ∈ Ideal.span (Set.range p)) : D x ∈ Ideal.span (Set.range p) ⊔ Ideal.span (Set.range (fun i => D (p i))) := by refine Submodule.span_induction ?_ ?_ ?_ ?_ hx · rintro y ⟨i, rfl⟩ exact Submodule.mem_sup_right (Ideal.subset_span ⟨i, rfl⟩) · rw [map_zero] exact Ideal.zero_mem _ · intro y z _ _ hy hz rw [map_add] exact Ideal.add_mem _ hy hz · intro a y hy ih change D (a * y) ∈ _ rw [D.leibniz] change a * D y + y * D a ∈ _ exact Ideal.add_mem _ (Ideal.mul_mem_left _ a ih) (Submodule.mem_sup_left ((Ideal.span (Set.range p)).mul_mem_right (D a) hy)) end section /-! Lifting derivations while retaining the original coefficient ring. -/ variable (k : Type*) {R : Type*} [CommRing k] [CommRing R] [Algebra k R] /-- A ring derivation annihilating the coefficient ring is a relative derivation with the same underlying function. -/ def ringDerivationOverBase (D : Derivation ℤ R R) (hD : ∀ a : k, D (algebraMap k R a) = 0) : Derivation k R R where toLinearMap := { toFun := D map_add' := D.map_add map_smul' := by intro a p simp only [Algebra.smul_def, RingHom.id_apply] rw [D.leibniz, hD] simp only [smul_eq_mul, mul_zero, add_zero] } map_one_eq_zero' := D.map_one_eq_zero leibniz' := D.leibniz /-- The coefficient algebra on the actual blowup chart, through its original structure map. -/ abbrev blowupRelativeBaseAlgebra (I : Ideal R) (a : I) : Algebra k (Blowup.Charts.Construction.blowupChart I a) := ((Blowup.Charts.Construction.blowupChartConstants I a).comp (algebraMap k R)).toAlgebra attribute [local instance] blowupRelativeBaseAlgebra /-- The lifted derivation is still relative to the original base. -/ def blowupRelativeChartDerivation (I : Ideal R) (a : I) (D : Derivation k R R) : Derivation k (Blowup.Charts.Construction.blowupChart I a) (Blowup.Charts.Construction.blowupChart I a) := ringDerivationOverBase k (ChartDerivation.Construction.blowupChartDerivation I a (D.restrictScalars ℤ)) (by intro x change ChartDerivation.Construction.blowupChartDerivation I a (D.restrictScalars ℤ) (Blowup.Charts.Construction.blowupChartConstants I a (algebraMap k R x)) = 0 rw [ChartDerivation.Construction.blowupChartDerivation_constants, Derivation.restrictScalars_apply, D.map_algebraMap, map_zero, mul_zero (Blowup.Charts.Construction.blowupChartConstants I a a.val)]) theorem blowupRelativeChartDerivation_apply (I : Ideal R) (a : I) (D : Derivation k R R) (p : Blowup.Charts.Construction.blowupChart I a) : blowupRelativeChartDerivation k I a D p = ChartDerivation.Construction.blowupChartDerivation I a (D.restrictScalars ℤ) p := rfl theorem blowupRelativeChartDerivation_constants (I : Ideal R) (a : I) (D : Derivation k R R) (p : R) : blowupRelativeChartDerivation k I a D (Blowup.Charts.Construction.blowupChartConstants I a p) = Blowup.Charts.Construction.blowupChartConstants I a a.val * Blowup.Charts.Construction.blowupChartConstants I a (D p) := ChartDerivation.Construction.blowupChartDerivation_constants I a (D.restrictScalars ℤ) p end /-! Relative differential ideals under actual controlled blowup transforms. -/ variable (k : Type*) {R : Type*} [CommRing k] [CommRing R] [Algebra k R] attribute [local instance] blowupRelativeBaseAlgebra theorem firstRelativeDifferentialIdeal_le_pow (I J : Ideal R) (n : ℕ) (hJ : J ≤ I ^ (n + 1)) : firstRelativeDifferentialIdeal k J ≤ I ^ n := (firstRelativeDifferentialIdeal_le_ordinary k J).trans (DifferentialIdealTransform.Construction.firstDifferentialIdeal_le_pow I J n hJ) /-- Relative differentiation and controlled transformation satisfy the same inclusion, in the original coefficient algebra, as ordinary differentiation. -/ theorem firstRelativeDifferentialIdeal_controlledTransform_le (I J : Ideal R) (a : I) (n : ℕ) (hJ : J ≤ I ^ (n + 1)) : ControlledTransform.Construction.blowupControlledTransform I (firstRelativeDifferentialIdeal k J) n a ≤ firstRelativeDifferentialIdeal k (ControlledTransform.Construction.blowupControlledTransform I J (n + 1) a) := by let c := Blowup.Charts.Construction.blowupChartConstants I a a.val let T := ControlledTransform.Construction.blowupControlledTransform I J (n + 1) a let U := firstRelativeDifferentialIdeal k T have htotal : (firstRelativeDifferentialIdeal k J).map (Blowup.Charts.Construction.blowupChartConstants I a) ≤ Ideal.span {c ^ n} * U := by rw [Ideal.map_le_iff_le_comap] apply sup_le · intro p hp obtain ⟨q, hq, he⟩ := DifferentialIdealTransform.Construction.blowup_controlledTransform_section_exists I J a (n + 1) hJ ⟨p, hp⟩ change Blowup.Charts.Construction.blowupChartConstants I a p ∈ Ideal.span {c ^ n} * U apply Ideal.mem_span_singleton_mul.mpr refine ⟨c * q, U.mul_mem_left c (le_firstRelativeDifferentialIdeal k T hq), ?_⟩ calc c ^ n * (c * q) = c ^ (n + 1) * q := by rw [pow_succ c]; exact (mul_assoc (c ^ n) c q).symm _ = Blowup.Charts.Construction.blowupChartConstants I a p := he.symm · apply Ideal.span_le.mpr rintro r ⟨⟨D, p⟩, rfl⟩ obtain ⟨q, hq, he⟩ := DifferentialIdealTransform.Construction.blowup_controlledTransform_section_exists I J a (n + 1) hJ p change Blowup.Charts.Construction.blowupChartConstants I a (D p.val) ∈ Ideal.span {c ^ n} * U apply Ideal.mem_span_singleton_mul.mpr refine ⟨blowupRelativeChartDerivation k I a D q + (n + 1 : ℕ) * Blowup.Charts.Construction.blowupChartConstants I a (D a.val) * q, ?_, (DifferentialBlowupTransform.Construction.blowupChart_derivative_division I a (D.restrictScalars ℤ) n p.val q he).symm⟩ apply Ideal.add_mem · exact relative_derivation_mem_first k T (blowupRelativeChartDerivation k I a D) hq · exact U.mul_mem_left _ (le_firstRelativeDifferentialIdeal k T hq) have hcolon := Submodule.colon_mono htotal (Set.Subset.refl (Ideal.span {c ^ n} : Set _)) have hc : IsRegular c := ExceptionalIdeal.Construction.blowupChart_exceptionalParameter_regular I a have hcn : IsRegular (c ^ n) := IsRegular.pow (a := c) n hc have heq : (Ideal.span {c ^ n} * U).colon (Ideal.span {c ^ n}) = U := ResidualCoefficientTransform.Construction.colon_principal_mul_of_regular U (c ^ n) hcn rw [heq] at hcolon exact hcolon /-- The full relative differential filtration has the controlled transform inclusion required by hypersurface persistence. -/ theorem iteratedRelativeDifferentialIdeal_controlledTransform_le (I J : Ideal R) (a : I) (n r : ℕ) (hJ : J ≤ I ^ (n + r)) : ControlledTransform.Construction.blowupControlledTransform I (Construction.iteratedRelativeDifferentialIdeal k J r) n a ≤ Construction.iteratedRelativeDifferentialIdeal k (ControlledTransform.Construction.blowupControlledTransform I J (n + r) a) r := by induction r generalizing J with | zero => exact le_rfl | succ r ih => have hJ' : J ≤ I ^ (n + r + 1) := by simpa only [Nat.add_assoc] using hJ have hfirst := firstRelativeDifferentialIdeal_controlledTransform_le k I J a (n + r) hJ' have hind := ih (firstRelativeDifferentialIdeal k J) (firstRelativeDifferentialIdeal_le_pow k I J (n + r) hJ') exact hind.trans (by simpa only [Construction.iteratedRelativeDifferentialIdeal, Nat.add_assoc] using iteratedRelativeDifferentialIdeal_mono k r hfirst) end end OAI.AlgebraicGeometry.Resolution.Blowups.Relative.DifferentialBlowup.Construction