# Subalgebra

In mathematics, a subalgebra is a subset of an algebra, closed under all its operations, and carrying the induced operations.
"Algebra", when referring to a structure, often means a vector space or module equipped with an additional bilinear operation. Algebras in universal algebra are far more general: they are a common generalisation of all algebraic structures. "Subalgebra" can refer to either case.

## Subalgebras for algebras over a ring or field

A subalgebra of an algebra over a commutative ring or field is a vector subspace which is closed under the multiplication of vectors. The restriction of the algebra multiplication makes it an algebra over the same ring or field. This notion also applies to most specializations, where the multiplication must satisfy additional properties, e.g. to associative algebras or to Lie algebras. Only for unital algebras is there a stronger notion, of unital subalgebra, for which it is also required that the unit of the subalgebra be the unit of the bigger algebra.

### Example

The 2×2-matrices over the reals R form a four-dimensional unital algebra M(2,R) in the obvious way. The 2×2-matrices for which all entries are zero, except for the first one on the diagonal, form a subalgebra. It is also unital, but it is not a unital subalgebra.
The identity element of M(2,R) is the identity matrix I , so the unital subalgebras contain the line of diagonal matrices {x I : x in R}. For two-dimensional subalgebras, consider
    $E^{2}={\begin{pmatrix}a&c\\b&-a\end{pmatrix}}^{2}={\begin{pmatrix}a^{2}+bc&0\\0&bc+a^{2}\end{pmatrix}}=pI\ \ {\text{where}}\ \ p=a^{2}+bc.$
When p = 0, then E is nilpotent and the subalgebra { x I + y E : x, y in R } is a copy of the dual number plane. When p is negative, take q = 1/√−p, so that (q E)$^2$ = − I, and subalgebra { x I + y (qE) : x,y in R } is a copy of the complex plane. Finally, when p is positive, take q = 1/√p, so that (qE)$^2$ = I, and subalgebra { x I + y (qE) : x,y in R } is a copy of the plane of split-complex numbers. By the law of trichotomy, these are the only planar subalgebras of M(2,R).
L. E. Dickson noted in 1914, the "Equivalence of complex quaternion and complex matric algebras", meaning M(2,C), the 2x2 complex matrices. But he notes also, "the real quaternion and real matric sub-algebras are not [isomorphic]." The difference is evident as there are the three isomorphism classs of planar subalgebras of M(2,R), while real quaternions have only one isomorphism class of planar subalgebras as they are all isomorphic to C.

## Subalgebras in universal algebra

In universal algebra, a subalgebra of an algebra A is a subset S of A that also has the structure of an algebra of the same type when the algebraic operations are restricted to S. If the axioms of a kind of algebraic structure is described by equational laws, as is typically the case in universal algebra, then the only thing that needs to be checked is that S is closed under the operations.
Some authors consider algebras with partial functions. There are various ways of defining subalgebras for these. Another generalization of algebras is to allow relations. These more general algebras are usually called structures, and they are studied in model theory and in theoretical computer science. For structures with relations there are notions of weak and of induced substructures.

### Example

For example, the standard signature for groups in universal algebra is (•, $^{−1}$, 1). (Inversion and unit are needed to get the right notions of homomorphism and so that the group laws can be expressed as equations.) Therefore, a subgroup of a group G is a subset S of G such that:
* the identity e of G belongs to S (so that S is closed under the identity constant operation);
* whenever x belongs to S, so does x$^{−1}$ (so that S is closed under the inverse operation);
* whenever x and y belong to S, so does x • y (so that S is closed under the group's multiplication operation).