This book gives a detailed account of the analytic foundations of gauge theory, namely, Uhlenbeck's compactness theorems for general connections and for YangMills connections. It guides graduate students into the analysis of YangMills theory as well as serves as a reference for researchers in the field. The volume is largely self contained. It contains a number of appendices (e.g., on Sobolev spaces of maps between manifolds) and an introductory part covering the \(L^p\)regularity theory for the inhomogenous Neumann problem. The two main parts contain the full proofs of Uhlenbeck's weak and strong compactness theorems on closed manifolds as well as their generalizations to manifolds with boundary and noncompact manifolds. These parts include a number of useful analytic tools such as general patching constructions and local slice theorems. The book is suitable for graduate students and research mathematicians interested in differential geometry, global analysis, and analysis on manifolds. A publication of the European Mathematical Society (EMS). Distributed within the Americas by the American Mathematical Society. Readership Graduate students and research mathematicians interested in differential geometry, global analysis, and analysis on manifolds. Table of Contents  The Neumann problem
 Weak compactness
 Strong compactness
 Appendix
 List of symbols
 Index
 Bibliography
