Classical first-order logic is in many ways central to work in mathematics, linguistics, computer science and artificial intelligence, so it is worthwhile to define it in full detail. We present soundness and completeness proofs of a sequent calculus for first-order logic, formalized in the interactive proof assistant Isabelle/HOL. Our formalization is based on work by Stefan Berghofer, which we have since updated to use Isabelle's declarative proof style Isar (Archive of Formal Proofs, Entry FOL-Fitting, August 2007 / July 2018). We represent variables with de Bruijn indices; this makes substitution under quantifiers less intuitive for a human reader. However, the nature of natural numbers yields an elegant solution when compared to implementations of substitution using variables represented by strings. The sequent calculus considered has the special property of an always empty antecedent and a list of formulas in the succedent. We obtain the proofs of soundness and completeness for the sequent calculus as a derived result of the inverse duality of its tableau counterpart. We strive to not only present the results of the proofs of soundness and completeness, but also to provide a deep dive into a programming-like approach to the formalization of first-order logic syntax, semantics and the sequent calculus. We use the formalization in a bachelor course on logic for computer science and discuss our experiences. * Corresponding author: jovi@dtu.dk
Teaching a Formalized Logical CalculusThe development described in this paper is available online: https://bitbucket.org/isafol/isafol/src/master/FOL_Berghofer/ 4253 lines FOL_Berghofer.thy 867 lines FOL_Tableau.thy A contribution of this paper 217 lines FOL_Sequent.thy A contribution of this paper 132 lines FOL_Appendix.thy A contribution of this paperThese numbers include blank lines and a few comments. All in all it takes around 5 seconds in real time to verify on a fairly standard computer. The entire formalization is based on the standard theory Main (the standard library of Isabelle/HOL which comes with many useful functions and facts about e.g. natural numbers and lists).We have recently named our system based on the formalization in Isabelle/HOL:
SeCa Sequent Calculus Verifier
SeCaV formalizes first-order logic with constants and functionsSeCaV verifies one-sided sequent calculus proofs
SeCaV uses the Isabelle proof assistantSeCaV is a tool for teaching logic Jørgen Villadsen
Asta Halkjaer FromAlexander Birch Jensen
Anders SchlichtkrullFor our bachelor course we focus on the fragment (499 lines) of the formalization available here:https://bitbucket.org/isafol/isafol/src/master/Sequent_Calculus/ Here only the soundness proof is included but in addition a small and a large proof in the sequent calculus is formalized. The structure of the paper is as follows. Section 2 explains the formalization of the syntax and the semantics of classical first-order logic. Section 3 describes the sequent calculus. Section 4 outlines the formalized soundness and completeness proof...