Documentation

Mathlib.CategoryTheory.Limits.Types.Coproducts

Coproducts in Type #

If F : J → Type max v u (with J : Type v), we show that the coproduct of F exists in Type max v u and identifies to the sigma type Σ j, F j. Similarly, the binary coproduct of two types X and Y identifies to X ⊕ Y, and the initial object of Type u if PEmpty.

@[reducible, inline]
abbrev CategoryTheory.Limits.CofanTypes {C : Type u} (F : CType v) :
Type (max (max u v) (w + 1))

Given a functor F : Discrete C ⥤ Type v, this is a "cofan" for F, but we allow the point to be in Type w for an arbitrary universe w.

Equations
Instances For
    @[reducible, inline]
    abbrev CategoryTheory.Limits.CofanTypes.inj {C : Type u} {F : CType v} (c : CofanTypes F) (i : C) :
    F ic.pt

    The injection map for a cofan of a functor to types.

    Equations
    Instances For

      The cofan given by a sigma type.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        @[simp]
        theorem CategoryTheory.Limits.CofanTypes.sigma_ι_snd {C : Type u} (F : CType v) (x✝ : Discrete C) (x : (Discrete.functor F).obj x✝) :
        ((sigma F).ι x✝ x).snd = x
        @[simp]
        theorem CategoryTheory.Limits.CofanTypes.sigma_ι_fst {C : Type u} (F : CType v) (x✝ : Discrete C) (x : (Discrete.functor F).obj x✝) :
        ((sigma F).ι x✝ x).fst = x✝.as
        @[simp]
        theorem CategoryTheory.Limits.CofanTypes.sigma_pt {C : Type u} (F : CType v) :
        (sigma F).pt = ((i : C) × F i)
        @[simp]
        theorem CategoryTheory.Limits.CofanTypes.sigma_inj {C : Type u} {F : CType v} (i : C) (x : F i) :
        (sigma F).inj i x = i, x
        theorem CategoryTheory.Limits.CofanTypes.isColimit_mk {C : Type u} {F : CType v} (c : CofanTypes F) (h₁ : ∀ (x : c.pt), ∃ (i : C) (y : F i), c.inj i y = x) (h₂ : ∀ (i : C), Function.Injective (c.inj i)) (h₃ : ∀ (i j : C) (x : F i) (y : F j), c.inj i x = c.inj j yi = j) :
        def CategoryTheory.Limits.CofanTypes.fromSigma {C : Type u} (F : CType v) (c : CofanTypes F) (x : (i : C) × F i) :
        c.pt

        Given a cofan of a functor to types, this is a canonical map from the Sigma type to the point of the cofan.

        Equations
        Instances For
          noncomputable def CategoryTheory.Limits.CofanTypes.equivOfIsColimit {C : Type u} {F : CType v} {c : CofanTypes F} (hc : Functor.CoconeTypes.IsColimit c) :
          (i : C) × F i c.pt

          The bijection from the sigma type to the point of a colimit cofan of a functor to types.

          Equations
          Instances For
            @[simp]
            theorem CategoryTheory.Limits.CofanTypes.equivOfIsColimit_apply {C : Type u} {F : CType v} {c : CofanTypes F} (hc : Functor.CoconeTypes.IsColimit c) (i : C) (x : F i) :
            (equivOfIsColimit hc) i, x = c.inj i x
            @[simp]
            theorem CategoryTheory.Limits.CofanTypes.equivOfIsColimit_symm_apply {C : Type u} {F : CType v} {c : CofanTypes F} (hc : Functor.CoconeTypes.IsColimit c) (i : C) (x : F i) :
            (equivOfIsColimit hc).symm (c.inj i x) = i, x
            theorem CategoryTheory.Limits.CofanTypes.inj_jointly_surjective_of_isColimit {C : Type u} {F : CType v} {c : CofanTypes F} (hc : Functor.CoconeTypes.IsColimit c) (x : c.pt) :
            ∃ (i : C) (y : F i), c.inj i y = x
            theorem CategoryTheory.Limits.CofanTypes.eq_of_inj_apply_eq_of_isColimit {C : Type u} {F : CType v} {c : CofanTypes F} (hc : Functor.CoconeTypes.IsColimit c) {i₁ i₂ : C} (y₁ : F i₁) (y₂ : F i₂) (h : c.inj i₁ y₁ = c.inj i₂ y₂) :
            i₁ = i₂
            def CategoryTheory.Limits.Cofan.cofanTypes {C : Type u} {F : CType v} (c : Cofan F) :

            If F : C → Type v, then the data of a "type-theoretic" cofan of F with a point in Type v is the same as the data of a cocone (in a categorical sense).

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              @[simp]
              theorem CategoryTheory.Limits.Cofan.cofanTypes_ι {C : Type u} {F : CType v} (c : Cofan F) (x✝ : Discrete C) (a✝ : (Discrete.functor F).obj x✝) :
              c.cofanTypes.ι x✝ a✝ = (match (motive := (x : Discrete C) → (Discrete.functor F).obj xc.pt) x✝ with | { as := j } => c.inj j) a✝
              @[simp]
              theorem CategoryTheory.Limits.Cofan.cofanTypes_pt {C : Type u} {F : CType v} (c : Cofan F) :
              theorem CategoryTheory.Limits.Cofan.inj_jointly_surjective_of_isColimit {C : Type u} {F : CType v} {c : Cofan F} (hc : IsColimit c) (x : c.pt) :
              ∃ (i : C) (y : F i), c.inj i y = x
              theorem CategoryTheory.Limits.Cofan.eq_of_inj_apply_eq_of_isColimit {C : Type u} {F : CType v} {c : Cofan F} (hc : IsColimit c) {i₁ i₂ : C} (y₁ : F i₁) (y₂ : F i₂) (h : c.inj i₁ y₁ = c.inj i₂ y₂) :
              i₁ = i₂

              The category of types has PEmpty as an initial object.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                @[deprecated CategoryTheory.Limits.Types.isInitialPEmpty (since := "2026-02-08")]

                Alias of CategoryTheory.Limits.Types.isInitialPEmpty.


                The initial object in Type u is PEmpty.

                Equations
                Instances For

                  An object in Type u is initial if and only if it is empty.

                  The sum type X ⊕ Y forms a cocone for the binary coproduct of X and Y.

                  Equations
                  Instances For
                    @[simp]
                    theorem CategoryTheory.Limits.Types.binaryCoproductCocone_ι_app (X Y : Type u) (x✝ : Discrete WalkingPair) (a✝ : (pair X Y).obj x✝) :
                    (binaryCoproductCocone X Y).ι.app x✝ a✝ = (match x✝.as with | WalkingPair.left => Sum.inl | WalkingPair.right => Sum.inr) a✝

                    The sum type X ⊕ Y is a binary coproduct for X and Y.

                    Equations
                    Instances For
                      @[simp]

                      The category of types has X ⊕ Y, as the binary coproduct of X and Y.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For

                        Any monomorphism in Type is a coproduct injection.

                        Equations
                        Instances For

                          The category of types has Σ j, f j as the coproduct of a type family f : J → Type.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            noncomputable def CategoryTheory.Limits.Types.coproductIso {J : Type v} (F : JType (max v u)) :
                            F (j : J) × F j

                            The categorical coproduct in Type u is the type-theoretic coproduct Σ j, F j.

                            Equations
                            Instances For
                              @[simp]
                              theorem CategoryTheory.Limits.Types.coproductIso_ι_comp_hom {J : Type v} (F : JType (max v u)) (j : J) :
                              CategoryStruct.comp (Sigma.ι F j) (coproductIso F).hom = fun (x : F j) => j, x
                              @[simp]
                              theorem CategoryTheory.Limits.Types.coproductIso_ι_comp_hom_apply {J : Type v} (F : JType (max v u)) (j : J) (x : F j) :
                              (coproductIso F).hom (Sigma.ι F j x) = j, x
                              @[simp]
                              theorem CategoryTheory.Limits.Types.coproductIso_mk_comp_inv {J : Type v} (F : JType (max v u)) (j : J) :
                              CategoryStruct.comp (asHom fun (x : F j) => j, x) (coproductIso F).inv = Sigma.ι F j
                              @[simp]
                              theorem CategoryTheory.Limits.Types.coproductIso_mk_comp_inv_apply {J : Type v} (F : JType (max v u)) (j : J) (x : F j) :
                              (coproductIso F).inv (asHom (fun (x : F j) => j, x) x) = Sigma.ι F j x