Relation between eigenvalues of $A^{\top}BB^{\top}A$ and $B^{\top}AA^{\top}B$

I have two real value matrices: $$A \in \mathbb{R}^{m \times n}$$ and $$B \in \mathbb{R}^{m \times p}$$. If I know which are the eigenvalues of $$A^{\top}BB^{\top}A$$, what can I say about the eigenvalues of $$B^{\top}AA^{\top}B$$?

I suspect that they coincide and that the extra eigenvalues are zeroes since this is what happens with the eigenvalues of $$A^{\top}A$$ and $$AA^{\top}$$.

Is this correct? I will do some tests with Octave now.

Update: the Octave results for a random $$10 \times 10$$ and a random $$10 \times 20$$ matrix seem to confirm my claim. Try it yourself:

m = 10, n = 10, p = 20;
A=rand(m, n);
B=rand(m, p);
eig(A'*B*B'*A)
eig(B'*A*A'*B)


Yes you are correct,

if you set $$C=A^TB$$ and $$C^{T}=B^TA$$.

Suppose that $$CC^{T}$$ is n x n matrix, and $$C^{T}C$$ is an m x m matrix, and the $$n \geq m$$.

If $$\lambda$$ is an eigenvalue for $$CC^{T}$$, where $$\lambda$$ is non-zero, then we have:

$$CC^{T}x=\lambda x$$, multiplying by $$C^{T}$$, we get : $$C^{T}C(C^{T}x)=\lambda(C^{T}x)$$.

Therefore, if $$\lambda$$ is a non-zero eigenvalue for $$CC^{T}$$, then $$C^{T}C$$ has the same eigenvalue too.

Observe, that this holds for any matrices A,B ie, they need not be transposes of each other.

Fact. The nonzero eigenvalues of $$X^\top X$$ and $$XX^\top$$ are the same.

We may apply this fact to your two matrices by taking $$X=A^\top B$$. Indeed, this gives \begin{align*} X^\top X &= (A^\top B)^\top(A^\top B)=B^\top AA^\top B & XX^\top &= (A^\top B)(A^\top B)^\top = A^\top BB^\top A \end{align*}

Take $$C = A^\top B$$. Then, $$C^\top = B^{\top}A$$. Therefore $$A^{\top}B B^{\top}A = C^\top C$$ and $$B^{\top}A A^{\top}B= C^\top C$$, so you have already answered the question.