# Algebra over a field

In mathematics, an algebra over a field (often simply called an algebra) is a vector space equipped with a bilinear product. Thus, an algebra is an algebraic structure consisting of a set together with operations of multiplication and addition and scalar multiplication by elements of a field and satisfying the axioms implied by "vector space" and "bilinear".
The multiplication operation in an algebra may or may not be associative, leading to the notions of associative algebras where associativity of multiplication is assumed, and non-associative algebras, where associativity is not assumed (but not excluded, either). Given an integer n, the ring of real square matrices of order n is an example of an associative algebra over the field of real numbers under matrix addition and matrix multiplication since matrix multiplication is associative. Three-dimensional Euclidean space with multiplication given by the vector cross product is an example of a nonassociative algebra over the field of real numbers since the vector cross product is nonassociative, satisfying the Jacobi identity instead.
An algebra is unital or unitary if it has an identity element with respect to the multiplication. The ring of real square matrices of order n forms a unital algebra since the identity matrix of order n is the identity element with respect to matrix multiplication. It is an example of a unital associative algebra, a (unital) ring that is also a vector space.
Many authors use the term algebra to mean associative algebra, or unital associative algebra, or in some subjects such as algebraic geometry, unital associative commutative algebra.
Replacing the field of scalars by a commutative ring leads to the more general notion of an algebra over a ring. Algebras are not to be confused with vector spaces equipped with a bilinear form, like inner product spaces, as, for such a space, the result of a product is not in the space, but rather in the field of coefficients.

## Definition and motivation
### Motivating examples

| Algebra | vector space | bilinear operator | associativity | commutativity |
| complex numbers | $\mathbb {R} ^{2}$ | product of complex numbers $\left(a+ib\right)\cdot \left(c+id\right)$ | Yes | Yes |
| cross product of 3D vectors | $\mathbb {R} ^{3}$ | cross product ${\vec {a}}\times {\vec {b}}$ | No | No (anticommutative) |
| quaternions | $\mathbb {R} ^{4}$ | Hamilton product $(a+{\vec {v}})(b+{\vec {w}})$ | Yes | No |
| polynomials | $\mathbb {R} [X]$ | polynomial multiplication | Yes | Yes |
| square matrices | $\mathbb {R} ^{n\times n}$ | matrix multiplication | Yes | No |

### Definition

Let K be a field, and let A be a vector space over K equipped with an additional binary operation from A × A to A, denoted here by · (that is, if x and y are any two elements of A, then x · y is an element of A that is called the product of x and y). Then A is an algebra over K if the following identities hold for all elements x, y, z in A , and all elements (often called scalars) a and b in K:
* Right distributivity: (x + y) · z = x · z + y · z
* Left distributivity: z · (x + y) = z · x + z · y
* Compatibility with scalars: (ax) · (by) = (ab) (x · y).
These three axioms are another way of saying that the binary operation is bilinear. An algebra over K is sometimes also called a K-algebra, and K is called the base field of A. The binary operation is often referred to as multiplication in A. The convention adopted in this article is that multiplication of elements of an algebra is not necessarily associative, although some authors use the term algebra to refer to an associative algebra.
When a binary operation on a vector space is commutative, left distributivity and right distributivity are equivalent, and, in this case, only one distributivity requires a proof. In general, for non-commutative operations left distributivity and right distributivity are not equivalent, and require separate proofs.

## Basic concepts
### Algebra homomorphisms

Given K-algebras A and B, a homomorphism of K-algebras or K-algebra homomorphism is a K-linear map f: A → B such that f(xy) = f(x) f(y) for all x, y in A. If A and B are unital, then a homomorphism satisfying f(1$_A$) = 1$_B$ is said to be a unital homomorphism. The space of all K-algebra homomorphisms between A and B is frequently written as
    $\mathbf {Hom} _{K{\text{-alg}}}(A,B).$
A K-algebra isomorphism is a bijective K-algebra homomorphism.

### Subalgebras and ideals

A subalgebra of an algebra over a field K is a linear subspace that has the property that the product of any two of its elements is again in the subspace. In other words, a subalgebra of an algebra is a non-empty subset of elements that is closed under addition, multiplication, and scalar multiplication. In symbols, we say that a subset L of a K-algebra A is a subalgebra if for every x, y in L and c in K, we have that x · y, x + y, and cx are all in L.
In the above example of the complex numbers viewed as a two-dimensional algebra over the real numbers, the one-dimensional real line is a subalgebra.
A left ideal of a K-algebra is a linear subspace that has the property that any element of the subspace multiplied on the left by any element of the algebra produces an element of the subspace. In symbols, we say that a subset L of a K-algebra A is a left ideal if for every x and y in L, z in A and c in K, we have the following three statements.
* x + y is in L (L is closed under addition),
* cx is in L (L is closed under scalar multiplication),
* z · x is in L (L is closed under left multiplication by arbitrary elements).
If (3) were replaced with x · z is in L, then this would define a right ideal. A two-sided ideal is a subset that is both a left and a right ideal. The term ideal on its own is usually taken to mean a two-sided ideal. Of course when the algebra is commutative, then all of these notions of ideal are equivalent. Conditions (1) and (2) together are equivalent to L being a linear subspace of A. It follows from condition (3) that every left or right ideal is a subalgebra.
This definition is different from the definition of an ideal of a ring, in that here we require the condition (2). Of course if the algebra is unital, then condition (3) implies condition (2).

