# Getting the rank of a matrix in Manova setting

Suppose we have that:

$\mathbf{X}_{lj} = \mathbf{\mu} + \mathbf{\tau_l}+ \epsilon_{tj}$ for j= $1,...,n_l$ and $l = 1,2,..g$

Here $\epsilon_{lj}$ are independent $N_p(\mathbf{0},\mathbf{\Sigma})$.

Assuming that $B = \sum_{l=1}^g n_l(\mathbf{\bar{x}}_l - \mathbf{\bar{x}})(\mathbf{\bar{x}}_l - \mathbf{\bar{x}})'$ and $W = \sum_{l=1}^g \sum_{j=1}^{n_t}(\mathbf{\bar{x}}_{lj} - \mathbf{\bar{x}_l})(\mathbf{\bar{x}}_{lj} - \mathbf{\bar{x_l}})'$.

Now, using this, I've been able to show that the Wilk's lambda which is $\frac{|W|}{|B+W|} = \prod_{i=1}^s \frac{1}{1+\lambda_i}$ where $\lambda_i$ are the eigenvalues of $W^{-1}B$.

I showed the result by using $T = |B+W|$:

$\frac{1}{\Lambda} = \frac{|T|}{|W|} = |W^{-1}T| = |W^{-1}(W+B)| = |I + W^{-1}B|$ and the result follows.

However, I'm trying to show that $s = min(p, g-1)$ where s is the rank of B.

Any help with the rank?