[proofplan]
The closure hypothesis is used first to show that forcing with $P$ adds no new sequences of ground-model ordinals of length $<\kappa$. This immediately prevents collapses of cardinals $\leq \kappa$ and prevents new cofinal sequences of length $<\kappa$. The remaining point is $\kappa^+$: the $\kappa^+$-chain condition bounds the number of possible values of each coordinate of a name, and since there are only $\kappa$ coordinates, no name for a map from a cardinal $\leq \kappa$ can be forced to have range all of $\kappa^+$.
[/proofplan]
[step:Use $<\kappa$-closure to prevent new short ordinal sequences]
We use the convention that $q \leq p$ means that $q$ is stronger than $p$. Let $\lambda < \kappa$ be an ordinal, let $\dot f$ be a $P$-name, and suppose $p_0 \in P$ forces that $\dot f: \lambda \to \operatorname{Ord}$ is a function.
We prove that there is a condition $q \leq p_0$ and a ground-model function $g: \lambda \to \operatorname{Ord}$ such that $q \Vdash \dot f = \check g$. For each $\alpha < \lambda$, construct by recursion a condition $p_{\alpha+1} \leq p_\alpha$ and an ordinal $\beta_\alpha$ such that
\begin{align*}
p_{\alpha+1} \Vdash \dot f(\check \alpha) = \check \beta_\alpha.
\end{align*}
At limit stages $\delta < \lambda$, the sequence $(p_\alpha)_{\alpha < \delta}$ has length $<\kappa$, so $<\kappa$-closure gives a lower bound $p_\delta \in P$ with $p_\delta \leq p_\alpha$ for every $\alpha < \delta$. Since $\lambda < \kappa$, regularity of $\kappa$ ensures that all limit stages appearing in the recursion have length $<\kappa$.
After the recursion, apply $<\kappa$-closure once more to the descending sequence $(p_\alpha)_{\alpha < \lambda}$ and choose $q \in P$ such that $q \leq p_\alpha$ for every $\alpha < \lambda$. Define the ground-model function $g: \lambda \to \operatorname{Ord}$ by
\begin{align*}
g(\alpha) = \beta_\alpha \quad \text{for every } \alpha < \lambda.
\end{align*}
Because $q \leq p_{\alpha+1}$ for every $\alpha < \lambda$, the condition $q$ forces $\dot f(\check \alpha) = \check \beta_\alpha$ for every $\alpha < \lambda$. Hence $q \Vdash \dot f = \check g$.
[guided]
The purpose of this step is to prove the exact distributivity consequence of closure that we will need later: no new functions from a length $<\kappa$ ordinal into the ordinals appear after forcing.
Fix an ordinal $\lambda < \kappa$, a condition $p_0 \in P$, and a $P$-name $\dot f$ such that
\begin{align*}
p_0 \Vdash \dot f: \check \lambda \to \operatorname{Ord}.
\end{align*}
We build a descending sequence of conditions that decides the values of $\dot f$ one coordinate at a time. Suppose that $p_\alpha$ has already been constructed. Since $p_\alpha$ forces that $\dot f(\check \alpha)$ is an ordinal, there is a stronger condition $p_{\alpha+1} \leq p_\alpha$ and an ordinal $\beta_\alpha$ such that
\begin{align*}
p_{\alpha+1} \Vdash \dot f(\check \alpha) = \check \beta_\alpha.
\end{align*}
At a limit stage $\delta < \lambda$, the conditions already constructed form a descending sequence $(p_\alpha)_{\alpha < \delta}$ of length $\delta$. Since $\delta < \lambda < \kappa$, the $<\kappa$-closure of $P$ gives a lower bound $p_\delta \in P$ satisfying $p_\delta \leq p_\alpha$ for all $\alpha < \delta$. This is exactly where closure is used.
Once the recursion has run through all $\alpha < \lambda$, the sequence $(p_\alpha)_{\alpha < \lambda}$ still has length $<\kappa$. Applying $<\kappa$-closure again, choose a single condition $q \in P$ such that $q \leq p_\alpha$ for every $\alpha < \lambda$. Now define the function $g: \lambda \to \operatorname{Ord}$ by
\begin{align*}
g(\alpha) = \beta_\alpha \quad \text{for every } \alpha < \lambda.
\end{align*}
This function belongs to the ground model because the whole recursion was carried out in the ground model and each $\beta_\alpha$ is a ground-model ordinal. Since $q$ is stronger than every $p_{\alpha+1}$, it preserves every decision made during the recursion:
\begin{align*}
q \Vdash \dot f(\check \alpha) = \check g(\check \alpha)
\end{align*}
for every $\alpha < \lambda$. Therefore
\begin{align*}
q \Vdash \dot f = \check g.
\end{align*}
Thus every name for an ordinal-valued sequence of length $<\kappa$ is decided by a stronger condition to be a ground-model sequence.
[/guided]
[/step]
[step:Preserve all cardinals at most $\kappa$]
Let $\mu \leq \kappa$ be a ground-model cardinal. Suppose toward a contradiction that some condition $p \in P$ forces that $\mu$ is not a cardinal. Then there is a ground-model cardinal $\lambda < \mu$ and a $P$-name $\dot f$ such that
\begin{align*}
p \Vdash \dot f: \check \lambda \to \check \mu \text{ is surjective}.
\end{align*}
Since $\lambda < \mu \leq \kappa$, we have $\lambda < \kappa$. By the previous step, there are $q \leq p$ and a ground-model function $g: \lambda \to \mu$ such that
\begin{align*}
q \Vdash \dot f = \check g.
\end{align*}
Then $q$ forces that $\check g: \check \lambda \to \check \mu$ is surjective. This is impossible, because in the ground model $\lambda < \mu$ and $\mu$ is a cardinal, so no function from $\lambda$ onto $\mu$ exists. Therefore no cardinal $\mu \leq \kappa$ is collapsed.
[/step]
[step:Preserve cofinalities below $\kappa$]
Let $\theta < \kappa$ be a regular cardinal, and let $\gamma$ be an ordinal with ground-model cofinality $\operatorname{cf}^V(\gamma) = \theta$. First we rule out a decrease. Suppose toward a contradiction that some condition $p \in P$ forces that the cofinality of $\gamma$ is a cardinal $\lambda < \theta$. Then there is a $P$-name $\dot c$ such that
\begin{align*}
p \Vdash \dot c: \check \lambda \to \check \gamma \text{ has cofinal range in } \check \gamma.
\end{align*}
Because $\lambda < \theta < \kappa$, the first step gives a condition $q \leq p$ and a ground-model function $c: \lambda \to \gamma$ such that
\begin{align*}
q \Vdash \dot c = \check c.
\end{align*}
Thus $q$ forces that the ground-model set $c[\lambda]$ is cofinal in $\gamma$. But in the ground model, $|c[\lambda]| \leq \lambda < \theta = \operatorname{cf}^V(\gamma)$, so $c[\lambda]$ is bounded in $\gamma$. This contradiction shows that the cofinality of $\gamma$ cannot decrease below $\theta$.
Now choose in the ground model a cofinal function $d: \theta \to \gamma$. Since forcing does not remove ground-model functions, every extension still contains $d$, and $d[\theta]$ remains cofinal in $\gamma$ because ordinal order is absolute. By the preceding cardinal-preservation step, $\theta$ remains a cardinal. Hence every extension satisfies $\operatorname{cf}(\gamma) \leq \theta$. Combining this upper bound with the no-decrease argument gives $\operatorname{cf}(\gamma) = \theta$, so cofinalities below $\kappa$ are preserved.
[guided]
We must prove two inequalities for the cofinality of $\gamma$ in the forcing extension. The closure argument prevents the cofinality from becoming smaller than $\theta$, while the old cofinal sequence from the ground model prevents it from becoming larger than $\theta$.
First suppose that a condition $p \in P$ forces that $\gamma$ has a cofinal sequence of length $\lambda$ for some cardinal $\lambda < \theta$. Then there is a $P$-name $\dot c$ such that
\begin{align*}
p \Vdash \dot c: \check \lambda \to \check \gamma \text{ has cofinal range in } \check \gamma.
\end{align*}
The hypothesis needed for the first step is that the domain length is below $\kappa$. This holds because $\lambda < \theta < \kappa$. Therefore there are a condition $q \leq p$ and a ground-model function $c: \lambda \to \gamma$ such that
\begin{align*}
q \Vdash \dot c = \check c.
\end{align*}
So $q$ forces the ground-model set $c[\lambda]$ to be cofinal in $\gamma$. But in the ground model this set has cardinality at most $\lambda$, and $\lambda < \theta = \operatorname{cf}^V(\gamma)$. By the definition of cofinality, no subset of $\gamma$ of cardinality smaller than $\theta$ can be cofinal in $\gamma$. Thus $c[\lambda]$ is bounded in $\gamma$ in the ground model, contradicting what $q$ forces. Hence the cofinality cannot decrease below $\theta$.
It remains to rule out an increase. Since $\operatorname{cf}^V(\gamma) = \theta$, choose in the ground model a cofinal function $d: \theta \to \gamma$. Forcing extensions preserve the old ordinals, the old order relation on ordinals, and the old function $d$. Therefore $d[\theta]$ is still cofinal in $\gamma$ in every forcing extension. The previous step proved that every cardinal at most $\kappa$ is preserved, and $\theta < \kappa$, so $\theta$ is still a cardinal in the extension. Consequently the extension has a cofinal subset of $\gamma$ of cardinality $\theta$, so it satisfies $\operatorname{cf}(\gamma) \leq \theta$.
The no-decrease argument gives $\operatorname{cf}(\gamma) \geq \theta$, and the old cofinal sequence gives $\operatorname{cf}(\gamma) \leq \theta$. Therefore $\operatorname{cf}(\gamma) = \theta$ in the extension.
[/guided]
[/step]
[step:Use the $\kappa^+$-chain condition to bound possible values of names]
Let $\mu \leq \kappa$, let $\dot f$ be a $P$-name, and suppose $p \in P$ forces that $\dot f: \check \mu \to \check{\kappa^+}$ is a function. We show that some ground-model set $A \subset \kappa^+$ of cardinality at most $\kappa$ contains all possible values of $\dot f$ below $p$.
For each $\xi < \mu$, take a maximal antichain $A_\xi$ below $p$ in the separative Boolean completion such that every element of $A_\xi$ decides the value of $\dot f(\check \xi)$. The separative Boolean completion also has the $\kappa^+$-chain condition: if it had an antichain of size $\kappa^+$, then density of the embedded copy of $P$ would refine each nonzero Boolean element to a condition in $P$, producing an antichain of size $\kappa^+$ in $P$. Hence each $A_\xi$ has cardinality at most $\kappa$.
For each $\xi < \mu$ and each $a \in A_\xi$, choose the unique ordinal $\beta_{\xi,a} < \kappa^+$ such that
\begin{align*}
a \Vdash \dot f(\check \xi) = \check \beta_{\xi,a}.
\end{align*}
Define
\begin{align*}
B_\xi = \{\beta_{\xi,a} : a \in A_\xi\}
\end{align*}
and
\begin{align*}
B = \bigcup_{\xi < \mu} B_\xi.
\end{align*}
Each $B_\xi$ has cardinality at most $\kappa$, and $\mu \leq \kappa$, so $|B| \leq \kappa \cdot \kappa = \kappa$. By construction,
\begin{align*}
p \Vdash \operatorname{ran}(\dot f) \subset \check B.
\end{align*}
[guided]
This is the only place where the chain condition is used. The issue is that a function with domain $\kappa$ is too long for the closure argument above, so we cannot decide all coordinates by building a descending sequence of length $\kappa$. Instead, we decide each coordinate by a maximal antichain and count how many values can appear.
Fix $\mu \leq \kappa$, a name $\dot f$, and a condition $p \in P$ such that
\begin{align*}
p \Vdash \dot f: \check \mu \to \check{\kappa^+}.
\end{align*}
For each coordinate $\xi < \mu$, work in the separative Boolean completion of $P$. Choose a maximal antichain $A_\xi$ below $p$ such that every condition $a \in A_\xi$ decides the value of $\dot f(\check \xi)$. This use of the Boolean completion is harmless because $P$ is densely embedded in it, and forcing statements about names are preserved by passing to the completion.
We also need the chain condition in the completion. If the completion had an antichain of size $\kappa^+$, density would let us choose below each nonzero Boolean element a condition from the embedded copy of $P$. Distinct refinements remain incompatible, so this would give an antichain of size $\kappa^+$ in $P$, contradicting the $\kappa^+$-chain condition of $P$. Thus the completion has the $\kappa^+$-chain condition.
The $\kappa^+$-chain condition says that every antichain has size strictly less than $\kappa^+$. Since $\kappa^+$ is the successor cardinal of $\kappa$, this means
\begin{align*}
|A_\xi| \leq \kappa
\end{align*}
for every $\xi < \mu$.
Now record the values decided by the antichain. For each $a \in A_\xi$, there is a unique ordinal $\beta_{\xi,a} < \kappa^+$ such that
\begin{align*}
a \Vdash \dot f(\check \xi) = \check \beta_{\xi,a}.
\end{align*}
Define the set of possible values at coordinate $\xi$ by
\begin{align*}
B_\xi = \{\beta_{\xi,a} : a \in A_\xi\}.
\end{align*}
Then $|B_\xi| \leq |A_\xi| \leq \kappa$. Finally define the total set of possible values by
\begin{align*}
B = \bigcup_{\xi < \mu} B_\xi.
\end{align*}
There are at most $\kappa$ many coordinates $\xi < \mu$, and each coordinate contributes at most $\kappa$ many possible values. Hence
\begin{align*}
|B| \leq \kappa \cdot \kappa = \kappa.
\end{align*}
We verify that $p$ forces the range of $\dot f$ to be contained in $B$. Fix $\xi < \mu$. Since $A_\xi$ is maximal below $p$, every extension of $p$ is compatible with some member of $A_\xi$. Each member of $A_\xi$ forces $\dot f(\check \xi)$ to equal an element of $B_\xi \subset B$. Therefore no extension of $p$ can force $\dot f(\check \xi) \notin \check B$. It follows that
\begin{align*}
p \Vdash \dot f(\check \xi) \in \check B
\end{align*}
for every $\xi < \mu$, and therefore
\begin{align*}
p \Vdash \operatorname{ran}(\dot f) \subset \check B.
\end{align*}
[/guided]
[/step]
[step:Preserve $\kappa^+$]
Suppose toward a contradiction that some condition $p \in P$ forces that $\kappa^+$ is collapsed. Strengthening $p$ if necessary, choose an ordinal $\alpha < \kappa^+$ and a $P$-name $\dot h$ such that
\begin{align*}
p \Vdash \dot h: \check \alpha \to \check{\kappa^+} \text{ is surjective}.
\end{align*}
Let $\mu = |\alpha|^V$ be the ground-model cardinality of $\alpha$. Since $\alpha < \kappa^+$, we have $\mu \leq \kappa$. Choose in the ground model a surjection $e: \mu \to \alpha$. Define the $P$-name $\dot f$ for the composition $\dot h \circ \check e$, so that
\begin{align*}
p \Vdash \dot f: \check \mu \to \check{\kappa^+} \text{ is surjective}.
\end{align*}
Apply the preceding step to this $\dot f$. There is a ground-model set $B \subset \kappa^+$ with $|B| \leq \kappa$ such that
\begin{align*}
p \Vdash \operatorname{ran}(\dot f) \subset \check B.
\end{align*}
Because $B$ has cardinality at most $\kappa$ in the ground model, $B \neq \kappa^+$. Choose $\eta \in \kappa^+ \setminus B$. Then $p$ forces both that $\dot f$ is surjective onto $\kappa^+$ and that $\eta$ is not in the range of $\dot f$, a contradiction. Therefore $\kappa^+$ remains a cardinal after forcing with $P$.
Combining the preservation of cardinals $\leq \kappa$, the preservation of cofinalities below $\kappa$, and the preservation of $\kappa^+$ proves the theorem.
[/step]