| 1 |
Set Primitive Projections. |
| 2 |
Set Implicit Arguments. |
| 3 |
Set Universe Polymorphism. |
| 4 |
Set Asymmetric Patterns. |
| 5 |
Set Printing Projections. |
| 6 |
Inductive sum A B := inl : A -> sum A B | inr : B -> sum A B. |
| 7 |
Inductive Empty :=. |
| 8 |
|
| 9 |
Record category := |
| 10 |
{ ob :> Type; |
| 11 |
hom : ob -> ob -> Type |
| 12 |
}. |
| 13 |
|
| 14 |
Definition sum_category (C D : category) : category := |
| 15 |
{| |
| 16 |
ob := sum (ob C) (ob D); |
| 17 |
hom x y := match x, y with |
| 18 |
| inl x, inl y => @hom C x y |
| 19 |
| inr x, inr y => @hom D x y |
| 20 |
| _, _ => Empty |
| 21 |
end |}. |
| 22 |
|
| 23 |
Goal forall C D (x y : ob (sum_category C D)), Type. |
| 24 |
intros C D x y. |
| 25 |
hnf in x, y. |
| 26 |
exact (hom (sum_category _ _) x y). |
| 27 |
Defined. |