propositional equality, identity types and homotopies

55
What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of P Propositional Equality, Identity Types and Homotopies Ruy de Queiroz (joint work with Anjolina de Oliveira) Centro de Inform ´ atica Universidade Federal de Pernambuco (UFPE) Recife, Brazil Computer Science Colloquium Indiana University 24 July 2015 Ruy de Queiroz (joint work with Anjolina de Oliveira) Centro de Inform ´ atica Universidade Federal de Pernambuco (UFPE) Recife, Brazil Propositional Equality, Identity Types and Homotopies

Upload: ruy-de-queiroz

Post on 17-Aug-2015

23 views

Category:

Science


0 download

TRANSCRIPT

Page 1: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Propositional Equality, Identity Typesand Homotopies

Ruy de Queiroz(joint work with Anjolina de Oliveira)

Centro de InformaticaUniversidade Federal de Pernambuco (UFPE)

Recife, Brazil

Computer Science ColloquiumIndiana University

24 July 2015

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 2: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Homotopy Type TheoryUnivalent Foundations of Mathematics

Institute for Advanced Study, Princeton484–600p. Open-source book: 27 main authors. 58

contributorsAvailable on GitHub. Latest version March 2014Ruy de Queiroz (joint work with Anjolina de Oliveira)

Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 3: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Homotopy Type TheoryUnivalent Foundations of Mathematics

“Homotopy type theory is a new branch ofmathematics that combines aspects of severaldifferent fields in a surprising way. It is based on arecently discovered connection between homotopytheory and type theory. It touches on topics asseemingly distant as the homotopy groups of spheres,the algorithms for type checking, and the definition ofweak∞-groupoids.”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 4: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Geometry and LogicAlexander Grothendieck

Alexander GrothendieckB. 28 March 1928 Berlin, Prussia, Germany

D. 13 November 2014 (aged 86) Saint-Girons, Ariege, France

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 5: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Geometry and LogicAlexander Grothendieck

. . . the study of n-truncated homotopy types (ofsemisimplicial sets, or of topological spaces) [shouldbe] essentially equivalent to the study of so-calledn-groupoids. . . . This is expected to be achieved byassociating to any space (say) X its “fundamentaln-groupoid” Πn(X ).... The obvious idea is that0-objects of Πn(X ) should be the points of X ,1-objects should be “homotopies” or paths betweenpoints, 2-objects should be homotopies between1-objects, etc.(Grothendieck 1983)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 6: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Geometry and LogicVladimir Voevodsky

“Some of the ways to approach the notion of space inmathematics:

1 topological spaces2 metric spaces3 homotopy theory (starts from points and paths)”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 7: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Geometry and LogicVladimir Voevodsky

“From an observation by Grothendieck:

Formalism of higher equivalences (theory of grupoids)=Homotopy theory (theory of shapes up to adeformation)

Combined with some other ideas it: leads to an encoding ofmathematics in terms of the homotopy theory. Unlike the usualencodings in terms of the set theory this one respectsequivalences.”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 8: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Equality as a Structure, not a RelationVladimir Voevodsky

“An equality between two abstract sets is not a relation but astructure. It is not expressed by an assertion of a propositionbut by presenting an element of a set of possible equalities.For example, the abstract sets corresponding to the sets {A,B}and {C,D} can be equal either through the correspondencethat takes A to C and B to D or through the one that takes A toD and B to C. This is one of the ways in which abstract sets arenot “things”.”The Paul Bernays Lectures, September 2014, ETH Zurich

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 9: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Content

1 What is a Proof of an Equality?

2 Brouwer–Heyting–Kolmogorov for Equality

3 Direct Computations

4 The Functional Interpretation of Propositional Equality

5 Normal form for equality proofs

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 10: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Type Theory and EqualityFour Judgements

In type theory, there are 4 kinds of judgements:

1 A type

2 x : A

3 x = y : A

4 A = B

