+ All Categories
Home > Documents > Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant...

Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant...

Date post: 19-Apr-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
29
Transcript
Page 1: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Generalizations of Hedberg's Theorem

Nicolai Kraus Martín Escardó Thierry Coquand

Thorsten Altenkirch

14/06/13

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 1 / 14

(1/14) FP Away Day 2013 � 14/06/13

Page 2: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Overview

Overview

Views on Type Theory

Reminder: Equality in Type Theory

Hedberg's Theorem

Generalizations

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 2 / 14

(2/14) FP Away Day 2013 � 14/06/13

Page 3: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Type Theory

Views on Type Theory

Formal system (Σ,Π, . . .)

Programming

computation

veri�ed programs

Proving

foundation for constructive

mathematics

formalization

e.g. a lot of homotopy

theory has been formalized

in HoTT

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 3 / 14

(3/14) FP Away Day 2013 � 14/06/13

Page 4: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Equality

Reminder: Equality

De�nitional Equality

Decidable equality for typechecking & computation; e. g.

(λa.b)x ≡β b[x/a]

Propositional Equality

Equality needing a proof, e. g.

∀mn . (m + n) = (n +m)

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 4 / 14

(4/14) FP Away Day 2013 � 14/06/13

Page 5: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Equality

Reminder: Equality

De�nitional Equality

Decidable equality for typechecking & computation; e. g.

(λa.b)x ≡β b[x/a]

Propositional Equality

Equality needing a proof, e. g.

∀mn . (m + n) = (n +m)

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 4 / 14

(4/14) FP Away Day 2013 � 14/06/13

Page 6: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Propositional Equality

Reminder: Identity Types

Propositional equality

. . . is just an inductive type

Formation

a, b : A

a =A b : type

Introduction

a : A

re�a : a =A a

Elimination (J - Paulin-Mohring)

for any a : A

P : (b : A)→ a =A b → Um : P (a, re�a)

J(m,b,q) : P (b, q)

Computation (β)

J(m,a,re�a) ≡β m

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 5 / 14

(5/14) FP Away Day 2013 � 14/06/13

Page 7: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Propositional Equality

Reminder: Identity Types

Propositional equality

. . . is just an inductive type

Formation

a, b : A

a =A b : type

Introduction

a : A

re�a : a =A a

Elimination (J - Paulin-Mohring)

for any a : A

P : (b : A)→ a =A b → Um : P (a, re�a)

J(m,b,q) : P (b, q)

Computation (β)

J(m,a,re�a) ≡β m

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 5 / 14

(5/14) FP Away Day 2013 � 14/06/13

Page 8: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Propositional Equality

Reminder: Identity Types

Propositional equality

. . . is just an inductive type

Formation

a, b : A

a =A b : type

Introduction

a : A

re�a : a =A a

Elimination (J - Paulin-Mohring)

for any a : A

P : (b : A)→ a =A b → Um : P (a, re�a)

J(m,b,q) : P (b, q)

Computation (β)

J(m,a,re�a) ≡β m

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 5 / 14

(5/14) FP Away Day 2013 � 14/06/13

Page 9: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Propositional Equality

Reminder: Identity Types

Propositional equality

. . . is just an inductive type

Formation

a, b : A

a =A b : type

Introduction

a : A

re�a : a =A a

Elimination (J - Paulin-Mohring)

for any a : A

P : (b : A)→ a =A b → Um : P (a, re�a)

J(m,b,q) : P (b, q)

Computation (β)

J(m,a,re�a) ≡β m

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 5 / 14

(5/14) FP Away Day 2013 � 14/06/13

Page 10: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Propositional Equality

Reminder: Identity Types

Propositional equality

. . . is just an inductive type

Formation

a, b : A

a =A b : type

Introduction

a : A

re�a : a =A a

Elimination (J - Paulin-Mohring)

for any a : A

P : (b : A)→ a =A b → Um : P (a, re�a)

J(m,b,q) : P (b, q)

Computation (β)

J(m,a,re�a) ≡β m

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 5 / 14

(5/14) FP Away Day 2013 � 14/06/13

Page 11: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Uniqueness of Identity Proofs

Uniqueness of Identity Proofs (UIP)

