Invariance Conditions for Nonlinear Dynamical Systems