### Extension of scalars

If we have a field extension F/K, which is to say a bigger field F that contains K, then there is a natural way to construct an algebra over F from any algebra over K. It is the same construction one uses to make a vector space over a bigger field, namely the tensor product $V_{F}:=V\otimes _{K}F$. So if A is an algebra over K, then $A_{F}$ is an algebra over F.

## Kinds of algebras and examples

Algebras over fields come in many different types. These types are specified by insisting on some further axioms, such as commutativity or associativity of the multiplication operation, which are not required in the broad definition of an algebra. The theories corresponding to the different types of algebras are often very different.

### Unital algebra

An algebra is unital or unitary if it has a unit or identity element I with Ix = x = xI for all x in the algebra.

### Zero algebra

An algebra is called a zero algebra if uv = 0 for all u, v in the algebra, not to be confused with the algebra with one element. It is inherently non-unital (except in the case of only one element), associative and commutative.
A unital zero algebra is the direct sum ⁠$K\oplus V$⁠ of a field ⁠$K$⁠ and a ⁠$K$⁠-vector space ⁠$V$⁠, that is equipped by the only multiplication that is zero on the vector space (or module), and makes it an unital algebra.
More precisely, evey element of the algebra may be uniquely written as ⁠$k+v$⁠ with ⁠$k\in K$⁠ and ⁠$v\in V$⁠, and the product is the only bilinear operation such that ⁠$vw=0$⁠ for every ⁠$v$⁠ and ⁠$w$⁠ in ⁠$V$⁠. So, if ⁠$k_{1},k_{2}\in K$⁠ and ⁠$v_{1},v_{2}\in V$⁠, one has $(k_{1}+v_{1})(k_{2}+v_{2})=k_{1}k_{2}+(k_{1}v_{2}+k_{2}v_{1}).$
A classical example of unital zero algebra is the algebra of dual numbers, the unital zero R-algebra built from a one dimensional real vector space.
This definition extends verbatim to the definition of a unital zero algebra over a commutative ring, with the replacement of "field" and "vector space" with "commutative ring" and "module".
Unital zero algebras allow the unification of the theory of submodules of a given module and the theory of ideals of a unital algebra. Indeed, the submodules of a module ⁠$V$⁠ correspond exactly to the ideals of ⁠$K\oplus V$⁠ that are contained in ⁠$V$⁠.
For example, the theory of Gröbner bases was introduced by Bruno Buchberger for ideals in a polynomial ring R = K[x$_1$, ..., x$_n$] over a field. The construction of the unital zero algebra over a free R-module allows extending this theory as a Gröbner basis theory for submodules of a free module. This extension allows, for computing a Gröbner basis of a submodule, to use, without any modification, any algorithm and any software for computing Gröbner bases of ideals.
Similarly, unital zero algebras allow to deduce straightforwardly the Lasker–Noether theorem for modules (over a commutative ring) from the original Lasker–Noether theorem for ideals.

### Associative algebra

Examples of associative algebras include
* the algebra of all n-by-n matrices over a field (or commutative ring) K. Here the multiplication is ordinary matrix multiplication.
* group algebras, where a group serves as a basis of the vector space and algebra multiplication extends group multiplication.
* the commutative algebra K[x] of all polynomials over K (see polynomial ring).
* algebras of functions, such as the R-algebra of all real-valued continuous functions defined on the interval [0,1], or the C-algebra of all holomorphic functions defined on some fixed open set in the complex plane. These are also commutative.
* Incidence algebras are built on certain partially ordered sets.
* algebras of linear operators, for example on a Hilbert space. Here the algebra multiplication is given by the composition of operators. These algebras also carry a topology; many of them are defined on an underlying Banach space, which turns them into Banach algebras. If an involution is given as well, we obtain B*-algebras and C*-algebras. These are studied in functional analysis.

### Non-associative algebra

A non-associative algebra (or distributive algebra) over a field K is a K-vector space A equipped with a K-bilinear map $A\times A\rightarrow A$. The usage of "non-associative" here is meant to convey that associativity is not assumed, but it does not mean it is prohibited – that is, it means "not necessarily associative".
Examples detailed in the main article include:
* Euclidean space R$^3$ with multiplication given by the vector cross product
* Octonions
* Lie algebras
* Jordan algebras
* Alternative algebras
* Flexible algebras
* Power-associative algebras

## Algebras and rings

The definition of an associative K-algebra with unit is also frequently given in an alternative way. In this case, an algebra over a field K is a ring A together with a ring homomorphism
    $\eta \colon K\to Z(A),$
where Z(A) is the center of A. Since η is a ring homomorphism, then one must have either that A is the zero ring, or that η is injective. This definition is equivalent to that above, with scalar multiplication
    $K\times A\to A$
