Documentation

Mathlib.CategoryTheory.ConcreteCategory.BundledHom

Category instances for algebraic structures that use bundled homs. #

Many algebraic structures in Lean initially used unbundled homs (e.g. a bare function between types, along with an IsMonoidHom typeclass), but the general trend is towards using bundled homs.

This file provides a basic infrastructure to define concrete categories using bundled homs, and define forgetful functors between them.

@[deprecated "The preferred method for talking about concrete categories is to implement the category manually and then provide the `ConcreteCategory` instance on top of this. See `ConcreteCategory/Basic.lean`" (since := "2025-11-17")]
class CategoryTheory.BundledHom {c : Type u → Type u} (hom : ⦃α β : Type u⦄ → c α → c β → Type u) :
Type (u + 1)

Class for bundled homs. Note that the arguments order follows that of lemmas for MonoidHom. This way we can use ⟨@MonoidHom.toFun, @MonoidHom.id ...⟩ in an instance.

  • toFun {α β : Type u} (Iα : c α) (Iβ : c β) : hom Iα Iβ → α → β

    the underlying map of a bundled morphism

  • id {α : Type u} (I : c α) : hom I I

    the identity as a bundled morphism

  • comp {α β γ : Type u} (Iα : c α) (Iβ : c β) (Iγ : c γ) : hom Iβ Iγ → hom Iα Iβ → hom Iα Iγ

    composition of bundled morphisms

  • hom_ext {α β : Type u} (Iα : c α) (Iβ : c β) : Function.Injective (toFun self Iα Iβ)

    a bundled morphism is determined by the underlying map

  • id_toFun {α : Type u} (I : c α) : toFun self I I (id self I) = _root_.id

    compatibility with identities

  • comp_toFun {α β γ : Type u} (Iα : c α) (Iβ : c β) (Iγ : c γ) (f : hom Iα Iβ) (g : hom Iβ Iγ) : toFun self Iα Iγ (comp self Iα Iβ Iγ g f) = toFun self Iβ Iγ g ∘ toFun self Iα Iβ f

    compatibility with the composition

Instances
    instance CategoryTheory.BundledHom.category {c : Type u → Type u} (hom : ⦃α β : Type u⦄ → c α → c β → Type u) [𝒞 : BundledHom hom] :

    Every @BundledHom c _ defines a category with objects in Bundled c.

    This instance generates the type-class problem BundledHom ?m. Currently that is not a problem, as there are almost no instances of BundledHom.

    Equations
    • One or more equations did not get rendered due to their size.
    instance CategoryTheory.BundledHom.hasForget {c : Type u → Type u} (hom : ⦃α β : Type u⦄ → c α → c β → Type u) [𝒞 : BundledHom hom] :

    A category given by BundledHom is a concrete category.

    Equations
    • One or more equations did not get rendered due to their size.
    def CategoryTheory.BundledHom.mkHasForget₂ {c : Type u → Type u} {hom : ⦃α β : Type u⦄ → c α → c β → Type u} [𝒞 : BundledHom hom] {d : Type u → Type u} {hom_d : ⦃α β : Type u⦄ → d α → d β → Type u} [BundledHom hom_d] (obj : ⦃α : Type u⦄ → c α → d α) (map : {X Y : Bundled c} → (X ⟶ Y) → (Bundled.map obj X ⟶ Bundled.map obj Y)) (h_map : ∀ {X Y : Bundled c} (f : X ⟶ Y), ⇑(map f) = ⇑f) :

    A version of HasForget₂.mk' for categories defined using @BundledHom.

    Equations
    Instances For
      @[reducible, inline]
      abbrev CategoryTheory.BundledHom.MapHom {c : Type u → Type u} (hom : ⦃α β : Type u⦄ → c α → c β → Type u) {d : Type u → Type u} (F : {α : Type u} → d α → c α) ⦃α β : Type u⦄ :
      d α → d β → Type u

      The hom corresponding to first forgetting along F, then taking the hom associated to c.

      For typical usage, see the construction of CommMonCat from MonCat.

      Equations
      Instances For
        def CategoryTheory.BundledHom.map {c : Type u → Type u} (hom : ⦃α β : Type u⦄ → c α → c β → Type u) [𝒞 : BundledHom hom] {d : Type u → Type u} (F : {α : Type u} → d α → c α) :

        Construct the CategoryTheory.BundledHom induced by a map between type classes. This is useful for building categories such as CommMonCat from MonCat.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          class CategoryTheory.BundledHom.ParentProjection {c d : Type u → Type u} (F : {α : Type u} → d α → c α) :

          We use the empty ParentProjection class to label functions like CommMonoid.toMonoid, which we would like to use to automatically construct BundledHom instances from.

          Once we've set up MonCat as the category of bundled monoids, this allows us to set up CommMonCat by defining an instance instance : ParentProjection (CommMonoid.toMonoid) := ⟨⟩

            Instances
              instance CategoryTheory.BundledHom.bundledHomOfParentProjection {c : Type u → Type u} (hom : ⦃α β : Type u⦄ → c α → c β → Type u) [𝒞 : BundledHom hom] {d : Type u → Type u} (F : {α : Type u} → d α → c α) [ParentProjection F] :
              Equations
              instance CategoryTheory.BundledHom.forget₂ {c : Type u → Type u} (hom : ⦃α β : Type u⦄ → c α → c β → Type u) [𝒞 : BundledHom hom] {d : Type u → Type u} (F : {α : Type u} → d α → c α) [ParentProjection F] :
              Equations
              • One or more equations did not get rendered due to their size.
              instance CategoryTheory.BundledHom.forget₂_full {c : Type u → Type u} (hom : ⦃α β : Type u⦄ → c α → c β → Type u) [𝒞 : BundledHom hom] {d : Type u → Type u} (F : {α : Type u} → d α → c α) [ParentProjection F] :