Via the so-called Curry-Howard interpretation, “x : A” can be read as“x is a proof of proposition A”.Also, “x = y : A” can be read as “x and y are (definitionally ) equalproofs of proposition A”.What about the judgement of “p is a proof of the statement that x andy are equal elements of type A”? This is where the so-called Identitytype comes into the picture:

p : IdA(x , y)Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 11: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Type Theory and its Derivations-as-TermsInterpretationHoward on Curry-Howard

“ [de Bruijn] discovered the idea of derivations asterms, and the accompanying idea offormulae-as-types, on his own. (...)Martin-Lof suggested that the derivations-as-termsidea would work particularly well in connection withPrawitz’s theory of natural deduction.” (W.Howard,Wadler’s Blog, 2014)

Since the early 1990’s, our focus has been on insisting on thederivations-as-terms perspective, especially wrt topropositional equality.

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 12: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Type Theory and Homotopy TheorySteve Awodey

“The purpose of this informal survey article is to introduce thereader to a new and surprising connection between Geometry,Algebra, and Logic, which has recently come to light in the formof an interpretation of the constructive type theory of PerMartin-Lof into homotopy theory, resulting in new examples ofcertain algebraic structures which are important in topology.This connection was discovered quite recently, and variousaspects of it are now under active investigation by severalresearchers.”(“Type Theory and Homotopy Theory”, 2010.)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 13: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Algebraic Structure: GroupoidsSteve Awodey

“A groupoid is like a group, but with a partially-definedcomposition operation. Precisely, a groupoid can be defined asa category in which every arrow has an inverse. A group is thusa groupoid with only one object. Groupoids arise in topology asgeneralized fundamental groups, not tied to a choice ofbasepoint.”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 14: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

What is a proof of an equality statement?What is the formal counterpart of a proof of an equality?

In talking about proofs of an equality statement, two dichotomiesarise:

1 definitional equality versus propositional equality

2 intensional equality versus extensional equality

First step on the formalisation of proofs of equality statements: PerMartin-Lof’s Intuitionistic Type Theory (Log Coll ’73, published 1975)with the so-called Identity Type

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 15: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity TypesIdentity Types - Topological and Categorical Structure

Workshop, Uppsala, November 13–14, 2006

“The identity type, the type of proof objects for thefundamental propositional equality, is one of the mostintriguing constructions of intensional dependent typetheory (also known as Martin-Lof type theory). Itscomplexity became apparent with the Hofmann–Streichergroupoid model of type theory. This model also hinted atsome possible connections between type theory andhomotopy theory and higher categories. Exploration of thisconnection is intended to be the main theme of theworkshop.”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 16: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity TypesType Theory and Homotopy Theory

Indeed, a whole new research avenue has since 2005 been exploredby people like Vladimir Voevodsky and Steve Awodey in trying tomake a bridge between type theory and homotopy theory, mainly viathe groupoid structure exposed in the Hofmann–Streicher (1994)countermodel to the principle of Uniqueness of Identity Proofs (UIP).In Hofmann & Streicher’s own words,

“We give a model of intensional Martin-Lof type theorybased on groupoids and fibrations of groupoids in whichidentity types may contain two distinct elements which arenot even propositionally equal. This shows that the principleof uniqueness of identity proofs is not derivable in thesyntax”. (“LICS ’94, pp. 208–212.)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 17: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity TypesIdentity Types as Topological Spaces

According to B. van den Berg and R. Garner (“Topological andsimplicial models of identity types”, ACM Transactions onComputational Logic, Jan 2012),

“All of this work can be seen as an elaboration of thefollowing basic idea: that in Martin-Lof type theory, a type Ais analogous to a topological space; elements a,b ∈ A topoints of that space; and elements of an identity typep,q ∈ IdA(a,b) to paths or homotopies p,q : a→ b in A.”.

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 18: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity TypesIdentity Types as Topological Spaces

