As the title says, I am wondering whether $\operatorname{cf}(2^{<\kappa})=\operatorname{cf}(\kappa)$ where $\kappa$ is an infinite cardinal. I believe I have a proof: Define $f:\kappa\to 2^{<\kappa}$ by $f(\alpha)=2^{\vert\alpha\vert}$. Then $f$ is a monotone increasing function and it is cofinal since $$2^{<\kappa}=\sup\{2^\theta:\theta<\kappa\text{ and }\theta\text{ is a cardinal}\}.$$ Since there is a monotone increasing cofinal function from $\kappa$ to $2^{<\kappa}$, we conclude $\operatorname{cf}(2^{<\kappa})=\operatorname{cf}(\kappa)$. Is this correct?
Edit: To clarify, monotone increasing means that if $\alpha\leq\beta$ then $f(\alpha)\leq f(\beta)$.
Here is the error in my proof: I implicitly assumed that $f$ maps $\kappa$ into $2^{<\kappa}$, but this may be false. Indeed, there may be a cardinal $\theta<\kappa$ such that $2^\theta=2^{<\kappa}\notin 2^{<\kappa}$. Thus, there may be no monotone increasing or strictly increasing function from $\kappa$ to $2^{<\kappa}$.