Given a : A.

Can we show

(b, c : A)→ (p : a = b)→ (q : a = c)→ (b, p) = (c, q) ?

Yes! Induction/J/�pattern matching� on (b, p) and (c, q)

⇒ (a, re�a) = (a, re�a).

Can we show (p, q : a = a)→ p = q ?

No!

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 6 / 14

(6/14) FP Away Day 2013 � 14/06/13

Page 12: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Uniqueness of Identity Proofs

Uniqueness of Identity Proofs (UIP)

Given a : A.

Can we show

(b, c : A)→ (p : a = b)→ (q : a = c)→ (b, p) = (c, q) ?

Yes! Induction/J/�pattern matching� on (b, p) and (c, q)

⇒ (a, re�a) = (a, re�a).

Can we show (p, q : a = a)→ p = q ?

No!

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 6 / 14

(6/14) FP Away Day 2013 � 14/06/13

Page 13: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Uniqueness of Identity Proofs

Uniqueness of Identity Proofs (UIP)

Given a : A.

Can we show

(b, c : A)→ (p : a = b)→ (q : a = c)→ (b, p) = (c, q) ?

Yes! Induction/J/�pattern matching� on (b, p) and (c, q)

⇒ (a, re�a) = (a, re�a).

Can we show (p, q : a = a)→ p = q ?

No!

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 6 / 14

(6/14) FP Away Day 2013 � 14/06/13

Page 14: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Uniqueness of Identity Proofs

Uniqueness of Identity Proofs (UIP)

Axiom UIP (or K)

p, q : a = b

UIP : p = q

Advantages

simple

more

powerful

pattern

matching

Disadvantages

impossible to use the rich equality structure

(as Homotopy Type Theory does to formalize

axiomatic homotopy theory)

incompatible with univalence (which allows

us to identify isomorphic types)

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 7 / 14

(7/14) FP Away Day 2013 � 14/06/13

Page 15: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Uniqueness of Identity Proofs

Uniqueness of Identity Proofs (UIP)

Axiom UIP (or K)

p, q : a = b

UIP : p = q

Advantages

simple

more

powerful

pattern

matching

Disadvantages

impossible to use the rich equality structure

(as Homotopy Type Theory does to formalize

axiomatic homotopy theory)

incompatible with univalence (which allows

us to identify isomorphic types)

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 7 / 14

(7/14) FP Away Day 2013 � 14/06/13

Page 16: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Uniqueness of Identity Proofs

Uniqueness of Identity Proofs (UIP)

Axiom UIP (or K)

p, q : a = b

UIP : p = q

Advantages

simple

more

powerful

pattern

matching

Disadvantages

impossible to use the rich equality structure

(as Homotopy Type Theory does to formalize

axiomatic homotopy theory)

incompatible with univalence (which allows

us to identify isomorphic types)

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 7 / 14

(7/14) FP Away Day 2013 � 14/06/13

Page 17: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Hedberg's Theorem

Which types satisfy UIP naturally?

First, a de�nition:

Decidable Equality

DecidableEqualityA :≡ ∀ a b . (a = b + ¬ a = b)

Examples: N, ListA if A has decidable equality

Counterexamples: Colists (over a nonempty type), universes

constant function

const(f ) :≡ ∀ a b . f (a) = f (b)

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 8 / 14

(8/14) FP Away Day 2013 � 14/06/13

Page 18: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Hedberg's Theorem

Which types satisfy UIP naturally?

First, a de�nition:

Decidable Equality

DecidableEqualityA :≡ ∀ a b . (a = b + ¬ a = b)

Examples: N, ListA if A has decidable equality

Counterexamples: Colists (over a nonempty type), universes

constant function

const(f ) :≡ ∀ a b . f (a) = f (b)

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 8 / 14

(8/14) FP Away Day 2013 � 14/06/13

Page 19: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Hedberg's Theorem

Which types satisfy UIP naturally?

First, a de�nition:

Decidable Equality

DecidableEqualityA :≡ ∀ a b . (a = b + ¬ a = b)

Examples: N, ListA if A has decidable equality

Counterexamples: Colists (over a nonempty type), universes

constant function

