import Mathlib import Definitions.Def_Deformations_ProartinianCat import Definitions.Def_CategoryTheory_Subfunctor_OfIsTerminal set_option autoImplicit false open CategoryTheory IsLocalRing namespace Deformation universe u variable {n : Type} [Fintype n] [DecidableEq n] (G : Type u) [Group G] [TopologicalSpace G] variable (π“ž : Type u) [CommRing π“ž] [IsLocalRing π“ž] variable (n) in def repnFunctor : ProartinianCat π“ž β₯€ Type u where obj R := G β†’β‚œ* GL n R map {R S} f := β†Ύ (fun ρ ↦ .comp (Units.mapβ‚œ f.hom.mapMatrix.toContinuousMonoidHom) ρ) omit [IsLocalRing π“ž] in @[simp] lemma repnFunctor_map {R S : ProartinianCat π“ž} (f : R ⟢ S) (ρ : G β†’β‚œ* GL n R) (x : G) : DFunLike.coe (F := G β†’β‚œ* GL n S) ((repnFunctor n G π“ž).map f ρ) x = Matrix.GeneralLinearGroup.map (n := n) f.hom.toRingHom (ρ x) := rfl variable {G π“ž} in def toRepresentation {R} (ρ : (repnFunctor n G π“ž).obj R) : Representation R G (n β†’ R) := (Units.coeHom _).comp (Matrix.GeneralLinearGroup.toLin.toMonoidHom.comp ρ.toMonoidHom) variable (n) set_option backward.isDefEq.respectTransparency false in noncomputable def repnQuotFunctor : ProartinianCat π“ž β₯€ Type u where obj R := MulAction.orbitRel.Quotient ((Matrix.GeneralLinearGroup.map (n := n) (ProartinianCat.toResidueField R).hom.toRingHom).ker.comap (ConjAct.ofConjAct.toMonoidHom)) (G β†’β‚œ* GL n R) map {R S} f := β†ΎQuotient.map ((repnFunctor n G π“ž).map f) (by rintro _ ρ ⟨⟨g, hg⟩, rfl⟩ refine ⟨⟨.toConjAct (Matrix.GeneralLinearGroup.map f.hom.toRingHom g.ofConjAct), ?_⟩, ?_⟩ Β· simpa [← Matrix.GeneralLinearGroup.map_comp_apply, ← Matrix.GeneralLinearGroup.map_comp, ← RingHom.coe_comp, ← ContinuousAlgHom.coe_comp, -AlgHomClass.toRingHom_toAlgHom, ← AlgHom.comp_toRingHom, ← ProartinianCat.hom_comp, Subsingleton.elim _ R.toResidueField] Β· obtain ⟨g, rfl⟩ := ConjAct.toConjAct.surjective g ext1 Ξ³ simp [ConjAct.toConjAct_smul, ← map_inv, -ConjAct.ofConjAct_inv, ← map_mul]) map_id _ := by ext ⟨_⟩; rfl map_comp _ _ := by ext ⟨_⟩; rfl noncomputable def toRepnQuot : repnFunctor n G π“ž ⟢ repnQuotFunctor n G π“ž where app _ := β†ΎQuotient.mk'' naturality _ _ _ := rfl noncomputable def liftFunctor (ρ : (repnFunctor n G π“ž).obj .residueField) : Subfunctor (repnFunctor n G π“ž) := .ofIsTerminal _ ProartinianCat.isTerminalResidueField {ρ} noncomputable def deformationFunctor (ρ : (repnFunctor n G π“ž).obj .residueField) : Subfunctor (repnQuotFunctor n G π“ž) := .ofIsTerminal _ ProartinianCat.isTerminalResidueField {(toRepnQuot n G π“ž).app _ ρ} end Deformation