Homotopy Type Theory Lecture Notes

Similar documents
( 1) i [ d i ]. The claim is that this defines a chain complex. The signs have been inserted into the definition to make this work out.

12 MATH 101A: ALGEBRA I, PART C: MULTILINEAR ALGEBRA. 4. Tensor product

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

Inner Product. Euclidean Space. Orthonormal Basis. Orthogonal

Affine transformations and convexity

Week 2. This week, we covered operations on sets and cardinality.

An Introduction to Morita Theory

2.3 Nilpotent endomorphisms

More metrics on cartesian products

Transfer Functions. Convenient representation of a linear, dynamic model. A transfer function (TF) relates one input and one output: ( ) system

Problem Set 9 Solutions

FINITELY-GENERATED MODULES OVER A PRINCIPAL IDEAL DOMAIN

Canonical transformations

APPENDIX A Some Linear Algebra

Lecture 7: Gluing prevarieties; products

Time-Varying Systems and Computations Lecture 6

The Order Relation and Trace Inequalities for. Hermitian Operators

Foundations of Arithmetic

FACTORIZATION IN KRULL MONOIDS WITH INFINITE CLASS GROUP

and problem sheet 2

THE SUMMATION NOTATION Ʃ

The Pseudoblocks of Endomorphism Algebras

princeton univ. F 17 cos 521: Advanced Algorithm Design Lecture 7: LP Duality Lecturer: Matt Weinberg

Difference Equations

Restricted Lie Algebras. Jared Warner

5 The Rational Canonical Form

Economics 101. Lecture 4 - Equilibrium and Efficiency

where a is any ideal of R. Lemma 5.4. Let R be a ring. Then X = Spec R is a topological space Moreover the open sets

Open Systems: Chemical Potential and Partial Molar Quantities Chemical Potential

A CHARACTERIZATION OF ADDITIVE DERIVATIONS ON VON NEUMANN ALGEBRAS

Bezier curves. Michael S. Floater. August 25, These notes provide an introduction to Bezier curves. i=0

On the set of natural numbers

Bézier curves. Michael S. Floater. September 10, These notes provide an introduction to Bézier curves. i=0

where a is any ideal of R. Lemma Let R be a ring. Then X = Spec R is a topological space. Moreover the open sets

Linear, affine, and convex sets and hulls In the sequel, unless otherwise specified, X will denote a real vector space.

NUMERICAL DIFFERENTIATION

THE CHINESE REMAINDER THEOREM. We should thank the Chinese for their wonderful remainder theorem. Glenn Stevens

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results.

SL n (F ) Equals its Own Derived Group

R n α. . The funny symbol indicates DISJOINT union. Define an equivalence relation on this disjoint union by declaring v α R n α, and v β R n β

ON A DETERMINATION OF THE INITIAL FUNCTIONS FROM THE OBSERVED VALUES OF THE BOUNDARY FUNCTIONS FOR THE SECOND-ORDER HYPERBOLIC EQUATION

20. Mon, Oct. 13 What we have done so far corresponds roughly to Chapters 2 & 3 of Lee. Now we turn to Chapter 4. The first idea is connectedness.

INTERSECTION THEORY CLASS 13

Determinants Containing Powers of Generalized Fibonacci Numbers

Mathematical Preparations

Supplementary Notes for Chapter 9 Mixture Thermodynamics

Lecture 3 Relationships Between Sets and Types

Remarks on the Properties of a Quasi-Fibonacci-like Polynomial Sequence

arxiv: v1 [math.co] 1 Mar 2014

COMPLEX NUMBERS AND QUADRATIC EQUATIONS

Errors for Linear Systems

On the smoothness and the totally strong properties for nearness frames

Math 101 Fall 2013 Homework #7 Due Friday, November 15, 2013

MA 323 Geometric Modelling Course Notes: Day 13 Bezier Curves & Bernstein Polynomials

Bernoulli Numbers and Polynomials

Module 2. Random Processes. Version 2 ECE IIT, Kharagpur

A particle in a state of uniform motion remain in that state of motion unless acted upon by external force.

Supplement: Proofs and Technical Details for The Solution Path of the Generalized Lasso

Polynomials. 1 More properties of polynomials

Homework Notes Week 7

Lecture 4: Universal Hash Functions/Streaming Cont d

Lecture 3. Ax x i a i. i i

Module 9. Lecture 6. Duality in Assignment Problems

n α j x j = 0 j=1 has a nontrivial solution. Here A is the n k matrix whose jth column is the vector for all t j=0

A CLASS OF RECURSIVE SETS. Florentin Smarandache University of New Mexico 200 College Road Gallup, NM 87301, USA

Problem Do any of the following determine homomorphisms from GL n (C) to GL n (C)?

NOTES ON SIMPLIFICATION OF MATRICES

Lecture 10 Support Vector Machines II

Ali Omer Alattass Department of Mathematics, Faculty of Science, Hadramout University of science and Technology, P. O. Box 50663, Mukalla, Yemen

DIFFERENTIAL FORMS BRIAN OSSERMAN

Affine and Riemannian Connections

Introduction to Vapor/Liquid Equilibrium, part 2. Raoult s Law:

1 Generating functions, continued

CALCULUS CLASSROOM CAPSULES

Math 217 Fall 2013 Homework 2 Solutions

REAL ANALYSIS I HOMEWORK 1

The Jacobsthal and Jacobsthal-Lucas Numbers via Square Roots of Matrices

Example: (13320, 22140) =? Solution #1: The divisors of are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41,

Edge Isoperimetric Inequalities

DOLD THEOREMS IN SHAPE THEORY

CSCE 790S Background Results

Assortment Optimization under MNL

9 Characteristic classes

Semilattices of Rectangular Bands and Groups of Order Two.

College of Computer & Information Science Fall 2009 Northeastern University 20 October 2009

Exercise Solutions to Real Analysis

Grover s Algorithm + Quantum Zeno Effect + Vaidman

a b a In case b 0, a being divisible by b is the same as to say that

DIFFERENTIAL SCHEMES

8.4 COMPLEX VECTOR SPACES AND INNER PRODUCTS

Notes on Frequency Estimation in Data Streams

Chapter 5. Solution of System of Linear Equations. Module No. 6. Solution of Inconsistent and Ill Conditioned Systems

6. Stochastic processes (2)

Appendix for Causal Interaction in Factorial Experiments: Application to Conjoint Analysis

Introductory Cardinality Theory Alan Kaylor Cline

MAT 578 Functional Analysis

6. Stochastic processes (2)

k t+1 + c t A t k t, t=0

First day August 1, Problems and Solutions

ALGEBRA MID-TERM. 1 Suppose I is a principal ideal of the integral domain R. Prove that the R-module I R I has no non-zero torsion elements.

Transcription:

15-819 Homotopy Type Theory Lecture Notes Evan Cavallo and Stefan Muller November 18 and 20, 2013 1 Reconsder Nat n smple types s a warmup to dscussng nductve types, we frst revew several equvalent presentatons of the smple type Nat seen earler n the course. The ntroducton forms for Nat are 0 and succ(m) for any M : Nat. The elmnaton form s the recursor rec. 1.1 Tradtonal Form Γ 0 : Nat NatI z1 Γ M : Nat Γ succ(m) : Nat NatI s1 Γ M : Nat Γ M 0 : Γ, x : M 1 : Γ rec[](m; M 0 ; x.m 1 ) : NatE 1 We nclude the motve n the recursor to motvate the dependently-typed presentaton to come although t s not necessary n the smply-typed settng. The dynamc behavor of rec s defned by the followng β rules. rec[](0; M 0 ; x.m 1 ) M 0 rec[](succ(m); M 0 ; x.m 1 ) [rec[](m; M 0 ; x.m 1 )/x]m 1 The recursor on 0 returns the base case M 0. On succ(m), t substtutes the recursve result on M for x n M 1. The η rule states that any object that behaves lke the recursor s defntonally equal to the recursor on the approprate arguments. [0/y]N M 0 Γ, z : Nat [succ(z)/y]n [[z/y]n/x]m 1 : Γ, y : Nat N rec[](y; M 0 ; x.m 1 ) η 1

1.2 s elements of the exponental The ntroducton forms of Nat may be treated as exponentals n the absence of a context. 0 : 1 Nat (NatI z3 ) succ : Nat Nat (NatI s3 ) Note that the type 1 Nat s equvalent to the type Nat. There are two ways to present the elmnaton form n ths format. The frst moves the Nat on whch the recurson s done to the argument poston, mplyng that rec has exponental type. M 0 : x : M 1 : z : Nat rec[](m 0 ; x.m 1 )(z) : NatE 3a Ths can be presented n a more drect way by omttng the argument. M 0 : x : M 1 : rec[](m 0 ; x.m 1 ) : Nat NatE 3b We can derve rules NatI z1, NatI s1 and NatE 1. For example, 2 Nat-algebras Γ, M : Nat M : Nat Γ, M : Nat succ : Nat Nat NatI s3 Γ, M : Nat succ(m) : Nat We now motvate the dea of Nat-algebras, whch are maps of the form 1 +. From the name, one would expect there to be a Nat-algebra where s Nat. Indeed, there s. z : 1 + Nat case(z;.0; x.succ(x)) : Nat We can wrte case(z;.0; x.succ(x)) above as {.0; x.succ(x)}(z) or, somewhat abusvely, {0, succ}(z). Ths gves {0, succ} : 1 + Nat Nat as desred. More generally, we can wrte any Nat-algebra as = { 0, 1 } where 0 : 1 Nat (or, equvalently, 0 : Nat) and 1 : Nat Nat. We call 0 the bass or pseudo-zero and 1 the nductve step or pseudo-successor. In fact, {0, succ} holds a specal poston among Nat-algebras. The Nat-algebras form a category and {0, succ} s the ntal object n ths category. Recall that ths means t has a unque morphsm to any other object n the category. Ths requres us to defne Muller and Cavallo 2013/11/18 and 2013/11/20 2

morphsms between Nat-algebras, whch we wll call Nat-homomorphsms. Gven two Natalgebras, : 1 + and β : 1 + B B, h : B s a Nat-homomorphsm f t makes the followng dagram commute. 1+h 1 + 1 + B h B β The map 1 + h : 1 + 1 + B s defned n the natural way: 1 + h : {.nl ; a.nr h(a)} To show that Nat s an ntal algebra, we must show that for every Nat-algebra : 1 +, there exsts a unque Nat-homomorphsm : Nat such that the followng dagram commutes (note that the order of quantfcatons expressed n the prevous sentence s not nherently clear n the dagram, and must be consdered to get a full understandng of the dagram.) 1+ 1 + Nat 1 + Nat {0,succ} Let s consder the requrements on for the dagram to commute. 0 = 0 succ(x) = 1 (x) where the left sdes correspond to followng the path {0, succ} and the rght sdes correspond to followng 1+. Note that these two equatons match the β rules for rec, so we can defne : rec[]( 0 ; 1 ) or smply : rec[](). s we see above, the β rules for rec mply commutaton of the dagram. Unqueness of follows from the η rule for rec. It s worth notng that commutng dagrams hde exactly the type of equalty that s beng dscussed, whch s qute mportant n HoTT. For Nat, for example, unqueness of holds on the nose, whle, n general, unqueness may be only up to hgher homotopy. 3 F -algebras The above dscusson can be generalzed to any functor F. functor s a mappng between categores C and D. Functors act on objects n a category and the morphsms between Muller and Cavallo 2013/11/18 and 2013/11/20 3

them,.e. for all objects X C, F (X) D, and for all morphsms f : X Y between objects X and Y n C, F (f) : F (X) F (Y ). Functors respect dentty and composton: 1. For every object X C, F (d X ) = d F (X) 2. For all morphsms f : X Y and g : Y Z, F (g f) = F (g) F (f) [1] For example, F Nat (C) : 1 + C s a functor. We check that F Nat preserves denttes and composton. Let X be an object of C. F Nat (d X ) = 1 + d X = {, d X } whch s ndeed an dentty on 1 + X. Let f : X Y, g : Y Z be morphsms between objects of C. F Nat (g f) = 1 + g f = {, g f} = {, g} {, f} = (1 + g) (1 + f) = F (g) F (f) For any functor F, an F -algebra s a mappng F (X) X. Thus, a Nat-algebra s an F Nat -algebra. F -algebras form categores as Nat-algebras do. For a functor F, objects and B, two F -algebras : F () and β : F (B) B, and a morphsm h : B, the followng dagram commutes. F () F (h) F (B) h n ntal F -algebra s an F -algebra : I such that for all other F -algebras : F (), there exsts a unque map : I such that the followng dagram commutes. B β F () F () I There also exsts the noton of an F -coalgebra, whch, dual to the above, s a map : F (). fnal F -coalgebra s a mappng j : J F (J) such that for all other F -coalgebras : F (), there exsts a unque map : J makng the followng dagram commute. J F () j F (J) Muller and Cavallo 2013/11/18 and 2013/11/20 4

Lemma 1 (Lambek). If : I s an ntal F -algebra, then s an somorphsm. That s, I. Proof. To show that s an somorphsm, we must exhbt an nverse 1 : I such that 1 = d I and 1 = d. Consder the F -algebra F () : F (). We now treat as homomorphsm between the F -algebras F () and makng ths dagram commute. F () F () F () I Snce s an ntal F -algebra, however, we also have a unque mappng : I makng the top half of ths dagram commute. F () F () F () F () I I There s also a unque mappng from I to I, whch must be the dentty. Ths ndcates that the mappng along the rght sde of the dagram must be equal to d I : We also have = d I = F () F () = F ( ) = F (d I ) = d where the frst equalty follows from the commutatvty of the upper half of the dagram, the second and fourth follow from the propertes of functors and the thrd follows from the result above. Ths shows that for any functor F, the ntal F -algebra I s a fxed pont of F. dual result can be proven showng that, f J s the fnal F -coalgebra of a functor F, then F (J) J. Muller and Cavallo 2013/11/18 and 2013/11/20 5

4 Internalzng Nat-lgebras Insde type theory, we can defne the noton of Nat-algebra as Natlg : Σ:U. ((1 + ) ) We can defne the type of Nat-homomorphsms between two Nat-algebras (, ) and (B, β) as NatHom(, β) : Σh: B. (β (1 + h) = h ) The fact that ν : (Nat, {0, succ}) s ntal n the category of Nat-algebras s expressed by the fact that NatHom(ν, ) s contractble for all : ths means that there exsts a Nat-homomorphsm from ν to whch s unque up to hgher homotopy. 5 W-types We d lke to be able to take a functor F and defne the ntal F -algebra wthn HoTT (f one exsts). For the class of polynomal functors, we can do ths usng Brouwer ordnals, also called W-types. W-types are nspred by the mathematcal concept of well-founded nducton. In classcal mathematcs, a partally ordered set, < s sad to be well-founded f every subset of has a <-mnmal element (equvalently, there are no nfnte descendng chans). Wellfounded sets are useful because they admt an nducton prncple: Proposton (Well-Founded Inducton): Let, < be a well-founded set and P (x) be a proposton. If for any a we can prove P (a) by assumng P (b) for all b < a, then P (a) holds for all a. The set of natural numbers N, < together wth ts usual orderng s an example of a well-founded set, and the nducton prncple s the famlar mathematcal nducton. Classcally, the proof that nducton holds goes by contradcton, so ths defnton s unsatsfactory for a constructve theory. We wll nstead characterze well-founded sets as those for whch we have a (constructve) nducton prncple. To better understand what we mean by ths, we wll defne W-types. To form a W-type, we requre a type and a type famly B over : Γ : U Γ, x: B : U Γ Wx:.B : U WF s the type of node sorts. Each node sort represents a dfferent way of formng an element of Wx:.B. For example, n the case of the natural numbers, the node sorts are 0 and succ. We can thnk of each element of the natural numbers as a tree bult from these two sorts of nodes. For example, the numbers 0 through 2 can be represented as Muller and Cavallo 2013/11/18 and 2013/11/20 6

