The rank condition and convergence of formal functions