# Why does $\text{dim}\,K^n = n$ for finite $n$ imply $\text{Im}(A^i)=\text{Im}(A^{i+1})$ for some $i\leq n.$

I'm studying about linear algebra and came across with the following:

Let $A\in \mathcal{M}_{n\times n}(K)$ for some field $K$. If $\text{dim}\,K^n = n$ is finite then $\text{Im}(A^i)=\text{Im}(A^{i+1})$ for some $i\leq n.$

Why is this true? I get it that $\text{Im}(A^{i+1})\subseteq \text{Im}(A^{i})$, but why does the statement hold for some $i\leq n$? Where does the $i\leq n$ come from?

Please let me know if my question is unclear. Thank you for your help!

Hint: For each $i$, $\dim(\operatorname{Im}(A^i))$ is an integer between $0$ and $n$, and $\dim(\operatorname{Im}(A^{i+1})) \leq \dim(\operatorname{Im}(A^i))$.