Skip to main content

Completeness Theorems for First-Order Logic Analysed in Constructive Type Theory

  • Conference paper
  • First Online:
Logical Foundations of Computer Science (LFCS 2020)

Abstract

We study various formulations of the completeness of first-order logic phrased in constructive type theory and mechanised in the Coq proof assistant. Specifically, we examine the completeness of variants of classical and intuitionistic natural deduction and sequent calculi with respect to model-theoretic, algebraic, and game semantics. As completeness with respect to standard model-theoretic semantics is not readily constructive, we analyse the assumptions necessary for particular syntax fragments and discuss non-standard semantics admitting assumption-free completeness. We contribute a reusable Coq library for first-order logic containing all results covered in this paper.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Accepted in Russian constructivism while in conflict with Brouwer’s intuitionism.

  2. 2.

    On www.ps.uni-saarland.de/extras/fol-completeness and hyperlinked with this pdf.

References

  1. Bauer, A.: First steps in synthetic computability theory. Electron. Notes Theor. Comput. Sci. 155, 5–31 (2006). Proceedings of the 21st Annual Conference on Mathematical Foundations of Programming Semantics (MFPS XXI)

    Article  Google Scholar 

  2. Berardi, S.: Intuitionistic completeness for first order classical logic. J. Symbolic Logic 64(1), 304–312 (1999)

    Article  MathSciNet  Google Scholar 

  3. Berger, U., Schwichtenberg, H.: An inverse of the evaluation functional for typed lambda-calculus. In: 1991 Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science, pp. 203–211. IEEE (1991)

    Google Scholar 

  4. Blanchette, J.C., Popescu, A., Traytel, D.: Unified classical logic completeness. In: Demri, S., Kapur, D., Weidenbach, C. (eds.) IJCAR 2014. LNCS (LNAI), vol. 8562, pp. 46–60. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-08587-6_4

    Chapter  Google Scholar 

  5. Braselmann, P., Koepke, P.: Gödel’s completeness theorem. Formalized Math. 13(1), 49–53 (2005)

    Google Scholar 

  6. Constable, R., Bickford, M.: Intuitionistic completeness of first-order logic. Ann. Pure Appl. Logic 165(1), 164–198 (2014)

    Article  MathSciNet  Google Scholar 

  7. Coquand, T., Mannaa, B.: The independence of Markov’s principle in type theory. Logical Methods Comput. Sci. 13(3), 18605974 (2017). arXiv: 1602.04530

  8. de Bruijn, N.G.: Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem. Indagationes Mathematicae (Proceedings) 75(5), 381–392 (1972)

    Article  MathSciNet  Google Scholar 

  9. Delaware, B., d S Oliveira, B.C., Schrijvers, T.: Meta-theory à la carte. In: ACM SIGPLAN Notices, vol. 48, pp. 207–218. ACM (2013)

    Google Scholar 

  10. Dybjer, P., Filinski, A.: Normalization and partial evaluation. In: Barthe, G., Dybjer, P., Pinto, L., Saraiva, J. (eds.) APPSEM 2000. LNCS, vol. 2395, pp. 137–192. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45699-6_4

    Chapter  Google Scholar 

  11. Felscher, W.: Dialogues, strategies, and intuitionistic provability. Ann. Pure Appl. Logic 28(3), 217–254 (1985)

    Article  MathSciNet  Google Scholar 

  12. Forster, Y., Larchey-Wendling, D., Dudenhefner, A., Heiter, E., Kirst, D., Kunze, F., Gert, S., Spies, S., Wehr, D., Wuttke, M.: A Coq Library of Undecidable Problems (2019). https://github.com/uds-psl/coq-library-undecidability

  13. Forster, Y., Heiter, E., Smolka, G.: Verification of PCP-related computational reductions in Coq. In: Avigad, J., Mahboubi, A. (eds.) ITP 2018. LNCS, vol. 10895, pp. 253–269. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-94821-8_15

    Chapter  Google Scholar 

  14. Forster, Y., Kirst, D., Smolka, G.: On synthetic undecidability in Coq, with an application to the Entscheidungsproblem. In: International Conference on Certified Programs and Proofs, pp. 38–51. ACM (2019)

    Google Scholar 

  15. Forster, Y., Kunze, F.: Verified extraction from Coq to a Lambda-Calculus. In: Coq Workshop, vol. 2016 (2016)

    Google Scholar 

  16. Forster, Y., Kunze, F.: A certifying extraction with time bounds from Coq to call-by-value Lambda Calculus. In: Harrison, J., O’Leary, J., Tolmach, A. (eds.) 10th International Conference on Interactive Theorem Proving, volume 141 of Leibniz International Proceedings in Informatics (LIPIcs), Dagstuhl, Germany, pp. 17:1–17:19. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2019)

    Google Scholar 

  17. Forster, Y., Smolka, G.: Weak call-by-value lambda calculus as a model of computation in Coq. In: Ayala-Rincón, M., Muñoz, C.A. (eds.) ITP 2017. LNCS, vol. 10499, pp. 189–206. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-66107-0_13

    Chapter  Google Scholar 

  18. Gödel, K.: Die Vollständigkeit der Axiome des logischen Funktionenkalküls. Monatshefte für Mathematik und Physik 37, 349–360 (1930)

    Article  MathSciNet  Google Scholar 

  19. Han, J., van Doorn, F.: A formalization of forcing and the consistency of the failure of the continuum hypothesis. In: International Conference on Interactive Theorem Proving. Springer, Heidelberg (2019). https://doi.org/10.4230/LIPIcs.ITP.2019.19

  20. Hasenjaeger, G.: Eine Bemerkung zu Henkin’s Beweis für die Vollständigkeit des Prädikatenkalküls der Ersten Stufe. J. Symbolic Logic 18(1), 42–48 (1953)

    Article  MathSciNet  Google Scholar 

  21. Henkin, L.: The completeness of the first-order functional calculus. J. Symbolic Logic 14(3), 159–166 (1949)

    Article  MathSciNet  Google Scholar 

  22. Herbelin, H., Ilik, D.: An analysis of the constructive content of Henkin’s proof of Gödel’s completeness theorem. Draft (2016)

    Google Scholar 

  23. Herbelin, H., Lee, G.: Forcing-based cut-elimination for gentzen-style intuitionistic sequent calculus. In: Ono, H., Kanazawa, M., de Queiroz, R. (eds.) WoLLIC 2009. LNCS (LNAI), vol. 5514, pp. 209–217. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02261-6_17

    Chapter  Google Scholar 

  24. Ilik, D.: Constructive completeness proofs and delimited control. Ph.D. thesis, Ecole Polytechnique X (2010)

    Google Scholar 

  25. Ishihara, H.: Reverse mathematics in Bishop’s constructive mathematics. Philosophia Scientae 6, 43–59 (2006)

    Article  Google Scholar 

  26. Keuchel, S., Schrijvers, T.: Generic datatypes à la carte. In: ACM SIGPLAN Workshop on Generic Programming, pp. 13–24. ACM (2013)

    Google Scholar 

  27. Kirst, D., Smolka, G.: Categoricity results and large model constructions for second-order ZF in dependent type theory. J. Autom. Reasoning 63, 415–438 (2018)

    Article  MathSciNet  Google Scholar 

  28. Kreisel, G.: On weak completeness of intuitionistic predicate logic. J. Symbolic Logic 27(2), 139–158 (1962)

    Article  MathSciNet  Google Scholar 

  29. Kreisel, G., Troelstra, A.S.: Formal systems for some branches of intuitionistic analysis. Ann. Math. Logic 1(3), 229–387 (1970)

    Article  MathSciNet  Google Scholar 

  30. Krivine, J.-L.: Une preuve formelle et intuitionniste du théorème de complétude de la logique classique. Bull. Symbolic Logic 2(4), 405–421 (1996)

    Article  MathSciNet  Google Scholar 

  31. Krivtsov, V.N.: An intuitionistic completeness theorem for classical predicate logic. Studia Logica 96(1), 109–115 (2010)

    Article  MathSciNet  Google Scholar 

  32. Krivtsov, V.N.: Semantical completeness of first-order predicate logic and the weak fan theorem. Studia Logica 103(3), 623–638 (2015)

    Article  MathSciNet  Google Scholar 

  33. Leivant, D.: Failure of completeness properties of intuitionistic predicate logic for constructive models. Annales scientifiques de l’Université de Clermont. Mathématiques 60(13), 93–107 (1976)

    Google Scholar 

  34. Lorenzen, P.: Logik und Agon. Atti del XII Congresso Internazionale di Filosofia 4, 187–194 (1960)

    Google Scholar 

  35. Lorenzen, P.: Ein dialogisches Konstruktivitätskriterium. In: Proceedings of the Symposium on Foundations of Mathematics (Warsaw, 2–9 September 1959), pp. 193–200 (1961)

    Google Scholar 

  36. MacNeille, H.M.: Partially ordered sets. Trans. Am. Math. Soc. 42(3), 416–460 (1937)

    Article  MathSciNet  Google Scholar 

  37. Mannaa, B., Coquand, T.: The independence of Markov’s principle in type theory. Logical Methods Comput. Sci. 13(3:10), 1–28 (2017)

    Google Scholar 

  38. McCarty, C.: Constructive validity is nonarithmetic. J. Symbolic Logic 53, 1036–1041 (1988)

    Article  MathSciNet  Google Scholar 

  39. McCarty, C.: Completeness and incompleteness for intuitionistic logic. J. Symbolic Logic 73(4), 1315–1327 (2008)

    Article  MathSciNet  Google Scholar 

  40. McCarty, D.C., et al.: Incompleteness in intuitionistic metamathematics. Notre Dame J. Formal Logic 32(3), 323–358 (1991)

    Article  MathSciNet  Google Scholar 

  41. Pédrot, P.-M., Tabareau, N.: Failure is not an option. In: Ahmed, A. (ed.) ESOP 2018. LNCS, vol. 10801, pp. 245–271. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-89884-1_9

    Chapter  Google Scholar 

  42. Plotkin, G.D.: Call-by-name, call-by-value and the lambda-calculus. Theor. Comput. Sci. 1(2), 125–159 (1975)

    Article  MathSciNet  Google Scholar 

  43. Ridge, T., Margetson, J.: A mechanically verified, sound and complete theorem prover for first order logic. In: Hurd, J., Melham, T. (eds.) TPHOLs 2005. LNCS, vol. 3603, pp. 294–309. Springer, Heidelberg (2005). https://doi.org/10.1007/11541868_19

    Chapter  MATH  Google Scholar 

  44. Schlichtkrull, A.: Formalization of the resolution calculus for first-order logic. J. Autom. Reason. 61(1–4), 455–484 (2018)

    Article  MathSciNet  Google Scholar 

  45. Schumm, G.F.: A Henkin-style completeness proof for the pure implicational calculus. Notre Dame J. Formal Logic 16(3), 402–404 (1975)

    Article  MathSciNet  Google Scholar 

  46. Scott, D.: The algebraic interpretation of quantifiers: intuitionistic and classical. In: Ehrenfeucht, V.M.A., Srebrny, M. (eds.) Andrzej Mostowski and Foundational Studies. IOS Press (2008)

    Google Scholar 

  47. Sørensen, M.H., Urzyczyn, P.: Sequent calculus, dialogues, and cut elimination. Reflections Type Theor. \(\lambda \)-Calculus Mind 253–261 (2007). http://www.cs.ru.nl/barendregt60/essays/

  48. Sozeau, M., Mangin, C.: Equations reloaded: high-level dependently-typed functional programming and proving in Coq. Proc. ACM Program. Lang. 3(ICFP), 86 (2019)

    Article  Google Scholar 

  49. Stark, K., Schäfer, S., Kaiser, J.: Autosubst 2: reasoning with multi-sorted de Bruijn terms and vector substitutions. In: International Conference on Certified Programs and Proofs, pp. 166–180. ACM (2019)

    Google Scholar 

  50. The Coq Proof Assistant (2019). http://coq.inria.fr

  51. Timany, A., Sozeau, M.: Cumulative inductive types in Coq. In: Kirchner, H. (ed.) International Conference on Formal Structures for Computation and Deduction, volume 108 of Leibniz International Proceedings in Informatics (LIPIcs), Dagstuhl, Germany,, pp. 29:1–29:16. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik (2018)

    Google Scholar 

  52. Underwood, J.: Aspects of the computational content of proofs. Technical report, Cornell University (1994)

    Google Scholar 

  53. Veldman, W.: An intuitiomstic completeness theorem for intuitionistic predicate logic 1. J. Symbolic Logic 41(1), 159–166 (1976)

    MathSciNet  MATH  Google Scholar 

  54. Wehr, D.: A constructive analysis of first-order completeness theorems in Coq. Bachelor’s thesis, Saarland University (2019)

    Google Scholar 

  55. Wuttke, M.: Verified programming of turing machines in Coq. Bachelor’s thesis, Saarland University (2018)

    Google Scholar 

