Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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