Moessner’s Theorem: An Exercise in Coinductive Reasoning in Coq

Part of the Lecture Notes in Computer Science book series (LNCS, volume 9660)


Moessner’s Theorem describes a construction of the sequence of powers \((1^n, 2^n, 3^n, \ldots )\), by repeatedly dropping and summing elements from the sequence of positive natural numbers. The theorem was presented by Moessner in 1951 without a proof and later proved and generalized in several directions. More recently, a coinductive proof of the original theorem was given by Niqui and Rutten. We present a formalization of their proof in the Coq proof assistant. This formalization serves as a non-trivial illustration of the use of coinduction in Coq. During the formalization, we discovered that Long and Salié’s generalizations could also be proved using (almost) the same bisimulation.





The authors thank Dexter Kozen, Jan Rutten, Olivier Danvy, and the anonymous referees for useful comments and discussions. The last author learned from Frank many years ago that a good steak, a glass of excellent wine, and fantastic company can make the hardest of days seem distant and irrelevant in the grand scheme of things! Frank, we wish you the very best for the years to come!


  1. 1.
    Bertot, Y., Castéran, P.: Interactive theorem proving and program development. Coq’Art: the calculus of inductive constructions. In: Texts in TCS. Springer, Heidelberg (2004)Google Scholar
  2. 2.
    Bickford, M., Kozen, D., Silva, A.: Formalizing Moessner’s theorem and generalizations in Nuprl (2013).
  3. 3.
    Clausen, C., Danvy, O., Masuko, M.: A characterization of Moessner’s sieve. Theor. Computut. Sci. 546, 244–256 (2014)MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Conway, J.H., Guy, R.K.: Moessner’s magic. In: The Book of Numbers, pp. 63–65. Springer, New York (1996)Google Scholar
  5. 5.
    Coq Development Team: The Coq proof assistant reference manual. INRIA (2013)Google Scholar
  6. 6.
    Giménez, C.E.: Un Calcul de Constructions Infinies et son Application à la vérification de systèmes communicants. Ph.D. thesis, L’École Normale Supérieure de Lyon (1996)Google Scholar
  7. 7.
    Hinze, R.: Scans and convolutions— a calculational proof of Moessner’s theorem. In: Scholz, S.-B., Chitil, O. (eds.) IFL 2008. LNCS, vol. 5836, pp. 1–24. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  8. 8.
    Honsberger, R.: More mathematical morsels. Dolciani Mathematical Expositions. Mathematical Association of America (1991)Google Scholar
  9. 9.
    Kozen, D., Silva, A.: On Moessner’s theorem. Am. Math. Monthly 120(2), 131–139 (2013)MathSciNetCrossRefMATHGoogle Scholar
  10. 10.
    Long, C.T.: On the Moessner theorem on integral powers. Am. Math. Monthly 73(8), 846–851 (1966)MathSciNetCrossRefMATHGoogle Scholar
  11. 11.
    Long, C.T.: Strike it out-add it up. The Math. Gaz. 66(438), 273–277 (1982)CrossRefGoogle Scholar
  12. 12.
    Moessner, A.: Eine Bemerkung über die Potenzen der natürlichen Zahlen. Sitzungsberichte der Bayerischen Akademie der Wissenschaften, Mathematischnaturwissenschaftliche Klasse 1952, no. 29 (1951)Google Scholar
  13. 13.
    Niqui, M., Rutten, J.J.M.M.: A proof of Moessner’s theorem by coinduction. High.-Ord. Symb. Comput. 24(3), 191–206 (2011)MathSciNetCrossRefMATHGoogle Scholar
  14. 14.
    Paasche, I.: Ein neuer Beweis des moessnerischen Satzes. Sitzungsberichte der Bayerischen Akademie der Wissenschaften, Mathematischnaturwissenschaftliche Klasse 1952 1, 1–5 (1953)MATHGoogle Scholar
  15. 15.
    Paasche, I.: Ein zahlentheoretische-logarithmischer Rechenstab. Math. Naturwiss. Unterr. 6, 26–28 (1953,1954)Google Scholar
  16. 16.
    Paasche, I.: Eine Verallgemeinerung des moessnerschen Satzes. Compositio Mathematica 12, 263–270 (1954)MathSciNetMATHGoogle Scholar
  17. 17.
    Perron, O.: Beweis des Moessnerschen Satzes. Sitzungsberichten der Bayerischen Akademie der Wissenschaften, Mathematisch-naturwissenschaftliche Klasse 1951 4, 31–34 (1951)MathSciNetMATHGoogle Scholar
  18. 18.
    Rutten, J.: A coinductive calculus of streams. Math. Struct. Comput. Sci. 15, 93–147 (2005)MathSciNetCrossRefMATHGoogle Scholar
  19. 19.
    Rutten, J.: Universal coalgebra: a theory of systems. Theor. Comput. Sci. 249(1), 3–80 (2000)MathSciNetCrossRefMATHGoogle Scholar
  20. 20.
    Salié, H.: Bemerkung zu einem Satz von Moessner. Sitzungsberichten der Bayerischen Akademie der Wissenschaften, Mathematisch-naturwissenschaftliche Klasse 1952 2, 7–11 (1952)MathSciNetMATHGoogle Scholar
  21. 21.
    Sozeau, M.: A new look at generalized rewriting in type theory. J. Form. Reason. 2(1), 41–62 (2009)MathSciNetMATHGoogle Scholar
  22. 22.
    Sozeau, M., Oury, N.: First-class type classes. In: Mohamed, O.A., Muñoz, C., Tahar, S. (eds.) TPHOLs 2008. LNCS, vol. 5170, pp. 278–293. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  23. 23.
    Urbak, P.: A formal study of Moessner’s sieve, M.Sc. thesis, Aarhus University (2015)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  • Robbert Krebbers
    • 1
  • Louis Parlant
    • 2
  • Alexandra Silva
    • 3
  1. 1.Aarhus UniversityAarhusDenmark
  2. 2.École Normale Supérieure de LyonLyonFrance
  3. 3.University College LondonLondonUK

Personalised recommendations