Download references

Acknowledgments

We thank Kathrin Stark for adapting Autosubst according to our needs, Fabian Kunze for helping with technicalities during the formalisation of Corollary 41, and Hugo Herbelin for fruitful discussion and pointers to relevant work.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dominik Kirst .

Editor information

Editors and Affiliations

Appendices

A Overview of Deduction Systems

Definition 55

Intuitionistic natural deduction is defined as follows:

figure i

We write \(\vdash \varphi \) whenever \(\varphi \) is intuitionistically provable from the empty context.

Definition 56

Classical natural deduction is defined as follows:

figure j

We write \(\vdash _c\varphi \) whenever \(\varphi \) is classically provable from the empty context.

Definition 57

The intuitionistic sequent calculus LJT is defined as follows:

figure k

Definition 58

The intuitionistic sequent calculus LJ is defined as follows:

figure l

B Notes on the Coq Formalisation

Our formalisation consists of about 7500 lines of code, with an even split between specification and proofs. The code is structured as follows.

Section

Specification

Proofs

Preliminaries Autosubst

169

53

Preliminaries for

680

599

Tarski Semantics

655

682

Kripke Semantics

342

255

On Markov’s Principle

593

978

Preliminaries for

523

430

Heyting Semantics

297

456

Dialogue Semantics

