# General linear group of a free module¶

The set $$\mathrm{GL}(M)$$ of automorphisms (i.e. invertible endomorphims) of a free module of finite rank $$M$$ is a group under composition of automorphisms, named the general linear group of $$M$$. In other words, $$\mathrm{GL}(M)$$ is the group of units (i.e. invertible elements) of $$\mathrm{End}(M)$$, the endomorphism ring of $$M$$.

The group $$\mathrm{GL}(M)$$ is implemented via the class FreeModuleLinearGroup.

AUTHORS:

• Eric Gourgoulhon (2015): initial version

REFERENCES:

• Chap. 15 of R. Godement: Algebra, Hermann (Paris) / Houghton Mifflin (Boston) (1968)
class sage.tensor.modules.free_module_linear_group.FreeModuleLinearGroup(fmodule)

General linear group of a free module of finite rank over a commutative ring.

Given a free module of finite rank $$M$$ over a commutative ring $$R$$, the general linear group of $$M$$ is the group $$\mathrm{GL}(M)$$ of automorphisms (i.e. invertible endomorphims) of $$M$$. It is the group of units (i.e. invertible elements) of $$\mathrm{End}(M)$$, the endomorphism ring of $$M$$.

This is a Sage parent class, whose element class is FreeModuleAutomorphism.

INPUT:

EXAMPLES:

General linear group of a free $$\ZZ$$-module of rank 3:

sage: M = FiniteRankFreeModule(ZZ, 3, name='M')
sage: e = M.basis('e')
sage: from sage.tensor.modules.free_module_linear_group import FreeModuleLinearGroup
sage: GL = FreeModuleLinearGroup(M) ; GL
General linear group of the Rank-3 free module M over the Integer Ring


Instead of importing FreeModuleLinearGroup in the global name space, it is recommended to use the module’s method general_linear_group():

sage: GL = M.general_linear_group() ; GL
General linear group of the Rank-3 free module M over the Integer Ring
sage: latex(GL)
\mathrm{GL}\left( M \right)


As most parents, the general linear group has a unique instance:

sage: GL is M.general_linear_group()
True


$$\mathrm{GL}(M)$$ is in the category of groups:

sage: GL.category()
Category of groups
sage: GL in Groups()
True


GL is a parent object, whose elements are automorphisms of $$M$$, represented by instances of the class FreeModuleAutomorphism:

sage: GL.Element
<class 'sage.tensor.modules.free_module_automorphism.FreeModuleAutomorphism'>
sage: a = GL.an_element() ; a
Automorphism of the Rank-3 free module M over the Integer Ring
sage: a.matrix(e)
[ 1  0  0]
[ 0 -1  0]
[ 0  0  1]
sage: a in GL
True
sage: GL.is_parent_of(a)
True


As an endomorphism, a maps elements of $$M$$ to elements of $$M$$:

sage: v = M.an_element() ; v
Element of the Rank-3 free module M over the Integer Ring
sage: v.display()
e_0 + e_1 + e_2
sage: a(v)
Element of the Rank-3 free module M over the Integer Ring
sage: a(v).display()
e_0 - e_1 + e_2


An automorphism can also be viewed as a tensor of type (1,1) on $$M$$:

sage: a.tensor_type()
(1, 1)
sage: a.display(e)
e_0*e^0 - e_1*e^1 + e_2*e^2
sage: type(a)
<class 'sage.tensor.modules.free_module_automorphism.FreeModuleLinearGroup_with_category.element_class'>


As for any group, the identity element is obtained by the method one():

sage: id = GL.one() ; id
Identity map of the Rank-3 free module M over the Integer Ring
sage: id*a == a
True
sage: a*id == a
True
sage: a*a^(-1) == id
True
sage: a^(-1)*a == id
True


The identity element is of course the identity map of the module $$M$$:

sage: id(v) == v
True
sage: id.matrix(e)
[1 0 0]
[0 1 0]
[0 0 1]


The module’s changes of basis are stored as elements of the general linear group:

sage: f = M.basis('f', from_family=(-e[1], 4*e[0]+3*e[2], 7*e[0]+5*e[2]))
sage: f
Basis (f_0,f_1,f_2) on the Rank-3 free module M over the Integer Ring
sage: M.change_of_basis(e,f)
Automorphism of the Rank-3 free module M over the Integer Ring
sage: M.change_of_basis(e,f) in GL
True
sage: M.change_of_basis(e,f).parent()
General linear group of the Rank-3 free module M over the Integer Ring
sage: M.change_of_basis(e,f).matrix(e)
[ 0  4  7]
[-1  0  0]
[ 0  3  5]
sage: M.change_of_basis(e,f) == M.change_of_basis(f,e).inverse()
True


Since every automorphism is an endomorphism, there is a coercion $$\mathrm{GL}(M) \rightarrow \mathrm{End}(M)$$ (the endomorphism ring of module $$M$$):

