Prove that $B$ is non singular and that $AB^{-1}A=A$ 
$$A_{n\times n}=\begin{bmatrix}a & b & b & b &. &.&.&&b\\b & a
&b&b&.&.&.&&b\\b & b &a&b&.&.&.&&b\\b & . &.&.&.&.&.&&b\\b & .
&.&.&.&.&.&&b\\b & b &b&b&.&.&.&&a\end{bmatrix}\text{ where } 
a+(n-1)b =0$$
Define $l^t=\begin{bmatrix}1&1&1&1&1&....1\end{bmatrix}$ Where $l$ is
  a $ n\times1$ vector, and:
$$B= A+ \frac{l\cdot l^t}{n}$$
Prove that $B$ is non singular and that $AB^{-1}A=A$

What i did:
$\text{A has a 0 eigenvalue , so A is a singular matrix}$
$\text{B  has an eigenvalue of 1 with eigenvector} $$\,\, v^{t}= \begin{bmatrix}1&1&1&1&1&....1\end{bmatrix}$
Any idea about how to proceed?
Thanks.

Let $\mathbf{1}_n$ denote the $n\times n$ matrix with all entries equal to one and $E_n$ denote the $n\times n$ identity matrix. Then
$$
A_n = b\mathbf 1_n + (a-b)E_n = b\mathbf 1_n -nbE_n
$$
and
$$
B_n = A_n + \frac{1}{n}\mathbf 1_n = \left(b+\frac{1}{n}\right)\mathbf 1_n - nbE_n.
$$
In general, for a matrix $X_n=\alpha \mathbf 1_n + \beta E_n$, that is
$$
X =
\begin{pmatrix}
\alpha+\beta & \alpha & \alpha & \cdots & \alpha \\
\alpha & \alpha+\beta & \alpha & \cdots & \alpha \\
\alpha & \alpha & \alpha+\beta & \cdots & \alpha \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
\alpha & \alpha & \alpha & \cdots & \alpha+\beta
\end{pmatrix},
$$
we can calculate the determinant by first subtracting the second row from the first to get
$$
\det X_n = \det
\begin{pmatrix}
\beta & -\beta & 0 & \cdots & 0 \\
\alpha & \alpha+\beta & \alpha & \cdots & \alpha \\
\alpha & \alpha & \alpha+\beta & \cdots & \alpha \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
\alpha & \alpha & \alpha & \cdots & \alpha+\beta
\end{pmatrix},
$$
and then Laplace expand with respect to the first row to obtain
$$
\det X_n =
\beta
\det X_{n-1} + \beta
\det
\begin{pmatrix}
\alpha & \alpha & \cdots & \alpha \\
\alpha & \alpha+\beta & \cdots & \alpha \\
\vdots & \vdots & \ddots & \vdots \\
\alpha & \alpha & \cdots & \alpha+\beta
\end{pmatrix}.
$$
For the second matrix, subtract the first row from all others to get
$$
\det X_n =
\beta
\det X_{n-1} + \beta
\det
\begin{pmatrix}
\alpha & \alpha & \cdots & \alpha \\
0 & \beta & \cdots & 0 \\
\vdots & \vdots & \ddots & \vdots \\
0 & 0 & \cdots & \beta
\end{pmatrix}
=
\beta \det X_{n-1} + \alpha \beta^{n-1}
$$
Since $\det X_1=\alpha+\beta$, this recursion yields $$\det X_n=n\alpha\beta^{n-1} +\beta^n=\beta^{n-1}(n\alpha+\beta).$$
Thus, $X_n$ is invertible if and only if $\beta\neq 0$ and $n\alpha+\beta\neq 0$. In this case, we may guess that (or consider the adjugate to see that) $X^{-1}$ is of the form $X^{-1} = \gamma \mathbf 1 + \delta E_n$ as well and work out that
$$
X^{-1} = -\frac{\alpha}{\beta(n\alpha+\beta)} \mathbf 1_n + \frac{1}{\beta} E_n.
$$
In the example at hand,
$$
\det B_n = (-nb)^{n-1}(n\left(b+\frac{1}{n}\right)-nb)= (-nb)^{n-1}
$$
which is non-zero if and only if $b$ is non-zero. And
$$
B_n^{-1} = \frac{nb+1}{n^2b} \mathbf 1_n - \frac{1}{nb} E_n.
$$
However, to check that $AB^{-1}A=A$ is satisfied it is enough to show $A^2=AB$, since all matrices of the given form commute.
