Let $\to$ be a relation over the set of binary strings of 0 and 1. $\to$ is defined by the following rules:
R1. $x10y \to x0001y $
R2. $x01y \to x1y $
R3. $x11y \to x0000y $
R4. $x00y \to x0y$
Where $x,y$ are arbitrary strings. The relation is interpreted as a rewriting system, mapping strings to stirings.
The exercise I am trying to solve ask for a function $f$ mapping strings of 0 and 1 into naturals such that $ x \to y $ implies $f (x) > f(y)$.
If the rewriting system would not have rules R1 and R3 one could simply take the lenght of the input string as the function f.
However it seems hard to find a function that yields the required inequality considering also the rules R1 and R4 that amplify the initial string.
Anyone happens to see such a function?
Edit: After the comment of Peter I would be interested in knowing if there is any easy way to prove that the rewriting system is locally confluent. That is, if a -> b and a -> c then b ⇝ d and c ⇝ d
Here maybe an answer that doesn't really give any more insight to the problem, but as I see it, I is only suppose to show, that there are only finitely many possibilities to rewrite a string.
Taking a string wie will assign a natural number to each digit and the value of the string will be the sum of the assigned natural numbers. We will first count the number of 1's to the left of that digit, say the number is $n$, and then assign $4^n$ to the digit.
Let us now prove that $x\to y$ indeed implies $f(x)>f(y)$. For this we will consider $x10y$ and so on, hence let $x$ include $n$ 1's. Then $$ f(x10y) - f(x0001y) = 4^{n+1} - 3\cdot 4^n = 4^n,$$ $$ f(x11y) - f(x0000y) = 4^n + 4^{n+1} - 4\cdot 4^n = 4^n,$$ $$ f(x01y) - f(x1y) = 4^n,$$ $$ f(x00y) - f(x0y) = 4^n.$$
My answer seems to have a strong similarity to the one given by quanta, but is carried out more explicitely.