6

We have two functions: $$ f: \{0,1\}^* \to \{0,1\}^* $$ $$ g: \{0,1\}^* \to \{0,1\}^* $$ that commute: $$ f[g(x)] = g[f(x)] $$

These two functions can be calculated in polynomial time (in the length of the input). Moreover, the outputs have the same length of the inputs: $|f(x)| = |x|$ and $|g(x)| = |x|$ .

A trivial example of functions that commute can be easily constructed by splitting the strings into two parts and defining: $$ f(x,y) = ( a(x), y ) $$ and $$ g(x,y) = ( x, b(y) ) $$ where the functions $a(x)$ and $b(y)$ can be calculated in polynomial time (in their inputs).

I was able to construct slightly more complex examples, but not much more complex. In all the examples, the evolution obtained by repeatedly applying $f$ seems to be independent of the evolution obtained by repeatedly applying $g$. More rigorously, in my examples, the following proposition holds:

Proposition 1

There are two functions $n'$ and $m'$ depending on $n$ and $m$, at most polynomial, such that there is an algorithm that, for any integers $n$ and $m$, calculates the function $f^n[g^m(x)]$, operating in polynomial time (in the length of its input), and taking the following inputs: the numbers $n$ and $m$, $f^{n'}(x)$, and $g^{m'}(x)$.

I remark that this happens even if $n$ and $m$ increase exponentially in $|x|$.

In the trivial example above, setting $n'=n$ and $m'=m$, we see that $f^n(x)= ( a^n(x), y )$ and $g^m(x) = (x, b^m(y) )$, from which it is easy to calculate $f^n[g^m(x,y)] = ( a^n(x), b^m(y) ) $.

Is Prop. 1 a general theorem? Alternatively, is there a counter-example to Prop. 1?

Literature references, improved formalization of the problem, nomenclature, and any other suggestion are welcome.

  • 1
    For another example to consider, suppose $h \colon {0,1}^* \to {0,1}^*$ is any function of this type, and we have $f(x) = h(h(x))$, $g(x) = h(h(h(x)))$, or any other composition of this type. It is not quite clear to me what Proposition 1 means, but it's possible that it would be false in this case. – Misha Lavrov Oct 27 '22 at 19:55
  • Rigorously, the example holds! You propose f(x)=h^2(x) and g(x)=h^3(x). Then f^n[g^m(x)] =h^(2n+3m)(x), that is equal to f^(n+3m/2)(x) only for even values of m. – Doriano Brogioli Oct 27 '22 at 20:08
  • I wasn't certain whether you allowed taking $n'$ or $m'$ to be $n+3m/2$. Another thought: what do you suggest doing with $f(x,y,z) = (a(x), b(y), z)$ and $g(x,y,z) = (x, b(y), c(z))$? – Misha Lavrov Oct 27 '22 at 20:16
  • I would say that, rigorously, this is a counterexample to proposition 1. However, if we request that the relations hold for an infinite set of natural numbers n and m (but not necessarily for all of them) then your example satisfies proposition 1. I will add this (more challenging) condition. – Doriano Brogioli Oct 27 '22 at 20:20
  • 1
    Well, if $m$ is odd, then you can take $f^{n+3(m-1)/2}(x)$ as input and apply $h$ to it! – Misha Lavrov Oct 27 '22 at 20:22
  • Yes! Then, also this example satisfies prop. 1! I was thinking to weaken prop. 1, requiring that n and m are in an infinite subset of natural numbers. But it seems that this latter idea makes this weaker version not much different from the original one. – Doriano Brogioli Oct 27 '22 at 20:34
  • 1
    "Given two integers n and m, there is an algorithm that calculates (...)": you should add that the algorithm does not depend upon $n$ or $m$. Otherwise just take $m'=m$ and the algorithm is $f^n$ applied to $g^m(x)$. – Jean-Armand Moroni Oct 30 '22 at 13:53
  • I see the point! But I decided to modify the question in the opposite direction, i.e. explicitly giving $n$ and $m$ in input. If $f^n$ is calculated by applying $n$ times $f$, its calculation takes exponential time in the size of the input, i.e. it takes $n$ steps, which are exponential in the size of $n$. – Doriano Brogioli Oct 30 '22 at 20:25
  • I summarize a bit, correct me if I am wrong. The comments above helped me to properly rewrite Prop. 1. After the changes, we can see the comments as conditions under which Prop. 1 holds. Misha Lavrov: if $f=h^a$ and $g=h^b$ (with $a$ and $b$ two natural numbers) then Prop. 1 holds. Jean-Armand Moroni: if $f^n$ can be calculated in polynomial time in the size (number of bits) of $n$ (so substantially faster than applying $n$ times $f$) then Prop. 1 holds. So, we still do not know if Prop. 1 holds, but, if you are looking for a counter-example, do not try with such functions. – Doriano Brogioli Oct 30 '22 at 20:36
  • I posted this question here: https://mathoverflow.net/questions/433839/computational-complexity-and-commuting-functions – Doriano Brogioli Nov 03 '22 at 20:44

0 Answers0