Kan complex

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
###Context###
#### Homotopy theory
+--{: .hide}
[[!include homotopy - contents]]
=--
#### Higher category theory
+--{: .hide}
[[!include higher category theory - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

## Idea
 {#Idea}

The notion of a _Kan complex_ is an abstraction of the combinatorial structure found in the [[singular simplicial complex]] of a [[topological space]]. There the existence of [[retractions]] of any geometric [[simplex]] to any of its [[horns]] -- simplices missing one face and their interior -- means that all [[horns]] in the singular complex can be filled with genuine simplices, the _Kan filler condition_.

At the same time, the notion of a Kan complex is an abstraction of the structure found in the [[nerve]] of a [[groupoid]], the [[Duskin nerve]] of a [[2-groupoid]] and generally (almost by definition, see at _[[cobordism hypothesis]]_) the nerves of [[n-groupoids]] for all $n \leq \infty$. In other words, Kan complexes constitute a [[geometric definition of higher category|geometric model]] for [[∞-groupoids]]/[[homotopy types]] which is based on the [[geometric shapes for higher structures|shape]] given by the [[simplex category]] (as opposed to, say, the [[globe category]], as for what are usually called [[∞-groupoids]]). Thus Kan complexes serve to support [[homotopy theory]].

More in detail, a Kan complex is a collection of $k$-[[simplex]]-shaped [[k-morphism]]s for all $k \in \mathbb{N}$, such that for all composable $k$-morphisms a composite does exist (not necessarily uniquely) and  such that all $k$-morphisms are invertible under this composition.

Specifically for the [[nerve]] $N(\mathcal{G}_\bullet)$ of a [[groupoid]] $\mathcal{G}_\bullet$, a $k$-cell is given by a sequence of [[morphisms]] of the form $\{0\to 1\to \ldots \to k\}$, thought of as a $k$-[[simplex]] by taking its $(k-1)$-faces to be the the sequences obtained from this by deleting the first or the last morphism or by composing two consecutive morphisms in the sequence.

Hence generally, in a Kan complex a $k$-face of an $(k+1)$-[[simplex]] may be thought of as the [[composition]] of the remaining faces, all regarded as [[k-morphisms]]. But unless the Kan complex is the [[nerve]] of a [[groupoid]] (a [[1-groupoid]]), there is in general not a unique such composite. Indeed, _choosing_ one of the fillers of each horn in a Kan complex to be _the_ composite means passing from Kan complexes to an [[algebraic definition of higher category|algebraic model]] for [[∞-groupoids]], _[[algebraic Kan complexes]]_.

Among all [[∞-groupoids]] the [[strict ∞-groupoids]] correspond to [[crossed complexes]] and various other related algebraic models, all or most of which have a [[full subcategory|faithful embedding]] into Kan complexes under a suitable [[nerve]] operation. One of these are the [[simplicial T-complexes]], the nerves crossed complexes. There all horns have unique 'thin' fillers, so these are Kan complexes corresponding to a strict form of higher dimensional groupoid.

## Definition

+-- {: .num_defn #KanComplexes}
###### Definition

A _Kan complex_ is a [[simplicial set]] $S$ that satisfies the _Kan condition_,

* which says that all [[horns]] of the simplicial set have [[filler]]s (that is, extend to [[simplices]]);

* which means equivalently that the unique homomorphism $S \to pt$ from $S$ to the [[point]] (the [[terminal object|terminal]] [[simplicial set]]) is a [[Kan fibration]];

* which means equivalently that for all [[diagrams]] of the form

  $$
  \array{
    \Lambda^i[n] &\to& S
    \\
    \downarrow && \downarrow
    \\
    \Delta[n] &\to& pt
  }
  \;\;\;
  \leftrightarrow
  \;\;\;
  \array{
    \Lambda^i[n] &\to& S
    \\
    \downarrow &&
    \\
    \Delta[n]
  }
  $$

  there exists a diagonal morphism

  $$
  \array{
    \Lambda^i[n] &\to& S
    \\
    \downarrow &\nearrow& \downarrow
    \\
    \Delta[n] &\to& pt
  }
  \;\;\;
  \leftrightarrow
  \;\;\;
  \array{
    \Lambda^i[n] &\to& S
    \\
    \downarrow &\nearrow&
    \\
    \Delta[n]
  }
  $$

  completing this to a [[commuting diagram]];

* which in turn means equivalently that the map from $n$-simplices to $(n,i)$-horns is an [[epimorphism]]
$$
  [\Delta[n], S]\, \twoheadrightarrow \,[\Lambda^i[n],S]
  \,.
$$

=--

+-- {: .num_remark }
###### Remark

The last characterization in def. \ref{KanComplexes} is
sometimes taken to induce the generalization to [[internalization|internal]]
Kan complexes in ambient geometric contexts.
For instance the generalization of [[Lie groupoids]] to
"Lie Kan complexes"
might be defined to be given by [[simplicial objects]] in
the [[category]] [[SmoothMfd]] of [[smooth manifolds]]
such that the morphisms

$$
  [\Delta[n], S] \to [\Lambda^i[n],S]
$$

are _[[surjective submersions]]_.

While this is useful for some purposes, one should beware that this naive generalization, if taken at face value, may break the [[homotopy theory|homotopy theoretic]] interpretation of (smooth, say) Kan complexes as models for ([[smooth infinity-groupoid|smooth]], say) [[∞-groupoids]]. A homotopy-good theory of Lie Kan complexes is discussed in ([NSS, section 4.2](#NSSb)).
See at _[[internal ∞-groupoid]]_ for more.

=--

+-- {: .num_remark}
###### Remark

Some special cases of def. \ref{KanComplexes} go by their own terminology:

* a Kan complex such that for every $k \gt n+1$ every $k$-[[boundary]] $\partial \Delta$ has a unique [[filler]] is called $(n+1)$-[[simplicial skeleton|coskeletal]];

* a Kan complex that is $(n+1)$-[[coskeleton|coskeletal]] such that in addition the $(n+1)$-[[horns]] and $(n+2)$-[[horns]] have a unique filler are also called _[[hypergroupoid|n-hypergroupoids]]_.

These $(n+1)$-coskeletal Kan complexes are models for [[n-groupoids]]/[[homotopy n-types]]/[[n-truncated object in an (infinity,1)-category|n-truncated]] [[∞-groupoids]].

=--

## As models for $\infty$-groupoids
 {#AsGrpds}

Here we discuss aspects of how _Kan complexes_ serve as a model (a "[[geometric definition of higher categories|geometric model]]") for [[groupoids]], [[2-groupoids]], ... [[n-groupoids]] and generally _[[∞-groupoids]]_ or _[[homotopy types]]_.

First we survey the general idea in

* [Heuristics on composition and inverses](#HeuristicsOnCompositionAndInverses)

then we recall 1-[[groupoids]] as Kan complexes via their [[nerves]] in

* [1-Groupoids as Kan complexes](#1GroupoidsAsKanComplexes)

Then we discuss basic aspects of the

* [Homotopy theory of ∞-groupoids as Kan complexes](#HomotopyTheoryOfKanComplexes).

+-- {: .num_remark}
###### Remark

This is a special case of how [[weak Kan complexes]] ([[quasi-categories]]) are a model for [[(∞,1)-categories]].

=--

+-- {: .num_remark}
###### Remark

The horn filling condition from this point of view is read as guaranteeing that:

for all collection of $(k-1)$ composable [[k-morphisms]] (given by a horn $\Lambda^k[n]$) there exists a [[k-morphism]] -- their _composite_ -- and an $(n+1)$-morphism connecting the original $(n-1)$ $n$-cells with their composite. Depending on $k$, this interpretation in terms of composition implies that one thinks of all cells as being reversible.

For illustrations of the horn-[[filler]] conditions see also at [[Kan fibration]].

=--

+-- {: .num_remark}
###### Remark

Whatever other definition of [[∞-groupoid]] one considers, it is expected (and in most cases has been shown) to map to a Kan complex under the [[nerve]]. See at _[[homotopy hypothesis]]_ for more on this.

=--

+-- {: .num_remark}
###### Remark

Of all the models for [[∞-groupoids]] known in the literature, Kan complexes are probably the most widely used, certainly in [[homotopy theory]] and related "geometric" approaches to [[higher category]] (such as in terms of [[n-fold complete Segal spaces]] etc.), less so in "algebraic" approaches to [[higher category theory]]. To a large extent this is because the category of Kan complexes -- in particular when thought of as the full sub-[[category of fibrant objects]] inside the standard [[model structure on simplicial sets]] -- lends itself usefully to many computations; to some extent it is maybe a historical coincidence that specifically for this model the theory was worked out in such detail. Maybe if [[Daniel Kan|Kan]] -- who first tried [[cubical sets]] and then rejected them in favor of [[simplicial sets]] due to some technical issues -- had tried [[connection on a cubical set|cubical set with connection]] first, things would have developed differently. See at _[[cubical set]]_ for discussion of this issue.

But in any case it seems clear that there is no "fundamental" conceptual role to prefer Kan complexes over other models for [[∞-groupoids]]. Instead, in view of modern developments it seems right to regard the abstract concept of [[homotopy type]] (not as an [[equivalence class]], but as a representative, though) as fundamental, and everything else to be "just a model" for this, which may or may not be useful for a particular computation. This point of view is formalized by the [[univalent foundations]] of mathematics in terms of [[homotopy type theory]]. Here the [[theory]] of [[homotopy types]] is given as an abstract foundational notion and then [[Kan complexes]] and related structures are shown to be a [[model]]. For more on this see at _[[homotopy type theory]]_.

=--

### Heuristics on composition and inverses
 {#HeuristicsOnCompositionAndInverses}

An [[∞-groupoid]] is first of all supposed to be a structure that consists of [[k-morphism]]s for all $k \in \mathbb{N}$, which for $k \geq 1$ go between $(k-1)$-morphisms.

In the context of Kan complexes, the tool for organizing such collections of [[k-morphisms]] is the notion of a _[[simplicial set]]_, which models $k$-morphisms as being of the [[geometric shape for higher structures|shape]] of $k$-[[simplices]] -- a [[vertex]] for $k = 0$, an [[edge]] for $k = 1$, a [[triangle]] for $k = 2$, a [[tetrahedron]] for $k = 3$, and so on.

This means that a simplicial set $K_\bullet$ is a sequence of [[sets]] $\{K_n\}_{n \in \mathbb{N}}$ (sets of $k$-simplex shaped $k$-morphisms for all $k$) equipped with [[functions]] $d_i \colon K_{k+1} \to K_{k}$ that send a $(k+1)$-simplex to its $i$-th face, and functions $s_i \colon K_k \to K_{k+1}$ that over a $k$-simplex "erects a flat $(k+1)$-simplex" in all possible ways (hence which inserts "[[identities]]" called "degeneracies" in this context).

If we write $\Delta$ for the [[category]] whose [[objects]] are abstract cellular [[simplices]] and whose morphisms are all cellular maps between these, then such a simplicial set is equivalently a [[functor]] of the form

$$
  K \colon \Delta^{op} \to Set
$$

Hence we think of this as assigning

* a set $[0] \mapsto K_0$ of [[objects]];

* a set $[1] \mapsto K_1$ of [[morphism]];

* a set $[2] \mapsto K_2$ of [[2-morphism]];

* a set $[3] \mapsto K_3$ of [[3-morphism]];

and generally

* a set $[k] \mapsto K_k$ of [[k-morphism]]s

as well as specifying

* functions $([n] \hookrightarrow [n+1]) \mapsto (K_{n+1} \to K_n)$
  that send $n+1$-morphisms to their boundary $n$-morphisms;

* functions $([n+1] \to [n]) \mapsto (K_{n} \to K_{n+1})$
  that send $n$-morphisms to [[identity]] $(n+1)$-morphisms
  on them.

The fact that $K$ is supposed to be a [[functor]] enforces that these assignments of sets and functions satisfy conditions that make consistent our interpretation of them as sets of $k$-morphisms and source and target maps between these.
These are called the _[[simplicial identities]]_.

But apart from this source-target matching, a generic simplicial set does not yet encode a notion of [[composition]] of these morphisms.

For instance for $\Lambda^1[2]$ the simplicial set consisting of two attached 1-cells

$$
  \Lambda^1[2] = \left\{
    \array{
       && 1
       \\
       & \nearrow && \searrow
       \\
       0 &&&& 2
    }
  \right\}
$$

and for $(f,g) : \Lambda^1[2] \to K$ an image of this situation in $K$, hence a pair $x_0 \stackrel{f}{\to} x_1 \stackrel{g}{\to} x_2$ of two _composable_ 1-morphisms in $K$, we want to demand that there exists a third 1-morphisms in $K$ that may be thought of as the [[composition]] $x_0 \stackrel{h}{\to} x_2$ of $f$ and $g$. But since we are working in [[higher category theory]] (and to ahere to the [[principle of equivalence]]), we want to identify this composite only up to a [[2-morphism]] equivalence

$$
    \array{
       && x_1
       \\
       & {}^{\mathllap{f}}\nearrow &\Downarrow^{\mathrlap{\simeq}}&
       \searrow^{\mathrlap{g}}
       \\
       x_0 &&\stackrel{h}{\to}&& x_2
    }
  \,.
$$

From the picture it is clear that this is equivalent to demanding that for $\Lambda^1[2] \hookrightarrow \Delta[2]$ the obvious inclusion of the two abstract composable 1-morphisms into the 2-simplex we have a diagram of morphisms of simplicial sets

$$
  \array{
    \Lambda^1[2] &\stackrel{(f,g)}{\to}& K
    \\
    \downarrow & \nearrow_{\mathrlap{\exists h}}
    \\
    \Delta[2]
  }
  \,.
$$

A simplicial set where for all such $(f,g)$ a corresponding such $h$ exists may be thought of as a collection of higher morphisms that is equipped with a notion of composition of adjacent 1-morphisms.

For the purpose of describing [[groupoid]]al composition, we now want that this composition operation has all [[inverse]]s. For that purpose, notice that for

$$
  \Lambda^2[2] = \left\{
    \array{
       && 1
       \\
       & && \searrow
       \\
       0 &&\to&& 2
    }
  \right\}
$$

the simplicial set consisting of two 1-morphisms that touch at their end, hence for

$$
  (g,h) : \Lambda^2[2] \to K
$$

two such 1-morphisms in $K$, then if $g$ had an inverse $g^{-1}$ we could use the above composition operation to compose that with $h$ and thereby find a morphism $f$ connecting the sources of $h$ and $g$. This being the case is evidently equivalent to the existence of diagrams of morphisms of simplicial sets of the form

$$
  \array{
    \Lambda^2[2] &\stackrel{(g,h)}{\to}& K
    \\
    \downarrow & \nearrow_{\mathrlap{\exists f}}
    \\
    \Delta[2]
  }
  \,.
$$

Demanding that all such diagrams exist is therefore demanding that we have on 1-morphisms a composition operation with inverses in $K$.

In order for this to qualify as an $\infty$-groupoid, this composition operation needs to satisfy an [[associativity law]] up to [[coherent]] [[2-morphisms]], which means that we can find the relevant [[tetrahedron]]s in $K$. These in turn need to be connected by _pentagonators_ and ever so on.  It is a nontrivial but true and powerful fact, that all these [[coherence]] conditions are captured by generalizing the above conditions to all dimensions as in the definition of Kan complexes.

In order to conceive of the $k$-[[simplices]] for higher $k$ as "[[globular set|globular]] [[k-morphism]]" going from a source to a target one needs a bit of combinatorics. This provided by the _[[orientals]]_ (due to [[Ross Street]]).

{#Oriental} The $k$-[[oriental]] $O(k)$ is precisely the prescription for how exactly to think of  a $k$-[[simplex]] as being a [[k-morphism]] in an [[omega-category]].

[[!include the first few orientals]]

In fact, the [[omega-nerve]] $N(K)$ of an [[omega-category]] $K$ is the [[simplicial set]] whose collection of $k$-cells $N(K)_k := Hom(O(k),K)$ is precisely the collection of images of the $k$th oriental $O(k)$ in $K$.

This is fully formally the prescription of how to think of a Kan complex as an $\infty$-groupoid: the Kan complex $C$ is the [[omega-nerve]] of an [[omega-category]] in which all morphism are invertible:

* the $k$-cells in  $C_k$ are precisely the collection of $k$-morphisms in the omega-category of shape the $k$th [[oriental]] $O(k)$;

* the [[horn]]-filler conditions satisfied by these cells is precisely a reflection of the fact that

  1. there exists a notion of composition of adjacent k-morphisms in the [[omega-category]];

  1. under this composition all $k$-morphisms have an inverse.

This is easy to see in low dimensions:

* a 1-cell $\phi \in C_1$ in the [[simplicial set]] $C$ has a single source 0-cell $x := d_1 \phi$ and a single target 0-cell $y := d_0 \phi$ and hence may be pictured as a [[morphism]]

  $$
    x \stackrel{\phi}{\to} y
    \,.
  $$

* a 2-cell $\phi \in C_2$ in the [[simplicial set]] $C$ has two incoming 1-cells $d_2 \phi, d_0 \phi \in C_1$ and one outgoing 1-cell $d_1 \phi \in C_1$, and if we think of the two incoming 1-cells as representing the composite of the corresponding 1-morphisms, we may picture the 2-cell $\phi$ here as a globular 2-morphism

  $$
    \array{
      && x_1
      \\
      & {}^{\mathllap{d_2 \phi}}\nearrow &\Downarrow^\phi& \searrow^{\mathrlap{d_0 \phi}}
      \\
      x_0 &&\underset{d_1 \phi}{\to}&& x_2
    }
    \,.
  $$

More in detail, one may think of the incoming two adjacent $1$-cells here as _not_ being the composite of these two morphism, but just as a [[composable pair]], and should think of the existence of the 2-morphism $\phi$ here as being a **compositor** in a [[bicategory]] that shows how the composable pair is composed to the morphism $d_1 \phi$.

So if an $\infty$-groupoid is thought of as a [[geometric shapes for higher structures|globular]] [[Batanin ∞-category| ∞-category]] in which all [[k-morphism]]s are invertible, then the corresponding Kan complex is the [[nerve]] or rather the [[∞-nerve]] of this [[∞-category]].

Notably if $C$ is to be regarded as (the nerve of) an ordinary [[groupoid]], every composable pair of morphisms has a unique composite, and hence there should be a _unique_ 2-cell

  $$
    \array{
      && x_1
      \\
      & {}^{f}\nearrow &\Downarrow& \searrow^{g}
      \\
      x_0 &&\underset{h = g \circ f}{\to}&& x_2
    }
  $$

that is the unique **identity 2-morphism**

$$
  g \circ f \stackrel{=}{\Rightarrow} h
  \,.
$$

More generally, in a [[2-groupoid]] there may be non-identity 2-morphisms, and hence for any 1-morphism $k \colon x_0 \to x_2$ 2-isomorphic to $h$, there may be many 2-morphisms $g \circ f \Rightarrow k$, hence many 2-cells

$$
  \array{
    && x_1
    \\
    & {}^{f}\nearrow &\Downarrow^{\simeq}& \searrow^{g}
    \\
    x_0 &&\underset{k }{\to}&& x_2
  }
  \,.
$$

All we can say for sure is that _at least_ one such 2-cell exists, and that the 2-cells themselves may be composed in some way. This is precisely what the horn-filler conditions in a Kan complex encode.

We have already seen in low dimension how the existence of composites in an $\omega$-category is reflected in the fact that in a Kan-complex certain 2-simplices exist, and how the non-uniqueness of these 2-simplices reflects the existence of nontrivial 2-morphisms.

To see in a similar fashion that the Kan condition ensures the existence of _inverses_ consider an _outer horn_ in $C$, a diagram of 1-cells of the form

$$
  \array{
    && x_1
    \\
    & {}^{\mathllap{f}}\nearrow
    \\
    x_0 &&\underset{h}{\to}&& x_2
  }
  \,.
$$

In general given such a diagram in a [[category]], there is no guarantee that the corresponding triangle as above will exist in its [[nerve]]. But if the category is a [[groupoid]], then it is guaranteed that the missing 1-face can be chose to be the [[inverse]] of $f$ composed with the morphism $h$, and there is at least one 2-morphism

$$
  \array{
    && x_1
    \\
    & {}^{\mathllap{f}}\nearrow
    &\Downarrow^{\simeq}& \searrow^{\mathrlap{h \circ f^{-1}}}
    \\
    x_0 &&\underset{h}{\to}&& x_2
  }
  \,.
$$

A similar analysis for higher dimensional cells shows that the fact that a Kan complex has all horn fillers encodes precisely the fact that it is the [[omega-nerve]] of an [[omega-category]] in which _all_ [[k-morphism]]s for all $k$ are composable if adjacent and have a weak inverse.

### 1-Groupoids as Kan complexes
 {#1GroupoidsAsKanComplexes}

We review how [[1-groupoids]] are incarnated as Kan complexes via their [[nerve]].

+-- {: .num_defn #Groupoid}
###### Definition

A ([[small category|small]]) _[[groupoid]]_ $\mathcal{G}_\bullet$ is

* a pair of [[sets]] $\mathcal{G}_0 \in Set $ (the set of [[objects]]) and $\mathcal{G}_1 \in Set$ (the set of [[morphisms]])

* equipped with [[functions]]

  $$
    \array{
      \mathcal{G}_1 \times_{\mathcal{G}_0} \mathcal{G}_1
      &\stackrel{\circ}{\to}&
      \mathcal{G}_1
      & \stackrel{\overset{t}{\to}}{\stackrel{\overset{i}{\leftarrow}}{\underset{s}{\to}}}&
      \mathcal{G}_0
    }\,,
  $$

  where the [[fiber product]] on the left is that over $\mathcal{G}_1 \stackrel{t}{\to} \mathcal{G}_0 \stackrel{s}{\leftarrow} \mathcal{G}_1$,

such that

* $i$ takes values in [[endomorphisms]];

  $$
    t \circ i = s \circ i =   id_{\mathcal{G}_0}, \;\;\;
  $$

* $\circ$ defines a partial [[composition]] operation which is [[associativity|associative]] and [[unitality|unital]] for $i(\mathcal{G}_0)$ the [[identities]]; in particular

  $s (g \circ f) = s(f)$ and $t (g \circ f) = t(g)$;

* every morphism has an [[inverse]] under this composition.

=--

+-- {: .num_defn #NerveOfGroupoid}
###### Definition

For $\mathcal{G}_\bullet$ a [[groupoid]], def. \ref{Groupoid}, we write

$$
  \mathcal{G}_n \coloneqq \mathcal{G}_1^{\times_{\mathcal{G}_0}^n}
$$

for the set of sequences of composable morphisms of length $n$, for $n \in \mathbb{N}$; schematically:

$$
  \mathcal{G}_n =
  \left\{
    x_0
      \stackrel{f_1}{\to}
    x_1
      \stackrel{f_2}{\to}
    x_2
      \stackrel{f_2}{\to}
    \cdots
      \stackrel{f_n}{\to}
    x_n
  \right\}
  \,.
$$

For each $n \geq 1$, the two maps $d_0$ and $d_n$ that forget the first and the last morphism in such a sequence and the $n-1$ maps $d_k$ that form the composition of the $k$th morphism in the sequence with the next one, constitute $(n+1)$ [[functions]] denoted

$$
  d_k \colon \mathcal{G}_n \to \mathcal{G}_{n-1}
  \,.
$$

Moreover, the assignments $s_i$ that insert an [[identity]] morphism in position $i$ constitute [[functions]] denoted

$$
  s_i \colon \mathcal{G}_{n-1} \to \mathcal{G}_n
  \,.
$$

=--

+-- {: .num_prop #NerveOfGroupoidIsKanComplex}
###### Proposition

These collections of maps in def. \ref{NerveOfGroupoid} satisfy the [[simplicial identities]], hence make the [[nerve]] $\mathcal{G}_\bullet$ into a [[simplicial set]]. Moreover, this simplicial set is a Kan complex, where each $n \geq 2$-[[horn]] has a _unique_ filler (extension to a [[simplex]]).

=--

(A 2-[[simplicial coskeleton|coskeletal]] Kan complex.)

+-- {: .num_prop }
###### Proposition

The [[nerve]] operation constitutes a [[full and faithful functor]]

$$
  N \colon Grpd \to KanCplx \hookrightarrow sSet
  \,.
$$

=--

### Homotopy theory of $\infty$-groupoids as Kan complexes
 {#HomotopyTheoryOfKanComplexes}

+-- {: .num_defn }
###### Definition

Write

$$
  KanCplx \hookrightarrow sSet
$$

for the [[category]] of Kan complexes, which is the [[full subcategory]] of that of [[simplicial sets]] on the Kan complexes.

=--

+-- {: .num_remark }
###### Remark

This means that for $X_\bullet,Y_\bullet \in KanCplx$ two Kan complexes, an element $f_\bullet \colon X_\bullet \to Y_\bullet$ in the [[hom-set]] $Hom_{KanCplx}(X_\bullet,Y_\bullet)$ is

* a sequences of [[functions]] $f_n \colon X_n \to Y_n$ for all $n \in \mathbb{N}$;

such that

* these respect all the face maps $d_k$ and the degeneracy maps $s_k$.

=--

+-- {: .num_defn #MappingObjectOfKanComplexes}
###### Definition

For $X_\bullet,Y_\bullet \in KanCplx$ two Kan complexes, their [[mapping space]]

$$
  Maps(X_\bullet,Y_\bullet)_\bullet \in KanCplx
$$

is the [[simplicial set]] given by

$$
  Maps(X_\bullet,Y_\bullet) \colon [n] \mapsto Hom_{sSet}(X_\bullet \times \Delta^n_\bullet, Y_\bullet)
  \,.
$$

=--

+-- {: .num_prop }
###### Proposition

The construction in def. \ref{MappingObjectOfKanComplexes} defines an [[internal hom]] of Kan complexes.

=--

+-- {: .num_remark }
###### Remark

As such it is also common to write $Y^X$ for $Maps(X,Y)$, as well as $[X,Y]$. Notice that the latter notation is sometimes used instead for just the set of [[connected components]] of $Maps(X,Y)$.

=--

+-- {: .num_example #PathSpaceObjectOfKanComplexes}
###### Example

Write

$$
  I_\bullet \coloneqq \{0 \stackrel{\simeq}{\to} 1\}
$$

for the Kan complex which is [[1-groupoid]] with two objects and one nontrivial morphism and its inverse between them. This comes with two inclusions

$$
  i_0, i_1 \colon \ast \to I
$$

of its endpoints.

Then for $X_\bullet \in KanCplx$ any other Kan complex, the [[mapping space]] $[I,X]_\bullet$ from def. \ref{MappingObjectOfKanComplexes} is the [[path space object]] of $X_\bullet$.

$$
  X_\bullet \stackrel{[i_0,X_\bullet]}{\leftarrow} [I_\bullet,X_\bullet]_\bullet \stackrel{[i_1,X]}{\to} X_\bullet
  \,.
$$

=--

A 1-cell in the mapping Kan complex $[X_\bullet, Y_\bullet]_\bullet$ is a [[homotopy]] between two morphisms of Kan complexes:

+-- {: .num_defn }
###### Definition

For $f_\bullet, g_\bullet \colon X_\bullet \to Y_\bullet$ two morphisms between two Kan complexes, hence $f_\bullet,g_\bullet \in Hom_{KanCplx}(X,Y)$, a (right-)[[homotopy]] $\eta \colon f \Rightarrow g$ is a morphism $\eta_\bullet \colon X_\bullet \to [I_\bullet,X_\bullet]_\bullet$ into the [[path space object]] of def. \ref{PathSpaceObjectOfKanComplexes} such that we have a [[commuting diagram]]

$$
  \array{
    && Y_\bullet
    \\
    & {}^{\mathllap{f_\bullet}}\nearrow & \uparrow^{\mathrlap{[i_0, X_\bullet]_\bullet}}
    \\
    X_\bullet &\stackrel{\eta_\bullet}{\to}& [I_\bullet, Y_\bullet]
    \\
    & {}_{\mathllap{g_\bullet}}\searrow & \downarrow_{\mathrlap{[i_1, X_\bullet]_\bullet}}
    \\
    &&  Y \bullet
  }
  \,.
$$

=--

It follows that the category $KanCplx$ is naturally [[enriched category|enriched]] over itself.

We may write [[∞Grpd]] for $KanCplx$ regarded as a $KanCplx$-[[enriched category]], hence as fibrant [[sSet-enriched category]]. We write $X$ (without the subscript) for a Kan complex $X_\bullet$ regarded as an object of $\infty Grpd$.

## Properties

### Model category

Kan complexes are the [[fibrant objects]] in the _[[model structure on simplicial sets|model structures on simplicial sets]]_ for which fibrations are [[Kan fibration|Kan fibrations]].

In this context, a weak equivalence between Kan complexes is a morphism of simplicial sets that induces an [[isomorphism]] on the [[simplicial homotopy groups]] of the two Kan complexes: a _[[weak homotopy equivalence]]_.

## Examples

### Kan complexes from nerves of $n$-groupoids

+-- {: .un_prop}
###### Proposition

The [[nerve]] $N(C)$ of a [[small category]]
is a Kan complex if and only if $C$ is a [[groupoid]].

=--

The existence of [[nLab:inverse|inverse]] morphisms in $D$ corresponds to the fact that in the [[Kan complex]] $N(D)$ the "outer" [[horns]]

$$
  \array{
    && d_0
    \\
    & && \searrow^{f}
    \\
    d_1 &&\stackrel{Id_{d_1}}{\to} && d_1
  }
  \;\;\;
  \;\;\;
  and
  \;\;\;
  \;\;\;
  \array{
    && d_1
    \\
    & {}^f\nearrow &&
    \\
    d_0 &&\stackrel{Id_{d_0}}{\to} && d_0
  }
$$

have fillers

$$
  \array{
    && d_0
    \\
    & {}^{f^{-1}}\nearrow&& \searrow^{f}
    \\
    d_1 &&\stackrel{Id_{d_1}}{\to} && d_1
  }
  \;\;\;
  \;\;\;
  and
  \;\;\;
  \;\;\;
  \array{
    && d_1
    \\
    & {}^f\nearrow && \searrow^{f^{-1}}
    \\
    d_0 &&\stackrel{Id_{d_0}}{\to} && d_0
  }
$$

(even unique fillers, due to the properties of the [[nerve]] of an ordinary category).

This is one way to see and motivate that a simplicial set that is a [[Kan complex]] but which does not necessarily have unique fillers makes models an [[∞-groupoid]].

Accordingly

+-- {: .un_prop}
###### Proposition

The [[nerve]] $N(C)$ of a [[strict ∞-category]]
is a Kan complex if and only if $C$ is a [[strict ∞-groupoid]].

=--

### Kan complexes from simplicial groups

The underlying simplicial set of a [[simplicial group]] (see there) is a Kan complex.

In particular, via the [[Dold-Kan correspondence]] (see there)

$$
  Ch_{\bullet \geq 0}
  \underoverset{\simeq}{DK}{\to}
  sAb
  \stackrel{forget}{\to}
  KanCplx
  \hookrightarrow
  sSet
$$

every [[chain complex]] (of abelian groups, in non-negative degree) is equivalent to a [[simplicial abelian group]] and this has an underlying Kan complex. This way [[homological algebra]] becomes a special case of the study of [[homotopy theory]] (of Kan complexes).

### Simplicial models of Mal'cev theories

Generalizing the example of simplicial groups: if $T$ is any [[Mal'cev theory]], i.e., a [[Lawvere theory]] which admits a Mal'cev operation $t$, then any $T$-algebra in simplicial sets, given by a [[product-preserving functor]] $A: T \to Set^{\Delta^{op}}$, is a Kan complex. ([Source](http://www.tac.mta.ca/tac/reprints/articles/12/tr12.pdf#270))

For example, the [[subobject classifier]] $\Omega$ in simplicial sets is a Kan complex because it is an internal [[Heyting algebra]], and the theory of Heyting algebras is Mal'cev.

It is not hard to imagine how the proof might go, by adapting the proof in the special case of simplicial groups, replacing occurrences of elements of the form $x y^{-1} z$ by values $t(x, y, z)$ of a chosen Mal'cev operation.

+-- {: .num_remark}
###### Remark
Somewhat more generally, for any [[Mal'cev category]] $C$, a simplicial object $\Delta^{op} \to C$ satisfies the Kan condition. This was shown by [Carboni, Kelly, and Pedicchio](#CKP).
=--

### Singular simplicial complexes / fundamental $\infty$-groupoids

For $X$ a [[topological space]], its _[[singular simplicial complex]]_ is the [[simplicial set]] $\Pi(X)$ (often denoted  $S(X)$ or $Sing(X)$) whose set of $n$-simplices is the [[hom-set]]

$$
  \Pi(X)_n := Top(\Delta^n_{Top}, X)
$$

in [[Top]] of continuous maps from the standard topological $n$-simplex $\Delta^n_{Top}$ into $X$.

Using the fact that the $\Delta^n_{Top}$ arrange themselves into a [[simplicial object|cosimplicial space]]

$$
  \Delta_{Top} : \Delta \to Top
$$

in the obvious way, the $(\Pi(X)_n)$ become a [[simplicial set]] in the corresponding obvious way. For instance the face maps are induced by restricting maps to $X$ along the face inclusions $\delta^i : \Delta^{n-1} \hookrightarrow \Delta^n$.

That $\Pi(X)$ is indeed a Kan complex is intuitively clear. Technically it follows from the fact that the inclusions ${{\Lambda^n}_{Top}}_k \hookrightarrow \Delta^n_{Top}$ of topological horns into topological simplices are
[[retracts]], in that there are continuous maps $\Delta^n_{Top} \to {{\Lambda^n}_{Top}}_k$ given by "squashing" a topological $n$-simplex onto parts of its boundary, such that
$$
  ({{\Lambda^n}_{Top}}_k \to \Delta^n_{Top} \to
  {{\Lambda^n}_{Top}}_k)
  =
  Id
  \,.
$$
Therefore the map
$[\Delta^n, \Pi(X)] \to [\Lambda^n_k,\Pi(X)]$ is an epimorphism, since it is equal to
to $Top(\Delta^n, X) \to Top(\Lambda^n_k, X)$ which has a right inverse $Top(\Lambda^n_k, X) \to Top(\Delta^n, X)$.

The [[∞-groupoid]] represented by the Kan complex $\Pi(X)$ is called the [[fundamental ∞-groupoid]] of $X$.

This example is the universal one: up to [[model structure on simplicial sets|weak equivalence of Kan complexes]] every Kan complex is the fundamental $\infty$-groupoid of a (compactly generated, weakly Hausdorff) [[topological space]].

This is the statement of the [[homotopy hypothesis]] (which is a theorem for $\infty$-groupoids modeled as Kan complexes.

## Cubical analogue

The simplicial notion of a Kan complex has an analogue for [[cubical set | cubical sets]], discussed at: [[cubical Kan complex]].

## Related concepts

* A slight weakening of the Kan condition, the _weak Kan condition_ leads to the definition of _[[quasi-category]]_.

Other concepts:

* [[∞-groupoid]]

* [[Eilenberg subcomplex]]

* [[weak Kan complex]]

* [[Kan fibration]]

[[Kan objects]] can be defined in any [[category]],
see there for more information.

## References

Originally, Kan complexes were defined in a [[cubical set|cubical setting]],
where Kan introduced the extension property for cubical horns
and established the elementary properties of cubical homotopy groups:

* [[Daniel M. Kan]], _Abstract homotopy.  I_, Proceedings of the National Academy of Sciences 41:12 (1955), 1092-1096.  [doi](http://dx.doi.org/10.1073/pnas.41.12.1092).

The second paper in the series proves that the cubical singular complex functor yields cubical Kan complexes:

* [[Daniel M. Kan]], _Abstract homotopy.  II_, Proceedings of the National Academy of Sciences 42:5 (1956), 255-258.  [doi](http://dx.doi.org/10.1073/pnas.42.5.255).

The third paper introduces simplicial Kan complexes (as “c.s.s. complexes which satisfy the extension condition”), and defines and studies the [[Kan fibrant replacement]] functor:

* [[Daniel M. Kan]], _Abstract homotopy.  III_, Proceedings of the National Academy of Sciences 42:7 (1956), 419-421.  [doi](http://dx.doi.org/10.1073/pnas.42.7.419).

The fourth paper proves that [[simplicial groups]] are Kan complexes and studies their properties, including the [[Kan loop group]] functor:

* [[Daniel M. Kan]], _Abstract homotopy.  IV_, Proceedings of the National Academy of Sciences 42:8 (1956), 542-544.  [doi](http://dx.doi.org/10.1073/pnas.42.8.542).

The details for Part III above appeared in the paper

* [[Daniel M. Kan]], _On c.s.s. complexes_, American Journal of Mathematics 79:3 (1957), 449–476.  [doi](http://dx.doi.org/10.2307/2372558)

[[John C. Moore]] in his review of this paper for [[Mathematical Reviews]] indicates that the term “Kan complex” was already in use at the time:

> For such complexes, usually called Kan complexes, homotopy groups may be defined, and, further, the notion of homotopy between maps of an arbitrary semi-simplicial complex into a Kan complex is an equivalence relation.

The details for Part IV above are given in the following paper:

* [[Daniel M. Kan]], _A Combinatorial Definition of Homotopy Groups_, The Annals of Mathematics 67:2 (1958), 282–312.  [doi](http://dx.doi.org/10.2307/1970006).

Exposition:

* {#Friedman08} [[Greg Friedman]], Section 7 of: _An elementary illustrated introduction to simplicial sets_, Rocky Mountain J. Math. 42(2): 353-423 (2012) ([arXiv:0809.4221](http://arxiv.org/abs/0809.4221), [doi:10.1216/RMJ-2012-42-2-353](https://projecteuclid.org/journals/rocky-mountain-journal-of-mathematics/volume-42/issue-2/Survey-Article-An-elementary-illustrated-introduction-to-simplicial-sets/10.1216/RMJ-2012-42-2-353.full))

Textbook accounts:

* {#GabrielZisman67} [[Pierre Gabriel]], [[Michel Zisman]], chapter IV.3 of _[[Calculus of fractions and homotopy theory]]_, Ergebnisse der Mathematik und ihrer Grenzgebiete, Band 35, Springer (1967)  ([pdf](https://www.math.rochester.edu/people/faculty/doug/otherpapers/GZ.pdf))

* {#GoerssJardine09} [[Paul Goerss]], [[J. F. Jardine]], Section I.3 of: _[[Simplicial homotopy theory]]_, Progress in Mathematics, Birkhäuser (1999) Modern Birkhäuser Classics (2009) ([doi:10.1007/978-3-0346-0189-4](https://link.springer.com/book/10.1007/978-3-0346-0189-4), [webpage](http://web.archive.org/web/19990208220238/http://www.math.uwo.ca/~jardine/papers/simp-sets/))

See also:

* Wikipedia, *[Kan fibration](https://en.wikipedia.org/wiki/Kan_fibration)*

For Kan complexes as such see also the references at _[[simplicial set]]_ and at *[[classical model structure on simplicial sets]]*.

For Kan complexes as $\infty$-groupoids, see for instance  section 1.2.5 of

* [[Jacob Lurie]], _[[Higher Topos Theory]]_

* [[Kerodon]], *Kan complexes* ([00SY](https://kerodon.net/tag/00SY))

An early mention of this idea was in

* [[Tim Porter]],  Letter to [[Grothendieck]], dated 16/6/1983 ([[16-06-1983.pdf|pdf:file]])

For background on the general relation of simplicial- and globular sets see also the references at [[oriental]].

Discussion of the [[homotopy theory]] of [[smooth ∞-groupoids]] presented by "Lie-Kan complexes" is in section 4.2 of

* [[Thomas Nikolaus]], [[Urs Schreiber]], [[Danny Stevenson]], _Principal $\infty$-bundles - Presentations_ ([arXiv:1207.0249](http://arxiv.org/abs/1207.0249))
  {#NSSb}

* [[Aurelio Carboni|A. Carboni]], [[Max Kelly|G.M. Kelly]], and M.C. Pedicchio, _Some remarks on Maltsev and Goursat categories_, Applied Categorical Structures, Volume 1, Issue 4 (December 1993), 385-421. ([Springer link](http://link.springer.com/article/10.1007%2FBF00872942))
 {#CKP}

[[!redirects Kan complexes]]

[[!redirects KanCplx]]


Kan extension

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
###Context###
#### Category theory
+--{: .hide}
[[!include category theory - contents]]
=--
#### 2-Category theory
+--{: .hide}
[[!include 2-category theory - contents]]
=--
#### Enriched category theory
+--{: .hide}
[[!include enriched category theory contents]]
=--
#### Limits and colimits
+--{: .hide}
[[!include infinity-limits - contents]]
=--
=--
=--

#Contents#
* table of contents
{:toc}

##Idea

The _Kan extension_ of a [[functor]]
$F \colon C \to D$ with respect to a [[functor]]
$$
 \array{
  C
  \\
  \big\downarrow\mathrlap{{}^p}
  \\
  C'
 }
$$

is, if it exists, a kind of _best approximation_ to
the problem of finding a functor $C' \to D$ such that
$$
  \array{
     C &\stackrel{F}{\to}& D
     \\
     \mathllap{{}^p}\big\downarrow & \nearrow
     \\
     C'
  }
  \,,
$$

hence to [[extension|extending]] the [[domain]] of $F$ through $p$ from $C$ to $C'$.

More generally, this notion makes sense not only in [[Cat]] but in any [[2-category]].

Similarly, a *[[Kan lift]]* is the best approximation to lifting a morphism $F \colon C \to D$ through a morphism

$$
  \array{
    D'
    \\
    \downarrow
    \\
    D
  }
$$

to a morphism $\hat F$

$$
  \array{
    && D'
    \\
    & {}^{\hat F}\nearrow & \downarrow
    \\
    C &\stackrel{F}{\to}& D
  }
  \,.
$$

Kan extensions are ubiquitous. See the discussion at _[Examples](#Examples)_ below.

## Definitions
 {#Definitions}

There are various slight variants of the definition of _Kan extension_ . In good cases they all exist and all coincide, but in some cases only some of these will actually exist.

We (have to) distinguish the following cases:

1. ["ordinary" or "weak" Kan extensions](#OrdinaryKanExtensions)

   These define the extension of an entire functor, by an [[adjunct|adjointness]] relation.

   Here we (have to) distinguish further between

   1. [global Kan extensions](#GlobalKanExtensions),

      which define extensions of _all_ possible functors of given domain and codomain (if all of them indeed exist);

   1. [local Kan extensions](#LocalKanExtensions),

      which define extensions of single functors only, which may exist even if not every functor has an extension.

1. ["pointwise" or "strong" Kan extensions](#Pointwise)

   These define the _value_ of an extended functor on each object (each "point") by a [[weighted limit|weighted (co)limit]].

   Furthermore, a pointwise Kan extension can be ["absolute"](#AbsoluteKanExtension).

If the pointwise version exists, then it coincides with the "ordinary" or "weak" version, but the former may exist without the pointwise version existing. See [below](#pointwiseVsWeak) for more.

Some authors (such as [Kelly](Kelly)) assert that only pointwise Kan extensions deserve the name "Kan extension," and use the term as
"weak Kan extension" for a functor equipped with a universal natural transformation.  It is certainly true that most Kan extensions which arise in practice are pointwise.  This distinction is even more important in [[enriched category]] theory.

### Ordinary or weak Kan extensions
 {#OrdinaryKanExtensions}

#### Global Kan extensions
 {#GlobalKanExtensions}

Let

$$
  p : C \to C'
$$

be a [[functor]]. For $D$ any other category, write

$$
  p^* : [C',D] \to [C,D]
$$

for the induced functor on the [[functor categories]]: this sends a functor $h : C' \to D$ to the composite functor $p^* h : C \stackrel{p}{\to} C' \stackrel{h}{\to} D$.

+-- {: .num_defn}
###### Definition

If $p^*$ has a [[left adjoint]], typically denoted

$$
  p_! : [C,D] \to [C',D]
$$

or

$$
  Lan_p : [C,D] \to [C',D]
$$

then this left adjoint is called the ( _ordinary_ or _weak_ ) **left Kan extension** operation along $p$. For $h \in [C,D]$ we call $p_! h$ the **left Kan extension of $h$** along $p$.

Similarly, if $p^*$ has a [[right adjoint]], this right adjoint is called the **right Kan extension** operation along $p$. It is typically denoted

$$
  p_* : [C,D] \to [C',D]
$$

or

$$
  Ran = Ran_p: [C,D] \to [C',D]
  \,.
$$

=--

The analogous definition clearly makes sense as stated in other contexts, such as in [[enriched category theory]].

\begin{proposition}

If $C' = *$ is the [[terminal category]], then

* the left Kan extension operation forms the [[colimit]] of a functor;

* the right Kan extension operation forms the [[limit]] of a functor.

\end{proposition}

+-- {: .proof}
###### Proof

The functor $p^*$ in this case sends objects $d$ of $D$ to the [[constant functor]] $\Delta_d$ on $d$. Notice that for $F \in [C,D]$ any functor,

* a [[natural transformation]] $\Delta_d \to F$ is the same as a [[cone]] over $F$;

* a [[natural transformation]] $F \to \Delta_d$ is the same as a [[cocone]] under $F$.

Therefore the natural hom-isomorphisms of the [[adjoint functor]]s
$(p_! \dashv p^*)$ and $(p^* \dashv p_*)$

$$
  D(d, p_* F) \simeq Func(\Delta_d, F)
$$

and

$$
  D(p_! F, d) \simeq Func(F, \Delta_d)
$$

assert that

* $p_* F$ corepresents the [[cone]]s over $F$: this means by definition that $p_* F = \lim_\leftarrow F$ is the [[limit]] over $F$;

* $p_! F$ represents the [[cocone]]s under $F$: this means by definition that $p_! F = \lim_\to F$ is the [[colimit]] of $F$.

=--

#### Local Kan extension
 {#LocalKanExtensions}

There is also a *local* definition of "the Kan extension of a given functor $F$ along $p$" which can exist even if the entire functor defined above does not.  This is a generalization of the fact that a *particular* diagram of shape $C$ can have a limit even if not every such diagram does.  It is also a special case of the fact discussed at [[adjoint functor]] that an adjoint functor can fail to exist completely, but may still be partially defined.  If the local Kan extension of every single functor exists for some given $p\colon C\to C'$ and $D$, then these local Kan extensions fit together to define a functor which is the global Kan extension.

Thus, by the general notion of "partial adjoints"; we say

+-- {: .num_defn #LocalKanExtension}
###### Definition

The local **left Kan extension** of  a functor $F\in [C,D]$ along $p : C \to C'$ is, if it exists, a functor

$$
  Lan_p\,F : C'\to D
$$

equipped with a [[natural isomorphism]]

$$
  Hom_{[C,D]}(F,p^*(-))\cong Hom_{[C',D]}(Lan_p\,F,-)
  \,,
$$

hence a [[representable functor|(co)representation]] of the functor $Hom_{[C,D]}(F,p^*(-))$.

The local definition of right Kan extensions along $p$ is dual.

=--

As for adjoints and limits, by the usual logic of representable functors this can equivalently be rephrased in terms of
universal morphisms:

+-- {: .num_defn}
###### Definition

The **left Kan extension $Lan F = Lan_p F$ of $F : C \to D$ along
$p :C\to C'$ is a functor $Lan F : C' \to D$ equipped with a [[natural transformation]] $\eta_F : F \Rightarrow p^* Lan F$.

[[kan-0.png:pic]]

with the property that every other natural transformation
$F \Rightarrow p^* G$ factors uniquely through $\eta_F$ as

[[kan-1.png:pic]]

Similarly for the right Kan extension, with the direction of the natural transformations reversed:

[[kan-2.png:pic]]

=--

By the usual reasoning (see e.g. [[Categories Work]], chapter IV, theorem 2), if these representations exist for every $F$ then they can be organised into a left (right) adjoint $Lan_p$ ($Ran_p$) to $p^*$.

+-- {: .num_remark #InHigherCats}
###### Remark

The definition in this form makes sense not just in [[Cat]] but in every [[2-category]]. In slightly different terminology, the left Kan extension of a 1-cell $F:C\to D$ along a 1-cell $p\in K(C,C')$ in a 2-category $K$ is a pair $(Lan_p F,\alpha)$ where $\alpha : F\to Lan_p F\circ p$ is a 2-cell which [[reflections|reflects]] the object $F\in K(C,D)$ along the functor $p^* = K(p,D):K(C',D)\to K(C,D)$.  Equivalently, it is such a pair such that for every $G\colon C' \to D$, the function
$$ K(C',D)(Lan_p F, G) \xrightarrow{- \cdot \alpha} K(C,D)(F, G \circ p) $$
is a [[bijection]].

In this form, the definition generalizes easily to any [[n-category]] for any $n\ge 2$.  If $K$ is an $n$-category, we say that the left Kan extension of a 1-morphism $F:C\to D$ along a 1-morphism $p\in K(C,C')$ is a pair $(Lan_p F,\alpha)$, where $Lan_p F \colon C' \to D$ is a 1-morphism and $\alpha : F\to Lan_p F\circ p$ is a 2-morphism, with the property that for any 1-morphism $G\colon C'\to D$, the induced functor
$$ K(C',D)(Lan_p F, G) \xrightarrow{- \cdot \alpha} K(C,D)(F, G \circ p) $$
is an [[equivalence]] of $(n-2)$-categories.

=--

### Preservation of Kan extensions
{#Preservation}

We say that a Kan extension $Lan_p F$ is *preserved* by a functor $G$ if the composite $G \circ Lan_p F$ is a Kan extension of $G F$ along $p$, and moreover the universal natural transformation $G F \to G(Lan_p F)p$ is the composite of $G$ with the universal transformation $F\to (Lan_p F)p$.

### Pointwise or strong Kan extensions
 {#Pointwise}

If the [[codomain]] category $D$ admits certain [[limit|(co)limits]], then left and right Kan extensions can be constructed, over each object ("point") of the domain category $C'$ out of these: Kan extensions that admit this form are called _pointwise_. (Reviews include ([Riehl, I 1.3](#Riehl))).

The notion of pointwise Kan extensions deserves to be discussed in the general context of [[enriched category theory]], which we do below. The reader may want to skip ahead to the section

* [pointwise Kan extensions by conical (co)limits](#PointwiseByConicalLimits)

which discusses the situation in ordinary ([[Set]]-[[enriched category|enriched]]) [[category theory]] in terms of ordinary limits ("conical" limits, defined in terms of [[cone]]s, to be distinguished from the more general [[weighted limit]]s). While the formulas in that case are classical and fundamentally useful in practice, they do rely heavily on special properties of the enriching category [[Set]].

The general formulation of pointwise Kan extensions in general enriched contexts is

* [in terms of weighted (co)limits](#PointwiseByWeightedColimits).

In the case that the codomain category is [[tensoring|(co)tensored]] these may be expressed equivalently

* [in terms of (co)ends](#PointwiseByCoEnds).

First, here is a characterization that doesn't rely on any computational framework:

+-- {: .num_defn}
###### Definition

A Kan extension, def. \ref{LocalKanExtension}, is called __pointwise__ if and only if it is [preserved](#Preservation) by all [[representable functor]]s.

=--

([[Categories Work]], theorem X.5.3)

#### In terms of weighted (co)limits
 {#PointwiseByWeightedColimits}

Suppose given $F : C \to D$ and $p : C \to C'$ such that for every $c' \in C'$, the [[weighted limit]]

$$
  (Ran_p F)(c') \coloneqq lim^{C'(c',p(-))} F
  \,.
$$

exists.  Then these objects fit together into a functor $Ran_p F$ which is a right Kan extension of $F$ along $p$.  Dually, if the [[weighted limit|weighted colimit]]
$$
  (Lan_p F)(c') \coloneqq colim^{C'(p(-),c')} F
  \,.
$$
exists for all $c'$, then they fit together into a left Kan extension $Lan_p F$.  These definitions evidently make sense in the generality of $V$-[[enriched category theory]] for $V$ a [[closed monoidal category|closed]] [[symmetric monoidal category]].  (In fact, they can be modified slightly to make sense in the full generality of a [[2-category equipped with proarrows]].)

In particular, this means that if $C$ is [[small category|small]] and $D$ is [[complete category|complete]] (resp. cocomplete), then all right (resp. left) Kan extensions of functors $F\colon C\to D$ exist along any functor $p\colon C\to C'$.

One can prove that any Kan extension constructed in this way must be pointwise, in the sense of being preserved by all representables as above.  Moreover, conversely, if a Kan extension $Lan_p F$ is pointwise, then one can prove that $(Lan_p F)(c')$ must be in fact a $C'(p(-),c')$-weighted colimit of $F$, and dually; thus the two notions are equivalent.

Unfolding the definitions of weighted (co)limits, these can be defined as representing objects
$$
  D\big(
   d
   ,\,
   (Ran_p F)(c')
  \big)
  \;\simeq\;
  Set^C\Big(
    C'\big(c', p(-)\big)
    ,\,
    D\big(d, F(-)\big)
  \Big)
$$
$$
  D\big(
    (Lan_p F)(c')
    ,\,
    d
  \big)
  \;\simeq\;
  Set^{C^{op}}\Big(
    C'\big(p(-), c'\big)
    ,\,
   D\big(F(-), d\big)
  \Big)
  \,.
$$
Similarly, for $V$-[[enriched categories]], replace [[Set]] here with the [[cosmos for enrichment]] $V$.

#### In terms of (co)ends
 {#PointwiseByCoEnds}

If the $V$-[[enriched category]] $D$ is [[power]]ed over $V$, then the above weighted limit may be re-expressed in terms of an [[end]] as

$$
  (Ran_p F)(c') \simeq \int_{c \in C} C'(c',p(c))\pitchfork F(c)
  \,.
$$

So in particular when $D = V$ this is

\[
  \label{RightKanExtensionViaEndFormula}
  (Ran_p F)(c') \simeq \int_{c \in C} [C'(c',p(c)),F(c)]
  \,.
\]

([Kelly (4.24)](#Kelly))

Similarly, if $D$ is [[copower|tensored]] over $V$, then the left Kan extension is given by a [[coend]].

\[
  \label{LeftKanExtensionViaCoendFormula}
  (Lan_p F)(c') \simeq \int^{c \in C} C'(p(c),c')\otimes F(c)
  \,.
\]

([Kelly (4.25)](#Kelly))

+-- {: .num_example #CoendFormulaForPresheavesOfSets}
###### Example
**(coend formula for left Kan extension of presheaves)**

The coend formula for the  left Kan extension is nicely understood when thinking of $C$ and $D$ above as [[opposite categories]] and for $\mathcal{V} = Set$, so that it takes [[presheaves]] $F$ on $C$ along $p \colon C \to C'$ to presheaves $Lan_p F$ on $C'$, by the formula

$$
  (Lan_p F)(c') \simeq \int^{c \in C} C'(c', p(c)) \times F(c)
  \,.
$$

Using the [[Yoneda lemma]] to rewrite $F(c) \simeq Hom_{PSh(C)}(c,F)$, this is

$$
  (Lan_p F)(c') \simeq \int^{c \in C} Hom_{C'}(c', p(c)) \times Hom_{PSh(C)}(c,F)
  \,.
$$

In this form one sees that the coend produces the set whose elements are [[equivalence classes]] of pairs of morphisms

$$
   (c' \to p(c), c \to F)
$$

where two such are regarded as equivalent whenever there is $f \colon c_1 \to c_2$ such that

$$
  \array{
    && c'
    \\
    & \swarrow && \searrow
    \\
    p(c_1) && \stackrel{p(f)}{\longrightarrow} && p(c_2)
    \\
    c_1 && \stackrel{f}{\longrightarrow} && c_2
    \\
    & \searrow && \swarrow
    \\
    && F
  }
  \,.
$$

This is particularly suggestive in cases when we may think of the objects of $C$ and $C'$ on the same footing, notably when $p$ is a [[full subcategory]] inclusion. For in that case we may imagine that a representative pair $(c' \to p(c), c \to F)$ is a stand-in for the actual pullback of elements of $F$ via forming the composite "$c'\to c \to F$", only that this composite is not defined. But the above equivalence relation is precisely that under which this composite would be invariant.

=--

#### In terms of conical (co)limits
 {#PointwiseByConicalLimits}

In the case of functors between ordinary [[locally small categories]], hence in the special case of $V$-[[enriched category theory]] for $V = $ [[Set]], there is an expression of a weighted (co)limit and hence a pointwise Kan extension as an ordinary ("conical", meaning: in terms of [[cone]]s) (co)limit over a [[comma category]]:

+-- {: .num_prop}
###### Proposition

Let

* $C$ be a [[small category]];

* $D$ have all small [[limit]]s.

Then the right Kan extension of a functor $F : C \to D$ of locally small categories along a functor $p : C \to C'$ exists
and its value on an object $c' \in C'$ is given by the [[limit]]

$$
    (Ran_p F)(c')
      \simeq
    \lim_\leftarrow \left((\Delta_{c'}/p) \to C \stackrel{F}{\to} D\right)
  \,,
$$

where

* $\Delta_{c'}/p$ is the [[comma category]];

* $\Delta_{c'}/p \to C$ is the canonical [[forgetful functor]].

Likewise, if $D$ admits small [[colimit]]s,
the left Kan extension of a functor exists and is pointwise given by the [[colimit]]

$$
    (Lan_p F)(c')
      \simeq
     \lim_\to \left((p/\Delta_{c'}) \to C \stackrel{F}{\to} D\right)
  \,.
$$

=--

This appears for instance as ([Borceux, I, thm 3.7.2](#Borceux)).
Discussion in the context of [[enriched category theory]] is in ([Kelly, section 3.4](#Kelly)).

A cartoon picture of the forgetful functor out of the [[comma category]] $p/\Delta_{c'} \to C$, useful to keep in mind, is

$$
  \left(
    \array{
      p(c_1) &&\stackrel{p(\phi)}{\to}&& p(c_2)
      \\
      & \searrow && \swarrow
      \\
      &&  c'
    }
  \right)
   \;\;
   \mapsto
   \;\;
  \left(
    c_1 \stackrel{\phi}{\to} c_2
  \right)
  \,.
$$

The [[comma category]] here is equivalently the [[category of elements]] of the functor $C'(p(-), c') : C^{op} \to Set$

$$
  (p/\Delta_{c'}) \simeq el( C'(p(-), c') )
  \,.
$$

+-- {: .proof}
###### Proof

Consider the case of the left Kan extension, the other case works analogously, but dually.

First notice that the above pointwise definition of values of a functor canonically extends to an actual functor:

for $\phi : c'_1 \to c'_2$ any morphism in $C'$ we get a functor

$$
  \phi_* : p/\Delta_{c'_1} \to p/\Delta_{c'_2}
$$

of comma categories, by postcomposition. This morphism of [[diagram]]s induces canonically a corresponding morphism of [[colimit]]s

$$
  (Lan_p F)(c'_1) \to (Lan_p F)(c'_2)
  \,.
$$

Now for the universal property of the functor $Lan_p F$ defined  this way. For $c' \in C'$ denote the components of the colimiting [[cocone]] $(Lan_p F)(c') := \lim_{\to}( p/\Delta_{c'} \to C \stackrel{F}{\to} D) $ by $s_{(-)}$, as in

$$
  \array{
   (p(c_1)\stackrel{\phi}{\to} c')
      &&\stackrel{p(h)}{\to}&&
   (p(c_2)\stackrel{\lambda}{\to} c')
    \\
    \\
    \\
    F(c_1) &&\stackrel{F(h)}{\to}&& F(c_2)
    \\
    & {}_{\mathllap{s_\phi}}\searrow && \swarrow_{\mathrlap{s_{\lambda}}}
    \\
    && (Lan_p F)(c')
  }
  \,.
$$

We now construct in components a natural transformation

$$
  \eta_F : F \to p^* Lan_p F
$$

for $Lan_p F$ defined as above, and show that it satisfies the required universal property.
The components of $\eta_F$ over $c \in C$ are morphisms

$$
  \eta_F(c) : F(c) \to (Lan_p F)(p (c))
  \,.
$$

Take these to be given by

$$

  \eta_F(c) := s_{Id_{p(c)}}
$$

(this is similar to what happens in the proof of the [[Yoneda lemma]], all of these arguments are variants of the argument for the Yoneda lemma, and vice versa). It is straightforward, if somewhat tedious, to check that these are natural, and that the natural transformation defined this way has the required universal property.

=--

#### Comparing the definitions   {#pointwiseVsWeak}

We have seen that if $D$ has enough limits or colimits, then a pointwise Kan extension can be defined in terms of these limits, and will necessarily satisfy the universal property described first.  However, not all Kan extensions are pointwise: that is, having a universal transformation $F \to (Lan_p F)p$ does not necessarily imply that the individual values of $Lan_p F$ are limits or colimits in its codomain.  Non-pointwise Kan extensions can exist even when $D$ does not admit very many limits.

It should be noted, though, that pointwise Kan extensions can still exist, and hence the particular requisite limits/colimits exist, even if $D$ is not (co)complete.  For instance, the Kan extensions that arise in the study of [[derived functor]]s are pointwise, and in fact [[absolute colimit|absolute]] (preserved by *all* functors), even though their codomains are [[homotopy categories]] which generally do not admit all limits and colimits.

Non-pointwise Kan extensions seem to be very rare in practice.  However, the abstract notion of Kan extension (sometimes called simply "extension") in a 2-category, and its dual notion of lifting, can be useful in [[2-category theory]].  For instance, [[bicategories]] such as [[Prof]] admit all right extensions and right liftings; a bicategory with this property may be considered a [[horizontal categorification]] of a [[closed monoidal category]].

### Absolute Kan extensions
  {#AbsoluteKanExtension}

An _absolute_ Kan extension $Lan_p F$ is one which is [preserved](#Preservation) by all functors $G$ out of the codomain of $F$:
\[
G (Lan_p F) \simeq Lan_p(G F)
\]
(same for right Kan extensions).

The most prominent example of absolute Kan extensions is given by [[adjoint functor|adjoint functors]]; in fact they can be defined as certain absolute Kan extensions. See there for the precise statement.

\begin{remark}
**(absolute vs pointwise)**
\linebreak
Absolute Kan extensions are always pointwise, as the latter can be defined as those preserved by representables; there are (lots of) examples of pointwise Kan extensions which are not absolute.

Note that in a general 2-category, absolute Kan extensions make perfect sense, while for defining pointwise ones more structure is needed: [[comma object|comma objects]] and/or some structure which would let us work with (co)limits _inside_ that 2-category (such as a [[Yoneda structure|(co)Yoneda structure]] or a [[2-category equipped with proarrows|proarrow equipment]]).
\end{remark}

### Of $(\infty,1)$-functors

The global definition of Kan extensions for
functors in terms of left/right adjoints to pullbacks may be interpreted essentially verbatim in the context of [[(∞,1)-categories]]

See at _[[(∞,1)-Kan extension]]_.

### In a general 2-category
  {#In2cat}

The Kan extension of a functor may be regarded more abstractly as an extension-problem in the [[2-category]] [[Cat]] of categories. The same extension problem can be stated verbatim in any [[2-category]] and hence there is a corresponding more general notion of Kan extensions of [[1-morphisms]] in [[2-categories]].  This is discussed in ([Lack 09, section 2.2](#Lack09)).

The question of defining a *pointwise* Kan extension in a general 2-category is more subtle, and there are at least two distinct approaches.  If the 2-category has [[comma objects]], then we can define a Kan extension to be pointwise if it remains a Kan extension upon pasting with any comma object; this is an "internalization" of the above definition in terms of *conical* colimits.  On the other hand, in a [[2-category equipped with proarrows]] we can define pointwise Kan extensions as particular weighted (co)limits using a representable weight; this generalizes the above definition as a weighted (co)limit.

In some 2-categories such as $Cat$, both definitions agree; but in others they do not, and in general in this case it is the equipment-theoretic version that is "correct".  For instance, in $V Cat$ the equipment-theoretic version gives the right notion of pointwise Kan extension, whereas the comma-object one is too strong.

As a concrete example, let $V=Cat$, so that $V Cat = 2 Cat$; then comma objects are not informative enough because they "don't see the 2-cells".  In even more specificity, let $B$ be the [[walking]] 2-cell and $M$ the walking pair of parallel 1-morphisms, with $f:1\to B$ and $g:1\to M$ the inclusions of the common domain of the parallel 1-morphisms; then the equipment-theoretic-pointwise $Lan_f g$ is constant at the domain object, whereas the comma-object-pointwise $Lan_f g$ does not exist.  See [(Roald, Example 2.24)](#Roald13) for details.

## Existence

The following reproduces a [MathOverflow answer](https://mathoverflow.net/questions/365947/when-size-matters-in-category-theory-for-the-working-mathematician/365951#365951) by [[Ivan Di Liberti]]:

\begin{lemma}
(Kan).
Let $\mathsf{B} \stackrel{f}{\leftarrow} \mathsf{A} \stackrel{g}{\to} \mathsf{C}$ be a [[span]] where $\mathsf{A}$ is [[small category|small]] and $\mathsf{C}$ is (small) [[cocomplete category|cocomplete]]. Then the [[left Kan extension]] $\mathsf{lan}_f g$ exists.
\end{lemma}

Kan extensions are a useful tool in everyday practice, with applications in many different topics of [[category theory]]. In this lemma (which is one of the most used in this topic) the set-theoretic issue is far from being hidden: **$\mathsf{A}$ needs to be small (with respect to $Ob(\mathsf{C})$!** There is no chance that the lemma is true when $\mathsf{A}$ is a [[large category]]. Indeed since [[colimits]] can be computed via Kan extensions, the lemma would imply that every (small) [[cocomplete category]] is large cocomplete, which is not allowed because [cocomplete small categories are posets](complete+small+category#CompleteSmallCategoriesArePosets). Also, there is no chance to solve the problem by saying: *well, let's just consider $\mathsf{C}$ to be large-cocomplete*, again because [cocomplete small categories are posets](complete+small+category#CompleteSmallCategoriesArePosets).

This problem is hard to avoid because the size of the categories of our interest is *as a fact* always larger than the size of their inhabitants (this just means that most of the time **Ob**$\mathsf{C}$ is a [[proper class]], as big as the size of the [[enriched category|enrichment]]).

Notice that the Kan extension problem **recovers the [[adjoint functor theorem]] one,** because adjoints are computed via Kan extensions of identities of large categories. Indeed, in that case, the [[solution set condition]] is precisely what is needed in order to cut down the size of some colimits that otherwise would be too large to compute, as can be synthesized by the sharp version of the Kan lemma.

\begin{lemma}
**Sharp Kan lemma.**
Let $\mathsf{B} \stackrel{f}{\leftarrow} \mathsf{A} \stackrel{g}{\to} \mathsf{C}$ be a span where $\mathsf{B}(f-,b)$ is a small presheaf for every $b \in \mathsf{B}$ and $\mathsf{C}$ is (small) cocomplete. Then the left Kan extension $\mathsf{lan}_f g$ exists.
\end{lemma}

Indeed this lemma allows $\mathsf{A}$ to be large, but we must pay a tribute to its presheaf category: $f$ needs to be somehow *locally small* (with respect to **Ob**$\mathsf{C}$).

\begin{lemma}
**Kan lemma Fortissimo.**
Let $ \mathsf{A} \stackrel{f}{\to} \mathsf{B} $ be a functor. The following are equivalent:

* for every $g :\mathsf{A} \to \mathsf{C}$ where $\mathsf{C}$ is a small-cocomplete category, $\mathsf{lan}_f g$ exists.
* $\mathsf{lan}_f y$ exists, where $y$ is the Yoneda embedding in the category of small presheaves $y: \mathsf{A} \to \mathcal{P}(\mathsf{A})$.
* $\mathsf{B}(f-,b)$ is a is small presheaf for every $b \in \mathsf{B}$.

\end{lemma}

Even unconsciously, the previous discussion is one of the reasons of the popularity of [[locally presentable categories]]. Indeed, having a dense generator is a good compromise between *generality and tameness*. As an evidence of this, in the context of [[accessible categories]] the sharp Kan lemma can be simplified.

\begin{lemma}
**Tame Kan lemma.**
Let $\mathsf{B} \stackrel{f}{\leftarrow} \mathsf{A} \stackrel{g}{\to} \mathsf{C}$ be a span of accessible categories, where $f$ is an accessible functor and $\mathsf{C}$ is (small) cocomplete. Then the left Kan extension $\mathsf{lan}_f g$ exists.
\end{lemma}

*References for Sharp.* I am not aware of a reference for this result. It can follow from a careful analysis of **Prop. A.7** in my paper **Codensity: Isbell duality, pro-objects, compactness and accessibility**. The structure of the proof remains the same, presheaves must be replaced by small presheaves.

*References for Tame.* This is an exercise, it can follow directly from the sharp Kan lemma, but it's enough to properly combine the usual Kan lemma, **Prop A.1&2** of the above-mentioned paper, and the fact that [[accessible functors]] have arity.

## Properties
  {#Properties}

### Left Kan extension on representables / fully faithfulness
 {#LeftKanOnRepresentables}

Let $\mathcal{V}$ be a suitable enriching category (a [[cosmos]]). Notably $\mathcal{V}$ may be [[Set]].

+-- {: .num_prop #LeftKanExtensionBasicProp}
###### Proposition

For $F : C \to D$ a $\mathcal{V}$-[[enriched functor]] between [[small category|small]] $\mathcal{V}$-[[enriched categories]] we have

1. the left Kan extension along $F$ takes [[representable functor|representable]] [[presheaves]] $C(c,-) : C \to \mathcal{V}$ to their image under $F$:

   $$
     Lan_F C(c, -) \simeq D(F(c), -)
   $$

   for all $c \in C$.

1. if $F$ is a [[full and faithful functor]] then
   $F^* (Lan_F H) \simeq H$ and in fact the $(Lan_F \dashv F^*)$-[[unit of an adjunction]] is a [[natural isomorphism]]

   $$
      Id \stackrel{\simeq}{\to} F^* \circ Lan_{F}
   $$

   whence it follows (by [this property](adjoint+functor#FullyFaithfulAndInvertibleAdjoints) of [[adjoint functor]]s) that $Lan_F : [C,\mathcal{V}] \to [D,\mathcal{V}]$ is itself a [[full and faithful functor]].

=--

The second statement appears for instance as ([Kelly, prop. 4.23](#Kelly)).

+-- {: .proof}
###### Proof

For the first statement, using the [[coend]] formula for the left Kan extension [above](#PointwiseByCoEnds) we have naturally in $d' \in D$ the expression

$$
  \begin{aligned}
    Lan_F C(c,-) :
    d' \mapsto
     &
    \int^{c' \in C} D(F(c'), d') \cdot C(c,-)(c')
    \\
    & \simeq
    \int^{c' \in C} D(F(c'), d') \cdot C(c,c')
    \\
    & \simeq
    D(F(c), d')
  \end{aligned}
  \,.
$$

Here the last step is called sometimes the [[co-Yoneda lemma]]. It follows for instance by observing that $\int^{c' \in C} D(F(c'), d') \cdot C(c,c')$ is equivalently dually the expression for the left Kan extension of the non-representable $D(F(-),d') : C^{op} \to \mathcal{V}$ along the _identity_ functor.

Similarly for the second, if $H : D \to E$ is any $\mathcal{V}$-[[enriched functor]] with $E$ [[tensoring|tensored]] over $\mathcal{V}$, then its left Kan extension evaluated on the image of $F$ is

$$
  \begin{aligned}
    Lan_F H : F(d) \mapsto
     & \int^{c \in C} D(F(c), F(d)) \cdot H(c)
     \\
     & \simeq
     \int^{c \in C} C(c, d) \cdot H(c)
     \\
     & \simeq H(d)
  \end{aligned}
  \,.
$$

=--

### Left Kan extensions preserving certain limits
 {#LeftKanExtensionPreservingCertainLimits}

The following statement says that [[left exact functors]] into [[toposes]] have left exact left Kan extension along the [[Yoneda embedding]] ([[Yoneda extension]]) and that this is the [[inverse image]] of a [[geometric morphism]] of [[sheaf toposes]] if the original functor preserves [[covers]].

(We state this in [[(∞,1)-category theory]], the same statement holds true in plain [[category theory]] by just disregarding all occurrences of "$\infty$".)

+-- {: .num_prop #YonedaExtensionOfLeftExact}
###### Proposition

Let $\mathbf{H}$ be an [[(∞,1)-topos]] and let $\mathcal{C}$ be an [[(∞,1)-site]] with [[(∞,1)-sheaf (∞,1)-category]] $Sh(\mathcal{C})$. Then the [[(∞,1)-functor]]

$$
  Top(\mathcal{X}, Sh(\mathcal{C}))
  \simeq
  Func^{lex, leftadj}(Sh(\mathcal{C}), \mathcal{X})
  \stackrel{(-)\circ L }{\longrightarrow}
  Func(PSh(\mathcal{C}), \mathcal{X})
  \stackrel{(-)\circ Y }{\longrightarrow}
  Func(\mathcal{C}, \mathcal{X})
$$

given by precomposition with [[∞-stackification]]/[[sheafification]] $L$ and with the [[(∞,1)-Yoneda embedding]] $Y$ is a [[full and faithful (∞,1)-functor]]. Moreover, its [[essential image]] consisist of those [[(∞,1)-functors]] $f \colon \mathcal{C} \longrightarrow \mathcal{X}$ which are [[left exact (∞,1)-functor|left exact]] and which preserve covers in that for $\{U_i \to X\}_i$ a [[covering]] in $\mathcal{C}$, then $\coprod_i f(U_i) \to f(X)$ is an [[effective epimorphism]] in $\mathcal{X}$.

=--

This appears as [[Higher Topos Theory|Lurie, HTT, prop. 6.2.3.20]].

+-- {: .num_remark }
###### Remark

Prop. \ref{YonedaExtensionOfLeftExact} is a central statement in the theory of [[classifying toposes]]. See there for more.

=--

For more discussion of left exactness properties preserved by left Kan extension see also ([Borceux-Day](#BorceuxDay), [Karazeris-Protsonis](#KarazerisProtsonis)).

### Kan extension along (op)fibration
 {#AlongFibrations}

+-- {: .num_prop}
###### Proposition

Let $f : C \to D$ be a small [[opfibration]] of categories, and let $\mathcal{C}$ be a category with all small [[colimits]]. Then for each $d \in D$ the inclusion

$$
  f^{-1}(d) \to f/d
$$

of the [[fiber]] over $d$ into the [[comma category]] given by

$$
  c \mapsto (c, Id_{d} = Id_{f(c)})
$$

has a [[left adjoint]]. given by

$$
  (c, f(c) \to d) \mapsto c'
  \,,
$$

where $c \to c'$ is a coCartesian lift of $f(c) \to d$.

Therefore (by the discussion _[here](final+functor#Examples)_) it is a [[cofinal functor]]. Accordingly, the local formula for the left Kan extension

$$
  f_! : [C, \mathcal{D}] \to [D, \mathcal{D}]
$$

is equivalently given by taking the colimit over the [[fiber]]:

$$
  f_! X : d \mapsto \lim_{\underset{f^{-1}(d)}{\to}} X
  \,.
$$

=--

A similar result holds for $(\infty,1)$-categories.
See [[Higher Topos Theory|Lurie, HTT, prop. 4.3.3.10]], set $S=Y$ and $q = \id_Y$.

## Examples
 {#Examples}

The central point about examples of Kan extensions is:

_Kan extensions are ubiquitous_ .

To a fair extent, [[category theory]] is all about Kan extensions and the other [[universal construction]]s: [[limit]]s, [[adjoint functor]]s, [[representable functor]]s, which are all special cases of Kan extensions -- and Kan extensions are special cases of these.

Listing examples of Kan extensions in [[category theory]] is much like listing examples of [[integral]]s in [[analysis]]: one can and does fill books with these. (In fact, that analogy has more to it than meets the casual eye: see [[coend]] for more).

Keeping that in mind, we do list some special cases and special classes of examples that are useful to know. But any list is necessarily wildly incomplete.

### General

* For $C' = $ the [[point]], the right Kan extension of $F$ is the [[limit]] of $F$, $Ran F \simeq \lim F$ and the left Kan extension is the [[colimit]] $Lan F \simeq colim F$.

* For $f : X \to Y$ a [[site|morphism of sites]] coming from a functor $f^t : S_Y \to S_X$ of the underlying categories, the left Kan extension of functors along $f^t$ is the [[inverse image]] operation $f^{-1} : PSh(Y) \to PSh(X)$.

* see also [[examples of Kan extensions]]

### Non-pointwise Kan extensions

Examples of Kan extensions that are not point-wise are discussed in [Borceux, exercise 3.9.7](#Borceux).

### Restriction and extension of sheaves

For more on the following see also

* [[restriction and extension of sheaves]]

The basic example for left Kan extensions using the above pointwise formula, is in the construction of the pullback of sheaves along a morphism of topological spaces. Let $f:X\to Y$ be a continuous map and $F$ a presheaf over $X$. Then the formula $(f_* F)(U) = F(f^{-1}(U))$ clearly defines a presheaf $f_* F$ on $Y$, which is in fact a sheaf if $F$ is.
On the other hand, given a presheaf $G$ over $Y$ we can not
define pullback presheaf $(f^{-1} G)(V)=G(f(V))$ because $f(V)$ might not be open in general (unless $f$ is an open map). For Grothendieck sites such $f(V)$ would not make even sense. But one can consider approximating from above by $G(W)$ for all $W\supset f(V)$ which are open and take a colimit of this diagram of inclusions (all $W$ are bigger, so getting down to the lower bound means going reverse to the direction of inclusions). But inclusion $f(V)\subset W$ implies $V\subset f^{-1}(f(V))\subset f^{-1}(W)$. The latter identity $V\subset f^{-1}(W)$ involves _only open sets_. Thus we take a colimit over the comma category $(V\downarrow f^{-1})$ of $G$. If $G$ is a sheaf, the colimit $G(V)$ understood as a rule $V\mapsto G(V)$ is still not a sheaf, we need to [[sheafification|sheafify]]. The result is sheaf-theoretic pullback
$$
f^{-1}G = \mathrm{sheafify}(V\mapsto\mathrm{colim}_{V\hookrightarrow f^{-1}W} G(W)) = \mathrm{sheafify}(V\mapsto\mathrm{colim}_{(V\downarrow f^{-1})} G)
$$
which is a sheaf, and one can analyze this construction to show that $f^{-1}$ is a left adjoint to $f_*$. This usage of left Kan extension persists in the more general case of Grothendieck topologies.

### Kan extension in physics
 {#ExamplesKanExtensionsInPhysics}

We list here some occurrences of Kan extensions in [[physics]].

Notice that since, by the above discussion, Kan extensions are ubiquitous in [[category theory]] and are essentially equivalent to other standard [[universal constructions]] such as notably [[colimit|co]]/[[limits]], to the extent that there is a relation between [[higher category theory and physics|category theory and physics]] at all, it necessarily also involves Kan extensions, in some guise. But here is a list of some example where they appear rather explicitly.

* In [[extended quantum field theory]] on open and closed manifolds, usually the theory "in the bulk" (on closed manifolds) is induced by "extending" that "[[boundary field theory|on the boundary]]", and in good cases this extension is explicitly a ([[homotopy Kan extension|homotopy]])-Kan extension. This is the case notably for [[2d TQFT]] in the form of [[TCFT]] ([Costello 04](TCFT#Costello04)), see at _[TCFT -- Classification](TCFT#Classification)_ for details.

* When [[path integral]] [[quantization]] is formalized in terms of [[fiber integration in generalized cohomology]] (as surveyed at _[[motivic quantization]]_) then the push-forward step, hence the path integral itself, is given by left [[homotopy Kan extension]] of [[parameterized spectrum|parameterized spectra]]. For explicit details see ([[schreiber:master thesis Nuiten|Nuiten 13, section 4.1]]), also ([[schreiber:Homotopy-type semantics for quantization|Schreiber 14, section 6.2]]). By example 6.3, a special case of this is the integration formulas via Kan extension in ([[Ambidexterity in K(n)-Local Stable Homotopy Theory|Hopkins-Lurie 14, section 4]]).

## Remark on terminology: pushforward vs. pullback

Generally, for $p : C \to C'$ a [[functor]], the induced "precomposition" functor on [[functor category|functor categories]]
$$
  [C', D] \stackrel{- \circ p}{\to}
  [C,D]
$$
is spoken of as _pulling back_ a functor on $C'$ to a functor on $C$, as this operation goes in the direction opposite to that of $p$ itself.  For this reason, we have above denoted this functor by $p^*$.  Likewise, one might call the (left or right) Kan extensions along $p$ a _push forward_ of functors from $C$ to functors on $C'$.

This notation also coincides with that for [[geometric morphisms]] in one case: any functor $p\colon C\to C'$ between small categories induces a geometric morphism $[C,Set] \to [C',Set]$ of [[presheaf topos|presheaf toposes]], whose [[inverse image]] is the above $p^*$ and whose [[direct image]] $p_*$ is the right Kan extension functor.  Note that $p^*$ preserves (finite) limits, as required of an inverse image functor, since it has a left adjoint, namely *left* Kan extension.

On the other hand, if $p$ is additionally a [[flat functor]], then the above precomposition functor is also the *direct* image of a geometric morphism, whose inverse image is given by *left* Kan extension (which preserves finite limits when $p$ is flat).  More generally, if $C^{op}$ and $(C')^{op}$ are [[sites]] and $p^{op}\colon C^{op}\to (C')^{op}$ is flat and preserves covering families (i.e. it is a [[morphism of sites]]), then precomposition is the direct image of a geometric morphism $Sh(C^{op})\to Sh((C')^{op})$ between sheaf toposes.

For example, $C^{op}$ and $(C')^{op}$ might be the [[posets]] $Open(X)$ and $Open(X')$ of open subsets of [[topological spaces]] (or [[locales]]) $X$ and $X'$ and inclusions, in which case
$$
  Open(X)^{op} \to Open(X')^{op}
$$
come from continuous maps of topological spaces going the other way
$$
  X \leftarrow X' : f
  \,,
$$
via the usual inverse image $f^{-1} : O(X)^{op} \to O(X')^{op}$ of open subsets.

Thus, in such cases, the functor $p^*$, which looks like a pullback of functors along $p = f^{-1}$, corresponds geometrically to a _push-forward_ of (pre)sheaves along $f$.  Therefore, in [[presheaf]] literature (such as [[Categories and Sheaves]]) the precomposition functor induced by $p$ is usually denoted $p_*$ and not $p^*$.

It is however noteworthy that also the opposite perspective does occur in geometrically motivated examples. For instance

* if $C$ is the [[discrete category]] on smooth space and $D = U(1)$ is the discrete category on the smooth space $X$ underlying the Lie group $U(1)$, then smooth functors (i.e. functors [[internal category|internal to]] [[generalized smooth space|smooth spaces]]) $F : C \to D$ can be identified with smooth $U(1)$-valued functions on $X$, and the functor on these functor categories induced by a smooth functor $p : C \to C'$ does correspond to the familiar notion of _pullback_ of functions;

* and similar in higher degrees: if $C = P_1(X)$ is the smooth path groupoid of a smooth space and $D = \mathbf{B} U(1)$ the smooth [[group]] $U(1)$ regarded as a one-object [[Lie groupoid]], then smooth functors $C \to D$ correspond to smooth 1-forms $\in \Omega^1(X)$ on $X$, and precomposition with a smooth functor $p : P_1(X) \to P_1(X')$ corresponds to the familiar notion of _pullback_ of 1-forms.

This means that whether or not Kan extensions correspond geometrically to pushforward or to pullback depends on the way (covariant or contravariant) in which the domain categories $C$, $C'$ are identified with geometric entities.

## Related concepts

* **Kan extension**, [[(∞,1)-Kan extension]]

* [[base change]]

  * [[dependent sum]], [[dependent product]]

  * [[dependent sum type]], [[dependent product type]]

* [[internal (co-)limit]]

* [[codensity monad]]

* [[shape theory]]

## References

The original definition is due to [[Daniel M. Kan]],
found in the paper that also defined [[adjoint functors]] and [[limits]]:

* [[Daniel M. Kan]], _Adjoint functors_, Transactions of the American Mathematical Society 87:2 (1958), 294–294 ([doi:10.1090/s0002-9947-1958-0131451-0](https://doi.org/10.1090/s0002-9947-1958-0131451-0)).

Textbook sources include

* {#Borceux} [[Francis Borceux]], section 3.7 of _[[Handbook of Categorical Algebra]] I_

* Kashiwara and Shapira, section 2.3 in _[[Categories and Sheaves]]_

The book

* [[Saunders MacLane]], _[[Categories Work|Categories for the working mathematician]]_

has a famous treatment of Kan extensions with a statement: "The notion of Kan extensions subsumes all the other fundamental concepts in category theory".  Of course, many other fundamental concepts of category theory can also be regarded as subsuming all the others.

Lecture notes with an eye towards applications in [[homotopy theory]] include

* {#Riehl} [[Emily Riehl]], Chapter 1 in: *[[Categorical Homotopy Theory]]*, Cambridge University Press (2014) [[doi:10.1017/CBO9781107261457](https://doi.org/10.1017/CBO9781107261457), [pdf](http://www.math.jhu.edu/~eriehl/cathtpy.pdf)]

For Kan extensions in the context of [[enriched category theory]] see

* [[Eduardo Dubuc]], _Kan extensions in enriched category theory_,  Lecture Notes in Mathematics, Vol. 145 Springer-Verlag, Berlin-New York 1970 xvi+173 pp.

and chapter 4 of

* {#Kelly} [[Max Kelly]], _Basic Concepts of Enriched Category Theory_,
 Cambridge University Press, Lecture Notes in Mathematics 64, 1982,  Republished in: Reprints in Theory and Applications of Categories, No. 10 (2005) pp. 1-136 ([tac:tr10](http://www.tac.mta.ca/tac/reprints/articles/10/tr10abs.html), [pdf](http://www.tac.mta.ca/tac/reprints/articles/10/tr10.pdf))

The [[(∞,1)-category theory]] notion is discussed in section 4.3 of

* [[Jacob Lurie]], _[[Higher Topos Theory]]_

For uses of Kan extension in the study of [[algebra over a Lawvere theory|algebras over an algebraic theory]] see

* [[Paul-André Melliès]] and [[Nicholas Tabareau]], _Free models of T-algebraic theories computed as Kan extensions_ ([web](http://hal.archives-ouvertes.fr/hal-00339331/fr/))

Preservation of certain limits by left Kan extended functors is discussed in

* {#BorceuxDay} [[Francis Borceux]], and [[Brian Day]], _On product-preserving Kan extension_, Bulletin of the Australian Mathematical Society, Vol 17 (1977), 247-255 ([pdf](http://journals.cambridge.org/download.php?file=%2FBAZ%2FBAZ17_02%2FS0004972700010455a.pdf&code=e8c9ebb215a55a0891f4e05f6aebbcf2))

* {#KarazerisProtsonis} Panagis Karazeris, Grigoris Protsonis, _Left Kan extensions preserving finite products_, ([pdf](http://www.math.upatras.gr/~pkarazer/publications/topsift.pdf))

The general notion of extensions of [[1-morphisms]] in [[2-categories]] is discussed in

* John W. Gray, _Quasi-Kan extensions for 2-categories_, Bull. Amer. Math. Soc. 80:1 (1974) 142-147 [pdf](https://pdfs.semanticscholar.org/346b/9ae758d63f12e8e5c635c85cb30f6c568fd9.pdf)
* {#Lack09} [[Steve Lack]], _A 2-categories companion_, in [[John Baez]], [[Peter May]], _[[Towards Higher Categories]]_, Springer, (2009) ([arXiv:math/0702535](http://arxiv.org/abs/math/0702535))
* [[Ross Street]], _Pointwise extensions and sketches in bicategories_, [arXiv:1409.6427](https://arxiv.org/abs/1409.6427)
* {#Roald13} Seerp Roald Koudenburg, *Algebraic weighted colimits*, [arXiv](http://arxiv.org/abs/1304.4079)

For the notion of (2-dimensional) (pointwise) bi-Kan extensions of pseudofunctors, see

* [[Fernando Lucatelli Nunes]], *On biadjoint triangles*, TAC [31-9](http://tac.mta.ca/tac/volumes/31/9/31-09abs.html)

* [[Fernando Lucatelli Nunes]], *Pseudo-Kan extensions and descent theory*, TAC [33-15](http://www.tac.mta.ca/tac/volumes/33/15/33-15abs.html)

and its applications to the theory of (2-dimensional) [[flat functors]] can be seen in

* M.E. Descotte, E.J. Dubuc, M. Szyld, *On the notion of flat 2-functors*, [Adv. Math](https://www.sciencedirect.com/science/article/abs/pii/S0001870818301968), arXiv:[1610.09429](https://arxiv.org/abs/1610.09429)

For a treatment of left Kan extensions as 'partial colimits', see

* [[Paolo Perrone]], [[Walter Tholen]], *Kan extensions are [[partial evaluation|partial]] colimits*, Applied Categorical Structures, 2022. ([arXiv:2101.04531](https://arxiv.org/abs/2101.04531))

[[!redirects Kan extension]]
[[!redirects Kan extensions]]
[[!redirects kan extension]]
[[!redirects kan extensions]]
[[!redirects left Kan extension]]
[[!redirects left Kan extensions]]
[[!redirects left kan extension]]
[[!redirects left kan extensions]]
[[!redirects right Kan extension]]
[[!redirects right Kan extensions]]
[[!redirects right kan extension]]
[[!redirects right kan extensions]]
[[!redirects pointwise Kan extension]]
[[!redirects pointwise Kan extensions]]
[[!redirects absolute Kan extension]]
[[!redirects absolute Kan extensions]]


Kan fibrant replacement

+-- {: .rightHandSide}
+-- {: .toc .clickDown tabindex="0"}
###Context###
#### Homotopy theory
+--{: .hide}
[[!include homotopy - contents]]
=--
#### Model category theory
+--{: .hide}
[[!include model category theory - contents]]
=--
=--
=--

> This entry describes special methods for the construction of  fibrant [[resolutions]] in the [[classical model structure on simplicial sets]].

#Contents#
* table of contents
{:toc}

## Idea

In as far as we may think of [[simplicial set]]s having some suitable properties as a [[simplicial model for weak ∞-categories]] (for instance for [[quasi-category|quasi-categories]]) and of a simplicial set that has the property of being a [[Kan complex]] as an [[∞-groupoid]], _Kan fibrant replacement_ of simplicial sets is the operation of _$\infty$-groupoidification_ in that it sends an $\infty$-category to the $\infty$-groupoid obtained by freely inverting all its non-invertible [[k-morphism]]s.

Technically, the terminology comes from the fact that with respect to the standard [[model structure on simplicial sets]] the [[Kan complex]]es are precisely the fibrant objects.

There are several methods to actually construct the Kan fibrant replacement. One convenient one, called the $Ex$ functor -- described below -- constructs an $\infty$-groupoid from (the nerve of) an $\infty$-category $C$ by

- taking its 1-morphisms to be ([[cospan|co]])[[span]]s in $C$;

- taking its 2-morphisms to be cospan-of-cospan [[multispan]]s in $C$:

- taking its 3-morphisms to be cospan-of-cospan-of-cospan [[multispan]]s in $C$:

- etc.

## The $Ex$-functor
 {#ExFunctor}

For $\Delta^k$ the simplicial $k$-[[simplex]] let $sd \Delta^k$ be its **barycentric [[subdivision]]** : this is the simplicial set that is the [[nerve]] of the [[poset]] of non-degenerate sub-simplices in $\Delta^k$.

Notice that this simplicial set $sd \Delta^k$ encodes the shape of a $k$-fold [[cospan]] of [[cospan]]s.

For instance,
$$
  sd \Delta^1 = \{0 \to (0,1) \leftarrow 1\}
$$
is the ordinary [[cospan]].

These multi-cospan simplicial sets define a functor $Ex : SSet \to SSet$ by setting

$$
  (Ex X)_k = Hom_{SSet}(sd \Delta[k], X)
  \,.
$$

So this functor reads in a simplicial set $X$ and spits out the simplicial set whose 1-cells are [[cospan]]s in $X$.

This comes with a natural map

$$
  X \to Ex X
  \,.
$$

Iterating this construction indefinitely defines a simplicial set $Ex^\infty X$ to be the [[colimit]] over

$$
  X \to Ex X \to Ex Ex X \to \cdots
  \,.
$$

The 1--cells in $Ex^\infty X$ are [[zig-zag]]s in $X$.

Then

**Proposition**

* $Ex^\infty X$ is a [[Kan complex]];

* $X \to Ex^\infty X$ is a natural weak equivalence,
in fact, an [[acyclic cofibration]],
even more strongly, it is a strong anodyne extension,
i.e., a transfinite composition of cobase changes of horn inclusions
(without retracts involved).

* $Ex^\infty$ preserves all 5 classes of maps: [[weak equivalences]], (acyclic) [[cofibrations]], and (acyclic) [[fibrations]], as well as strong anodyne extensions and simplicial homotopy equivalences.

* $Ex^\infty$ preserves [[finite limits]] and [[filtered colimits]].

* $Ex^\infty(f)$ is a simplicial homotopy equivalence
if and only if $f$ is a simplicial weak equivalence.

## Applications

For now, see here:

* Why is Kan's Ex∞ functor useful? [MathOverflow question](https://mathoverflow.net/questions/324738/why-is-kans-ex-infty-functor-useful).

## References ##

An original reference is

* [[Dan Kan]], _On c.s.s. complexes_, Amer. J. Math. 79 (1957), 449-476.

A standard textbook reference is

* [[Paul Goerss]] [[Rick Jardine]], _[[Simplicial homotopy theory]]_, Progress in Mathematics
174, Birkhäuser, 1999.

A summary of the basics is in

* [[Bertrand Guillou]], _Kan's $Ex^\infty$-functor_ ([pdf](http://www.math.uiuc.edu/~bertg/KanEx.pdf))

Discussion in the context of [[simplicial presheaves]] is  section 3 of

* [[Rick Jardine]], _Simplicial presheaves_ ([pdf](http://www.math.uwo.ca/~jardine/papers/Fields-01.pdf))

See also

* Sean Moss, _Another approach to the Kan-Quillen model structure_ ([arXiv:1506.04887](http://arxiv.org/abs/1506.04887))

## Related concepts

* [[simplicial weak equivalence]]

## References

The original article:

(...)

The analog of $Ex$ for the ([[localization of an (infinity,1)-category|localization of]]) [[quasi-categories]] incarnated as [[marked simplicial sets]]:

* [[Daniel Carranza]], [[Chris Kapulkin]], [[Zachery Lindsey]], Def. 7.2 in:*Calculus of Fractions for Quasicategories* [[arXiv:2306.02218](https://arxiv.org/abs/2306.02218)]

[[!redirects Kan fibrant replacements]]
[[!redirects Ex^∞]]
[[!redirects Ex-infinity]]