In mathematics, especially in the fields of group theory and representation theory of groups, a class function is a function on a group G that is constant on the conjugacy classes of G. In other words, it is invariant under the conjugation map on G. Such functions play a basic role in representation theory. In mathematics, especially in the fields of group theory and representation theory of groups, a class function is a function on a group G that is constant on the conjugacy classes of G. In other words, it is invariant under the conjugation map on G. Such functions play a basic role in representation theory. The character of a linear representation of G over a field K is always a class function with values in K. The class functions form the center of the group ring K. Here a class function f is identified with the element ∑ g ∈ G f ( g ) g {displaystyle sum _{gin G}f(g)g} . The set of class functions of a group G with values in a field K form a K-vector space. If G is finite and the characteristic of the field does not divide the order of G, then there is an inner product defined on this space defined by ⟨ ϕ , ψ ⟩ = 1 | G | ∑ g ∈ G ϕ ( g ) ψ ( g − 1 ) {displaystyle langle phi ,psi angle ={frac {1}{|G|}}sum _{gin G}phi (g)psi (g^{-1})} where |G| denotes the order of G. The set of irreducible characters of G forms an orthogonal basis, and if K is a splitting field for G, for instance if K is algebraically closed, then the irreducible characters form an orthonormal basis. In the case of a compact group and K = C the field of complex numbers, the notion of Haar measure allows one to replace the finite sum above with an integral: ⟨ ϕ , ψ ⟩ = ∫ G ϕ ( t ) ψ ( t − 1 ) d t . {displaystyle langle phi ,psi angle =int _{G}phi (t)psi (t^{-1}),dt.} When K is the real numbers or the complex numbers, the inner product is a non-degenerate Hermitian bilinear form.