Abstract
Reversible Primitive Permutations (RPP) are recursively defined functions designed to model Reversible Computation. We illustrate a proof, fully developed with the proof-assistant Lean, certifying that: “RPP can encode every Primitive Recursive Function”. Our reworking of the original proof of that statement is conceptually simpler, fixes some bugs, suggests a new more primitive reversible iteration scheme for RPP, and, in order to keep formalization and semi-automatic proofs simple, led us to identify a single pattern that can generate some useful reversible algorithms in RPP: Cantor Pairing, Quotient/Reminder of integer division, truncated Square Root. Our Lean source code is available for experiments on Reversible Computation whose properties can be certified.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Asperti, A., Coen, C.S., Tassi, E., Zacchiroli, S.: User interaction with the matita proof assistant. J. Autom. Reasoning 39, 109–139 (2007)
Cantor, G.: Ein beitrag zur mannigfaltigkeitslehre. J. für die reine und angewandte Mathematik 1878(84), 242–258 (1878)
Carneiro, M.: Computability.primrec. https://leanprover-community.github.io/mathlib_docs/computability/primrec.html
Carneiro, M.: Formalizing computability theory via partial recursive functions. In: 10th International Conference on Interactive Theorem Proving, ITP 2019, 9–12 September 2019, Portland, OR, USA, pp. 12:1–12:17 (2019)
de Moura, L., Kong, S., Avigad, J., van Doorn, F., von Raumer, J.: The lean theorem prover (system description). In: Felty, A.P., Middeldorp, A. (eds.) CADE 2015. LNCS (LNAI), vol. 9195, pp. 378–388. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21401-6_26
De Vos, A.: Reversible Computing - Fundamentals, Quantum Computing, and Applications. Wiley, Hoboken (2010)
Jacopini, G., Mentrasti, P.: Generation of invertible functions. Theor. Comput. Sci. 66(3), 289–297 (1989)
Maletto, G.: A Formal Verification of Reversible Primitive Permutations. BSc Thesis, Dipartimento di Matematica - Torino, October 2021. https://github.com/GiacomoMaletto/RPP/tree/main/Tesi
Maletto, G.: RPP in LEAN. https://github.com/GiacomoMaletto/RPP/tree/main/Lean
Matos, A., Paolini, L., Roversi, L.: The fixed point problem of a simple reversible language. TCS 813, 143–154 (2020)
Matos, A.B.: Linear programs in a simple reversible language. Theor. Comput. Sci. 290(3), 2063–2074 (2003)
Matos, A.B., Paolini, L., Roversi, L.: On the expressivity of total reversible programming languages. In: Lanese, I., Rawski, M. (eds.) RC 2020. LNCS, vol. 12227, pp. 128–143. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-52482-1_7
K. Morita. Theory of Reversible Computing. Monographs in Theoretical Computer Science. An EATCS Series. Springer, Japan (2017). https://doi.org/10.1007/978-4-431-56606-9
Moura, L., Ullrich, S.: The lean 4 theorem prover and programming language. In: Platzer, A., Sutcliffe, G. (eds.) CADE 2021. LNCS (LNAI), vol. 12699, pp. 625–635. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-79876-5_37
Paolini, L., Piccolo, M., Roversi, L.: A certified study of a reversible programming language. In: Uustalu, T. (ed.) TYPES 2015 postproceedings, volume 69 of LIPIcs. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, Germany (2017)
Paolini, L., Piccolo, M., Roversi, L.: On a class of reversible primitive recursive functions and its turing-complete extensions. New Gen. Comput. 36(3), 233–256 (2018)
Paolini, L., Piccolo, M., Roversi, L.: A class of recursive permutations which is primitive recursive complete. Theor. Comput. Sci. 813, 218–233 (2020)
Perumalla, K.S.: Introduction to Reversible Computing. Chapman & Hall/CRC Computational Science. Taylor & Francis, New York (2013)
Rogers, H.: Theory of Recursive Functions and Effective Computability. McGraw-Hill Series in Higher Mathematics. McGraw-Hill, New York (1967)
Szudzik, M.P.: The Rosenberg-Strong Pairing Function. CoRR, abs/1706.04129, 2017
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2022 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Maletto, G., Roversi, L. (2022). Certifying Algorithms and Relevant Properties of Reversible Primitive Permutations with Lean. In: Mezzina, C.A., Podlaski, K. (eds) Reversible Computation. RC 2022. Lecture Notes in Computer Science, vol 13354. Springer, Cham. https://doi.org/10.1007/978-3-031-09005-9_8
Download citation
DOI: https://doi.org/10.1007/978-3-031-09005-9_8
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-09004-2
Online ISBN: 978-3-031-09005-9
eBook Packages: Computer ScienceComputer Science (R0)