Derivable relations in a monoid Let $ X $ be a monoid which is generated by the elements $ x_1, x_2, \hat x_1, \hat x_2 $ and the relations $ \hat x_i x_i = 1 $ and $ x_i \hat x_j = \hat x_j x_i $ for any distinct $ i, j = 1, 2 $.
By the relations, any element of $ X $ can be written as an element of the form $ \omega \hat \omega $ with $ \omega = \prod_{i = 1}^r c_i $ and $ c_i \in \langle x_1, x_2 \rangle $ and $ \hat \omega = \prod_{i = 1}^{\hat r} \hat c_i $ and $ \hat c_i \in \langle \hat x_1, \hat x_2 \rangle $.
Now, since there are no further defining relations, I think the $ c_i $ and $ \hat c_i $ should be uniquely determined. But I am not sure, how to prove this rigorously.
Thanks
 A: The suggestion 'defining a complete rewriting system' in one of the comments of BenjaminSteinberg yields the following proof:
We use the definitions and theorems in https://en.wikipedia.org/wiki/Abstract_rewriting_system#Normal_forms_and_the_word_problem
Let $ \Sigma^* $ be the free monoid in the alphabet $ \Sigma = \{ z_1, z_2, \hat z_1, \hat z_2 \} $.
We define the rewriting system $ R = \{ \hat z_i z_i \to 1, \hat z_i z_j \to z_j \hat z_i : i, j = 1, 2 \text{ and } i \ne j \} $. Let $ S $ be the equivalence relation on $ \Sigma^* $ which is generated by $ R $. Then $ \Sigma^* \to X $ via $ z_i \mapsto x_i $ and $ \hat z_i \mapsto \hat x_i $ induces an isomorphism $ \Sigma^* / S \to X $. Thus, we may identify $ X $ with $ \Sigma^* / S $. Then the starting question becomes: Is there exactly one $ R $-irreducible form in each class in $ \Sigma^* / S $?
For that, we show that $ ( \Sigma^*, R ) $ is Noetherian and locally confluent. Then Newman's Lemma provides that $ ( \Sigma^*, R ) $ is also confluent (this is the door opener) and, therefore, canonical (also called complete). Those systems provide that there is exactly one $ R $-irreducible form in each class in $ \Sigma^* / S $.
For $ ( \Sigma^*, R ) $ being Notherian:
There are only finitely many times that only the rules $ \hat z_i z_j \to z_j \hat z_i $ can be applied on a word. Then the word is either irreducible or the rule $ \hat z_i z_i \to 1 $ can be applied for some $ i = 1, 2 $. But, this shortens the word. Hence, the second case only appear finitely many times.
For $ ( \Sigma^*, R ) $ being locally confluent:
Independent of this particular rewriting system, it is enough to check local confluence for words $ w $ of the form $ w = u v t $ and rules of the form $ u v \to u' $ and $ v t \to t' $. But, there are no such rules in $ R $. Therefore, it follows trivially that $ ( \Sigma^*, R ) $ is locally confluent.
q.e.d
I am a little suspicious because the statement (uniqueness in the question) followed more or less without effort. Either I made a mistake or the actual work was done by Newmann's Lemma.
