$A,B\in \mathbb R^{n\times n}$ share $n$ common linearly-independent eigenvectors $\Rightarrow AB=BA$. I've been trying to prove the following statement:

Let $A,B\in \mathbb R^{n\times n}$ be square matrices such that they share $n$ common linearly-independent eigenvectors. Then $AB=BA$.

Everything I thought of seemed to be unhelpful, so I have no clue what to do next.
Thank you and have a nice day!.
 A: Note that though $A, B \in \Bbb R^{n \times n}$, the eigenvalues may be complex and thus the eigenvectors may be in $\Bbb C^n$.  Bearing this in mind, we proceed:
Let
$\vec e_1, \vec e_2, \ldots, \vec e_n \tag 1$
be the $n$ common, linearly independent eigenvectors of $A$ and $B$; then we have
$A\vec e_i = \alpha_i \vec e_i, \; 1 \le i \le n, \tag 2$
and
$B\vec e_i = \beta_i \vec e_i, \; 1 \le i \le n, \tag 3$
for some scalars $\alpha_i, \beta_i \in \Bbb C$, $1 \le i \le n$.  Thus
$AB \vec e_i = A(\beta_i \vec e_i) = \beta_i A \vec e_i = \beta_i \alpha_i \vec e_i = \alpha_i \beta_i \vec e_i = \alpha_i B\vec e_i = B \alpha_i \vec e_i = BA\vec e_i. \tag 4$
Since the $\vec e_i$ are $n$ in number and linearly independent, the form a basis of $\Bbb C^n$; thus for any
$\vec v \in \Bbb C^n \tag 5$
we may write
$\vec v = \displaystyle \sum_1^n v_i \vec e_i, \; v_i \in \Bbb C, \; 1 \le i \le n,; \tag 6$
thus
$AB \vec v = \displaystyle \sum_1^n v_i AB \vec e_i = \sum_1^n v_i BA \vec e_i = BA\vec v; \tag 7$
therefore we conclude
$AB = BA. \tag 8$
