Definition of $\text{GL}(n,R)$

How do one usually define the general linear group over a ring $R$, denoted by $\text{GL}(n,R)$. I was told in a paper that $\text{GL}(n,R)$ is a group, and I presumed that $$\text{GL}(n,R)=\{A\in M_{n\times n}(R)|\text{det}(A)~\mbox{is a unit in}~R\}.$$However, I tried google it and found $$\text{GL}(n,R)=\{A\in M_{n\times n}(R)|\text{det}(A)\neq0\}.$$See for example, http://gmcninch.math.tufts.edu/Math215-Fall-2012/storage/HW4.pdf. As $R$ is not necessarily a unital ring, so it would happen that $\text{GL}(n,R)$ is not a group. Could any expert tell me which understanding is correct? And also, could you recommend any textbook which provides detailed discussion about this kind of group? I need to learn this more, thank you very much!

-
We want inverses, so the first definition is definitely the right one. – Zhen Lin Feb 6 '13 at 12:05
If so, how do explain the definition in the website? Why he still calls it a group? – Easy Feb 6 '13 at 12:12
The homework sheet you link to after "See for example" does not appear to contain any definition of the general linear group over an arbitrary ring. It defines $GL_2(\mathbb Z/n\mathbb Z)$, but its definition is the non-unit determinant one. – Henning Makholm Feb 6 '13 at 12:18
Whatever, could you recommend any textbook which introduces the general linear groups over a unital commutative ring? I am struggling to find a proper reference. Thanks – Easy Feb 6 '13 at 12:20
sorry, I think I should drop the "unital" condition.. – Easy Feb 6 '13 at 12:22

If $R$ is a commutative ring with identity, then for an integer $n\geq 1$, $\mathrm{GL}_n(R)$ is the set of $n\times n$ matrices in $g\in\mathrm{M}_n(R)$ (coefficients in $R$) such that $\mathrm{det}(g)\in R^\times$. This is precisely the group of invertible elements of the ring $\mathrm{M}_n(R)$ of matrices.
If $R$ is a field, then $R^\times=R\setminus\{0\}$, so in this case, the condition $\det(g)\in R^\times$ is equivalent to $\det(g)\neq 0$, but this is not true for (non-zero) commutative rings which aren't fields.
why $det(g)\in R^\times$ implies $g$ invertible? For example, suppose $R=\mathbb{Z}_4$ and $det(g)=2$, then $det(g^{-1})=2^{-1}$, which doesn't exist. – Easy Feb 6 '13 at 12:11
@user60079: Here $R^\times$ is the group of units in the ring, so $2\notin R^\times$ in your example. If the determinant of a matrix is a unit, then Cramer's rule produces an inverse for it. – Henning Makholm Feb 6 '13 at 12:13