[proofplan]
The old ground-model cofinal sequence of order type $\lambda$ still exists after forcing, so the forced cofinality of $\kappa$ is at most $\lambda$. Finite cofinalities are handled first: $\lambda=0$ means $\kappa=0$, while $\lambda=1$ means $\kappa$ has a largest element, and both facts are absolute for forcing. For the infinite case, assume a condition forces a cofinal map from a shorter ordinal into $\kappa$. The ccc lets us decide each value of the name on a countable maximal antichain, so all possible values of the alleged short sequence form a ground-model set of cardinality below $\lambda$ when $\lambda$ is uncountable; when $\lambda=\omega$, a shorter domain is finite and therefore cannot be cofinal in a limit ordinal. This gives the required contradiction in every case.
[/proofplan]
[step:Preserve the old cofinal map as an upper bound for the forced cofinality]
Let
\begin{align*}
g:\lambda \to \kappa
\end{align*}
be a ground-model cofinal map, whose existence follows from $\operatorname{cf}^V(\kappa)=\lambda$. Since forcing does not change ordinals or the values of ground-model functions on ground-model ordinals, every condition in $\mathbb P$ forces that $\check g:\check\lambda \to \check\kappa$ is cofinal. Hence
\begin{align*}
\Vdash_{\mathbb P} \operatorname{cf}(\check\kappa) \leq \check\lambda.
\end{align*}
[/step]
[step:Handle finite ground-model cofinalities by absoluteness of endpoints]
If $\lambda=0$, then $\operatorname{cf}^V(\kappa)=0$, so $\kappa=0$. [Forcing preserves ordinals](/theorems/6539), hence every condition forces $\check\kappa=0$ and therefore forces $\operatorname{cf}(\check\kappa)=0$.
If $\lambda=1$, then there is an ordinal $\gamma<\kappa$ such that $\kappa=\gamma+1$. Forcing preserves ordinal successor and order, so every condition forces that $\check\gamma$ is the largest element of the ordinal $\check\kappa$. Hence every condition forces that the constant map from $1$ to $\check\kappa$ with value $\check\gamma$ has cofinal range in $\check\kappa$, and no map with empty domain is cofinal in a nonzero successor ordinal. Thus every condition forces $\operatorname{cf}(\check\kappa)=1$.
[/step]
[step:Show that no shorter ground-model domain can be forced cofinal when $\lambda$ is infinite]
Assume for this step that $\lambda$ is infinite. Let $\theta \in \operatorname{Ord}^V$ satisfy $|\theta|^V < \lambda$. We prove that no condition forces the existence of a cofinal map from $\check\theta$ into $\check\kappa$.
Suppose, toward a contradiction, that $p \in \mathbb P$ and $\dot f$ is a $\mathbb P$-name such that
\begin{align*}
p \Vdash_{\mathbb P} \dot f:\check\theta \to \check\kappa \text{ has cofinal range}.
\end{align*}
For each $\xi < \theta$, define
\begin{align*}
D_\xi := \{q \in \mathbb P : q \leq p \text{ and there exists } \alpha < \kappa \text{ such that } q \Vdash_{\mathbb P} \dot f(\check\xi)=\check\alpha\}.
\end{align*}
The set $D_\xi$ is dense below $p$: if $r \leq p$, then since $p$ forces $\dot f(\check\xi) \in \check\kappa$, the forcing decision lemma for ordinal-valued names applies to the name $\dot f(\check\xi)$ below $r$. Thus there are an extension $s \leq r$ and an ordinal $\alpha < \kappa$ such that
\begin{align*}
s \Vdash_{\mathbb P} \dot f(\check\xi)=\check\alpha.
\end{align*}
The hypothesis needed for this lemma is exactly that $r$ lies below a condition forcing $\dot f(\check\xi)$ to be an element of the ground-model ordinal $\check\kappa$; hence every possible decided value is some ground-model ordinal below $\kappa$.
Choose a maximal antichain $A_\xi \subset D_\xi$ below $p$ by [Zorn's lemma](/theorems/1226) applied in the ground model $V$ to the partially ordered set of antichains contained in $D_\xi$ below $p$. Since $\mathbb P$ satisfies the countable chain condition, each $A_\xi$ is countable in $V$. For each $q \in A_\xi$, let $\alpha_{\xi,q}<\kappa$ be the unique ordinal such that
\begin{align*}
q \Vdash_{\mathbb P} \dot f(\check\xi)=\check\alpha_{\xi,q}.
\end{align*}
Define the ground-model set of all possible decided values
\begin{align*}
B := \{\alpha_{\xi,q} : \xi < \theta \text{ and } q \in A_\xi\}.
\end{align*}
If $\lambda$ is uncountable, then regularity of the cofinality cardinal $\lambda=\operatorname{cf}^V(\kappa)$ gives
\begin{align*}
|B|^V \leq |\theta|^V \cdot \omega < \lambda.
\end{align*}
Hence $B$ is bounded in $\kappa$, so there exists $\beta < \kappa$ such that
\begin{align*}
\alpha < \beta
\end{align*}
for every $\alpha \in B$.
If $\lambda=\omega$, then $|\theta|^V<\omega$, so $\theta$ is finite. Since $\operatorname{cf}^V(\kappa)=\omega$, the ordinal $\kappa$ is a limit ordinal. In this case a map from $\theta$ into $\kappa$ has finite range, and every finite subset of the limit ordinal $\kappa$ is bounded in $\kappa$. Thus no such map can be cofinal. This proves the step when $\lambda=\omega$.
Therefore, for the rest of this step and the next step, we are in the uncountable case and the bound $\beta<\kappa$ has been constructed.
[guided]
Fix an ordinal $\theta \in V$ with $|\theta|^V<\lambda$. We want to rule out the possibility that forcing adds a cofinal sequence in $\kappa$ indexed by $\theta$. Suppose instead that there are a condition $p \in \mathbb P$ and a name $\dot f$ with
\begin{align*}
p \Vdash_{\mathbb P} \dot f:\check\theta \to \check\kappa \text{ has cofinal range}.
\end{align*}
For each coordinate $\xi<\theta$, we collect conditions below $p$ that decide the value of $\dot f(\check\xi)$. Define
\begin{align*}
D_\xi := \{q \in \mathbb P : q \leq p \text{ and there exists } \alpha < \kappa \text{ such that } q \Vdash_{\mathbb P} \dot f(\check\xi)=\check\alpha\}.
\end{align*}
This set is dense below $p$. Indeed, if $r \leq p$, then $r$ is still below a condition forcing that $\dot f(\check\xi)$ is an ordinal below $\check\kappa$. We apply the forcing decision lemma for ordinal-valued names to the name $\dot f(\check\xi)$ below the condition $r$. The lemma requires that the name be forced below $r$ to take values in a ground-model ordinal; this holds because $r \leq p$ and $p$ forces $\dot f(\check\xi)\in\check\kappa$. Therefore some extension $s \leq r$ decides the value, and the decided value must be a ground-model ordinal $\alpha<\kappa$:
\begin{align*}
s \Vdash_{\mathbb P} \dot f(\check\xi)=\check\alpha.
\end{align*}
Hence $s \in D_\xi$.
Now choose a maximal antichain $A_\xi \subset D_\xi$ below $p$. This choice is justified in the ground model by Zorn's lemma applied to the partially ordered set of antichains contained in $D_\xi$ below $p$. The ccc hypothesis is used exactly here: every antichain in $\mathbb P$ is countable, so each $A_\xi$ is countable in the ground model. For each $q \in A_\xi$, the value decided by $q$ is unique, because a single condition cannot force two distinct ground-model ordinals to be equal. Let $\alpha_{\xi,q}<\kappa$ denote that unique value:
\begin{align*}
q \Vdash_{\mathbb P} \dot f(\check\xi)=\check\alpha_{\xi,q}.
\end{align*}
Define
\begin{align*}
B := \{\alpha_{\xi,q} : \xi < \theta \text{ and } q \in A_\xi\}.
\end{align*}
This set is in the ground model and contains every possible value that can be forced for $\dot f(\check\xi)$ by the chosen deciding antichains. Since we have one countable antichain for each $\xi<\theta$, the cardinality estimate is
\begin{align*}
|B|^V \leq |\theta|^V \cdot \omega.
\end{align*}
If $\lambda$ is uncountable, then the cofinality cardinal $\lambda=\operatorname{cf}^V(\kappa)$ is regular, and multiplication by $\omega$ cannot raise a cardinal below $\lambda$ up to $\lambda$. Therefore
\begin{align*}
|B|^V < \lambda.
\end{align*}
The definition of cofinality then says that no subset of $\kappa$ of cardinality below $\operatorname{cf}^V(\kappa)=\lambda$ can be cofinal in $\kappa$. Hence $B$ is bounded in $\kappa$: there exists $\beta<\kappa$ such that
\begin{align*}
\alpha < \beta
\end{align*}
for every $\alpha \in B$.
If $\lambda=\omega$, the preceding product estimate would be false for nonzero finite $\theta$, because $|\theta|^V\cdot\omega=\omega$. Instead we use the fact that $|\theta|^V<\omega$ makes $\theta$ finite. Since $\operatorname{cf}^V(\kappa)=\omega$, the ordinal $\kappa$ is a limit ordinal. A finite range cannot be cofinal in a limit ordinal: the maximum of finitely many ordinals below $\kappa$ is still below $\kappa$. Thus the alleged finite-domain cofinal map is impossible before the antichain bounding argument is needed.
The finite cofinalities have already been handled separately. If $\lambda=0$, then $\kappa=0$ and forcing preserves this ordinal equality. If $\lambda=1$, then $\kappa$ has a largest element in $V$, and forcing preserves the successor structure witnessing that largest element. Therefore the present infinite-case argument covers exactly the remaining possibilities: $\lambda=\omega$ and uncountable regular $\lambda$.
[/guided]
[/step]
[step:Contradict the forced cofinality by bounding every possible value in the uncountable case]
Assume we are in the uncountable case of the preceding step, so $\beta<\kappa$ is the ground-model bound for the set $B$ of all values decided by the antichains $A_\xi$.
We claim that
\begin{align*}
p \Vdash_{\mathbb P} \forall \xi \in \check\theta\, (\dot f(\xi)<\check\beta).
\end{align*}
Let $\xi<\theta$ and let $r \leq p$ be arbitrary. Since $A_\xi$ is maximal below $p$, there exists $q \in A_\xi$ compatible with $r$. Choose $s \leq r,q$. Because $q \Vdash_{\mathbb P} \dot f(\check\xi)=\check\alpha_{\xi,q}$ and $\alpha_{\xi,q}<\beta$, the stronger condition $s$ forces
\begin{align*}
s \Vdash_{\mathbb P} \dot f(\check\xi)<\check\beta.
\end{align*}
Thus below every $r \leq p$ there is an extension forcing $\dot f(\check\xi)<\check\beta$, and no extension can force $\dot f(\check\xi)\geq\check\beta$ because it would be compatible with some member of $A_\xi$ deciding a value below $\beta$. Therefore
\begin{align*}
p \Vdash_{\mathbb P} \dot f(\check\xi)<\check\beta.
\end{align*}
Since $\xi<\theta$ was arbitrary,
\begin{align*}
p \Vdash_{\mathbb P} \forall \xi \in \check\theta\, (\dot f(\xi)<\check\beta).
\end{align*}
But $\beta<\kappa$, so a function whose values are all below $\beta$ does not have cofinal range in $\kappa$. This contradicts
\begin{align*}
p \Vdash_{\mathbb P} \dot f:\check\theta \to \check\kappa \text{ has cofinal range}.
\end{align*}
Therefore no such $p,\dot f,\theta$ exist.
[/step]
[step:Conclude that the forced cofinality is exactly the ground-model cofinality]
The previous steps show that whenever $\theta \in \operatorname{Ord}^V$ has $|\theta|^V<\lambda$,
\begin{align*}
\Vdash_{\mathbb P} \text{there is no cofinal map } \check\theta \to \check\kappa.
\end{align*}
For finite $\lambda$, this conclusion is already contained in the endpoint analysis above. For infinite $\lambda$, the case $\lambda=\omega$ was handled by the finite-domain argument, and the uncountable case was handled by the antichain-bounding argument.
To see that this implies the forced lower bound, suppose toward a contradiction that some $p \in \mathbb P$ forces $\operatorname{cf}(\check\kappa)<\check\lambda$. By the maximum principle for forcing, applied to the forced existential assertion defining a cofinal map from some ordinal below $\check\lambda$ into $\check\kappa$, there are an extension $p_0\leq p$, a $\mathbb P$-name $\dot h$, and a $\mathbb P$-name $\dot f$ such that $p_0$ forces that $\dot h$ is an ordinal below $\check\lambda$ and that $\dot f:\dot h\to\check\kappa$ has cofinal range. Applying the forcing decision lemma for ordinal-valued names to $\dot h$ below $p_0$, strengthen once more to a condition, still denoted $p$, and choose a ground-model ordinal $\theta<\lambda$ with $p\Vdash_{\mathbb P}\dot h=\check\theta$. Then
\begin{align*}
p \Vdash_{\mathbb P} \dot f:\check\theta \to \check\kappa \text{ has cofinal range}.
\end{align*}
Since $\theta<\lambda$ and $\lambda$ is a cardinal in $V$, we have $|\theta|^V<\lambda$, contradicting the result just proved. Hence
\begin{align*}
\Vdash_{\mathbb P} \operatorname{cf}(\check\kappa) \geq \check\lambda.
\end{align*}
Together with the upper bound from the old cofinal map,
\begin{align*}
\Vdash_{\mathbb P} \operatorname{cf}(\check\kappa) \leq \check\lambda,
\end{align*}
we obtain
\begin{align*}
\Vdash_{\mathbb P} \operatorname{cf}(\check\kappa)=\check\lambda.
\end{align*}
If $\lambda$ is uncountable, then $\omega<\lambda$, so the special case $\theta=\omega$ says that no condition can force a countable sequence to be cofinal in $\kappa$. Hence ccc forcing does not add a new countable cofinal sequence to an ordinal whose ground-model cofinality is uncountable.
[/step]