A generalization of the Alaoglu-Bourbaki theorem and its applications