In mathematics, an affine Lie algebra is an infinite-dimensional Lie algebra that is constructed in a canonical fashion out of a finite-dimensional simple Lie algebra. Given an affine Lie algebra, one can also form the associated affine Kac-Moody algebra, as described below. From a purely mathematical point of view, affine Lie algebras are interesting because their representation theory, like representation theory of finite-dimensional semisimple Lie algebras, is much better understood than that of general Kac–Moody algebras. As observed by Victor Kac, the character formula for representations of affine Lie algebras implies certain combinatorial identities, the Macdonald identities. Affine Lie algebras play an important role in string theory and two-dimensional conformal field theory due to the way they are constructed: starting from a simple Lie algebra , one considers the loop algebra, , formed by the -valued functions on a circle (interpreted as the closed string) with pointwise commutator. The affine Lie algebra is obtained by adding one extra dimension to the loop algebra and modifying a commutator in a non-trivial way, which physicists call a quantum anomaly (in this case, the anomaly of the WZW model) and mathematicians a central extension. More generally, if σ is an automorphism of the simple Lie algebra associated to an automorphism of its Dynkin diagram, the twisted loop algebra consists of -valued functions f on the real line which satisfy the twisted periodicity condition . Their central extensions are precisely the twisted affine Lie algebras. The point of view of string theory helps to understand many deep properties of affine Lie algebras, such as the fact that the characters of their representations transform amongst themselves under the modular group. Affine Lie algebras from simple Lie algebras Definition If is a finite-dimensional simple Lie algebra, the corresponding affine Lie algebra is constructed as a central extension of the loop algebra , with one-dimensional center As a vector space, where is the complex vector space of Laurent polynomials in the indeterminate t. The Lie bracket is defined by the formula for all and , where is the Lie bracket in the Lie algebra and is the Cartan-Killing form on The affine Lie algebra corresponding to a finite-dimensional semisimple Lie algebra is the direct sum of the affine Lie algebras corresponding to its simple summands. There is a distinguished derivation of the affine Lie algebra defined by The corresponding affine Kac–Moody algebra is defined as a semidirect