Consider, for example, the construction of the free group in two generators. One starts with an alphabet consisting of the five letters . In the first step, there is not yet any assigned meaning to the "letters" or ; these will be given later, in the second step. Thus, one could equally well start with the alphabet in five letters that is . In this example, the set of all words or strings will include strings such as aebecede and abdc, and so on, of arbitrary finite length, with the letters arranged in every possible order.
In the next step, one imposes a set of equivalence relations. The equivalence relations for a group are that of multiplication by the identity, , and the multiplication of inverses: . Applying these relations to the strings above, one obtains
where it was understood that c is a stand-in for , and d is a stand-in for , while e is the identity element. Similarly, one has
This is often written as
is the set of all words, and
A simpler example are the free monoids. The free monoid on a set X, is the monoid of all finite strings using X as alphabet, with operation concatenation of strings. The identity is the empty string. In essence, the free monoid is simply the set of all words, with no equivalence relations imposed. This example is developed further in the article on the Kleene star.
The algebraic relations may then be general arities or finitary relations on the leaves of the tree. Rather than starting with the collection of all possible parenthesized strings, it can be more convenient to start with the Herbrand universe. Properly describing or enumerating the contents of a free object can be easy or difficult, depending on the particular algebraic object in question. For example, the free group in two generators is easily described. By contrast, little or nothing is known about the structure of free Heyting algebras in more than one generator. The problem of determining if two different strings belong to the same equivalence class is known as the word problem.
As the examples suggest, free objects look like constructions from syntax; one may reverse that to some extent by saying that major uses of syntax can be explained and characterised as free objects, in a way that makes apparently heavy 'punctuation' explicable (and more memorable).
Let be any set, let be an algebraic structure of type , and let be a function. we say that (or informally just ) is a free algebra (of type ) on the set of free generators if, for every algebra of type and function , there exists a unique homomorphism such that .
Consider the category C of algebraic structures; these can be thought of as sets plus operations, obeying some laws. This category has a functor, , the forgetful functor, which maps objects and functions in C to Set, the category of sets. The forgetful functor is very simple: it just ignores all of the operations.
The free functor F, when it exists, is the left adjoint to U. That is, takes sets X in Set to their corresponding free objects F(X) in the category C. The set X can be thought of as the set of "generators" of the free object F(X).
For the free functor to be a left adjoint, one must also have a C-morphism . More explicitly, F is, up to isomorphisms in C, characterized by the following universal property:
Concretely, this sends a set into the free object on that set; it's the "inclusion of a basis". Abusing notation, (this abuses notation because X is a set, while F(X) is an algebra; correctly, it is ).
For example the tensor algebra construction on a vector space as left adjoint to the functor on associative algebras that ignores the algebra structure. It is therefore often also called a free algebra.