## 4.31 2-fibre products

In this section we introduce $2$-fibre products. Suppose that $\mathcal{C}$ is a 2-category. We say that a diagram

$\xymatrix{ w \ar[r] \ar[d] & y \ar[d] \\ x \ar[r] & z }$

2-commutes if the two 1-morphisms $w \to y \to z$ and $w \to x \to z$ are 2-isomorphic. In a 2-category it is more natural to ask for 2-commutativity of diagrams than for actually commuting diagrams. (Indeed, some may say that we should not work with strict 2-categories at all, and in a “weak” 2-category the notion of a commutative diagram of 1-morphisms does not even make sense.) Correspondingly the notion of a fibre product has to be adjusted.

Let $\mathcal{C}$ be a $2$-category. Let $x, y, z\in \mathop{\mathrm{Ob}}\nolimits (\mathcal{C})$ and $f\in \mathop{\mathrm{Mor}}\nolimits _\mathcal {C}(x, z)$ and $g\in \mathop{\mathrm{Mor}}\nolimits _{\mathcal C}(y, z)$. In order to define the 2-fibre product of $f$ and $g$ we are going to look at 2-commutative diagrams

$\xymatrix{ & w \ar[r]_ a \ar[d]_ b & x \ar[d]^{f} \\ & y \ar[r]^{g} & z. }$

Now in the case of categories, the fibre product is a final object in the category of such diagrams. Correspondingly a 2-fibre product is a final object in a 2-category (see definition below). The $2$-category of $2$-commutative diagrams over $f$ and $g$ is the $2$-category defined as follows:

1. Objects are quadruples $(w, a, b, \phi )$ as above where $\phi$ is an invertible 2-morphism $\phi : f \circ a \to g \circ b$,

