Proposition 3
Tag 05FJ, permanent. Cite it as [Bourbaki, Tag 05FJ].
Algebra, chapter I, § 7. Free monoids, free groups
Let M be a monoid. Every mapping f of X into M extends uniquely to a homomorphism of Mo(X) into M.
Let be a homomorphism of into extending . If is a word, then in the monoid , whence
in the monoid (§ 1, no. 2, formula (2)). This proves the uniqueness of .
Let for every word . The associativity theorem (§ 1, no. 3, Theorem 1) and the definition of product in imply . By convention the empty product is the identity element of and for . Hence is a homomorphism of into extending .
Let be a mapping. By Proposition 3, there exists one and only one homomorphism of Mo(X) into Mo(Y) which coincides with u on X; it is denoted by Mo(u). It maps a word to the word . As in the case of magmas (no. 1), the equation Mo(v \circ u) = Mo(v) \circ Mo(u) is established for every mapping and it can be shown that Mo(u) is injective (resp. surjective, bijective) if u is. For every subset S of X, Mo(S) is identified with the submonoid of Mo(X) generated by S.
Let X be a set and be a family of ordered pairs of elements of Mo(X). Let R be the equivalence relation on Mo(X) compatible with the law on Mo(X) and generated by the (§ 1, no. 6). The monoid Mo(X)/R is called the monoid defined by X and the relators . Let h be the canonical morphism of Mo(X) onto Mo(X)/R. Then Mo(X) is generated by h(X).
Let N be a monoid and a family of elements of N. Let k be the morphism of Mo(X) into N such that for all (Proposition 3). If for all , there exists one and only one magma morphism such that for all (§ 1, no. 6, Proposition 9); as k is unital, f is a monoid morphism.
Bourbaki puts the proof directly after the statement, so what is above is the statement and its proof together.