Theory of Lipid Polymorphism as a Function of pH