Generating totally ordered free commutative monoids Let’s say I have a set $A$. I build the free commutative monoid $M$ generated by $A$.


*

*When can a well-order on $A$ be extended to $M$, in a way that is compatible with its monoid structure? I am interested both in the case when $A$ is finite and infinite.

*Under which conditions would such an extension be unique?
 A: For your first question, the answer is positive with lexicographic ordering (as said by Chris). 
Your monoid is $\mathbb{N}^{(A)}$ (i.e. the set of mappings $\alpha: A\to \mathbb{N}$ with finite support, additive version) or $M=\{A^{\alpha}\}_{\alpha\in \mathbb{N}^{(A)}}$ for a multiplicative version using the multiindex notation like in the multivariate polynomials (take e.g. the ring $\mathbb{Z}[A]$).
An easy way to see that this is an ordering is to consider the free commutative group over the same alphabet $A$, i.e. $\mathbb{Z}^{(A)}$ and ($A$ being still supposed totally ordered by 
$<$) the set 
$$
P:=\{\alpha\in \mathbb{Z}^{(A)}\setminus\{0\}\ |\ \alpha(\min(supp(\alpha)))>0\}
$$ 
where the support of $\alpha$ is
$$
supp(\alpha)=\{a\in A\ |\ \alpha(a)\not=0\}
$$
in other words $P$ is just the set of non-zero multiindices such that the coefficient at the least place is $>0$ (for this only total order is required). One has just to check that 


*

* $P+P\subset P$

* $P\cap -P=\emptyset$

* for $\alpha,\beta\in \mathbb{N}^{(A)}$, $\alpha\prec_{lex}\beta$ iff 
$\beta-\alpha\in P$

* $\prec_{lex}$ extends the given ordering on $A$

* if $(A,<)$ is well ordered, so is $(\mathbb{N}^{(A)},\prec_{lex})$
which is maybe long but straightforward. 
For your second question, one can see that this extension is unique iff $|A|\leq 1$ ($A$ is empty or a singleton) as, if $|A|\geq 2$ all lexicographic orderings are different 
(and exchanged by permutations in case $A$ is finite). Still if $|A|\geq 2$ (and totally ordered), there are orders which are not in this class as the "graded lexicographic ordering 
$\prec_{grlex}$" obtained by 
$$
\alpha\prec_{grlex}\beta \Longleftrightarrow |\alpha|<|\beta|\mbox{ or }(|\alpha|=|\beta| 
\mbox{ and } \alpha\prec_{lex}\beta)
$$ 
... and in all cases (when $A$ is not empty), the reverse ordering is different from the given one.
Hope it helps, do not hesitate if something is unclear.