From the Homotopy type theory collective book (2013):

“In type theory, for every type A there is a (formerlysomewhat mysterious) type IdA of identifications of twoobjects of A; in homotopy type theory, this is just the pathspace AI of all continuous maps I → A from the unitinterval. In this way, a term p : IdA(a,b) represents a pathp : a b in A.”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 19: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity Types: IterationFrom Propositional to Predicate Logic and Beyond

In the same aforementioned workshop, B. van den Berg in hiscontribution “Types as weak omega-categories” draws attention to thepower of the identity type in the iterating types to form a globular set:

“Fix a type X in a context Γ. Define a globular set as follows:A0 consists of the terms of type X in context Γ,modulodefinitional equality; A1 consists of terms of the typesId(X ; p; q) (in context Γ) for elements p,q in A0, modulodefinitional equality; A2 consists of terms of well-formedtypes Id(Id(X ; p; q); r ; s) (in context Γ) for elements p,q inA0, r , s in A1, modulo definitional equality; etcetera...”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 20: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity Types: IterationThe homotopy interpretation

Here is how we can see the connections between proofs of equalityand homotopies:

a, b : Ap, q : IdA(a,b)α, β : IdIdA(a,b)(p,q)· · · : IdIdId...(· · · )

Now, consider the following interpretation:Types SpacesTerms Maps

a : A Points a : 1→ Ap : IdA(a,b) Paths p : a⇒ b

α : IdIdA(a,b)(p,q) Homotopies α : p V q

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 21: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity TypesUnivalent Foundations of Mathematics

From Vladimir Voevodsky (IAS, Princeton) “UnivalentFoundations: New Foundations of Mathematics”, Mar 26, 2014:

“There were two main problems with the existingfoundational systems which made them inadequate.Firstly, existing foundations of mathematics werebased on the languages of Predicate Logic andlanguages of this class are too limited.Secondly, existing foundations could not be used todirectly express statements about such objects as, forexample, the ones that my work on 2-theories wasabout.”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 22: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity TypesUnivalent Foundations of Mathematics

From Vladimir Voevodsky (IAS, Princeton) “UnivalentFoundations: New Foundations of Mathematics”, Mar 26, 2014:

“Univalent Foundations, like ZFC-based foundationsand unlike category theory, is a complete foundationalsystem, but it is very different from ZFC. To provide aformat for comparison let me suppose that anyfoundation for mathematics adequate both for humanreasoning and for computer verification should havethe following three components.”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 23: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Identity TypesUnivalent Foundations of Mathematics

From Vladimir Voevodsky (IAS, Princeton), “UnivalentFoundations: New Foundations of Mathematics”, Mar 26, 2014:

“The first component is a formal deduction system: alanguage and rules of manipulating sentences in thislanguage that are purely formal, such that a record ofsuch manipulations can be verified by a computerprogram.The second component is a structure that provides ameaning to the sentences of this language in terms ofmental objects intuitively comprehensible to humans.The third component is a structure that enableshumans to encode mathematical ideas in terms of theobjects directly associated with the language.”

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 24: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Propositional EqualityProofs of equality as (rewriting) computational paths

What is a proof of an equality statement? In what sense it can beseen as a homotopy? Motivated by looking at equalities in typetheory as arising from the existence of computational paths betweentwo formal objects, it may be useful to review the role and the powerof the notion of propositional equality as formalised in the so-calledCurry–Howard functional interpretation.The main idea, i.e. proofs of equality statements as (reversible)sequences of rewrites, goes back to a paper entitled “Equality inlabelled deductive systems and the functional interpretation ofpropositional equality”, , presented in Dec 1993 at the 9th AmsterdamColloquium, and published in the proceedings in 1994.

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 25: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Brouwer–Heyting–Kolmogorov InterpretationProofs rather than truth-values

a proof of the proposition: is given by:A ∧ B a proof of A and

a proof of BA ∨ B a proof of A or

a proof of BA→ B a function that turns a proof of A

into a proof of B∀xD.P(x) a function that turns an element a

into a proof of P(a)∃xD.P(x) an element a (witness)

and a proof of P(a)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 26: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Brouwer–Heyting–Kolmogorov Interpretation: FormallyCanonical proofs rather than truth-values

a proof of the proposition: has the canonical form of:A ∧ B 〈p,q〉 where p is a proof of A and

q is a proof of BA ∨ B inl(p) where p is a proof of A or

inr(q) where q is a proof of B(‘inl’ and ‘inr’ abbreviate‘into the left/right disjunct’)

A→ B λx .b(x) where b(p) is a proof of Bprovided p is a proof of A

∀xD.P(x) Λx .f (x) where f (a) is a proof of P(a)provided a is an arbitrary individual chosenfrom the domain D

∃xD.P(x) 〈f (a),a〉 where a is a witnessfrom the domain D, f (a) is a proof of P(a)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 27: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Brouwer–Heyting–Kolmogorov InterpretationWhat is a proof of an equality statement?

a proof of the proposition: is given by:

t1 = t2 ?(Perhaps a sequence of rewritesstarting from t1 and ending in t2?)

What is the logical status of the symbol “=”?What would be a canonical/direct proof of t1 = t2?

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 28: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Statman’s Direct ComputationsTerms, Equations, Measure

Definition (equations and systems of equations)

Let us consider equations E between individual termsa,b, c, . . ., possibly containing function variables, and finite setsof equations S.

Definition (measure)

A function M from terms to non-negative integers is called ameasure if M(a) ≤ M(b) implies M(c[a/x ]) ≤ M(c[b/x ]), and,whenever x occurs in c, M(a) ≤ M(c[a/x ]).

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 29: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Statman’s Direct ComputationsKreisel–Tait’s calculus K

Definition (calculus K )

The calculus K of Kreisel and Tait consists of the axioms a = a andthe rule of substituting equals for equals:

(1)E [a/x ] a .

= bE [b/x ]

where a .= b is, ambiguously, a = b and b = a, together with the rules

(2)sa = sba = b

(3)0 = sab = c

(4)a = snab = c

H will be the system consisting only of the rule (1)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 30: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of EqualitySequences of conversions

(λx .(λy .yx)(λw .zw))v .η (λx .(λy .yx)z)v .β (λy .yv)z .β zv(λx .(λy .yx)(λw .zw))v .β (λx .(λw .zw)x)v .η (λx .zx)v .β zv(λx .(λy .yx)(λw .zw))v .β (λx .(λw .zw)x)v .β (λw .zw)v .η zv

There is at least one sequence of conversions from the initial term tothe final term. (In this case we have given three!) Thus, in the formaltheory of λ-calculus, the term (λx .(λy .yx)(λw .zw))v is declared to beequal to zv .Now, some natural questions arise:

1 Are the sequences themselves normal?

2 Are there non-normal sequences?

3 If yes, how are the latter to be identified and (possibly)normalised?

4 What happens if general rules of equality are involved?Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 31: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of EqualityPropositional equality

Definition (Hindley & Seldin 2008)

P is β-equal or β-convertible to Q (notation P =β Q) iff Q isobtained from P by a finite (perhaps empty) series ofβ-contractions and reversed β-contractions and changes ofbound variables. That is, P =β Q iff there exist P0, . . . ,Pn(n ≥ 0) such thatP0 ≡ P, Pn ≡ Q,(∀i ≤ n − 1)(Pi .1β Pi+1 or Pi+1 .1β Pi or Pi ≡α Pi+1).

NB: equality with an existential force.NB: equality as the reflexive, symmetric and transitive closureof 1-step contraction: arising from rewriting

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 32: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationEquality: Existential Force and Rewriting Path

The same happens with λβη-equality:

