This book provides a comprehensive account of a key (and perhaps the most important) theory upon which the Taylor–Wiles proof of Fermat's last theorem is based. The book begins with an overview of the theory of automorphic forms on linear algebraic groups and then covers the basic theory and results on elliptic modular forms, including a substantial simplification of the Taylor–Wiles proof by Fujiwara and Diamond. It contains a detailed exposition of the representation theory of profinite groups (including deformation theory), as well as the Euler characteristic formulas of Galois cohomology groups. The final chapter presents a proof of a non-abelian class number formula and includes several new results from the author. The book will be of interest to graduate students and researchers in number theory (including algebraic and analytic number theorists) and arithmetic algebraic geometry.