import Mathlib import Definitions.Def_Deformations_ProartinianCat set_option autoImplicit false universe u namespace Deformation open CategoryTheory IsLocalRing ProartinianCat local notation3:max "๐“ด" ๐“ž:max => (IsLocalRing.ResidueField ๐“ž) namespace ProartinianCat variable {๐“ž : Type u} [CommRing ๐“ž] [IsLocalRing ๐“ž] variable {R : ProartinianCat ๐“ž} variable (R) in noncomputable def residueMap (r : R) : ๐“ด ๐“ž := (toResidueField R).hom r lemma residueMap_one : residueMap R (1 : R) = 1 := map_one (toResidueField R).hom lemma residueMap_mul (r s : R) : residueMap R (r * s) = residueMap R r * residueMap R s := map_mul (toResidueField R).hom r s lemma residueMap_add (r s : R) : residueMap R (r + s) = residueMap R r + residueMap R s := map_add (toResidueField R).hom r s lemma residueMap_zero : residueMap R (0 : R) = 0 := map_zero (toResidueField R).hom lemma residueMap_algebraMap (o : ๐“ž) : residueMap R (algebraMap ๐“ž R o) = algebraMap ๐“ž (๐“ด ๐“ž) o := (toResidueField R).hom.commutes o lemma residueMap_eq_zero_of_mem {r : R} (hr : r โˆˆ maximalIdeal R) : residueMap R r = 0 := by show (toResidueField R).hom r = 0 rw [โ† RingHom.mem_ker, ker_toResidueField R] exact hr lemma isLocallyConstant_residueMap : IsLocallyConstant (residueMap R) := (IsLocallyConstant.iff_continuous ((toResidueField R).hom : R โ†’ (residueField (๐“ž := ๐“ž)))).mpr (toResidueField R).hom.cont variable (R) in structure IsTangentVector (D : R โ†’ ๐“ด ๐“ž) : Prop where map_add : โˆ€ r s, D (r + s) = D r + D s leibniz : โˆ€ r s, D (r * s) = residueMap R r * D s + D r * residueMap R s map_algebraMap : โˆ€ o : ๐“ž, D (algebraMap ๐“ž R o) = 0 isLocallyConstant : IsLocallyConstant D namespace IsTangentVector variable {D : R โ†’ ๐“ด ๐“ž} (hD : IsTangentVector R D) include hD lemma map_zero : D 0 = 0 := by have h := (hD.map_add 0 0).symm rw [add_zero] at h exact add_left_cancel (h.trans (add_zero (D 0)).symm) lemma map_one : D 1 = 0 := by simpa using hD.map_algebraMap 1 end IsTangentVector variable (R) in def tangentSubmodule : Submodule (๐“ด ๐“ž) (R โ†’ ๐“ด ๐“ž) where carrier := {D | IsTangentVector R D} zero_mem' := { map_add := fun _ _ => (add_zero (0 : ๐“ด ๐“ž)).symm leibniz := fun r s => by simp map_algebraMap := fun _ => rfl isLocallyConstant := IsLocallyConstant.const 0 } add_mem' := by rintro D D' hD hD' exact { map_add := fun r s => by simp only [Pi.add_apply, hD.map_add, hD'.map_add]; ring leibniz := fun r s => by simp only [Pi.add_apply, hD.leibniz, hD'.leibniz]; ring map_algebraMap := fun o => by simp only [Pi.add_apply, hD.map_algebraMap, hD'.map_algebraMap, add_zero] isLocallyConstant := IsLocallyConstant.compโ‚‚ hD.isLocallyConstant hD'.isLocallyConstant (ยท + ยท) } smul_mem' := by rintro c D hD exact { map_add := fun r s => by simp only [Pi.smul_apply, hD.map_add, smul_eq_mul]; ring leibniz := fun r s => by simp only [Pi.smul_apply, hD.leibniz, smul_eq_mul]; ring map_algebraMap := fun o => by simp only [Pi.smul_apply, hD.map_algebraMap, smul_zero] isLocallyConstant := hD.isLocallyConstant.comp (c โ€ข ยท) } @[simp] lemma mem_tangentSubmodule {D : R โ†’ ๐“ด ๐“ž} : D โˆˆ tangentSubmodule R โ†” IsTangentVector R D := Iff.rfl end ProartinianCat end Deformation