Definition 7.5 (λβη-equality) (Hindley & Seldin 2008)The equality-relation determined by the theory λβη iscalled =βη; that is, we define

M =βη N ⇔ λβη ` M = N.

Note again that two terms are λβη-equal if there exists a proofof their equality in the theory of λβη-equality.

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 33: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of EqualityGentzen’s ND for propositional equality

Remark

In setting up a set of Gentzen’s ND-style rules for equality weneed to account for:

1 definitional versus propositional equality;2 there may be more than one normal proof of a certain

equality statement;3 given a (possibly non-normal) proof, the process of

bringing it to a normal form should be finite and confluent.

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 34: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationEquality in Type Theory

Martin-Lof’s Intuitionistic Type Theory :Intensional (1975)Extensional (1982(?), 1984)

Remark (Definitional vs. Propositional Equality)

definitional, i.e. those equalities that are given as rewriterules, orelse originate from general functional principles(e.g. β, η, ξ, µ, ν, etc.);propositional, i.e. the equalities that are supported (orotherwise) by an evidence (a sequence of substitutionsand/or rewrites)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 35: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationDefinitional Equality

Definition (Hindley & Seldin 2008)

(α) λx .M = λy .[y/x ]M (y /∈ FV (M))(β) (λx .M)N = [N/x ]M(η) (λx .Mx) = M (x /∈ FV (M))

(ξ)M = M ′

λx .M = λx .M ′

(µ)M = M ′

NM = NM ′

(ν)M = M ′

MN = M ′N(ρ) M = M

(σ)M = NN = M

(τ)M = N N = P

M = P

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 36: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationIntuitionistic Type Theory

→-introduction

[x : A]

f (x) = g(x) : Bλx .f (x) = λx .g(x) : A→ B

(ξ)

→-eliminationx = y : A g : A→ B

gx = gy : B(µ)

x : A g = h : A→ Bgx = hx : B

(ν)

→-reduction a : A[x : A]

b(x) : B(λx .b(x))a = b(a/x) : B (β)

c : A→ Bλx .cx = c : A→ B

(η)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 37: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsLessons from Curry–Howard and Type Theory

Harmonious combination of logic and λ-calculus;

Proof terms as ‘record of deduction steps’, i.e.‘deductions-as-terms’

Function symbols as first class citizens.

Cp.

∃xP(x)

[P(t)]

CC

with

∃xP(x)

[t : D, f (t) : P(t)]

g(f , t) : C? : C

in the term ‘?’ the variable f gets abstracted from, and this enforces akind of generality to f , even if this is not brought to the ‘logical’ level.Ruy de Queiroz (joint work with Anjolina de Oliveira)

Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 38: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsEquality in Martin-Lof’s Intensional Type Theory

A type a : A b : A

Id intA (a,b) type

Id int -formation

a : A

r(a) : Id intA (a,a)

Id int -introductiona = b : A

r(a) : Id intA (a,b)

Id int -introduction

a : A b : A c : Id intA (a,b)

[x :A]d(x):C(x,x,r(x))

[x :A,y :A,z:Id intA (x,y)]

C(x,y,z) type

J(c,d) : C(a,b, c)Id int -elimination

a : A[x : A]

d(x) : C(x , x ,r(x))

[x : A, y : A, z : Id intA (x , y)]

C(x , y , z) typeJ(r(a),d(x)) = d(a/x) : C(a,a,r(a))

Id int -equality

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 39: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsEquality in Martin-Lof’s Extensional Type Theory

A type a : A b : AIdext

A (a,b) typeIdext -formation

a = b : Ar : Idext

A (a,b)Idext -introduction

c : IdextA (a,b)

a = b : AIdext -elimination

c : IdextA (a,b)

c = r : IdextA (a,b)

Idext -equality

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 40: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsThe missing entity

Considering the lessons learned from Type Theory, thejudgement of the form:

a = b : Awhich says that a and b are equal elements from domain D, letus add a function symbol:

a =s b : Awhere one is to read: a is equal to b because of ‘s’ (‘s’ beingthe rewrite reason); ‘s’ is a term denoting a sequence ofequality identifiers (β, η, ξ, etc.), i.e. a composition of rewrites.In other words, ‘s’ is the computational path from a to b.(This formal entity is missing in both of Martin-Lof’sformulations of Identity Types.)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 41: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsPropositional Equality

Id-introductiona =s b : A

s(a,b) : IdA(a,b)

Id-elimination

m : IdA(a,b)

[a =g b : A]

h(g) : CJ(m, λg.h(g)) : C

Id-reductiona =s b : A

s(a,b) : IdA(a,b)Id-intr

[a =g b : A]

h(g) : CJ(s(a,b), λg.h(g)) : C

Id-elim

.β[a =s b : A]

h(s/g) : CRuy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 42: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsPropositional Equality: A Simple Example of a Proof

By way of example, let us prove

ΠxAΠyA(IdA(x , y)→ IdA(y , x))

[p : IdA(x , y)]

[x =t y : A]

y =σ(t) x : A(σ(t))(y , x) : IdA(y , x)

J(p, λt(σ(t))(y , x)) : IdA(y , x)

λp.J(p, λt(σ(t))(y , x)) : IdA(x , y)→ IdA(y , x)

λy .λp.J(p, λt(σ(t))(y , x)) : ΠyA(IdA(x , y)→ IdA(y , x))

λx .λy .λp.J(p, λt(σ(t))(y , x)) : ΠxAΠyA(IdA(x , y)→ IdA(y , x))

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 43: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsPropositional Equality: The Groupoid Laws

With the formulation of propositional equality that we have justdefined, we can also prove that all elements of an identity typeobey the groupoid laws, namely

1 Associativity2 Existence of an identity element3 Existence of inverses

Also, the groupoid operation, i.e. composition ofpaths/sequences, is actually, partial , meaning that not allelements will be connected via a path. (The groupoidinterpretation refutes the Uniqueness of Identity Proofs.)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 44: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsPropositional Equality: The Uniqueness of Identity Proofs

“We will call UIP (Uniqueness of Identity Proofs) the followingproperty. If a1,a2 are objects of type A then for any proofs pand q of the proposition “a1 equals a2” there is another proofestablishing equality of p and q. (...) Notice that in traditionallogical formalism a principle like UIP cannot even be sensiblyexpressed as proofs cannot be referred to by terms of theobject language and thus are not within the scope ofpropositional equality.” (Hofmann & Streicher 1996)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 45: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsNormal form for the rewrite reasons

Strategy:

Analyse possibilities of redundancyConstruct a rewriting systemProve termination and confluence

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 46: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsNormal form for the rewrite reasons

Definition (equation)

An equation in our LNDEQ is of the form:

s =r t : A

where s and t are terms, r is the identifier for the rewrite reason, andA is the type (formula).

Definition (system of equations)

A system of equations S is a set of equations:

{s1 =r1 t1 : A1, . . . , sn =rn tn : An}

where ri is the rewrite reason identifier for the i th equation in S.Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 47: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsNormal form for the rewrite reasons

Definition (rewrite reason)

Given a system of equations S and an equation s =r t : A, ifS ` s =r t : A, i.e. there is a deduction/computation of theequation starting from the equations in S, then the rewritereason r is built up from:(i) the constants for rewrite reasons: { ρ, σ, τ, β, η, ν, ξ, µ };(ii) the ri ’s;using the substitution operations:(iii) subL;(iv) subR;and the operations for building new rewrite reasons:(v) σ, τ , ξ, µ.

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 48: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsNormal form for the rewrite reasons

Definition (general rules of equality)

The general rules for equality (reflexivity, symmetry andtransitivity) are defined as follows:

x : Ax =ρ x : A

(reflexivity)

x =t y : Ay =σ(t) x : A

(symmetry)

x =t y : A y =u z : Ax =τ(t ,u) z : A

(transitivity)

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 49: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsNormal form for the rewrite reasons

Definition (subterm substitution)

The rule of “subterm substitution” is split into two rules:

x =r C[y ] : A y =s u : A′

x =subL(r ,s) C[u] : A

x =r w : A′ C[w ] =s u : AC[x ] =subR(r ,s) u : A

where C[x ] is the context in which the subterm x appears

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 50: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsReductions

Definition (reductions involving ρ and σ)

x =ρ x : Ax =σ(ρ) x : A

.sr x =ρ x : A

x =r y : Ay =σ(r) x : A

x =σ(σ(r)) y : A.ss x =r y : A

Associated rewritings:σ(ρ) .sr ρσ(σ(r)) .ss r

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 51: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsReductions

Definition (reductions involving τ )

x=r y :D y=σ(r)x :Dx=τ(r,σ(r))x :D

.tr x =ρ x : D

y=σ(r)x :D x=r y :Dy=τ(σ(r),r)y :D

.tsr y =ρ y : D

