Title: A microscopic derivation of the critical magnetic field in a superconductor