The equilibrium of the processes of polyimide formation