Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Lean/Mathlib/Mathlib/CategoryTheory/Preadditive/     Datei vom 15.10.2026 mit Größe 3 kB image not shown  

Quelle  CommGrp_.lean   Sprache: Lean

 

/-
Copyright (c) 2025 Markus Himmel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Himmel
-/

module

public import Mathlib.CategoryTheory.Monoidal.CommGrp_
public import Mathlib.CategoryTheory.Preadditive.Biproducts

set_option doc.verso true
set_option doc.verso.suggestions false

/-!
# Commutative group objects in additive categories.

We construct an inverse of the forgetful functor `CommGrp C ⥤ C` if `C` is an additive category.

This looks slightly strange because the additive structure of `C` maps to the multiplicative
structure of the commutative group objects.
-/


@[expose] public section

universe v u

namespace CategoryTheory.Preadditive

open CategoryTheory Limits MonoidalCategory CartesianMonoidalCategory

variable {C : Type u} [Category.{v} C] [Preadditive C] [CartesianMonoidalCategory C]

@[simps]
instance (X : C) : GrpObj X where
  one := 0
  mul := fst _ _ + snd _ _
  inv := -�� X
  one_mul := by simp [← leftUnitor_hom]
  mul_one := by simp [← rightUnitor_hom]
  mul_assoc := by simp [add_assoc]

variable [BraidedCategory C]

instance (X : C) : IsCommMonObj X where
  mul_comm := by simp [add_comm]

variable (C) in
/-- The canonical functor from an additive category into its commutative group objects. This is
always an equivalence, see `commGrpEquivalence`. -/

@[simps]
def toCommGrp : C ⥤ CommGrp C where
  obj X := ⟨X⟩
  map {X Y} f := InducedCategory.homMk (Grp.homMk'' f)

-- PROJECT: develop `ChosenFiniteCoproducts`, and construct `ChosenFiniteCoproducts` from
-- `CartesianMonoidalCategory` in preadditive categories, to give this lemma a proper home.
set_option backward.privateInPublic true in
omit [BraidedCategory C] in
private theorem monoidal_hom_ext {X Y Z : C} {f g : X ⊗ Y ⟶ Z}
    (h₁ : lift (�� X) 0 ≫ f = lift (�� X) 0 ≫ g) (h₂ : lift 0 (�� Y) ≫ f = lift 0 (�� Y) ≫ g) :
    f = g :=
  BinaryCofan.IsColimit.hom_ext
    (binaryBiconeIsBilimitOfLimitConeOfIsLimit (tensorProductIsBinaryProduct X Y)).isColimit h₁ h₂

set_option backward.isDefEq.respectTransparency false in
set_option backward.privateInPublic true in
set_option backward.privateInPublic.warn false in
/-- Auxiliary definition for `commGrpEquivalence`. -/
@[simps!]
def commGrpEquivalenceAux : CommGrp.forget C ⋙ toCommGrp C ≅
      �� (CommGrp C) := by
  refine NatIso.ofComponents (fun _ => CommGrp.mkIso (Iso.refl _) ?_ ?_) ?_
  · exact ((IsZero.iff_id_eq_zero _).2 (Subsingleton.elim _ _)).eq_of_src _ _
  · simp only [Functor.id_obj,
      mul_def, Iso.refl_hom, Category.comp_id, tensorHom_id, id_whiskerRight, Category.id_comp]
    apply monoidal_hom_ext
    · simp only [comp_add, lift_fst, lift_snd, add_zero]
      convert (MonObj.lift_comp_one_right _ 0).symm
      · simp
      · infer_instance
    · simp only [comp_add, lift_fst, lift_snd, zero_add]
      convert (MonObj.lift_comp_one_left 0 _).symm
      · simp
      · infer_instance
  · cat_disch

set_option backward.isDefEq.respectTransparency.types false in
set_option backward.defeqAttrib.useBackward true in
/-- An additive category is equivalent to its category of commutative group objects. -/
@[simps!]
def commGrpEquivalence : C ≌ CommGrp C where
  functor := toCommGrp C
  inverse := CommGrp.forget C
  unitIso := Iso.refl _
  counitIso := commGrpEquivalenceAux

end CategoryTheory.Preadditive

Messung
CHZG
9310010097

¤ Dauer der Verarbeitung: 0.3 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland