A naive view of Homotopy Type Theory and its relation to the … · 2014. 7. 10. · 2014 1/22....
Transcript of A naive view of Homotopy Type Theory and its relation to the … · 2014. 7. 10. · 2014 1/22....
A naive view of Homotopy Type Theoryand its relation to the Calculus of Constructions
Yves BertotInria
2014
1 / 22
Overview
I Conjunction between type theory and homotopy theoryI Intensional type theory
I Proofs as first-class objectsI Inductive presentation of equality
I Paths in homotopy theoryI A precise structure as higher categoryI Abstract view: synthetic homotopy theoryI Need for more axioms: not the last word?
2 / 22
Elements of context
I Growing complexity in mathematicsI The odd-order theorem: 250 pagesI discontent among leading mathematicians, V. Voevodsky, T.
Hales
I Computer verification of proofsI One attractive approach: Curry-Howard Isomorphism
I A proposal for a new foundation of mathematics
3 / 22
Formalized mathematics in a few words
I Computer language to represent objects of mathematicsI numbers, figuresI logical statementsI proofs
I Verification algorithmsI Verifying that formulas are well-formedI Verifying that proofs respect the rules of logic
I Variety of choicesI LCF style: proofs are not in the same worldI Intensional Type Theory: proofs are algorithms
New unusual questions
4 / 22
Logical reading of types
I Thanks to de Bruijn, Curry, Howard, Martin-LofI Implication behaves pretty much like a function type
I a proof of A⇒ B constructs proofs of B when given proofs ofA
I Use the function type A -> B to represent implicationI Requires that all functions are total
I Data constructors as logical connectivesI The statement proved by the pair of two proofs of A and B
that means A ∧ B
I A logic inherent to functional programmingI One type-checker to rule them all
I Remember: Propositions are types
5 / 22
Uses of proofs as first-class citizens
I With dependent types and pairs: an approach to subsetsI Using proof as certificatesI E.g. : (n,P) is a ‘certified prime number’
if n is a number and P a proof that it is prime
I Link to computationI The proof language is itself a programming languageI Possibility to “extract” algorithms
I Raising new questionsI if (a, p) and (a, p′) are two “certified values”, are they equal?I Are proofs relevant?I Important question when equality proofs
6 / 22
What is this thing called Equality
I A family of equality types: for every x y : A, x = y is a type
I Described as an inductive type with a single constructornamed refl
I Induction principle illuminatingeq rect:
∀A : Type.∀x : A.∀P : A→ Prop.P(x)⇒ ∀y : A. x = y ⇒ P(y)
I If x = y then every property satisfied by x is also satisfied by yI x and y are undistinguishableI Not reallyI Remember: the induction principle is named eq rectI Computing behavior: eq rect refl u computes to u
7 / 22
Not really interchangeable
I In context
x, y : A ; B : A -> Type; a : B y; H : x = y
if u has type B y, then u = a is well typedif u has type B x, then u = a is not
I but eq rect H u = a is well typedI Do we know eq rect H does not modify u?
I Solution proposed long ago: add an axiom Unicity of IdentityProofs (Hoffmann&Streicher98)
I The story could end here!I If proofs are unique then all are equal to reflexivity proofsI eq rect computes nicely on reflexivity proofs
8 / 22
Questioning “undistinguishable”
I In the induction principle for equalityeq rect:
∀A : Type.∀x : A.∀P : A→ Prop.P(x)⇒ ∀y : A.x = y ⇒ P(y)
I the range of P is limited to functions definable in the language
9 / 22
Homotopic perspective
I Consider the model where:I Types are (equivalence classes of) topological spaces
collections of points with a notion of proximity or continuityI Functions are equivalence classes of continuous functionsI Two points are equal if there is a continuous path between
them
I equality types are types, they have their own equality types,etc.
10 / 22
Paths of several dimensions
I Paths between points are lines
I Paths between lines are surfaces, etc.
11 / 22
contracting paths
The space of all paths with one given extremity can be reduced toa singleton.
12 / 22
Contractibility
I A topological space is contractible whenI There exists a point a in this space (center of contraction)I There exists a continuous function mapping any other point x
to a path from x to a
I A circle is not contractible
I For any point the space of paths from this point is contractible
13 / 22
Introduction to Groupoids
I A special kind of category where every morphism is anisomorphism
I The abstract description of equivalence relationsI for p, p1, p2, p3 proofs of equivalence:
I p, p1 proof that x ∼ y , p2 proof that y ∼ z , p3 proof thatz ∼ t
I The equivalence relation’s transitivity is noted •I p1 • p2 is a proof that x ∼ z
I The equivalence relation’s symmetry is noted −1
I p−1 is a proof that y ∼ x
I The equivalence relation’s reflexivity is an identity element forevery x , noted 1x or 1
I With a few more coherence laws
14 / 22
Groupoid structure and ∞-groupoid
I Coherence lawsI associativity • : (p1 • p2) • p3 p1 • (p2 • p3) are the same (1)I neutral property of 1 : 1 • p, p • 1, and p are the same (2,3)I The symetry property maps every arrow to its inverse p • p−1
is the same as 1 (4)I A bit like a group, but • is partialI A groupoid is a category where every morphism is an
isomorphism
I A higher groupoid: when the equalities of (1,2,3,4) are statedas proofs of equivalence in another groupoid
I ∞-groupoid when proofs of equivalence are used all the wayup
15 / 22
Unification: homotopy type theory
I In homotopy theory, paths form an ∞-groupoid
I In type theory, proofs of equality form an ∞-groupoid
I New correspondence: types are topological spaces
I Many proofs of homotopy theory can be modeled directly intype theory
I Topological structures can be described by adding new pathsaround points
16 / 22
Examples of topological spaces
I The interval: two points and a path between them,I The circle
I one point and a path from it to itself (distinct from thereflexivity path),
I two points and two paths between them,
I The sphereI two points (north and south) and, for every point in the circle
(equator), a path (meridian) from north to south,I one base point and a path between the reflexivity path at the
base and itself
I types of paths are themselves topological spaces
17 / 22
Generic topological operations
I Suspension of A: two points (north and south) and for everyelement in A a path from north to south
I bool is the suspension of the empty set,I the circle is the suspension of boolI the sphere is the suspension of the circleI the 3-sphere is the suspension of the sphereI the n + 1-sphere is the suspension of the n sphere
I Truncation operation: force all path at a certain level to beequal
18 / 22
Homotopy equivalence
I In a structure, reduce any path to a constant pathI Only if the two extremities are distinct
I Example: 2 presentations of the circle
19 / 22
Should you be afraid?
I Homotopy type theory looks at the microscopical levelI Continuity in real numbers lives at another level
I It distinguishes types where all points have trivial path spacesI Called hsetsI For them UIP holds
I Hedberg theorem: datatypes with decidable equality are hsetsI For instance: nat
I Also distinguishes types with at most one elementI For them proof-irrelevance holds
20 / 22
What are the gains?
I Synthetic homotopy theoryI Basic homotopy theory directly in type theoryI Already done proofs about loop spaces, e.g.
I Understanding of quotientsI A systematic approach to adding equalities
I Advantages of hsets already exploited in ssreflectI Homotopy type theory generalizes beyond decidable equality
I The Univalence axiom (isomorphic types are equal)I Functional extensionalityI Propositional extensionality
21 / 22
Questions not discussed in this talk
I universe polymorphism: resizing rulesI Higher inductive types
I Adding explicit paths between elements in types (higherconstructors)
I Avoid inconsistenciesI Consider higher constructors in computations
22 / 22