A theorem on partially ordered sets, with applications to fixed point theorems