R-composition of Lyapunov functions