Documentation

Mathlib.CategoryTheory.Groupoid

Groupoids #

We define Groupoid as a typeclass extending Category, asserting that all morphisms have inverses.

The instance IsIso.ofGroupoid (f : X โŸถ Y) : IsIso f means that you can then write inv f to access the inverse of any morphism f.

Groupoid.isoEquivHom : (X โ‰… Y) โ‰ƒ (X โŸถ Y) provides the equivalence between isomorphisms and morphisms in a groupoid.

We provide a (non-instance) constructor Groupoid.ofIsIso from an existing category with IsIso f for every f.

See also #

See also CategoryTheory.Core for the groupoid of isomorphisms in a category.

class CategoryTheory.Groupoid (obj : Type u) extends CategoryTheory.Category.{v, u} obj :
Type (max u (v + 1))

A Groupoid is a category such that all morphisms are isomorphisms.

Instances
    @[reducible, inline]
    abbrev CategoryTheory.LargeGroupoid (C : Type (u + 1)) :
    Type (u + 1)

    A LargeGroupoid is a groupoid where the objects live in Type (u+1) while the morphisms live in Type u.

    Equations
      Instances For
        @[reducible, inline]
        abbrev CategoryTheory.SmallGroupoid (C : Type u) :
        Type (u + 1)

        A SmallGroupoid is a groupoid where the objects and morphisms live in the same universe.

        Equations
          Instances For
            @[instance 100]
            instance CategoryTheory.IsIso.of_groupoid {C : Type u} [Groupoid C] {X Y : C} (f : X โŸถ Y) :

            Groupoid.inv is involutive.

            Equations
              Instances For
                @[simp]
                theorem CategoryTheory.Groupoid.invEquiv_symm_apply {C : Type u} [Groupoid C] {X Y : C} (aโœ : Y โŸถ X) :
                invEquiv.symm aโœ = inv aโœ
                @[simp]
                theorem CategoryTheory.Groupoid.invEquiv_apply {C : Type u} [Groupoid C] {X Y : C} (aโœ : X โŸถ Y) :
                invEquiv aโœ = inv aโœ

                In a groupoid, isomorphisms are equivalent to morphisms.

                Equations
                  Instances For
                    @[simp]
                    theorem CategoryTheory.Groupoid.isoEquivHom_apply {C : Type u} [Groupoid C] (X Y : C) (self : X โ‰… Y) :
                    (isoEquivHom X Y) self = self.hom
                    @[deprecated "Use Groupoid.invEquivalence.functor" (since := "2025-12-31")]

                    The functor from a groupoid C to its opposite sending every morphism to its inverse.

                    Equations
                      Instances For
                        @[simp]
                        theorem CategoryTheory.Groupoid.invFunctor_map (C : Type u) [Groupoid C] {xโœ xโœยน : C} (f : xโœ โŸถ xโœยน) :
                        (invFunctor C).map f = (inv f).op

                        The equivalence from a groupoid C to its opposite sending every morphism to its inverse.

                        Equations
                          Instances For
                            @[simp]
                            theorem CategoryTheory.Groupoid.invEquivalence_counitIso (C : Type u) [Groupoid C] :
                            (invEquivalence C).counitIso = NatIso.ofComponents (fun (x : Cแต’แต–) => Iso.refl (({ obj := Opposite.unop, map := fun {x y : Cแต’แต–} (f : x โŸถ y) => inv f.unop, map_id := โ‹ฏ, map_comp := โ‹ฏ }.comp { obj := Opposite.op, map := fun {x x_1 : C} (f : x โŸถ x_1) => (inv f).op, map_id := โ‹ฏ, map_comp := โ‹ฏ }).obj x)) โ‹ฏ
                            @[simp]
                            theorem CategoryTheory.Groupoid.invEquivalence_functor_map (C : Type u) [Groupoid C] {xโœ xโœยน : C} (f : xโœ โŸถ xโœยน) :

                            A Prop-valued typeclass asserting that a given category is a groupoid.

                            Instances

                              Promote (noncomputably) an IsGroupoid to a Groupoid structure.

                              Equations
                                Instances For
                                  noncomputable def CategoryTheory.Groupoid.ofIsIso {C : Type u} [Category.{v, u} C] (all_is_iso : โˆ€ {X Y : C} (f : X โŸถ Y), IsIso f) :

                                  A category where every morphism IsIso is a groupoid.

                                  Equations
                                    Instances For
                                      def CategoryTheory.Groupoid.ofHomUnique {C : Type u} [Category.{v, u} C] (all_unique : {X Y : C} โ†’ Unique (X โŸถ Y)) :

                                      A category with a unique morphism between any two objects is a groupoid

                                      Equations
                                        Instances For

                                          A category equipped with a fully faithful functor to a groupoid is fully faithful

                                          Equations
                                            Instances For
                                              instance CategoryTheory.InducedCategory.groupoid {C : Type u} (D : Type uโ‚‚) [Groupoid D] (F : C โ†’ D) :
                                              Equations
                                                instance CategoryTheory.groupoidPi {I : Type u} {J : I โ†’ Type uโ‚‚} [(i : I) โ†’ Groupoid (J i)] :
                                                Groupoid ((i : I) โ†’ J i)
                                                Equations
                                                  instance CategoryTheory.groupoidProd {ฮฑ : Type u} {ฮฒ : Type v} [Groupoid ฮฑ] [Groupoid ฮฒ] :
                                                  Groupoid (ฮฑ ร— ฮฒ)
                                                  Equations
                                                    instance CategoryTheory.isGroupoidPi {I : Type u} {J : I โ†’ Type uโ‚‚} [(i : I) โ†’ Category.{v, uโ‚‚} (J i)] [โˆ€ (i : I), IsGroupoid (J i)] :
                                                    IsGroupoid ((i : I) โ†’ J i)
                                                    instance CategoryTheory.isGroupoidProd {ฮฑ : Type u} {ฮฒ : Type uโ‚‚} [Category.{v, u} ฮฑ] [Category.{vโ‚‚, uโ‚‚} ฮฒ] [IsGroupoid ฮฑ] [IsGroupoid ฮฒ] :
                                                    IsGroupoid (ฮฑ ร— ฮฒ)