sage: End(M).has_coerce_map_from(GL)
True


(see FreeModuleHomset for details), but not in the reverse direction, since only bijective endomorphisms are automorphisms:

sage: GL.has_coerce_map_from(End(M))
False


A bijective endomorphism can be converted to an element of $$\mathrm{GL}(M)$$:

sage: h = M.endomorphism([[1,0,0], [0,-1,2], [0,1,-3]]) ; h
Generic endomorphism of Rank-3 free module M over the Integer Ring
sage: h.parent() is End(M)
True
sage: ah = GL(h) ; ah
Automorphism of the Rank-3 free module M over the Integer Ring
sage: ah.parent() is GL
True


As maps $$M\rightarrow M$$, ah and h are identical:

sage: v  # recall
Element of the Rank-3 free module M over the Integer Ring
sage: ah(v) == h(v)
True
sage: ah.matrix(e) == h.matrix(e)
True


Of course, non-invertible endomorphisms cannot be converted to elements of $$\mathrm{GL}(M)$$:

sage: GL(M.endomorphism([[0,0,0], [0,-1,2], [0,1,-3]]))
Traceback (most recent call last):
...
TypeError: the Generic endomorphism of Rank-3 free module M over the
Integer Ring is not invertible


Similarly, there is a coercion $$\mathrm{GL}(M)\rightarrow T^{(1,1)}(M)$$ (module of type-(1,1) tensors):

sage: M.tensor_module(1,1).has_coerce_map_from(GL)
True


(see TensorFreeModule for details), but not in the reverse direction, since not every type-(1,1) tensor can be considered as an automorphism:

sage: GL.has_coerce_map_from(M.tensor_module(1,1))
False


Invertible type-(1,1) tensors can be converted to automorphisms:

sage: t = M.tensor((1,1), name='t')
sage: t[e,:] = [[-1,0,0], [0,1,2], [0,1,3]]
sage: at = GL(t) ; at
Automorphism t of the Rank-3 free module M over the Integer Ring
sage: at.matrix(e)
[-1  0  0]
[ 0  1  2]
[ 0  1  3]
sage: at.matrix(e) == t[e,:]
True


Non-invertible ones cannot:

sage: t0 = M.tensor((1,1), name='t_0')
sage: t0[e,0,0] = 1
sage: t0[e,:]  # the matrix is clearly not invertible
[1 0 0]
[0 0 0]
[0 0 0]
sage: GL(t0)
Traceback (most recent call last):
...
TypeError: the Type-(1,1) tensor t_0 on the Rank-3 free module M over
the Integer Ring is not invertible
sage: t0[e,1,1], t0[e,2,2] = 2, 3
sage: t0[e,:]  # the matrix is not invertible in Mat_3(ZZ)
[1 0 0]
[0 2 0]
[0 0 3]
sage: GL(t0)
Traceback (most recent call last):
...
TypeError: the Type-(1,1) tensor t_0 on the Rank-3 free module M over
the Integer Ring is not invertible

Element

alias of FreeModuleAutomorphism

base_module()

Return the free module of which self is the general linear group.

OUTPUT:

EXAMPLES:

sage: M = FiniteRankFreeModule(ZZ, 2, name='M')
sage: GL = M.general_linear_group()
sage: GL.base_module()
Rank-2 free module M over the Integer Ring
sage: GL.base_module() is M
True

one()

Return the group identity element of self.

The group identity element is nothing but the module identity map.

OUTPUT:

EXAMPLES:

Identity element of the general linear group of a rank-2 free module:

sage: M = FiniteRankFreeModule(ZZ, 2, name='M', start_index=1)
sage: GL = M.general_linear_group()
sage: GL.one()
Identity map of the Rank-2 free module M over the Integer Ring


The identity element is cached:

sage: GL.one() is GL.one()
True


Check that the element returned is indeed the neutral element for the group law:

sage: e = M.basis('e')
sage: a = GL([[3,4],[5,7]], basis=e) ; a
Automorphism of the Rank-2 free module M over the Integer Ring
sage: a.matrix(e)
[3 4]
[5 7]
sage: GL.one() * a == a
True
sage: a * GL.one() == a
True
sage: a * a^(-1) == GL.one()
True
sage: a^(-1) * a == GL.one()
True


The unit element of $$\mathrm{GL}(M)$$ is the identity map of $$M$$:

sage: GL.one()(e[1])
Element e_1 of the Rank-2 free module M over the Integer Ring
sage: GL.one()(e[2])
Element e_2 of the Rank-2 free module M over the Integer Ring


Its matrix is the identity matrix in any basis:

sage: GL.one().matrix(e)
[1 0]
[0 1]
sage: f = M.basis('f', from_family=(e[1]+2*e[2], e[1]+3*e[2]))
sage: GL.one().matrix(f)
[1 0]
[0 1]