312

488

Total

3571

3941

In general, we find that Coq provides the ideal grounds for formalising projects like ours. It has external libraries supporting the formalisation of syntax, enough automation to support the limited amounts we need and allows constructive reverse mathematics due to its axiomatic minimality.

In the remainder of the section, we elaborate on noteworthy design choices of the formalisation.

Formalisation of Binders. There are various competing techniques to formalise binders in proof assistants. In first-order logic, binders occur in quantification. The chosen technique especially affects the definition of deduction systems and can considerably ease or impede proofs of standard properties like weakening.

We opted for a de Bruijn representation of variables and binders with parallel substitutions. The Autosubst 2 tool [49] provides convenient automation for the definition of and proofs about this representation of syntax.

Notably, our representation then results in very straightforward proofs for weakening with only 5 lines. In contrast, using other representations for binders results in considerably more complicated weakening proofs, e.g. 150 lines in an approach using names [14] and 95 lines in an approach using traced syntax [23].

Also note that first-order logic has the simplest structure of binders possible: Since quantifiers range over terms, but terms do not contain binders, we do not need a prior notion of renaming, as usually standard in de Bruijn presentations of syntax. This observation results in more compact code (because usually, every statement on substitutions has to be proved for renamings first, with oftentimes the same proof) and was incorporated into Autosubst 2, which now does not generate renamings if they are not needed. Furthermore, we remark that the HOAS encoding of such simple binding structures results in a strictly positive inductive type and would thus be in principle definable in Coq.