given by
    $(k,a)\mapsto \eta (k)a.$
Given two such associative unital K-algebras A and B, a unital K-algebra homomorphism f: A → B is a ring homomorphism that commutes with the scalar multiplication defined by η, which one may write as
    $f(ka)=kf(a)$
for all $k\in K$ and $a\in A$. In other words, the following diagram commutes:
    ${\begin{matrix}&&K&&\\&\eta _{A}\swarrow &\,&\eta _{B}\searrow &\\A&&{\begin{matrix}f\\\longrightarrow \end{matrix}}&&B\end{matrix}}$

## Structure coefficients

For algebras over a field, the bilinear multiplication from A × A to A is completely determined by the multiplication of basis elements of A. Conversely, once a basis for A has been chosen, the products of basis elements can be set arbitrarily, and then extended in a unique way to a bilinear operator on A, i.e., so the resulting multiplication satisfies the algebra laws.
Thus, given the field K, any finite-dimensional algebra can be specified up to isomorphism by giving its dimension (say n), and specifying n$^3$ structure coefficients c$_{i,j,k}$, which are scalars. These structure coefficients determine the multiplication in A via the following rule:
    $\mathbf {e} _{i}\mathbf {e} _{j}=\sum _{k=1}^{n}c_{i,j,k}\mathbf {e} _{k}$
where e$_1$,...,e$_n$ form a basis of A.
Note however that several different sets of structure coefficients can give rise to isomorphic algebras.
In mathematical physics, the structure coefficients are generally written with upper and lower indices, so as to distinguish their transformation properties under coordinate transformations. Specifically, lower indices are covariant indices, and transform via pullbacks, while upper indices are contravariant, transforming under pushforwards. Thus, the structure coefficients are often written c$_{i,j}$$^k$, and their defining rule is written using the Einstein notation as
    e$_i$e$_j$ = c$_{i,j}$$^k$e$_k$.
If you apply this to vectors written in index notation, then this becomes
    (xy)$^k$ = c$_{i,j}$$^k$x$^i$y$^j$.
If K is only a commutative ring and not a field, then the same process works if A is a free module over K. If it isn't, then the multiplication is still completely determined by its action on a set that spans A; however, the structure constants can't be specified arbitrarily in this case, and knowing only the structure constants does not specify the algebra up to isomorphism.

## Classification of low-dimensional unital associative algebras over the complex numbers

Two-dimensional, three-dimensional and four-dimensional unital associative algebras over the field of complex numbers were completely classified up to isomorphism by Eduard Study.
There exist two such two-dimensional algebras. Each algebra consists of linear combinations (with complex coefficients) of two basis elements, 1 (the identity element) and a. According to the definition of an identity element,
    $\textstyle 1\cdot 1=1\,,\quad 1\cdot a=a\,,\quad a\cdot 1=a\,.$
It remains to specify
    $\textstyle aa=1$ for the first algebra,
    $\textstyle aa=0$ for the second algebra.
There exist five such three-dimensional algebras. Each algebra consists of linear combinations of three basis elements, 1 (the identity element), a and b. Taking into account the definition of an identity element, it is sufficient to specify
    $\textstyle aa=a\,,\quad bb=b\,,\quad ab=ba=0$ for the first algebra,
    $\textstyle aa=a\,,\quad bb=0\,,\quad ab=ba=0$ for the second algebra,
    $\textstyle aa=b\,,\quad bb=0\,,\quad ab=ba=0$ for the third algebra,
    $\textstyle aa=1\,,\quad bb=0\,,\quad ab=-ba=b$ for the fourth algebra,
    $\textstyle aa=0\,,\quad bb=0\,,\quad ab=ba=0$ for the fifth algebra.
The fourth of these algebras is non-commutative, and the others are commutative.

## Generalization: algebra over a ring

In some areas of mathematics, such as commutative algebra, it is common to consider the more general concept of an algebra over a ring, where a commutative ring R replaces the field K. The only part of the definition that changes is that A is assumed to be an R-module (instead of a K-vector space).

### Associative algebras over rings

A ring A is always an associative algebra over its center, and over the integers. A classical example of an algebra over its center is the split-biquaternion algebra, which is isomorphic to $\mathbb {H} \times \mathbb {H}$, the direct product of two quaternion algebras. The center of that ring is $\mathbb {R} \times \mathbb {R}$, and hence it has the structure of an algebra over its center, which is not a field. Note that the split-biquaternion algebra is also naturally an 8-dimensional $\mathbb {R}$-algebra.
In commutative algebra, if A is a commutative ring, then any unital ring homomorphism $R\to A$ defines an R-module structure on A, and this is what is known as the R-algebra structure. So a ring comes with a natural $\mathbb {Z}$-module structure, since one can take the unique homomorphism $\mathbb {Z} \to A$. On the other hand, not all rings can be given the structure of an algebra over a field (for example the integers). See Field with one element for a description of an attempt to give to every ring a structure that behaves like an algebra over a field.