A min-max principle for non-differentiable functions with a weak compactness condition