0 succ succ 0 succ nother natural example s the type of bnary trees. Ths type can be defned by two node sorts node and leaf, wth the elements takng the form of trees such as ths: node 0 leaf leaf In order to fully specfy these two types, we need to have some noton of a node s arty. Ths s gven by the type famly B. For each node sort a :, B(a) descrbes the branchng factor of a, the ndex type to specfy the predecessors of a node of sort a. For example, the branchng factor of the sort 0 or leaf would be 0, the branchng factor of succ would be 1, and the branchng factor of node would be 1+1. Thus we can wrte Nat as Wx:2. f(x; 0; 1), where tt represents 0 and ff represents succ. Now that we have the purposes of and B n hand, we can see how to defne the ntroducton rule for Wx:.B. a : x:b(a) w : Wx:.B Γ sup[a](x.w) : Wx:.B WI In other words, n order to construct a node of sort a, we must gve an element Wx:.B for each predecessor as specfed by the branchng factor B(a). Note that when B(a) s 0 we can construct a new node wthout any predecessor nformaton. For example, we can construct elements of the naturals as follows: 0 : sup[tt](x.abort Wx:2. f(x;0;1) (x)) 1 : sup[ff](.0) 2 : sup[ff](.1) The recursor for Wx:.B follows the dea of well-founded recurson: n order to defne the result of a functon f on an element w : Wx:.B, we can assume we ve already computed f for all of w s predecessors. Γ C : U Γ, a :, r : B(a) C M : C Γ, z : Wx:.B wrec[c](a, r.m)(z) : C WR Muller and Cavallo 2013/11/18 and 2013/11/20 7

In the hypothess, we assume that we are dealng wth a node of type a and that we have the value r(b) for each b : B(a) ndexng a predecessor. We use ths nformaton to construct the value M of the recursor at the current node. The recursor comes wth the compuaton rule wrec[c](a, r.m)(sup[a](w)) [a, λz.wrec[c](a, r.m)(w(z))/a, r]m whch, as expected, gves the value of wrec[c](a, r.m) on sup[a](w) n terms of the value on each predecessor w(z) for z : B(a). The dependent elmnator has a smlar form, expressng the dea of well-founded nducton. Γ, z : Wx:.B P : U Γ, a:, p : B(a) Wx:.B, h : b:b(a) P (p(b)) M : P (sup[a](p)) Γ, z : Wx:.B wnd[x.p ](a, p, h.m) : P (z) Here, n order to formulate the hypothess, we need to assume the addtonal data p : B(a) Wx:.B whch gves us the predecessors of the element we are consderng. The computaton rule takes the form wnd[x.p ](a, p, h.m)(sup[a](w)) = [a, w, λz.wnd[x.p ](a, p, h.m)(w(z))/a, p, h]m In general, we can only assert that ths computaton rule holds propostonally. Each W-type determnes a functor, n partcular a polynomal functor. Ths s a functor of the form F (X) = Σa:.(B(a) X) for some type and type famly B. We can see that the W-type Wx:.B defnes an F -algebra where F (X) : Σa:.(B(a) X): we have λ(a, w). sup[a](w) : F (X) X. The map λ(a, w). sup[a](w) s n fact an equvalence, and Wx:.B s a homotopy-ntal F -algebra. In the case of our W-type defnton of Nat, observe that the functor determned by Wx:2. f(x; 0; 1) s F (X) = Σb:2.(f(b; 0; 1) X). One can check that Σb:2.(f(b; 0; 1) X) 1 + X. Thus, ths type satsfes the equaton F (X) = 1 + X, our orgnal defnton of a Nat-algebra. References [1] Wkpeda. Functor. http://en.wkpeda.org/wk/functor, 2013. WE Muller and Cavallo 2013/11/18 and 2013/11/20 8