[proofplan]
We must verify four claims: the formula for $|f|$ is well-defined (independent of which simplex we use to represent a point), the values land in $|L|$, the map is continuous, and the assignment is functorial. Well-definedness reduces to the uniqueness of barycentric coordinates on the interior of a simplex plus agreement on shared faces. Well-valuedness follows because $\{f(a_i)\}$ spans a simplex of $L$ by the definition of a simplicial map. Continuity is proved first on each closed simplex (where $|f|$ is affine in the barycentric coordinates) and then globally via the gluing lemma, using the fact that $|K|$ carries the coherent topology with respect to its closed simplices. Functoriality is a one-line check directly from the formula.
[/proofplan]
[step:Recall the domain and codomain, and state the map precisely]
Let $K, L$ be simplicial complexes with vertex sets $V(K)$, $V(L)$, and let $f: V(K) \to V(L)$ be a simplicial map — that is, a function on vertices such that whenever $\{a_0, \ldots, a_n\} \in K$ (a simplex of $K$), the image $\{f(a_0), \ldots, f(a_n)\}$ spans a simplex of $L$ (possibly with repetitions, i.e., of dimension $\le n$).
Each point $x \in |K|$ of the geometric realisation lies in the closure of some simplex $\sigma = \langle a_0, \ldots, a_n \rangle \in K$ and is uniquely expressible on the interior of its carrier simplex as
\begin{align*}
x = \sum_{i=0}^n t_i a_i, \qquad t_i \geq 0, \qquad \sum_{i=0}^n t_i = 1,
\end{align*}
where $(t_0, \ldots, t_n)$ are the **barycentric coordinates** of $x$ with respect to $\sigma$ (guaranteed by affine independence of $\{a_0, \ldots, a_n\}$; see [Affine Independence via Linear Independence](/theorems/1912)). Define
\begin{align*}
|f|: |K| &\to |L| \\
\sum_{i=0}^n t_i a_i &\mapsto \sum_{i=0}^n t_i f(a_i).
\end{align*}
We verify in the following steps that $|f|$ is well-defined, continuous, and functorial.
[/step]
[step:Show that $|f|(x) \in |L|$ for every $x$]
Fix $x \in |K|$ lying in a closed simplex $\overline{\sigma}$ with $\sigma = \langle a_0, \ldots, a_n \rangle \in K$, and write $x = \sum_{i=0}^n t_i a_i$ with $t_i \geq 0$, $\sum t_i = 1$.
By the simplicial map hypothesis, $\{f(a_0), \ldots, f(a_n)\}$ spans a simplex $\tau \in L$. The spanning set may have repetitions (if $f$ identifies some vertices of $\sigma$), so $\tau$ has dimension $\leq n$; however, $\tau \in L$ is a genuine simplex of $L$, and by definition
\begin{align*}
\tau = \left\{ \sum_{j} s_j b_j : b_j \in \{f(a_0), \ldots, f(a_n)\}, s_j \geq 0, \sum_j s_j = 1 \right\} \subseteq |L|,
\end{align*}
where the $b_j$ range over the distinct vertices of $\tau$.
The image $|f|(x) = \sum_{i=0}^n t_i f(a_i)$ is a convex combination (weights non-negative, summing to $1$) of the vertices $f(a_0), \ldots, f(a_n)$, hence a convex combination of the distinct vertices of $\tau$ (collecting terms with repeated vertices). Therefore $|f|(x) \in \tau \subseteq |L|$.
[/step]
[step:Show well-definedness: the value of $|f|$ does not depend on the representing simplex]
A point $x \in |K|$ may lie in the closure of several simplices (namely, it lies in the closures of all simplices that contain its carrier as a face). We must show that applying the formula on two such closed simplices gives the same image.
Let $\sigma = \langle a_0, \ldots, a_n \rangle$ be the **carrier simplex** of $x$: the unique simplex in $K$ whose interior contains $x$ (existence and uniqueness are the content of [Unique Interior Simplex](/theorems/1914)). On the interior of $\sigma$, barycentric coordinates of $x$ with respect to $\{a_0, \ldots, a_n\}$ are unique (by affine independence of the vertices), so the formula $|f|(x) = \sum_{i=0}^n t_i f(a_i)$ is well-defined relative to the carrier.
For a simplex $\sigma' \in K$ containing $\sigma$ as a face, say $\sigma' = \langle a_0, \ldots, a_n, a_{n+1}, \ldots, a_N \rangle$, the barycentric expansion of $x$ with respect to $\sigma'$ has $t_i$ for $i \leq n$ and $0$ for $i > n$ (again by uniqueness of barycentric coordinates on the interior of $\sigma$, extended by zeros on the extra vertices). Applying the formula on $\sigma'$,
\begin{align*}
\sum_{i=0}^N t_i f(a_i) = \sum_{i=0}^n t_i f(a_i) + \sum_{i=n+1}^N 0 \cdot f(a_i) = \sum_{i=0}^n t_i f(a_i),
\end{align*}
which agrees with the value on $\sigma$. Hence the formula gives the same image regardless of which (valid) simplex we use to represent $x$.
[guided]
A point $x \in |K|$ lies in infinitely many closed simplices in general — for instance, a vertex $v$ of $K$ lies in $\overline{\tau}$ for every simplex $\tau$ having $v$ as one of its vertices. So writing "$x = \sum t_i a_i$ in a simplex $\langle a_0, \ldots, a_n \rangle$" is ambiguous without choosing which simplex.
The key fact that saves us is: each $x$ has a **carrier simplex** — a unique simplex whose *interior* (not closure) contains $x$. See [Unique Interior Simplex](/theorems/1914). On the interior, the coefficients $t_i$ are strictly positive, and they are uniquely determined by $x$ and the (affinely independent) vertices $a_0, \ldots, a_n$: the map $(t_0, \ldots, t_n) \mapsto \sum t_i a_i$ is injective on $\{\sum t_i = 1\}$ by affine independence (see [Affine Independence via Linear Independence](/theorems/1912)).
For any other simplex $\sigma'$ that contains $\sigma$ (the carrier) as a face, the barycentric representation of $x$ on $\sigma'$ is forced: the extra vertices must have coefficient $0$, because otherwise $x$ would be in the interior of a simplex of the same dimension as $\sigma'$, which contradicts $\sigma$ being the carrier. So the expansion on $\sigma'$ is just the expansion on $\sigma$ padded with zeros, and applying $|f|$ gives the same image.
For simplices $\sigma'$ that merely contain $x$ in their closure but do not contain $\sigma$ as a face — these cases do not arise: the closure $\overline{\sigma'}$ contains $x$ iff $\sigma \subseteq \partial \sigma'$ (including the case $\sigma = \sigma'$), by the definition of the carrier.
So the formula is unambiguous.
[/guided]
[/step]
[step:Show continuity of $|f|$ on each closed simplex]
Fix a closed simplex $\overline{\sigma} \subset |K|$, with $\sigma = \langle a_0, \ldots, a_n \rangle$. The barycentric coordinate functions
\begin{align*}
\beta_i: \overline{\sigma} &\to [0, 1] \\
x = \sum_{j=0}^n t_j a_j &\mapsto t_i
\end{align*}
are continuous on $\overline{\sigma}$, because they are the composition of the homeomorphism $\overline{\sigma} \cong \Delta^n$ (the standard $n$-simplex in $\mathbb{R}^{n+1}$ carrying the Euclidean topology) with the $i$-th coordinate projection, both of which are continuous.
The restriction $|f|\big|_{\overline{\sigma}}$ is the map
\begin{align*}
|f|\big|_{\overline{\sigma}}: \overline{\sigma} &\to |L| \\
x &\mapsto \sum_{i=0}^n \beta_i(x) \cdot f(a_i),
\end{align*}
a finite linear combination (with coefficients varying continuously) of fixed points $f(a_i) \in |L|$. The image lies inside the finite-dimensional affine subspace spanned by $f(a_0), \ldots, f(a_n)$ in the ambient Euclidean space in which $|L|$ is realised (or, more intrinsically, inside the closed simplex $\overline{\tau}$ with $\tau \in L$ spanned by $\{f(a_i)\}$). The map $(t_0, \ldots, t_n) \mapsto \sum t_i f(a_i)$ is affine and hence continuous, and composing with continuous $\beta_i$ preserves continuity. Therefore $|f|\big|_{\overline{\sigma}}$ is continuous.
[/step]
[step:Promote continuity on closed simplices to continuity on $|K|$]
Recall the topology on $|K|$: a set $U \subseteq |K|$ is open if and only if $U \cap \overline{\sigma}$ is open in $\overline{\sigma}$ for every simplex $\sigma \in K$ — this is the **coherent topology** (also called the weak topology) with respect to the family of closed simplices $\{\overline{\sigma} : \sigma \in K\}$. Equivalently, a map $g: |K| \to Z$ is continuous if and only if its restriction $g\big|_{\overline{\sigma}}$ is continuous for every simplex $\sigma \in K$.
This is the gluing lemma (pasting lemma) for coherent topologies: a function is continuous on the whole space iff it is continuous on each piece of a coherent cover.
By the previous step, $|f|\big|_{\overline{\sigma}}$ is continuous for every $\sigma \in K$. Therefore $|f|: |K| \to |L|$ is continuous.
[guided]
Why does it suffice to check continuity on each closed simplex? Because $|K|$ carries the **coherent topology** (also called the weak topology, or CW-type topology) with respect to the family of closed simplices. By definition, a set in $|K|$ is closed iff its intersection with each closed simplex is closed; this is equivalent to saying that a map out of $|K|$ is continuous iff its restriction to each closed simplex is continuous.
This is exactly the situation in which the [gluing lemma](/theorems/???) (pasting lemma) applies: if $|K|$ is a union of closed sets $\{\overline{\sigma}\}_\sigma$, and a function is continuous on each piece with compatible values on overlaps, then it is continuous on $|K|$. The compatibility on overlaps is exactly what Step 3 (well-definedness) verified. Continuity on each piece is Step 4.
Note: if $K$ is infinite, $|K|$ is in general not metrisable, and the coherent topology can differ from the subspace topology inherited from any Euclidean embedding. It is the coherent topology — in which gluing works — that is the standard topology on $|K|$.
[/guided]
[/step]
[step:Verify functoriality $|f \circ g| = |f| \circ |g|$]
Let $K, L, M$ be simplicial complexes and let $g: V(K) \to V(L)$ and $f: V(L) \to V(M)$ be simplicial maps. Then $f \circ g: V(K) \to V(M)$ is a simplicial map (if $\{a_0, \ldots, a_n\} \in K$, then $\{g(a_0), \ldots, g(a_n)\}$ spans a simplex of $L$, and hence $\{f(g(a_0)), \ldots, f(g(a_n))\}$ spans a simplex of $M$).
Fix $x = \sum_{i=0}^n t_i a_i \in |K|$ in its carrier simplex. Applying definitions:
\begin{align*}
|f \circ g|(x) = \sum_{i=0}^n t_i (f \circ g)(a_i) = \sum_{i=0}^n t_i f(g(a_i)).
\end{align*}
On the other hand,
\begin{align*}
(|f| \circ |g|)(x) = |f|\left(\sum_{i=0}^n t_i g(a_i)\right).
\end{align*}
To evaluate $|f|$ at $\sum_{i=0}^n t_i g(a_i)$ we use the defining formula: the point is a convex combination of the vertices $g(a_0), \ldots, g(a_n)$ (with possible repetitions), which span a simplex of $L$; applying $|f|$ sends each $g(a_i)$ to $f(g(a_i))$ and preserves the barycentric coefficients:
\begin{align*}
|f|\left(\sum_{i=0}^n t_i g(a_i)\right) = \sum_{i=0}^n t_i f(g(a_i)).
\end{align*}
(If some $g(a_i)$ are equal, the formula still gives the same value after collecting like terms on both sides — the operation "apply $f$ to each vertex, keep the coefficients" is well-defined on the level of formal linear combinations.)
The two expressions agree:
\begin{align*}
|f \circ g|(x) = \sum_{i=0}^n t_i f(g(a_i)) = (|f| \circ |g|)(x).
\end{align*}
Since this holds for every $x \in |K|$, $|f \circ g| = |f| \circ |g|$ as maps $|K| \to |M|$.
[/step]