Characterisation of partitions of an infinite cardinal Let $\kappa$ be an infinite cardinal, and let $m$ be a cardinal. I want to prove the following statement:
For every onto function $F:\kappa \rightarrow m$ there exists a subset $H \subseteq \kappa$ of size $\lambda$ such that $F$ is constant on $H$ $\iff$ $\kappa > \lambda$ or $\kappa = \lambda $ and $\operatorname{cf}\kappa > m$.
I am having some difficulty however. We may of course assume that $\kappa > m$ and $\kappa \ge \lambda$. So proving the $(\implies)$ direction, suppose that $\kappa \not> \lambda$, i.e. $\kappa = \lambda$. I want to show that $\operatorname{cf} \kappa > m$. However, I am making no progress with this. Similarly with the proof in the other direction.
Can anyone give me some ideas? Thanks very much.
 A: ($\Rightarrow$) I'll just demonstrate that $\kappa \rightarrow ( \kappa )^1_{\mathrm{cf} (\kappa)}$ fails.
Denoting $\mathrm{cf} ( \kappa)$ by $m$, let $\langle \alpha_i \rangle_{i < m}$ be a strictly increasing sequence cofinal in $\kappa$.  Define $f : \kappa \to m$ by setting $f(\alpha)$ to be the least $i$ such that $\alpha \leq \alpha_i$.  It is easy to see that any $f$-homogeneous set must be bounded, and, since $\kappa$ is a cardinal, bounded subsets have cardinality strictly less than $\kappa$.
($\Leftarrow$) Assume first that $\kappa > \lambda$ (and $\kappa > m$), then given $f : \kappa \to m$, consider $\{ f^{-1} \{i\} : i < m \}$.  If none of these sets has size at least $\lambda$, then $$\kappa = | \kappa | = \left| \bigcup_{i < m} f^{-1} \{ i \} \right| \leq \sum_{i < m} \left| f^{-1} \{ i \} \right| \leq m \cdot \lambda < \kappa,$$
a contradiction!
If $\kappa = \lambda$ and $\mathrm{cf} (\kappa) > m$, given $f : \kappa \to m$, consider $\{ f^{-1} \{i\} : i < m \}$.  If none of these sets has size $\kappa$, I claim that there is a $\mu < \kappa$ such that $\left| f^{-1} \{ i \} \right| \leq \mu$ for all $i < m$.

  
*
  
*If $\kappa$ is a successor cardinal, then $\kappa = \mu^+$ for some $\mu$, and it easily follows from the above that $\left| f^{-1} \{ i \} \right| \leq \mu$ for all $i < m$.
  
*If $\kappa$ is a limit cardinal, then the family of all cardinals $\mu < \kappa$ is cofinal in $\kappa$.  As $\left\{ \left| f^{-1} \{ i \} \right| : i < m \right\}$ is a family of $\,\leq m < \mathrm{cf} (\kappa)$ cardinals less than $\kappa$, it follows that it cannot be cofinal in $\kappa$, and so there must be a $\mu < \kappa$ with $\left| f^{-1} \{ i \} \right| \leq \mu$ for all $i < m$.
  

Taking such a $\mu$, it follows that $$\kappa = | \kappa | = \left| \bigcup_{i < m} f^{-1} \{ i \} \right| \leq \sum_{i < m} \left| f^{-1} \{ i \} \right| \leq m \cdot \mu < \kappa,$$
a contradiction!
