But the commutativity is not necessary, in the case where f = “square root, rounded down” and g = “x rounded down to a multiple of K”. In such case, it is true that gg = g, but not always gf = fg, and yet always gfg = gf.
From that example, I would be tempted to generalize that gg = g and fg = f. But that would not be true for x^3 and absolute value.
So maybe gg = g and gfg = gf? Is it sufficient? gfgf = gff. gfgfgf = gfgff = gfff. Yes, it is. Is it necessary? No, for example if f is a constant then gg does not have to be equal to g and it will work anyway. There are also counter-examples if f is not a constant, for example if we have a bijection between N and NN, then let f([a, b]) = [a^3, K] and g([a, b]) = [|a|, whatever(b)]; then gfgf([a, b]) = gff([a, b]) = [|a^9|, whatever(K)].
This is the moment where I give up. It was tempting to translate g(f^n) = (gf)^n into a set of equations that does not include n, but apparently I can’t do it.
This is an inspirational example. If g is idempotent (g^2 = g) and commutes with f (gf = fg), they will satisfy the property.
Wow, that is a nice generalization.
But the commutativity is not necessary, in the case where f = “square root, rounded down” and g = “x rounded down to a multiple of K”. In such case, it is true that gg = g, but not always gf = fg, and yet always gfg = gf.
From that example, I would be tempted to generalize that gg = g and fg = f. But that would not be true for x^3 and absolute value.
So maybe gg = g and gfg = gf? Is it sufficient? gfgf = gff. gfgfgf = gfgff = gfff. Yes, it is. Is it necessary? No, for example if f is a constant then gg does not have to be equal to g and it will work anyway. There are also counter-examples if f is not a constant, for example if we have a bijection between N and NN, then let f([a, b]) = [a^3, K] and g([a, b]) = [|a|, whatever(b)]; then gfgf([a, b]) = gff([a, b]) = [|a^9|, whatever(K)].
This is the moment where I give up. It was tempting to translate g(f^n) = (gf)^n into a set of equations that does not include n, but apparently I can’t do it.