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

Quelle  CommComon_.lean   Sprache: Lean

 

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

module

public import Mathlib.CategoryTheory.Monoidal.Comon_

/-!
# The category of commutative comonoids in a braided monoidal category.

We define the category of commutative comonoid objects in a braided monoidal category `C`.

## Main definitions

* `CommComon C` - The bundled structure of commutative comonoid objects

## Tags

comonoid, commutative, braided
-/


@[expose] public section

universe v₁ v₂ v₃ u₁ u₂ u₃ u

namespace CategoryTheory

open MonoidalCategory ComonObj

variable {C : Type u₁} [Category.{v₁} C] [MonoidalCategory.{v₁} C] [BraidedCategory.{v₁} C]

variable (C) in
/-- A commutative comonoid object internal to a monoidal category. -/
structure CommComon where
  /-- The underlying object in the ambient monoidal category -/
  X : C
  [comon : ComonObj X]
  [comm : IsCommComonObj X]

attribute [instance] CommComon.comon CommComon.comm

namespace CommComon

/-- A commutative comonoid object is a comonoid object. -/
@[simps X]
def toComon (A : CommComon C) : Comon C := ⟨A.X⟩

section

attribute [local instance] ComonObj.instTensorUnit in
/-- The trivial comonoid on the unit object is commutative. -/
instance instCommComonObjUnit : IsCommComonObj (��_ C) where
  comul_comm := by simp [← unitors_equal]

end

attribute [local instance] ComonObj.instTensorUnit in
variable (C) in
/-- The trivial commutative comonoid object. We later show this is initial in `CommComon C`. -/
@[simps!]
def trivial : CommComon C := mk (��_ C)

instance : Inhabited (CommComon C) :=
  ⟨trivial C⟩

instance : Category (CommComon C) :=
  inferInstanceAs (Category (InducedCategory _ CommComon.toComon))

@[simp]
theorem id_hom (A : CommComon C) : Comon.Hom.hom (InducedCategory.Hom.hom (�� A)) = �� A.X :=
  rfl

@[simp]
theorem comp_hom {R S T : CommComon C} (f : R ⟶ S) (g : S ⟶ T) :
    Comon.Hom.hom (f ≫ g).hom = f.hom.hom ≫ g.hom.hom :=
  rfl

@[ext]
lemma hom_ext {A B : CommComon C} (f g : A ⟶ B) (h : f.hom.hom = g.hom.hom) : f = g :=
  InducedCategory.hom_ext (Comon.Hom.ext h)

section

variable (C)

/-- The forgetful functor from commutative comonoid objects to comonoid objects. -/
@[simps!]
def forget₂Comon : CommComon C ⥤ Comon C :=
  inducedFunctor _

end

end CommComon

instance {C : Type*} [Category* C] [MonoidalCategory C] [SymmetricCategory C]
    (A B : C) [ComonObj A] [ComonObj B]
    [IsCommComonObj A] [IsCommComonObj B] : IsCommComonObj (A ⊗ B) where
  comul_comm := by
    rw [Comon.tensorObj_comul, Category.assoc, SymmetricCategory.tensorμ_braid_swap]
    simp

end CategoryTheory

Messung
CHZG
9210010097

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland