I am studying some properties of the least squares estimator and I have the following statement, with $X$ a full rank matrix
If $e$ is independent of $\hat y = X \hat \beta$, then $S^2=e^Te/(n-p)$ will be independent of $\hat \beta$.
The teacher quickly said that $\hat y$ is one-to-one with $\hat \beta$ since $X$ is full rank, so if $e$ is independent of $\hat y = X \hat \beta$ then it is also independent from $\hat \beta$ then $S^2$ is independent of $\hat \beta$
I don't understand why is this true and I feel this reasoning is not very rigorous. Can someone make it clear ?