In mathematics, an **automorphism** is an isomorphism from a mathematical object to itself. It is, in some sense, a symmetry of the object, and a way of mapping the object to itself while preserving all of its structure. The set of all automorphisms of an object forms a group, called the automorphism group. It is, loosely speaking, the symmetry group of the object.

In the context of abstract algebra, a mathematical object is an algebraic structure such as a group, ring, or vector space. An **automorphism** is simply a bijective homomorphism of an object with itself. (The definition of a homomorphism depends on the type of algebraic structure; see, for example, group homomorphism, ring homomorphism, and linear operator.)

The identity morphism (identity mapping) is called the **trivial automorphism** in some contexts. Respectively, other (non-identity) automorphisms are called **nontrivial automorphisms**.

The exact definition of an automorphism depends on the type of "mathematical object" in question and what, precisely, constitutes an "isomorphism" of that object. The most general setting in which these words have meaning is an abstract branch of mathematics called category theory. Category theory deals with abstract objects and morphisms between those objects.

In category theory, an **automorphism** is an endomorphism (i.e., a morphism from an object to itself) which is also an isomorphism (in the categorical sense of the word, meaning there exists a right and left inverse endomorphism).

This is a very abstract definition since, in category theory, morphisms are not necessarily functions and objects are not necessarily sets. In most concrete settings, however, the objects will be sets with some additional structure and the morphisms will be functions preserving that structure.

Main article: Automorphism group |

If the automorphisms of an object `X` form a set (instead of a proper class), then they form a group under composition of morphisms. This group is called the **automorphism group** of `X`.

- Closure
- Composition of two automorphisms is another automorphism.
- Associativity
- It is part of the definition of a category that composition of morphisms is associative.
- Identity
- The identity is the identity morphism from an object to itself, which is an automorphism.
- Inverses
- By definition every isomorphism has an inverse that is also an isomorphism, and since the inverse is also an endomorphism of the same object it is an automorphism.

The automorphism group of an object *X* in a category *C* is denoted Aut_{C}(*X*), or simply Aut(*X*) if the category is clear from context.

- In set theory, an arbitrary permutation of the elements of a set
*X*is an automorphism. The automorphism group of*X*is also called the symmetric group on*X*. - In elementary arithmetic, the set of integers,
**Z**, considered as a group under addition, has a unique nontrivial automorphism: negation. Considered as a ring, however, it has only the trivial automorphism. Generally speaking, negation is an automorphism of any abelian group, but not of a ring or field. - A group automorphism is a group isomorphism from a group to itself. Informally, it is a permutation of the group elements such that the structure remains unchanged. For every group
*G*there is a natural group homomorphism*G*→ Aut(*G*) whose image is the group Inn(*G*) of inner automorphisms and whose kernel is the center of*G*. Thus, if*G*has trivial center it can be embedded into its own automorphism group.^{[1]} - In linear algebra, an endomorphism of a vector space
*V*is a linear operator*V*→*V*. An automorphism is an invertible linear operator on*V*. When the vector space is finite-dimensional, the automorphism group of*V*is the same as the general linear group, GL(*V*). (The algebraic structure of all endomorphisms of*V*is itself an algebra over the same base field as*V*, whose invertible elements precisely consist of GL(*V*).) - A field automorphism is a bijective ring homomorphism from a field to itself. In the cases of the rational numbers (
**Q**) and the real numbers (**R**) there are no nontrivial field automorphisms. Some subfields of**R**have nontrivial field automorphisms, which however do not extend to all of**R**(because they cannot preserve the property of a number having a square root in**R**). In the case of the complex numbers,**C**, there is a unique nontrivial automorphism that sends**R**into**R**: complex conjugation, but there are infinitely (uncountably) many "wild" automorphisms (assuming the axiom of choice).^{[2]}^{[3]}Field automorphisms are important to the theory of field extensions, in particular Galois extensions. In the case of a Galois extension*L*/*K*the subgroup of all automorphisms of*L*fixing*K*pointwise is called the Galois group of the extension. - The automorphism group of the quaternions (
**H**) as a ring are the inner automorphisms, by the Skolem–Noether theorem: maps of the form*a*↦*bab*^{−1}.^{[4]}This group is isomorphic to SO(3), the group of rotations in 3-dimensional space. - The automorphism group of the octonions (
**O**) is the exceptional Lie group G_{2}. - In graph theory an automorphism of a graph is a permutation of the nodes that preserves edges and non-edges. In particular, if two nodes are joined by an edge, so are their images under the permutation.
- In geometry, an automorphism may be called a motion of the space. Specialized terminology is also used:
- In metric geometry an automorphism is a self-isometry. The automorphism group is also called the isometry group.
- In the category of Riemann surfaces, an automorphism is a biholomorphic map (also called a conformal map), from a surface to itself. For example, the automorphisms of the Riemann sphere are Möbius transformations.
- An automorphism of a differentiable manifold
*M*is a diffeomorphism from*M*to itself. The automorphism group is sometimes denoted Diff(*M*). - In topology, morphisms between topological spaces are called continuous maps, and an automorphism of a topological space is a homeomorphism of the space to itself, or self-homeomorphism (see homeomorphism group). In this example it is
*not sufficient*for a morphism to be bijective to be an isomorphism.

One of the earliest group automorphisms (automorphism of a group, not simply a group of automorphisms of points) was given by the Irish mathematician William Rowan Hamilton in 1856, in his icosian calculus, where he discovered an order two automorphism,^{[5]} writing:

so that is a new fifth root of unity, connected with the former fifth root by relations of perfect reciprocity.

Main articles: Inner automorphism and Outer automorphism group |

In some categories—notably groups, rings, and Lie algebras—it is possible to separate automorphisms into two types, called "inner" and "outer" automorphisms.

In the case of groups, the inner automorphisms are the conjugations by the elements of the group itself. For each element *a* of a group *G*, conjugation by *a* is the operation *φ*_{a} : *G* → *G* given by *φ*_{a}(*g*) = *aga*^{−1} (or *a*^{−1}*ga*; usage varies). One can easily check that conjugation by *a* is a group automorphism. The inner automorphisms form a normal subgroup of Aut(*G*), denoted by Inn(*G*); this is called Goursat's lemma.

The other automorphisms are called outer automorphisms. The quotient group Aut(*G*) / Inn(*G*) is usually denoted by Out(*G*); the non-trivial elements are the cosets that contain the outer automorphisms.

The same definition holds in any unital ring or algebra where *a* is any invertible element. For Lie algebras the definition is slightly different.