2. 1-morphisms from $(w', a', b', \phi ')$ to $(w, a, b, \phi )$ are given by $(k : w' \to w, \alpha : a' \to a \circ k, \beta : b' \to b \circ k)$ such that

$\xymatrix{ f \circ a' \ar[rr]_{\text{id}_ f \star \alpha } \ar[d]_{\phi '} & & f \circ a \circ k \ar[d]^{\phi \star \text{id}_ k} \\ g \circ b' \ar[rr]^{\text{id}_ g \star \beta } & & g \circ b \circ k }$

is commutative,

3. given a second $1$-morphism $(k', \alpha ', \beta ') : (w'', a'', b'', \phi '') \to (w', \alpha ', \beta ', \phi ')$ the composition of $1$-morphisms is given by the rule

$(k, \alpha , \beta ) \circ (k', \alpha ', \beta ') = (k \circ k', (\alpha \star \text{id}_{k'}) \circ \alpha ', (\beta \star \text{id}_{k'}) \circ \beta '),$
4. a 2-morphism between $1$-morphisms $(k_ i, \alpha _ i, \beta _ i)$, $i = 1, 2$ with the same source and target is given by a 2-morphism $\delta : k_1 \to k_2$ such that

$\xymatrix{ a' \ar[rd]_{\alpha _2} \ar[r]_{\alpha _1} & a \circ k_1 \ar[d]^{\text{id}_ a \star \delta } & & b \circ k_1 \ar[d]_{\text{id}_ b \star \delta } & b' \ar[l]^{\beta _1} \ar[ld]^{\beta _2} \\ & a \circ k_2 & & b \circ k_2 & }$

commute,

5. vertical composition of $2$-morphisms is given by vertical composition of the morphisms $\delta$ in $\mathcal{C}$, and

6. horizontal composition of the diagram

$\xymatrix{ (w'', a'', b'', \phi '') \rrtwocell ^{(k'_1, \alpha '_1, \beta '_1)}_{(k'_2, \alpha '_2, \beta '_2)}{\delta '} & & (w', a', b', \phi ') \rrtwocell ^{(k_1, \alpha _1, \beta _1)}_{(k_2, \alpha _2, \beta _2)}{\delta } & & (w, a, b, \phi ) }$

is given by the diagram

$\xymatrix@C=12pc{ (w'', a'', b'', \phi '') \rtwocell ^{(k_1 \circ k'_1, (\alpha _1 \star \text{id}_{k'_1}) \circ \alpha '_1, (\beta _1 \star \text{id}_{k'_1}) \circ \beta '_1)}_{(k_2 \circ k'_2, (\alpha _2 \star \text{id}_{k'_2}) \circ \alpha '_2, (\beta _2 \star \text{id}_{k'_2}) \circ \beta '_2)}{\ \ \ \delta \star \delta '} & (w, a, b, \phi ) }$

Note that if $\mathcal{C}$ is actually a $(2, 1)$-category, the morphisms $\alpha$ and $\beta$ in (2) above are automatically also isomorphisms1. In addition the $2$-category of $2$-commutative diagrams is also a $(2, 1)$-category if $\mathcal{C}$ is a $(2, 1)$-category.

Definition 4.31.1. A final object of a $(2, 1)$-category $\mathcal{C}$ is an object $x$ such that

1. for every $y \in \mathop{\mathrm{Ob}}\nolimits (\mathcal{C})$ there is a morphism $y \to x$, and

2. every two morphisms $y \to x$ are isomorphic by a unique 2-morphism.

Likely, in the more general case of $2$-categories there are different flavours of final objects. We do not want to get into this and hence we only define $2$-fibre products in the $(2, 1)$-case.

Definition 4.31.2. Let $\mathcal{C}$ be a $(2, 1)$-category. Let $x, y, z\in \mathop{\mathrm{Ob}}\nolimits (\mathcal{C})$ and $f\in \mathop{\mathrm{Mor}}\nolimits _\mathcal {C}(x, z)$ and $g\in \mathop{\mathrm{Mor}}\nolimits _{\mathcal C}(y, z)$. A 2-fibre product of $f$ and $g$ is a final object in the category of 2-commutative diagrams described above. If a 2-fibre product exists we will denote it $x \times _ z y\in \mathop{\mathrm{Ob}}\nolimits (\mathcal{C})$, and denote the required morphisms $p\in \mathop{\mathrm{Mor}}\nolimits _{\mathcal C}(x \times _ z y, x)$ and $q\in \mathop{\mathrm{Mor}}\nolimits _{\mathcal C}(x \times _ z y, y)$ making the diagram

$\xymatrix{ & x \times _ z y \ar[r]^{p} \ar[d]_ q & x \ar[d]^{f} \\ & y \ar[r]^{g} & z }$

2-commute and we will denote the given invertible 2-morphism exhibiting this by $\psi : f \circ p \to g \circ q$.

Thus the following universal property holds: for any $w\in \mathop{\mathrm{Ob}}\nolimits (\mathcal{C})$ and morphisms $a \in \mathop{\mathrm{Mor}}\nolimits _{\mathcal C}(w, x)$ and $b \in \mathop{\mathrm{Mor}}\nolimits _\mathcal {C}(w, y)$ with a given 2-isomorphism $\phi : f \circ a \to g\circ b$ there is a $\gamma \in \mathop{\mathrm{Mor}}\nolimits _{\mathcal C}(w, x \times _ z y)$ making the diagram

$\xymatrix{ w\ar[rrrd]^ a \ar@{-->}[rrd]_\gamma \ar[rrdd]_ b & & \\ & & x \times _ z y \ar[r]_ p \ar[d]_ q & x \ar[d]^{f} \\ & & y \ar[r]^{g} & z }$

2-commute such that for suitable choices of $a \to p \circ \gamma$ and $b \to q \circ \gamma$ the diagram

$\xymatrix{ f \circ a \ar[r] \ar[d]_\phi & f \circ p \circ \gamma \ar[d]^{\psi \star \text{id}_\gamma } \\ g\circ b \ar[r] & g \circ q \circ \gamma }$

commutes. Moreover $\gamma$ is unique up to isomorphism. Of course the exact properties are finer than this. All of the cases of 2-fibre products that we will need later on come from the following example of 2-fibre products in the 2-category of categories.

Example 4.31.3. Let $\mathcal{A}$, $\mathcal{B}$, and $\mathcal{C}$ be categories. Let $F : \mathcal{A} \to \mathcal{C}$ and $G : \mathcal{B} \to \mathcal{C}$ be functors. We define a category $\mathcal{A} \times _\mathcal {C} \mathcal{B}$ as follows:

1. an object of $\mathcal{A} \times _\mathcal {C} \mathcal{B}$ is a triple $(A, B, f)$, where $A\in \mathop{\mathrm{Ob}}\nolimits (\mathcal{A})$, $B\in \mathop{\mathrm{Ob}}\nolimits (\mathcal{B})$, and $f : F(A) \to G(B)$ is an isomorphism in $\mathcal{C}$,

2. a morphism $(A, B, f) \to (A', B', f')$ is given by a pair $(a, b)$, where $a : A \to A'$ is a morphism in $\mathcal{A}$, and $b : B \to B'$ is a morphism in $\mathcal{B}$ such that the diagram

$\xymatrix{ F(A) \ar[r]^ f \ar[d]^{F(a)} & G(B) \ar[d]^{G(b)} \\ F(A') \ar[r]^{f'} & G(B') }$

is commutative.

Moreover, we define functors $p : \mathcal{A} \times _\mathcal {C}\mathcal{B} \to \mathcal{A}$ and $q : \mathcal{A} \times _\mathcal {C}\mathcal{B} \to \mathcal{B}$ by setting

$p(A, B, f) = A, \quad q(A, B, f) = B,$

in other words, these are the forgetful functors. We define a transformation of functors $\psi : F \circ p \to G \circ q$. On the object $\xi = (A, B, f)$ it is given by $\psi _\xi = f : F(p(\xi )) = F(A) \to G(B) = G(q(\xi ))$.

Lemma 4.31.4. In the $(2, 1)$-category of categories $2$-fibre products exist and are given by the construction of Example 4.31.3.

Proof. Let us check the universal property: let $\mathcal{W}$ be a category, let $a : \mathcal{W} \to \mathcal{A}$ and $b : \mathcal{W} \to \mathcal{B}$ be functors, and let $t : F \circ a \to G \circ b$ be an isomorphism of functors.

Consider the functor $\gamma : \mathcal{W} \to \mathcal{A} \times _\mathcal {C}\mathcal{B}$ given by $W \mapsto (a(W), b(W), t_ W)$. (Check this is a functor omitted.) Moreover, consider $\alpha : a \to p \circ \gamma$ and $\beta : b \to q \circ \gamma$ obtained from the identities $p \circ \gamma = a$ and $q \circ \gamma = b$. Then it is clear that $(\gamma , \alpha , \beta )$ is a morphism from $(W, a, b, t)$ to $(\mathcal{A} \times _\mathcal {C} \mathcal{B}, p, q, \psi )$.

Let $(k, \alpha ', \beta ') : (W, a, b, t) \to (\mathcal{A} \times _\mathcal {C} \mathcal{B}, p, q, \psi )$ be a second such morphism. For an object $W$ of $\mathcal{W}$ let us write $k(W) = (a_ k(W), b_ k(W), t_{k, W})$. Hence $p(k(W)) = a_ k(W)$ and so on. The map $\alpha '$ corresponds to functorial maps $\alpha ' : a(W) \to a_ k(W)$. Since we are working in the $(2, 1)$-category of categories, in fact each of the maps $a(W) \to a_ k(W)$ is an isomorphism. We can use these (and their counterparts $b(W) \to b_ k(W)$) to get isomorphisms

$\delta _ W : \gamma (W) = (a(W), b(W), t_ W) \longrightarrow (a_ k(W), b_ k(W), t_{k, W}) = k(W).$

It is straightforward to show that $\delta$ defines a $2$-isomorphism between $\gamma$ and $k$ in the $2$-category of $2$-commutative diagrams as desired. $\square$

Remark 4.31.5. Let $\mathcal{A}$, $\mathcal{B}$, and $\mathcal{C}$ be categories. Let $F : \mathcal{A} \to \mathcal{C}$ and $G : \mathcal{B} \to \mathcal{C}$ be functors. Another, slightly more symmetrical, construction of a $2$-fibre product $\mathcal{A} \times _\mathcal {C} \mathcal{B}$ is as follows. An object is a quintuple $(A, B, C, a, b)$ where $A, B, C$ are objects of $\mathcal{A}, \mathcal{B}, \mathcal{C}$ and where $a : F(A) \to C$ and $b : G(B) \to C$ are isomorphisms. A morphism $(A, B, C, a, b) \to (A', B', C', a', b')$ is given by a triple of morphisms $A \to A', B \to B', C \to C'$ compatible with the morphisms $a, b, a', b'$. We can prove directly that this leads to a $2$-fibre product. However, it is easier to observe that the functor $(A, B, C, a, b) \mapsto (A, B, b^{-1} \circ a)$ gives an equivalence from the category of quintuples to the category constructed in Example 4.31.3.

$\xymatrix{ & \mathcal{Y} \ar[d]_ I \ar[rd]^ K & \\ \mathcal{X} \ar[r]^ H \ar[rd]^ L & \mathcal{Z} \ar[rd]^ M & \mathcal{B} \ar[d]^ G \\ & \mathcal{A} \ar[r]^ F & \mathcal{C} }$

be a $2$-commutative diagram of categories. A choice of isomorphisms $\alpha : G \circ K \to M \circ I$ and $\beta : M \circ H \to F \circ L$ determines a morphism

$\mathcal{X} \times _\mathcal {Z} \mathcal{Y} \longrightarrow \mathcal{A} \times _\mathcal {C} \mathcal{B}$

of $2$-fibre products associated to this situation.

Proof. Just use the functor

$(X, Y, \phi ) \longmapsto (L(X), K(Y), \alpha ^{-1}_ Y \circ M(\phi ) \circ \beta ^{-1}_ X)$

on objects and

$(a, b) \longmapsto (L(a), K(b))$

on morphisms. $\square$

Lemma 4.31.7. Assumptions as in Lemma 4.31.6.

1. If $K$ and $L$ are faithful then the morphism $\mathcal{X} \times _\mathcal {Z} \mathcal{Y} \to \mathcal{A} \times _\mathcal {C} \mathcal{B}$ is faithful.

2. If $K$ and $L$ are fully faithful and $M$ is faithful then the morphism $\mathcal{X} \times _\mathcal {Z} \mathcal{Y} \to \mathcal{A} \times _\mathcal {C} \mathcal{B}$ is fully faithful.

3. If $K$ and $L$ are equivalences and $M$ is fully faithful then the morphism $\mathcal{X} \times _\mathcal {Z} \mathcal{Y} \to \mathcal{A} \times _\mathcal {C} \mathcal{B}$ is an equivalence.

Proof. Let $(X, Y, \phi )$ and $(X', Y', \phi ')$ be objects of $\mathcal{X} \times _\mathcal {Z} \mathcal{Y}$. Set $Z = H(X)$ and identify it with $I(Y)$ via $\phi$. Also, identify $M(Z)$ with $F(L(X))$ via $\alpha _ X$ and identify $M(Z)$ with $G(K(Y))$ via $\beta _ Y$. Similarly for $Z' = H(X')$ and $M(Z')$. The map on morphisms is the map

$\xymatrix{ \mathop{\mathrm{Mor}}\nolimits _\mathcal {X}(X, X') \times _{\mathop{\mathrm{Mor}}\nolimits _\mathcal {Z}(Z, Z')} \mathop{\mathrm{Mor}}\nolimits _\mathcal {Y}(Y, Y') \ar[d] \\ \mathop{\mathrm{Mor}}\nolimits _\mathcal {A}(L(X), L(X')) \times _{\mathop{\mathrm{Mor}}\nolimits _\mathcal {C}(M(Z), M(Z'))} \mathop{\mathrm{Mor}}\nolimits _\mathcal {B}(K(Y), K(Y')) }$

Hence parts (1) and (2) follow. Moreover, if $K$ and $L$ are equivalences and $M$ is fully faithful, then any object $(A, B, \phi )$ is in the essential image for the following reasons: Pick $X$, $Y$ such that $L(X) \cong A$ and $K(Y) \cong B$. Then the fully faithfulness of $M$ guarantees that we can find an isomorphism $H(X) \cong I(Y)$. Some details omitted. $\square$

$\xymatrix{ \mathcal{A} \ar[rd] & & \mathcal{C} \ar[ld] \ar[rd] & & \mathcal{E} \ar[ld] \\ & \mathcal{B} & & \mathcal{D} }$

be a diagram of categories and functors. Then there is a canonical isomorphism

$(\mathcal{A} \times _\mathcal {B} \mathcal{C}) \times _\mathcal {D} \mathcal{E} \cong \mathcal{A} \times _\mathcal {B} (\mathcal{C} \times _\mathcal {D} \mathcal{E})$

of categories.

Proof. Just use the functor

$((A, C, \phi ), E, \psi ) \longmapsto (A, (C, E, \psi ), \phi )$

if you know what I mean. $\square$

Henceforth we do not write the parentheses when dealing with fibre products of more than 2 categories.

$\xymatrix{ \mathcal{A} \ar[rd] & & \mathcal{C} \ar[ld] \ar[rd] & & \mathcal{E} \ar[ld] \\ & \mathcal{B} \ar[rd]_ F & & \mathcal{D} \ar[ld]^ G \\ & & \mathcal{F} & }$

be a commutative diagram of categories and functors. Then there is a canonical functor

$\text{pr}_{02} : \mathcal{A} \times _\mathcal {B} \mathcal{C} \times _\mathcal {D} \mathcal{E} \longrightarrow \mathcal{A} \times _\mathcal {F} \mathcal{E}$

of categories.

Proof. If we write $\mathcal{A} \times _\mathcal {B} \mathcal{C} \times _\mathcal {D} \mathcal{E}$ as $(\mathcal{A} \times _\mathcal {B} \mathcal{C}) \times _\mathcal {D} \mathcal{E}$ then we can just use the functor

$((A, C, \phi ), E, \psi ) \longmapsto (A, E, G(\psi ) \circ F(\phi ))$

if you know what I mean. $\square$

$\mathcal{A} \to \mathcal{B} \leftarrow \mathcal{C} \leftarrow \mathcal{D}$

be a diagram of categories and functors. Then there is a canonical isomorphism

$\mathcal{A} \times _\mathcal {B} \mathcal{C} \times _\mathcal {C} \mathcal{D} \cong \mathcal{A} \times _\mathcal {B} \mathcal{D}$

of categories.

Proof. Omitted. $\square$

We claim that this means you can work with these $2$-fibre products just like with ordinary fibre products. Here are some further lemmas that actually come up later.

$\xymatrix{ \mathcal{C}_3 \ar[r] \ar[d] & \mathcal{S} \ar[d]^\Delta \\ \mathcal{C}_1 \times \mathcal{C}_2 \ar[r]^{G_1 \times G_2} & \mathcal{S} \times \mathcal{S} }$

be a $2$-fibre product of categories. Then there is a canonical isomorphism $\mathcal{C}_3 \cong \mathcal{C}_1 \times _{G_1, \mathcal{S}, G_2} \mathcal{C}_2$.

Proof. We may assume that $\mathcal{C}_3$ is the category $(\mathcal{C}_1 \times \mathcal{C}_2)\times _{\mathcal{S} \times \mathcal{S}} \mathcal{S}$ constructed in Example 4.31.3. Hence an object is a triple $((X_1, X_2), S, \phi )$ where $\phi = (\phi _1, \phi _2) : (G_1(X_1), G_2(X_2)) \to (S, S)$ is an isomorphism. Thus we can associate to this the triple $(X_1, X_2, \phi _2^{-1} \circ \phi _1)$. Conversely, if $(X_1, X_2, \psi )$ is an object of $\mathcal{C}_1 \times _{G_1, \mathcal{S}, G_2} \mathcal{C}_2$, then we can associate to this the triple $((X_1, X_2), G_2(X_2), (\psi , \text{id}_{G_2(X_2)}))$. We claim these constructions given mutually inverse functors. We omit describing how to deal with morphisms and showing they are mutually inverse. $\square$

$\xymatrix{ \mathcal{C}' \ar[r] \ar[d] & \mathcal{S} \ar[d]^\Delta \\ \mathcal{C} \ar[r]^{G_1 \times G_2} & \mathcal{S} \times \mathcal{S} }$

be a $2$-fibre product of categories. Then there is a canonical isomorphism

$\mathcal{C}' \cong (\mathcal{C} \times _{G_1, \mathcal{S}, G_2} \mathcal{C}) \times _{(p, q), \mathcal{C} \times \mathcal{C}, \Delta } \mathcal{C}.$

Proof. An object of the right hand side is given by $((C_1, C_2, \phi ), C_3, \psi )$ where $\phi : G_1(C_1) \to G_2(C_2)$ is an isomorphism and $\psi = (\psi _1, \psi _2) : (C_1, C_2) \to (C_3, C_3)$ is an isomorphism. Hence we can associate to this the triple $(C_3, G_1(C_1), (G_1(\psi _1^{-1}), \phi ^{-1} \circ G_2(\psi _2^{-1})))$ which is an object of $\mathcal{C}'$. Details omitted. $\square$

Lemma 4.31.13. Let $\mathcal{A} \to \mathcal{C}$, $\mathcal{B} \to \mathcal{C}$ and $\mathcal{C} \to \mathcal{D}$ be functors between categories. Then the diagram

$\xymatrix{ \mathcal{A} \times _\mathcal {C} \mathcal{B} \ar[d] \ar[r] & \mathcal{A} \times _\mathcal {D} \mathcal{B} \ar[d] \\ \mathcal{C} \ar[r]^-{\Delta _{\mathcal{C}/\mathcal{D}}} \ar[r] & \mathcal{C} \times _\mathcal {D} \mathcal{C} }$

is a $2$-fibre product diagram.

Proof. Omitted. $\square$

$\xymatrix{ \mathcal{U} \ar[d] \ar[r] & \mathcal{V} \ar[d] \\ \mathcal{X} \ar[r] & \mathcal{Y} }$

be a $2$-fibre product of categories. Then the diagram

$\xymatrix{ \mathcal{U} \ar[d] \ar[r] & \mathcal{U} \times _\mathcal {V} \mathcal{U} \ar[d] \\ \mathcal{X} \ar[r] & \mathcal{X} \times _\mathcal {Y} \mathcal{X} }$

is $2$-cartesian.

Proof. This is a purely $2$-category theoretic statement, valid in any $(2, 1)$-category with $2$-fibre products. Explicitly, it follows from the following chain of equivalences:

\begin{align*} \mathcal{X} \times _{(\mathcal{X} \times _\mathcal {Y} \mathcal{X})} (\mathcal{U} \times _\mathcal {V} \mathcal{U}) & = \mathcal{X} \times _{(\mathcal{X} \times _\mathcal {Y} \mathcal{X})} ((\mathcal{X} \times _\mathcal {Y} \mathcal{V}) \times _\mathcal {V} (\mathcal{X} \times _\mathcal {Y} \mathcal{V})) \\ & = \mathcal{X} \times _{(\mathcal{X} \times _\mathcal {Y} \mathcal{X})} (\mathcal{X} \times _\mathcal {Y} \mathcal{X} \times _\mathcal {Y} \mathcal{V}) \\ & = \mathcal{X} \times _\mathcal {Y} \mathcal{V} = \mathcal{U} \end{align*}

see Lemmas 4.31.8 and 4.31.10. $\square$

[1] In fact it seems in the $2$-category case that one could define another 2-category of 2-commutative diagrams where the direction of the arrows $\alpha$, $\beta$ is reversed, or even where the direction of only one of them is reversed. This is why we restrict to $(2, 1)$-categories later on.

Comment #94 by David Zureick-Brown on

Typo in (4): "with the same is given by a".

Comment #5394 by Manuel Hoff on

I think the formulation in 02XE and 02XF is slightly misleading. One only gets an equivalence of categories in each case, not an isomorphism. If one strengthens the assumption by saying not only that the square is a 2-fibre product diagram but also that the top left category is isomorphic to the explicit choice of 2-fibre product from 003R, then the statement gets correct.

My general opinion would be that it is better to not letting the formulation of the statements depend on a choice of 2-fibre product (hence replacing "isomorphism" with "equivalence" at some points although this gives a weaker statement).

Comment #5627 by on

Yes, unfortunately you are right! So each of these lemmas has two versions: one where you get an equivalence unique up to unique $2$-isomorphism and one where you get a well defined isomorphism. All through the Stacks project we use the explict construction in Example 4.31.3 as our $2$-fibre product. Hmm... I am going to leave this as is for now. It would be good if we could find examples in later use of these lemmas where this sort of really leads to confusion or problems, because that would be motivation for fixing this. Let me know if you find something.

Comment #5915 by Santai Qu on

It seems that there are topos in the proof of Lemma 4.31.4. In the third line of the second paragraph in that proof, $(W, a, b, t)$ should be $(\mathcal{W}, a, b, t)$. The same for the first line in the third paragraph in that proof.

Comment #6780 by Mark on

In the sentence "The 2-category of 2-commutative diagrams is the 2-category defined as follows...", it might be better to put in the dependency of $f$ and $g$ somewhere (e.g. use instead "The 2-category of 2-commutative diagrams over $f$ and $g$ is the 2-category...")

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).