Given the alphabet $A = \{a,b\}^*$ and function
$\operatorname{equals}(q,w) = \begin{cases} a, & \text{if } q = w \\ \epsilon, & \text{otherwise} \end{cases}$
How to define primitive recursive function to one above? Just the idea, without proofs will be sufficient for me.
If both are empty strings, then they are the same.
If one is an empty string and the other one is not, they are not the same.
If they are both non-empty strings, but the first letter is different, then they are not the same.
If they are both non-empty, and their first letter is the same, then they are the same if what comes after that letter is the same for both ( so here is where you get the recursion!)