Formalisation of Signatures. Our whole development is parametrised against a signature, defined as a typeclass in Coq:

figure m

We implement term and predicate application using the dependent vector type. While the vector type is known to cause issues in dependent programming, in this instance it was the best choice. Recursion on terms is accepted by Coq’s guardness checker, and while the generated induction principle (as is always the case for nested inductives) is too weak, a sufficient version can easily be implemented by hand:

figure n

Syntactic Fragments. There are essentially four ways to formalise the syntactic fragment . First, we could parametrise the type of formulas with tags, as done in [14] and second, we could use well-explored techniques for modular syntax [26, 9]. However, both of these approaches would not be compatible with the Autosubst tool. Additionally, modular syntax would force users of our developed library for first-order logic to work on the peculiar representation of syntax using containers or functors instead of regular inductive types.

The third option is to only define the type , and then define a predicate on this formulas characterising the fragment . This approach introduces many additional assumptions in almost all statements, decreasing their readability and yielding many simple but repetitive proof obligations. Furthermore, we would have to parameterise natural deduction over predicates as well, in order for the (IE) rule to not introduce terms e.g. containing \(\dot{\exists }\) when only deductions over should be considered.

To make the formalisation as clear and reusable as possible, we chose the fourth and most simple possible approach: We essentially duplicate the contents of Sect. 2 for both and , resulting in two independent developments on top of the two preliminary parts.

