Multiplicity of each eigenvalue in a minimal polynomial of a matrix

It is well known that for a $$n \times n$$ matrix $$A$$ , the charicteristic polynomial $$p(x)$$ satisfies

$$p(x)=\prod_{\lambda : eigenvector} (x-\lambda)^{a(\lambda)}$$

where $$a(\lambda )$$ is the algebraic multiplicity of $$\lambda$$

The minimal polynomial of $$A$$ , $$\mu _A (x)$$ can also be represented as a form of

$$\mu_A (x)=\prod (x-\lambda)^{b(\lambda)}$$

The question is: if the geometric multiplicity of $$\lambda$$ is $$g( \lambda )$$, is

$$b(\lambda ) \le a(\lambda )-g(\lambda )+1$$ ?

I think I saw this inequality somewhere, but I'm failing to find how to prove it, and I'm not even sure if it works. Please tell me whether it works, and a proof if it does.

Yes, this is true. Suppose that the Jordan normal form of $$A$$ has Jordan blocks with eigenvalue $$\lambda$$ of sizes $$k_1,\dots,k_m$$. Then $$a(\lambda)=\sum_{i=1}^mk_i,$$ $$g(\lambda)=m,$$ and $$b(\lambda)=\max(k_1,\dots,k_m).$$ Thus $$a(\lambda)-g(\lambda)=\sum_{i=1}^m(k_i-1)\geq b(\lambda)-1$$ since $$b(\lambda)$$ is one of the $$k_i$$. (This is assuming $$\lambda$$ actually is an eigenvalue at all; if not then $$a(\lambda)=g(\lambda)=b(\lambda)=0$$ and the inequality still holds.)