module Algebra.Group.Ab.Free where
Free abelian groupsπ
We have already constructed the free group on a set and the free abelian group on a group; Composing these adjunctions, we obtain the free abelian group on a set.
Free-abelian : β {β} β Type β β Abelian-group β Free-abelian T = Abelianise (Free-Group T)
Free-abelianβ£Forget : β {β} β Free-abelian-functor {β} β£ AbβͺSets Free-abelianβ£Forget = LFβ£GR (free-objectsβleft-adjoint make-free-group) (free-objectsβleft-adjoint make-free-abelian)
open is-group-hom module _ {β} (T : Type β) (t-set : is-set T) where functionβfree-ab-hom : (G : Abelian-group β) β (T β β G β) β Ab.Hom (Free-abelian T) G functionβfree-ab-hom G fn = morp where private module G = Abelian-group-on (G .snd) goβ : Free-group T β β G β goβ = fold-free-group {G = G .fst , G.AbelianβGroup-on} fn .hom go : β Free-abelian T β β β G β go (inc x) = goβ x go (glue (a , b , c) i) = goβ a G.* G.commutes {goβ b} {goβ c} i go (squash x y p q i j) = G.has-is-set (go x) (go y) (Ξ» i β go (p i)) (Ξ» i β go (q i)) i j morp : Ab.Hom (Free-abelian T) G morp .hom = go morp .preserves .pres-β = elim! Ξ» x y β refl