Universal Algebra in Unimath

Universal Algebra in Unimath

Universal Algebra in UniMath Gianluca Amato ! Ï Università di Chieti–Pescara, Italy Marco Maggesi ! Ï Università di Firenze, Italy Cosimo Perini Brogi ! Ï Università di Genova, Italy Abstract We present recent updates in our development of a library for Universal Algebra in the UniMath proof assistant. The code here discussed concerns multi-sorted signatures and their algebras, along with the basics for equation systems. Moreover, we give neat constructions of the corresponding univalent categories by using the formalism of displayed categories, and show that the term algebra over a signature is the initial object of the category. Besides the formalization, we reflect on the methodological principles – based on the ideaof evaluability of our elementary construction by the built-in normalization procedure of the system – leading our coding style, and show that this path is practicable indeed by sketching simple examples. 2012 ACM Subject Classification Theory of computation → Algebraic language theory; Theory of computation → Type theory; Theory of computation → Automated reasoning; Theory of computation → Constructive mathematics Keywords and phrases Universal Algebra, Homotopy Type Theory, Univalent Foundations, UniMath Supplementary Material Computer formalization in the UniMath system. Version 2021-02-02 : https://github.com/amato-gianluca/UniMath/releases/tag/ITP2021 Funding The authors thank the European research network on types for programming and verific- ation (COST Action EUTypes CA15123) for supporting the School and Workshop on Univalent Mathematics 2019 where this project had its origin. Gianluca Amato: Partially supported by INdAM-GNCS and COST Action EUTypes CA15123. Marco Maggesi: Partially supported by the Italian Ministry of University and Research, INdAM- GNSAGA, and COST Action EUTypes CA15123. Introduction In this paper we report on our ongoing implementation of Universal Algebra within the formal environment of UniMath [15]. Our leading motivation has been to provide a general framework for formalizing and studying algebraic structures as presented in the field of Universal Algebra within a proof assistant. By providing a formal system for isolating the invariants of the theory we are arXiv:2102.05952v1 [cs.LO] 11 Feb 2021 interested in, Univalent Mathematics has seemed to provide a suitable environment to carry out our endeavour since the very beginning. In particular, since it is natural to study mathematical structures up to isomorphisms, Univalent Mathematics seems to be especially suited for this kind of task. We chose to work within the UniMath environment since it provides a minimalist implementation of univalent type theory, and, at the same time, it comes with a large repository of mechanized results covering several fields of mathematics, so that it opens a wide range of possibilities for future development of our formalization. By the code we survey on in the present paper, we have introduced the main notions concerning multi-sorted signatures. Developing them in a formal environment has required 2 Universal Algebra in UniMath some expedients in the definitions of the basics, and, accordingly, of some subsequent constructions too. In particular, we had to introduce heterogeneous vectors and generalise types involving signatures by introducing (what we called) “sorted sets”. Having signatures, we then have given the related formalization of the category of algebras using the notion of a displayed category [6] over the category of sorted hSets, whose univalence is proven by adapting the strategy used for the univalence of functor categories. The resulting construction is still a modular one and the resulting proof-term is more concise, for sure, than the one obtained by checking that algebras and homomorphisms satisfy the axioms for standard categories. Defining terms is made complex by the fact that, by precise choice, UniMath doesnot make use of the theory of (Co)Inductive Constructions. Therefore, we encode terms as lists of operation symbols, to be thought of as instructions for a stack-based machine. Terms are those lists of symbols that may be virtually executed without generating type errors or stack underflows. Moreover, we prove that the term algebra over a signature is the initial object in the corresponding category, and that, more generally, an algebra of terms over a signature and a set of variables has the desired universal mapping property. Our formalization also includes the notion of equations and of algebras modelling an equation system associated with a signature; as for the category of algebras, we use the displayed category formalism to construct the univalent category of equational algebras over a given signature σ as the full subcategory of algebras over σ satisfying an equation system. A preliminary version of this work – with single-sorted signatures – has been presented at the Workshop on Homotopy Type Theory and Univalent Mathematics 2020 [9]. Outline In the main body of the present work, we will discuss all the notions we introduced in our implementation, so that the paper is structured as a presentation of the code, followed by the discussion of some examples, a quick anticipation of future work and a brief comparison with different formalizations of similar topics as coda. In details, we can summarise it as follows: In § 1, we give a general account of the methodology and the principles which guide our work; In § 2.1, we introduce the very basics of universal algebra along with some auxiliary definitions involving the new types we need to handle multi-sorted signatures, their algebras, and homomorphisms; In § 2.2, we present the main details of our implementation of terms, prove that term algebras and free algebras do have the required universal property – stated as the contractibility of the type of out-going homomorphisms – and discuss the practical and methodological relevance of our induction principle on terms; In § 2.3, we introduce systems of equations and equational algebras over a signature; In § 2.4, we sketch the main lines of our constructions of the categories of algebras and equational algebras over a signature in terms of displayed categories over a base category of indexed hSets whose univalence is proven by a proof-strategy very close to that one adopted for functor categories; Finally, § 3 is devoted to three applications of our implementation, namely: lists (§ 3.1), monoids (§ 3.2), and Tarski’s semantics of propositional boolean formulas (§ 3.3). G. Amato and M. Maggesi and C. Perini Brogi 3 1 Goals and methodology What we have mechanized is not, clearly, a mathematical novelty, but our endeavour has some payoffs. Firstly, the code introduces in the UniMath library a minimal set of definitions and results that is open to the community of developers for future achievements and formal investigations on the relation between pre-categorical research in general algebraic structures and its subsequent development in e.g. Lawvere theories [1]. Secondly, a peculiar feature of our code is the original implementation of term algebras over a signature, which fits within the original approach to mechanization of univalent mathematics, but highlights the computational relevance of the constructions avoiding the restrictions imposed on the Coq engine in UniMath. As a matter of fact, terms for a signature constitute a family inductively defined over the operation symbols together with an additional set of variables. As it is known, how- ever, UniMath makes use of just some features of the Coq proof assistant. To be precise, both record and inductive types are avoided in order to keep the system sound from a foundational/philosophical viewpoint. On the other hand, one of our main goals has been to make all our constructions about terms evaluable – as far as possible – by the built-in automation mechanisms of the proof assistant. More precisely, we represent each term using a sequence of function symbols. This sequence is thought to be executed by a stack machine: each symbol of arity n pops n elements from the stack and pushes a new element at the top. A term is denoted by a sequence of function symbols that a stack-like machine can execute without type errors and stack underflow, returning a stack with a single element. This approach led us to prove both a recursion and induction principle on terms that is evaluable as a functional term of the formal system. This is somehow mandatory when sticking to a form of (small scale) reflection: with our formalized stack-machine we have written in UniMath an implicit algorithm to compute terms over a signature; by means of our induction principle we can run it – so to speak – within the very formal system of UniMath, and use it to reason about terms in a safe way. Moreover, our methodology sympathizes (in a sense) with what Barendregt called Poincaré principle: our implementation of terms allows us to rely on the very core engine of UniMath when dealing with these formal objects, so that whenever we want to handle them we can focus on the real demonstrative contents of the formalization, leaving to the automation behind the computer proof assistant the trivial computational steps involved in the very proof-term. Generally speaking, we find standard categorical presentations, though perspicaciously elegant in their abstractness, lacking a certain suitability for computerized mathematics. By contrast, our goal is justified by a specific need of methodological coherence – wejust sketched it few line above – when approaching

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    18 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us