$A$ and $B$ are commutative noetherian local rings with maximal ideals $\mathfrak{m}$ and $\mathfrak{n}$ respectively.
If $f\colon A \to B$ is a local ring homomorphism, how do I prove the inequality $$\dim(B) \leq \dim(A) + \dim(B/f(\mathfrak{m})B),$$ where $\dim$ denotes the Krull dimension?
I know that dim equals the minimal number of generators of an $\mathfrak{m}$-primary ideal in the noetherian local case, but so far I cannot prove this statement.