Parametrised Deduction Systems. When defining the minimal, intuitionistic, and classical versions of natural deduction, a similar issue arises. Here, we chose to use one single predicate definition, where the rules for explosion and Peirce can be enabled or disabled using tags, which are parameters of the predicate.

figure o

We can then define all considered variants of ND by fixing those parameters:

figure p

This definition allows us to give for instance a general weakening proof, which can then be instantiated to the different versions. Similarly, we can give a parametrised soundness proof, and depending on the parameters fix required properties on the models used in the definition of validity.

Object Tactics. At several parts of our developments we have to build concrete ND derivations. This can always be done by explicitly applying the constructors of the ND predicate, which however becomes tedious quickly. We thus developed object tactics reminiscent of the tactics available in Coq. The tactic ointros for instance applies the (II) rule, whereas the tactic oapply can apply hypotheses, i.e. combine the rules (IE) and (C). All object tactics are in the file FullND.v.

Extraction to \(\lambda \)-Calculus. The proof that completeness of provability w.r.t. standard Tarski and Kripke semantics is equivalent to \(\mathsf {MP}_\mathsf {L}\) crucially relies on an \(\mathsf {L}\)-enumeration of provable formulas. While giving a Coq enumeration is easy using techniques described in [14], the translation of any function to a model of computation is considered notoriously hard. We use the framework by Forster and Kunze [16] which allows the automated translation of Coq functions to \(\mathsf {L}\).

Using the framework was mostly easy and spared us considerable formalisation effort. However, the framework covers only simple types, whereas our representation of both terms and formulas contains the dependent vector type. We circumvent this problem by defining a non-dependent term type term’ and a predicate wf characterising exactly the terms in correspondence with our original type of terms.

figure q

We then define a formula type form’ based on term’ and a suitable deduction system. One can give a bijection between well-formed non-dependent terms term’ and dependent terms term and prove the equivalence of the corresponding deduction systems under this bijection.

Functions working on term’ and form’ were easily extracted to \(\mathsf {L}\) using the framework, yielding an \(\mathsf {L}\)-enumerability proof for ND essentially with no manual formalisation effort.

Library of Formalised Undecidable Problems in Coq. We take the formalisation of synthetic undecidability from [14], which is part of the Coq library of formalised undecidable problems [12]. The reduction from \(\mathsf {L}\)-halting to provability is factored via Turing machines, Minsky machines, binary stack machines and the Post correspondence problem (PCP), all part of the library as well.

Equations Package. Defining non-structurally recursive functions is sometimes considered hard in Coq and other proof assistants based on dependent type theory. One such example is the function \([\![ \_ ]\!]\) used to embed formulas into Heyting algebras (Definition 45). We use the Equations package [48] to define this function by recursion on the size of the formula, ignoring terms. The definition then becomes entirely straightforward and the provided simp tactic, while sometimes a bit premature, enables compact proofs.

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Forster, Y., Kirst, D., Wehr, D. (2020). Completeness Theorems for First-Order Logic Analysed in Constructive Type Theory. In: Artemov, S., Nerode, A. (eds) Logical Foundations of Computer Science. LFCS 2020. Lecture Notes in Computer Science(), vol 11972. Springer, Cham. https://doi.org/10.1007/978-3-030-36755-8_4

Download citation

Publish with us

Policies and ethics