mathematical logic is a subfield of mathematics exploring the applications of formal logic to mathematics. it bears close connections to metamathematics, the foundations of mathematics, and theoretical computer science. the unifying themes in mathematical logic include the study of the expressive power of formal systems and the deductive power of formal proof systems.
mathematical logic is often divided into the fields of set theory, model theory, recursion theory, and proof theory. these areas share basic results on logic, particularly first-order logic, and definability. in computer science (particularly in the acm classification) mathematical logic encompasses additional topics not detailed in this article; see logic in computer science for those.
since its inception, mathematical logic has both contributed to, and has been motivated by, the study of foundations of mathematics. this study began in the late 19th century with the development of axiomatic frameworks for geometry, arithmetic, and analysis. in the early 20th century it was shaped by david hilbert's program to prove the consistency of foundational theories. results of kurt gödel, gerhard gentzen, and others provided partial resolution to the program, and clarified the issues involved in proving consistency. work in set theory showed that almost all ordinary mathematics can be formalized in terms of sets, although there are some theorems that cannot be proven in common axiom systems for set theory. contemporary work in the foundations of mathematics often focuses on establishing which parts of mathematics can be formalized in particular formal systems (as in reverse mathematics) rather than trying to find theories in which all of mathematics can be developed.