Abstract
Locales, the module system of the theorem prover Isabelle, were designed so that developments in abstract algebra could be represented faithfully and concisely. Whether these goals were met is assessed through a case study. Parts of an algebra textbook, Jacobson’s Basic Algebra, that are challenging structurally were formalised. Key parts of the formalisation are presented in greater detail. An analysis of the work from both qualitative and quantitative perspectives substantiates that the design goals were met. In particular, the size ratio of formal to “pen and paper” text does not increase when going further into the book. The analysis also yields guidance on locales including patterns of use, which are identified and described.
Similar content being viewed by others
Notes
Counted were the entries containing locale declarations—more precisely, where at least one theory file contained a line matching the regular expression .
Readers wishing to reproduce the examples in Isabelle should use bold, not regular, “1” (input token ).
In locale expressions outside locale declarations, the for clause retains its usual semantics as a binder.
Jacobson requires S to be non-vacuous, but this was not required in the formalisation.
Isabelle requires escaping the single quote character in syntax declarations; “ ” yields “ ”.
\(K_R(G)\) denotes the group of right translations \(k_R : G \rightarrow G\) for \(k \in K\). Jacobson leaves right translations as an exercise, which had to be formalised as well. For the corresponding work on left translations, see Sect. 3.5 above.
In reproducing Gunter’s definition I have changed \((G, {\textit{prod}} \ )\) to \(\mathcal {G}\). Her original definition \( inv \, (G, {\textit{prod}} \ ) \, x \equiv \varepsilon y. \, y \in G \wedge ({\textit{prod}} \ \, y \, x = id \, (G, {\textit{prod}} \ ))\) does not involve the projections \({ fst } \ \) and \({\textit{snd}} \ \), but many others of her definitions do. Further, since defined operations are well-defined on the carrier set definite choice is sufficient for making definitions. There is no need for the axiom of choice.
Proofs are preserved in Isabelle’s source code repository: https://isabelle.in.tum.de/repos/isabelle/file/7e6cdcd113a2/src/HOL/GroupTheory/.
Wiedijk [26] supposes that the mathematical text is available in computer-readable form and suggests the factor be computed by comparing sizes of compressed files of the formalisation and its mathematical source. I have chosen to simply compare numbers of lines as is common practice when measuring code size in computer science.
This paragraph reproduces my response to a post in the Isabelle Users mailing list: https://lists.cam.ac.uk/pipermail/cl-isabelle-users/2019-September/msg00074.html.
References
Aransay, J., Ballarin, C., Rubio, J.: A mechanized proof of the basic perturbation lemma. J. Autom. Reason. 40(4), 271–292 (2008)
Bailey, A.: The Machine-Checked Literate Formalisation of Algebra in Type Theory. Ph.D. Thesis, University of Manchester (1998)
Ballarin, C.: Locales and locale expressions in Isabelle/Isar. In: Berardi, S., Coppo, M., Damiani, F. (eds.) Types for Proofs and Programs, TYPES 2003, Torino, Italy, LNCS 3085, pp. 34–50. Springer, Berlin (2004)
Ballarin, C.: Tutorial to locales and locale interpretation. In: Lambán, L., Romero, A., Rubio, J. (eds.) Contribuciones Científicas en honor de Mirian Andrés Gómez. Servicio de Publicaciones de la Universidad de La Rioja, Logroño, Spain, Also part of the Isabelle user documentation (2010)
Ballarin, C.: Reading an algebra textbook. In: Lange C. et al. (eds.) CEUR Workshop Proceedings 1010. Intelligent Computer Mathematics, Bath (2013)
Ballarin, C.: Locales: a module system for mathematical theories. J. Autom. Reason. 52(2), 123–153 (2014)
Ballarin, C.: A case study in basic algebra. Archive of Formal Proofs https://isa-afp.org/entries/Jacobson_Basic_Algebra.html (2019)
Ballarin, C. et al.: The Isabelle/HOL algebra library. Part of the Isabelle distribution, https://isabelle.in.tum.de/library/HOL/HOL-Algebra/
Chan, H.-L., Norrish, M.: Mechanisation of AKS algorithm: Part 1–the main theorem. In: Urban, C., Zhang, X. (eds.) Interactive Theorem Proving, ITP 2015, Nanjing, China, LNCS 9236, pp. 117–136. Springer, Berlin (2015)
Farmer, W.M.: Theory interpretation in simple type theory. In: Heering, J., Mainke, K., Möller, B., Nipkow, T. (eds.) Higher-Order Algebra, Logic, and Term Rewriting, HOA ’93, Amsterdam, The Netherlands, LNCS 816, pp. 96–123. Springer, Berlin (1994)
Goguen, J.A., Burstall, R.M.: Institutions: abstract model theory for specification and programming. J. ACM 39(1), 95–146 (1992)
Gunter, E.L.: Doing Algebra in Simple Type Theory. Technical Report MS-CIS-89-38, University of Pennsylvania (1989)
Haftmann, F., Wenzel, M.: Constructive type classes in Isabelle. In: Altenkirch, T., McBride, C. (eds.) Types for proofs and programs, TYPES 2006, Nottingham, UK, LNCS 4502, pp. 160–174. Springer, Berlin (2007)
Haftmann, F., Wenzel, M., (2009) Local theory specifications in Isabelle, Isar. In: Berardi S., Damiani F., de’Liguoro U. (eds) Types for Proofs and Programs, TYPES, Torino, Italy, LNCS 5497, pp. 153–168. Springer, Berlin (2008)
Harper, R., Pierce, B.C.: Design considerations for ML-style module systems. In: Pierce, B.C. (ed.) Advanced Topics in Types and Programming Languages. MIT Press, Cambridge (2005)
Jacobson, N.: Basic Algebra, vol. I, 2nd edn. Freeman, Dallas (1985)
Kammüller, F.: Modular Reasoning in Isabelle. Ph.D. Thesis, University of Cambridge, Computer Laboratory, Also Technical Report No. 470 (1999)
Kammüller, F., Wenzel, M., Paulson, L.C.: Locales: a sectioning concept for Isabelle. In: Bertot, Y., Dowek, G., Hirschowitz, A., Paulin, C., Théry, L. (eds.) Theorem Proving in Higher Order Logics: TPHOLs’99, Nice, France, LNCS 1690, pp. 149–165. Springer, Berlin (1999)
Mahboubi, A., Tassi, E.: Canonical structures for the working Coq user. In: Blazy, S., Paulin-Mohring, C., Pichardie, D. (eds.) Interactive Theorem Proving, ITP 2013, Rennes, France, LNCS 7998, pp. 19–34. Springer, Berlin (2013)
Naraschewski, W., Wenzel, M.: Object-oriented verification based on record subtyping in higher-order logic. In: Theorem Proving in Higher Order Logics, LNCS 1479. Springer, pp 349–366 (1998)
Paulson, L.C.: Defining functions on equivalence classes. ACM Transactions on Computational Logic 7(4), 658–675 (2006)
Soubiran, E.: Modular Development of Theories and Name-Space Management for the Coq Proof Assistant. Ph.D. Thesis, École Polytechnique (2012)
van Benthem Jutting, L.S.: Checking Landau’s “Grundlagen” in the Automath System. Ph.D Thesis, Technische Hogeschool Eindhoven (1977)
von Raumer, J.: Secondary Sylow Theorems. Archive of Formal Proofs, https://isa-afp.org/entries/Secondary_Sylow.html, (2014)
Wenzel, M.: Isabelle/Isar–a generic framework for human-readable proof documents. Stud. Log. Gramm. Rhetor. 10(23), 277–298 (2007). (Festschrift in Honour of Andrzej Trybulec)
Wiedijk, F.: The de Bruijn factor. https://www.cs.ru.nl/~freek/factor/factor.pdf (2000)
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
About this article
Cite this article
Ballarin, C. Exploring the Structure of an Algebra Text with Locales. J Autom Reasoning 64, 1093–1121 (2020). https://doi.org/10.1007/s10817-019-09537-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10817-019-09537-9