# Is this a free magma?

Given a context-free grammar $S\to(),S\to(SS)$, which generates all sentences of matching brackets in expressions of binary (possibly non associative) operations, and let $P$ be the set of all these sentences. Then $P$ is a magma with the operation $(p_1 p_2)\in P$ for all $p_1,p_2\in P$. Is this a free magma over $()$ or are there some relations? I guess it's free, but how to prove it?

• Thinking of it I guess it's trivially free, since a relation would identify two sentences.
– Lehs
Commented Aug 17, 2015 at 6:56

Define the degree of $p\in P$ as $|p|=1$ if $p=()$ and $|p|=|p_1|+|p_2|$ if $p=(p_1 p_2)$. The degree of $p$ is the number of occurrences of the sentence $()$ in $p$. Given a magma $M$ and elements $x_1,\dots , x_n$ in $M$. If $|p|=n$ then $p$ can be applied to $x_1,\dots , x_n$ which can be written $p(x_1,\dots , x_n)$ and is when calculated an element in $M$, by in order from left replace $()$ in $p$ with $x_1,\dots , x_n$.
A relation of elements in $P$ would be an expression $$p(p_1,\dots,p_n)=q(q_1,\dots, q_m)$$ where $|p|=n$ and $|q|=m$. But if $n,m>1$ there are $p^\prime, p^{\prime\prime},q^\prime,q^{\prime\prime}\in P$ such that $p(p_1,\dots,p_n)=(p^\prime p^{\prime\prime})$ and $q(q_1,\dots, q_m)=(q^\prime q^{\prime\prime})$, while $p^{\prime}=q^\prime$ and $p^{\prime\prime}=q^{\prime\prime}$, and the right side and the left side above must be identical strings (induction). It's trivially besides from the abstract appearance.