
Isomorphism is equality Thierry Coquand∗, Nils Anders Danielsson∗ University of Gothenburg and Chalmers University of Technology Abstract The setting of this work is dependent type theory extended with the univa- lence axiom. We prove that, for a large class of algebraic structures, isomorphic instances of a structure are equal|in fact, isomorphism is in bijective correspon- dence with equality. The class of structures includes monoids whose underlying types are \sets", and also posets where the underlying types are sets and the ordering relations are pointwise \propositional". For monoids on sets equality coincides with the usual notion of isomorphism from universal algebra, and for posets of the kind mentioned above equality coincides with order isomorphism. Keywords: Dependent type theory; Proof assistants; Univalence 1. Introduction De Bruijn argued that it is more natural for mathematicians to work with a typed language than with the untyped universe of set theory (1975). In this paper we explore a possible mathematical advantage of working in a type the- ory|inspired by the ones designed by de Bruijn and his coworkers1 (de Bruijn 1980)|over working in set theory. Consider the following two monoids: (N; λmn. m + n; 0) and (N n f 0 g; λmn. m + n − 1; 1): These monoids are isomorphic, as witnessed by the isomorphism λn. n + 1. However, in set theory they are not equal: there are properties that are satisfied by only one of them. For instance, only the first one satisfies the property that the carrier set contains the element 0. In (a certain) type theory extended with the univalence axiom (see Section 2) the situation is different. This is the focus of the present paper: • We prove that monoids M1 and M2 that are isomorphic, i.e. for which there is a homomorphic bijection f : M1 ! M2, are equal (see Section 3.5). ∗Corresponding author. Email addresses: [email protected] (Thierry Coquand), [email protected] (Nils Anders Danielsson) 1The AUTOMATH project team included van Benthem Jutting, van Daalen, Kornaat, Nederpelt, de Vrijer, Zandleven, Zucker, and others (Nederpelt and Geuvers 1994). Notice: This is the authors' version of a work that was accepted for publication in Indagationes Mathematicae. Changes resulting from the publishing process, such as peer review, editing, cor- rections, structural formatting, and other quality control mechanisms may not be reflected in this document. Changes may have been made to this work since it was submitted for publication. A definitive version was subsequently published in Indagationes Mathematicae 24(4):1105{1120, 2013, doi:10.1016/ j.indag.2013.09.002 . In fact, we show that isomorphism is in bijective correspondence with equality. Note that the equality that we use is substitutive. This means that, unlike in set theory, any property that holds for the first monoid above also holds for the second one. (The result is restricted to monoids whose carrier types are \sets". This term is defined in Section 2.5. Many types, including the natural numbers, are sets.) • The result about monoids follows directly from a more general theorem (see Section 3.3), which applies to a large class of algebraic structures, including posets and discrete fields (defined as in Section 3.5). All the main results in the paper have been formalised using the proof assis- tant Agda2 (Norell 2007; The Agda Team 2013), which is based on Martin-L¨of type theory (Martin-L¨of1975; Nordstr¨omet al. 1990). Unlike in regular Martin- L¨oftype theory we use a \non-computing" J rule (i.e. the computation rule for J only holds propositionally, not definitionally); this choice, which makes the result more generally applicable, is motivated in Section 2.3. We believe that our arguments carry over to other variants of type theory, but do not make any formal claims in this direction. Note that our theorem is proved inside the type theory, using the univalence axiom. In the absence of this axiom we can still observe, meta-theoretically, that we cannot prove any statement that distinguishes the two monoids above (given the consistency of the axiom). A related observation was made already in the 1930s by Lindenbaum and Tarski (1983, see also Tarski (1986)): in a certain variant of type theory every sentential function is invariant under bijections. The formulation of \isomorphism is equality" that is used in this paper is not intended to be as general as possible; we try to strike a good balance between generality and ease of understanding. Other variations of this result have been developed concurrently by Aczel (The Univalent Foundations Program 2013) and Ahrens et al. (2013). See Section 4 for further discussion of related work. 2. Preliminaries This section introduces some concepts, terminology and results used below. We assume some familiarity with type theory. The presentation in this and subsequent sections is close to the Agda formal- isation, but differs in minor details. In particular, we do not always use proper Agda syntax. 2.1. Hierarchy of types We assume that we have an infinite hierarchy of \types of types" Type0 : Type1 : Type2 : ::: (and use the synonym Type = Type0). Below we define some concepts using certain types Typei and Typej. These definitions are ap- plicable to arbitrary \universe levels" i and j . 2Using the --without-K flag; the code has been made available to download. 2 In Agda a member of Typei is not automatically a member of Typej for i < j , but one can manually lift types from one level to another. In this paper we omit such liftings. 2.2. Quantifiers If we have A : Typei and B : A ! Typej, then we can introduce the Π- type, or dependent function type, (x : A) ! B x (this type is sometimes writ- ten 8 x: B x). If we have f :(x : A) ! B x and t : A, then the application f t has type B t. Simple (non-dependent) function types are written A ! B. In order to reduce clutter we sometimes use \implicit" function types. The notations fx : Ag ! B x and 8 fxg: B x mean the same as (x : A) ! B x and 8 x: B x, respectively, except that the function's argument is not given explicitly: we write f rather than f t, with the hope that readers can infer t from the context. Sometimes we combine several quantifiers into one: (x y : A) ! B x y means the same as (x : A) ! (y : A) ! B x y, and 8 x fy zg: B x y z means the same as 8 x: 8 fyg: 8 fzg: B x y z. Σ-types, or dependent pairs, are written Σ x : A: B x (or Σ x: B x). If we have t : A and u : B t, then (t; u) has type Σ x : A: B x. Σ-types come with two projection functions. The first projection is written proj1 and the sec- ond proj2. Cartesian products (non-dependent pairs) are defined as A × B = Σ : A: B. We make use of η-equality for both Π-types and Σ-types: the function f :(x : A) ! B x is definitionally equal to λ x: f x (where x is not free in f ), and the pair p : Σ x : A: B x is definitionally equal to (proj1 p; proj2 p). (Def- initional equality is discussed below.) We suspect that the use of definitional η-equality is not essential, but have used it in our Agda formalisation. 2.3. Equality Following de Bruijn (1975) we distinguish between definitional (or judge- mental) and propositional (or book) equality. Definitional equality (βη-equality plus unfolding of user-made definitions) is inferred automatically by the type checker, and comes with no term formers. If we have t : A, and A is defi- nitionally equal to B, then we have t : B as well: definitional equalities are \invoked automatically". Propositional equality, on the other hand, is a type with corresponding term formers. The propositional equality type, containing proofs of equality between x and y, is written x ≡ y. Here x and y must have the same type A, and if we have A : Typei, then we also have x ≡ y : Typei. There is one introduction rule for equalities—reflexivity: refl : fA : Typeig ! (x : A) ! x ≡ x The equality eliminator is traditionally called J : J : fA : Typeig ! (P :(x y : A) ! x ≡ y ! Typej) ! (8 x: P x x (refl x)) ! 8 fx yg: (eq : x ≡ y) ! P x y eq 3 Typically J and refl come together with a \computation rule", a definitional equality stating how applications of the form J P r (refl x) compute (Martin- L¨of1975). We include such a rule, but stated as a propositional equality: J-refl : fA : Typeig ! (P :(x y : A) ! x ≡ y ! Typej) ! (r : 8 x: P x x (refl x)) ! 8 x: J P r (refl x) ≡ r x The reason for using a propositional computation rule is the ongoing quest to find a computational interpretation of the univalence axiom (described in Section 2.5): perhaps we will end up with a computational interpretation in which J-refl does not hold definitionally. As mentioned in the introduction the propositional equality type is substi- tutive. This follows directly from the J rule: subst : fA : Typeig ! (P : A ! Typej) ! fx y : Ag ! x ≡ y ! P x ! P y subst P = J (λ u v : P u ! P v)(λ p: p) We sometimes make use of axioms stating that propositional equality of functions is extensional: Extensionality :(A : Typei) ! (B : A ! Typej) ! (f g :(x : A) ! B x) ! (8 x: f x ≡ g x) ! f ≡ g When we use the term \extensionality" below we refer to this kind of exten- sionality.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages17 Page
-
File Size-