const(f ) :≡ ∀ a b . f (a) = f (b)

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 8 / 14

(8/14) FP Away Day 2013 � 14/06/13

Page 20: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Hedberg's Theorem

DecidableEqualityA

there is a family gab : a = b → a = b of constant endofunctions

m

UIPA

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 9 / 14

(9/14) FP Away Day 2013 � 14/06/13

Page 21: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Strengthening Hedberg's Theorem

DecidableEquality is a very strong property.

How about something weaker? For example:

Separated

∀ a b .¬¬(a = b) → a = b

With function extensionality,

separatedA → UIPA

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 10 / 14

(10/14) FP Away Day 2013 � 14/06/13

Page 22: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Strengthening Hedberg's Theorem

We can still do better if we have

truncation, aka squash types or bracket types (Awodey / Bauer).

Think of ‖A‖ as the �squashed� version of A where we cannot

distinguish the di�erent inhabitants any more (similar to ¬¬A).

H-Separated

∀ a b . ‖a = b‖ → a = b

h-separatedA⇔UIPA

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 11 / 14

(11/14) FP Away Day 2013 � 14/06/13

Page 23: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Strengthening Hedberg's Theorem

We can still do better if we have

truncation, aka squash types or bracket types (Awodey / Bauer).

Think of ‖A‖ as the �squashed� version of A where we cannot

distinguish the di�erent inhabitants any more (similar to ¬¬A).

H-Separated

∀ a b . ‖a = b‖ → a = b

h-separatedA⇔UIPA

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 11 / 14

(11/14) FP Away Day 2013 � 14/06/13

Page 24: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Strengthening Hedberg's Theorem

We can still do better if we have

truncation, aka squash types or bracket types (Awodey / Bauer).

Think of ‖A‖ as the �squashed� version of A where we cannot

distinguish the di�erent inhabitants any more (similar to ¬¬A).

H-Separated

∀ a b . ‖a = b‖ → a = b

h-separatedA⇔UIPA

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 11 / 14

(11/14) FP Away Day 2013 � 14/06/13

Page 25: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Generalizations

h-separatedA, i. e.

‖a = b‖ → a = b

m

there is a family

gab : a = b → a = b of

constant endofunctions

m

UIPA, i. e.

(p, q : a = b)→ p = q

‖X‖ → X

m

there is a constant

g : X → X

all inhabitants of X are equal,

i. e. (a, b : X)→ a = b

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 12 / 14

(12/14) FP Away Day 2013 � 14/06/13

Page 26: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Generalizations

h-separatedA, i. e.

‖a = b‖ → a = b

m

there is a family

gab : a = b → a = b of

constant endofunctions

m

UIPA, i. e.

(p, q : a = b)→ p = q

‖X‖ → X

m ?

there is a constant

g : X → X

all inhabitants of X are equal,

i. e. (a, b : X)→ a = b

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 12 / 14

(12/14) FP Away Day 2013 � 14/06/13

Page 27: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Hedberg's Theorem

Generalizations

h-separatedA, i. e.

‖a = b‖ → a = b

m

there is a family

gab : a = b → a = b of

constant endofunctions

m

UIPA, i. e.

(p, q : a = b)→ p = q

‖X‖ → X

m m

there is a constant

g : X → X

all inhabitants of X are equal,

i. e. (a, b : X)→ a = b

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 12 / 14

(12/14) FP Away Day 2013 � 14/06/13

Page 28: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Applications

Applications

We can de�ne a new notion of anonymous existence that

behaves similar to truncation ‖·‖, but is de�nable in Type

Theory.

We can show related theorems, such as:

If we have ‖X‖ → X for all types,

then all equalities are decidable.

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 13 / 14

(13/14) FP Away Day 2013 � 14/06/13

Page 29: Nicolai Kraus Martín Escardó Thierry Coquand Thorsten ... · ab: a= b!a= b of constant endofunctions m UIP A Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch

Questions

Questions?

Thank you!

Nicolai Kraus, Martín Escardó, Thierry Coquand, Thorsten Altenkirch ()Generalizations of Hedberg's Theorem 14/06/13 14 / 14

(14/14) FP Away Day 2013 � 14/06/13


Recommended