If $\det A \neq 0, AB= (\det A)E_n$ then $A \in GL_n( \mathbb Q [X])$

Is the following statement always true?

Let $A \in \mathbb Q [X]^{n \times n}$. If $\det A \neq 0$ and there exists a $B\in \mathbb Q[X]^{n \times n}$ with $AB= (\det A)E_n$ then $A \in GL_n( \mathbb Q [X])$.

Note: $GL_n(\mathbb Q)$ is defined as the set of all invertible $n \times n$ matrices over $\mathbb Q [X]$.

$E_n$ is defined as the identity matrix with dimension $n \times n$.

I think that the statement is true, because a matrix is invertible if its determinant is invertible over the given field. And in that case every determinant unequal $0$ is invertible over $\mathbb Q$. So even without the side information with matrix $B$ it is true.

Looking at the condition $B\in \mathbb Q[X]^{n \times n}$ with $AB= (\det A)E_n$, $(\det A)E_n$ is also invertible so the statement still should be true.

Question: Is that guess correct?

Note: This question is related to that post.

It is false. Take $n=1$, $A=(X)$, and $B=(1)=E_1$. Then $\det A=X$ and $AB=(X)=(\det A)E_1$. But $A$ is not invertible in $GL_1(\mathbb{Q}[X])$ (because $X$ is not invertible in $\mathbb{Q}[X]$).
• Why is $X$ not invertible in $\mathbb Q[X]$? Is it because we have polynomials here? Jul 6, 2017 at 18:33
• What do you think the inverse of $X$ in $\mathbb{Q}[X]$ is? Jul 6, 2017 at 18:34
• $X\cdot X^{-1}=1 \cdot X^0$ Jul 6, 2017 at 18:38
• $X^{-1}\notin\mathbb{Q}[X]$ Jul 6, 2017 at 18:38
• because it is a polynomial? I mean $X^{-1}$ should be in $\mathbb Q$, or am I wrong? Jul 6, 2017 at 18:40