Solution (source code)

= Solution

Put $\mu=\operatorname{cf}(\kappa)$ and choose cofinal <ordinals> $\alpha_i<\kappa$, $i<\mu$. With $a_i=|\alpha_i|$, the same union comparison and <infinite cardinal arithmetic> give $\sum_{i<\mu}a_i=\kappa$. Since $a_i<\kappa$, their <successor cardinals> satisfy $a_i^+\leq\kappa$. The <König theorem for cardinal numbers> therefore gives
$$
\boxed{\kappa=\sum_{i<\mu}a_i<\prod_{i<\mu}a_i^+\leq\kappa^\mu=\kappa^{\operatorname{cf}(\kappa)}.}
$$
This <König bound for the Gimel function> applies to regular and <singular cardinals> alike; choosing cofinal <ordinals> also covers successor <cardinal numbers>.