Typing Total Recursive Functions in Coq

  • Dominique Larchey-WendlingEmail author
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10499)


We present a (relatively) short mechanized proof that Coq types any recursive function which is provably total in Coq. The well-founded (and terminating) induction scheme, which is the foundation of Coq recursion, is maximal. We implement an unbounded minimization scheme for decidable predicates. It can also be used to reify a whole category of undecidable predicates. This development is purely constructive and requires no axiom. Hence it can be integrated into any project that might assume additional axioms.


  1. 1.
    Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development - Coq’Art: The Calculus of Inductive Constructions. Texts in Theoretical Computer Science. An EATCS Series. Springer, Heidelberg (2004)CrossRefzbMATHGoogle Scholar
  2. 2.
    Bove, A., Capretta, V.: Modelling general recursion in type theory. Math. Struct. Comput. Sci. 15(4), 671–708 (2005)MathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Castéran, P.: Utilisation en Coq de l’opérateur de description (2007).
  4. 4.
    Coen, C.S., Valentini, S.: General recursion and formal topology. In: Partiality and Recursion in Interactive Theorem Provers, PAR@ITP 2010, EPiC Series, Edinburgh, UK, 15 July 2010, vol. 5, pp. 71–82. EasyChair (2010)Google Scholar
  5. 5.
    Girard, J.Y., Taylor, P., Lafont, Y.: Proofs and Types. Cambridge University Press, New York (1989)zbMATHGoogle Scholar
  6. 6.
    Krivine, J.: Lambda-Calculus, Types and Models. Ellis Horwood Series in Computers and Their Applications. Ellis Horwood, Masson (1993)zbMATHGoogle Scholar
  7. 7.
    Larchey-Wendling, D.: A constructive mechanization of Lambda Calculus in Coq (2017).
  8. 8.
    Norrish, M.: Mechanised computability theory. In: Eekelen, M., Geuvers, H., Schmaltz, J., Wiedijk, F. (eds.) ITP 2011. LNCS, vol. 6898, pp. 297–311. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-22863-6_22 CrossRefGoogle Scholar
  9. 9.
    Soare, R.I.: Recursively Enumerable Sets and Degrees. Springer-Verlag New York Inc., New York (1987)CrossRefzbMATHGoogle Scholar
  10. 10.
    Werner, B.: Sets in types, types in sets. In: Abadi, M., Ito, T. (eds.) TACS 1997. LNCS, vol. 1281, pp. 530–546. Springer, Heidelberg (1997). doi: 10.1007/BFb0014566 CrossRefGoogle Scholar
  11. 11.
    Xu, J., Zhang, X., Urban, C.: Mechanising turing machines and computability theory in Isabelle/HOL. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) ITP 2013. LNCS, vol. 7998, pp. 147–162. Springer, Heidelberg (2013). doi: 10.1007/978-3-642-39634-2_13 CrossRefGoogle Scholar
  12. 12.
    Zammit, V.: A mechanisation of computability theory in HOL. In: Goos, G., Hartmanis, J., Leeuwen, J., Wright, J., Grundy, J., Harrison, J. (eds.) TPHOLs 1996. LNCS, vol. 1125, pp. 431–446. Springer, Heidelberg (1996). doi: 10.1007/BFb0105420 CrossRefGoogle Scholar
  13. 13.
    Zammit, V.: A proof of the S-m-n theorem in Coq. Technical report, The Computing Laboratory, The University of Kent, Canterbury, Kent, UK, March 1997.

Copyright information

© Springer International Publishing AG 2017

Authors and Affiliations

  1. 1.LORIA – CNRSNancyFrance

Personalised recommendations