/- Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Joseph Tooby-Smith -/ import HepLean.PerturbationTheory.FieldOpAlgebra.Basic /-! # Universality properties of FieldOpAlgebra -/ namespace FieldSpecification open FieldOpFreeAlgebra open HepLean.List open FieldStatistic namespace FieldOpAlgebra variable {๐“• : FieldSpecification} /-- For a field specification, `๐“•`, given an algebra `A` and a function `f : ๐“•.CrAnFieldOp โ†’ A` such that the lift of `f` to `FreeAlgebra.lift โ„‚ f : FreeAlgebra โ„‚ ๐“•.CrAnFieldOp โ†’ A` is zero on the ideal defining `๐“•.FieldOpAlgebra`, the corresponding map `๐“•.FieldOpAlgebra โ†’ A`. -/ def universalLiftMap {A : Type} [Semiring A] [Algebra โ„‚ A] (f : ๐“•.CrAnFieldOp โ†’ A) (h1 : โˆ€ a โˆˆ TwoSidedIdeal.span ๐“•.fieldOpIdealSet, FreeAlgebra.lift โ„‚ f a = 0) : FieldOpAlgebra ๐“• โ†’ A := Quotient.lift (FreeAlgebra.lift โ„‚ f) (by intro a b h rw [equiv_iff_exists_add] at h obtain โŸจa, rfl, haโŸฉ := h simp only [map_add] rw [h1 a ha] simp) @[simp] lemma universalLiftMap_ฮน {A : Type} [Semiring A] [Algebra โ„‚ A] (f : ๐“•.CrAnFieldOp โ†’ A) (h1 : โˆ€ a โˆˆ TwoSidedIdeal.span ๐“•.fieldOpIdealSet, FreeAlgebra.lift โ„‚ f a = 0) : universalLiftMap f h1 (ฮน a) = FreeAlgebra.lift โ„‚ f a := by rfl /-- For a field specification, `๐“•`, given an algebra `A` and a function `f : ๐“•.CrAnFieldOp โ†’ A` such that the lift of `f` to `FreeAlgebra.lift โ„‚ f : FreeAlgebra โ„‚ ๐“•.CrAnFieldOp โ†’ A` is zero on the ideal defining `๐“•.FieldOpAlgebra`, the corresponding algebra map `๐“•.FieldOpAlgebra โ†’ A`. -/ def universalLift {A : Type} [Semiring A] [Algebra โ„‚ A] (f : ๐“•.CrAnFieldOp โ†’ A) (h1 : โˆ€ a โˆˆ TwoSidedIdeal.span ๐“•.fieldOpIdealSet, FreeAlgebra.lift โ„‚ f a = 0) : FieldOpAlgebra ๐“• โ†’โ‚[โ„‚] A where toFun := universalLiftMap f h1 map_one' := by rw [show 1 = ฮน (๐“• := ๐“•) 1 from rfl, universalLiftMap_ฮน] simp map_mul' x y := by obtain โŸจx, rflโŸฉ := ฮน_surjective x obtain โŸจy, rflโŸฉ := ฮน_surjective y simp [โ† map_mul] map_zero' := by simp only rw [show 0 = ฮน (๐“• := ๐“•) 0 from rfl, universalLiftMap_ฮน] simp map_add' x y := by obtain โŸจx, rflโŸฉ := ฮน_surjective x obtain โŸจy, rflโŸฉ := ฮน_surjective y simp [โ† map_add] commutes' r := by simp only rw [Algebra.algebraMap_eq_smul_one r] rw [show r โ€ข 1 = ฮน (๐“• := ๐“•) (r โ€ข 1) from rfl, universalLiftMap_ฮน] simp only [map_smul, map_one] exact Eq.symm (Algebra.algebraMap_eq_smul_one r) @[simp] lemma universalLift_ฮน {A : Type} [Semiring A] [Algebra โ„‚ A] (f : ๐“•.CrAnFieldOp โ†’ A) (h1 : โˆ€ a โˆˆ TwoSidedIdeal.span ๐“•.fieldOpIdealSet, FreeAlgebra.lift โ„‚ f a = 0) : universalLift f h1 (ฮน a) = FreeAlgebra.lift โ„‚ f a := by rfl /-- For a field specification, `๐“•`, the algebra `๐“•.FieldOpAlgebra` satifies the following universal property. Let `f : ๐“•.CrAnFieldOp โ†’ A` be a function and `g : ๐“•.FieldOpFreeAlgebra โ†’โ‚[โ„‚] A` the universal lift of that function associated with the free algebra `๐“•.FieldOpFreeAlgebra`. If `g` is zero on the ideal defining `๐“•.FieldOpAlgebra`, then there is a unique algebra map `g' : FieldOpAlgebra ๐“• โ†’โ‚[โ„‚] A` such that `g' โˆ˜ ฮน = g`. -/ lemma universality {A : Type} [Semiring A] [Algebra โ„‚ A] (f : ๐“•.CrAnFieldOp โ†’ A) (h1 : โˆ€ a โˆˆ TwoSidedIdeal.span ๐“•.fieldOpIdealSet, FreeAlgebra.lift โ„‚ f a = 0) : โˆƒ! g : FieldOpAlgebra ๐“• โ†’โ‚[โ„‚] A, g โˆ˜ ฮน = FreeAlgebra.lift โ„‚ f := by use universalLift f h1 simp only apply And.intro ยท ext a simp ยท intro g hg ext a obtain โŸจa, rflโŸฉ := ฮน_surjective a simpa using congrFun hg a end FieldOpAlgebra end FieldSpecification