u=r v :D v=ρv :Du=τ(r,ρ)v :D

.rrr u =r v : D

u=ρu:D u=r v :Du=τ(ρ,r)v :D

.lrr u =r v : D

Associated equations: τ(r , σ(r)) .tr ρ, τ(σ(r), r) .tsr ρ, τ(r , ρ) .rrr r ,τ(ρ, r) .lrr r .

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 52: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsReductions

Definition

βrewr -×-reductionx =r y : A z : B

〈x , z〉 =ξ1(r) 〈y , z〉 : A× B× -intr

FST (〈x , z〉) =µ1(ξ1(r)) FST (〈y , z〉) : A× -elim

.mx2l1 x =r y : A

Associated rewriting:µ1(ξ1(r)) .mx2l1 r

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 53: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsReductions

Definition

βrewr -×-reductionx =r x ′ : A y =s z : B〈x , y〉 =ξ∧(r ,s) 〈x ′, z〉 : A× B

× -intr

FST (〈x , y〉) =µ1(ξ∧(r ,s)) FST (〈x ′, z〉) : A× -elim

.mx2l2 x =r x ′ : A

Associated rewriting:µ1(ξ∧(r , s)) .mx2l2 r

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 54: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

Categorical Interpretation of Computational PathsComputational Paths form a Weak Category

Theorem

For each type A, computational paths induce a weakcategorical structure Arw where:

objects: terms a of the type A, i.e., a : Amorphisms: a morphism (arrow) between terms a : A andb : A are arrows s : a→ b such that s is a computationalpath between the terms, i.e., a =s b : A.

Corollary

Arw has a weak groupoidal structure.

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies

Page 55: Propositional Equality, Identity Types and Homotopies

What is a Proof of an Equality? Brouwer–Heyting–Kolmogorov for Equality Direct Computations The Functional Interpretation of Propositional Equality Normal form for equality proofs

The Functional Interpretation of Direct ComputationsReductions

Working papers:

1 Propositional equality, identity types, and direct computationalpathsRuy J.G.B. de Queiroz, Anjolina G. de Oliveirahttp://arxiv.org/abs/1107.1901

2 Sequences of Rewrites: A Categorical InterpretationArthur F. Ramos, Ruy J.G.B. de Queiroz, Anjolina G. de Oliveirahttp://arxiv.org/abs/1412.2105

3 On the Groupoid Model of Computational PathsArthur F. Ramos, Ruy J.G.B. de Queiroz, Anjolina G. de Oliveirahttp:// arXiv:1506.02721

Ruy de Queiroz (joint work with Anjolina de Oliveira)Centro de Informatica Universidade Federal de Pernambuco (UFPE) Recife, Brazil

Propositional Equality, Identity Types and Homotopies