Edit : Corrected my question by striking the word "free".
Let $k$ be any field, and $B$ a semisimple $k$-algebra of finite dimension, which is not assumed commutative. We fix a $k$-basis $\beta_1,\ldots ,\beta_r$ on $B$. Given any free $B$-module $V$ of finite rank, we define a polynomial $\det_V\in k[x_1,\ldots ,x_r]$ by $$\operatorname{det} _V = \det(x_1\beta_1+\ldots+x_r\beta_r)$$ That is, $\det_V$ is the determinant of the $k[x_1,\ldots ,x_r]$-linear endomorphism $x_1\beta_1+\ldots+x_r\beta_r$ of the free module $V\otimes_kk[x_1,\ldots,x_r]$, where we see $\beta_i$ as multiplication by itself in $V$. We have the following statement:
Two
free$B$-modules $U$ and $V$ of finite dimension over $k$ are isomorphic if and only if $\det_U=\det_V$.
This statement is given in Genestier and Ngô's lecture on Shimura varieties, and I am trying to understand the given proof/find another reference for this.
I can see why the direct implication holds: if $U$ and $V$ are isomorphic as $B$-modules, multiplication by $\beta_i$ in one will correspond to multiplication by $\beta_i$ in the other.
For the converse, first the case $k=\bar{k}$ is treated. In this situation, $B$ is isomorphic to a product of matrix algebras over $k$, in which case the result supposedly follows from classification of modules over a matrix algebra. Would somebody know a reference for such classification ?
As for the general case, the given argument is that the group of automorphisms of a $B$-module is itself the group of unit of a semi-simple $k$-algebra (that is, the algebra of endomorphisms), thus it has trivial Galois cohomology. Therefore we can descend from $\bar k$ to $k$. Why ? How does Galois cohomology relate to the descent of an isomorphism $U\otimes_k \bar{k}\cong V\otimes_k \bar{k}$ of $B\otimes_k\bar k$-modules, to an isomorphism $U\cong V$ ?
The other direction seems much easier than what you describe: If $\det_U = \det_V$, then $\det_U \rvert_{x=a} = \det_V \rvert_{x=a}$ for every tuple $a=(a_1,...,a_r)$ in any $k$-algebra.
Now consider the coefficients $a_i\in k$ with $\sum a_i \beta_i = 1_B$ and use this observation for the tuple $(\lambda a_i)$ to conclude $\det(\lambda \cdot id_U) = \det(\lambda \cdot id_V)$ for all $\lambda\in k$. Therefore $\forall \lambda\in k: \lambda^{\dim_k(U)} = \lambda^{\dim_k(V)}$. Now if $k$ is infinite, then this immediately implies $\dim(U) = \dim(V)$. If $k$ is finite, then we can tensor both modules with the algebraic closure $\overline{k}$ or some other infinite field over $k$ to obtain the same inequality.
Now if you assume that $U$ and $V$ are free $B$-modules, then $\dim_k(U)=\dim_k(B) \cdot \dim_B(U)$ so that we conclude $\dim_B(U) = \dim_B(V)$ and therefore $U\cong V$.
But note that more is true: By specialising to $(\alpha_1-T a_1,\alpha_2-T a_2,\ldots,\alpha_r - T a_r)\in k[T]^r$ where $\alpha_i\in k$ are arbitrary (and $a_i$ are still the coefficients of $1_B$) , we find that the characteristic polynomials of $\alpha_1\beta_1+\ldots \alpha_r \beta_r$ acting on $U$ and $V$ are equal. By the Brauer-Nesbitt lemma this shows that $U$ and $V$ have the same composition factors (counted with multiplicity). Because $B$ is semisimple (and here is the only point where that's used), this implies $U\cong V$.
And in fact that's the best you can do for non-semisimple $B$: $\det_U=\det_V$ iff $U$ and $V$ have the same composition factors.