Benedikt Ahrens and RΓ©gis Spadotti—
Terminal semantics for codata types in intensional Martin-LoΜf type theory
Table of contents
Index
Require
Import
Category.Types
.
Require
Import
Category.Setoids
.
Require
Import
Theory.Category
.
Require
Import
Theory.Functor
.
Require
Import
Theory.Product
.
Require
Import
Theory.Isomorphism
.
Require
Import
Theory.CartesianStrongMonoidal
.
Functor π¬πΈ : π»πππ β πΊπππππ
Definition
Program Definition
F
:
π»πππ
β
πΊπππππ
β
Ξ»
T
β
Setoids.make
β¦
Carrier
β
T
;
Equiv
β
eq
β¦
.
Program Definition
map
{
A
B
} :
[
A
β
B
βΆ
F
A
β
F
B
]
β
Ξ»
f
β¦
Setoids.Morphism.make
f
.
f-cong
Show proof.
intros
f
g
eq_fg
x
y
eq_xy
;
simpl
.
now
rewrite
eq_xy
.
Lemma
id
A
:
id
[
F
A
]
β
map
id
[
A
]
.
Show proof.
intros
x
y
eq_xy
;
now
rewrite
eq_xy
.
Lemma
map_compose
A
B
C
(
f
:
A
β
B
) (
g
:
B
β
C
) :
map
(
g
β
f
)
β
(
map
g
)
β
(
map
f
)
.
Show proof.
intros
x
y
eq_xy
.
now
rewrite
eq_xy
.
Definition
π¬πΈ
:
Functor
π»πππ
πΊπππππ
β
mkFunctor
id
map_compose
.
π¬πΈ is strong monoidal
Program Instance
π¬πΈ
_SM
:
CartesianStrongMonoidal
π¬πΈ
β
CartesianStrongMonoidal.make
β¦
Ο
β
Ξ»
A
B
β
Setoids.Morphism.make
(
Ξ»
x
β
x
)
β¦
.
Ο-cong
Show proof.
now
f_equal
.
Ο-inverse
Show proof.
constructor
.
-
intros
f
g
eq_fg
.
exact
eq_fg
.
-
intros
f
g
eq_fg
.
simpl
in
Γ.
destruct
f
.
auto
.
Functor π¬πΈ-Γ : π»πππ Γ π»πππ β πΊπππππ
Definition
Program Definition
π¬πΈ
_prod
:
Functor
(
π»πππ
π
π»πππ
)
πΊπππππ
β
Functor.make
β¦
F
β
Ξ»
A
β
Setoids.make
β¦
Carrier
β
fst
A
β¨Γβ©
snd
A
;
Equiv
β
eq
β¦
;
map
β
Ξ»
A
B
β
Ξ»
f
β¦
Setoids.Morphism.make
(
Ξ»
x
β
(
fst
f
(
fst
x
)
,
snd
f
(
snd
x
)
)
)
β¦
.
equivalence
Show proof.
eauto
with
typeclass_instances
.
map-proper
Show proof.
intros
[? ?] [? ?] [? ?] [? ?] [? ?]
eq
.
injection
eq
;
intros
.
simpl
in
*;
f_equal
;
congruence
.
Notation
"
π¬πΈ-π " β
π¬πΈ
_prod
.
Benedikt Ahrens and RΓ©gis Spadotti—
Terminal semantics for codata types in intensional Martin-LoΜf type theory
Table of contents
Index