Kinetics of unfolding and refolding of proteins: I. Mathematical analysis