| 1 |
Set Primitive Projections. |
| 2 |
Set Implicit Arguments. |
| 3 |
Set Universe Polymorphism. |
| 4 |
Set Asymmetric Patterns. |
| 5 |
|
| 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 |
Set Printing All. |
| 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 _ x y (* Toplevel input, characters 177-178: |
| 19 |
Error: |
| 20 |
In environment |
| 21 |
C : category |
| 22 |
D : category |
| 23 |
x : sum (ob C) (ob D) |
| 24 |
y : sum (ob C) (ob D) |
| 25 |
x0 : ob C |
| 26 |
y0 : ob C |
| 27 |
The term "x0" has type "ob C" while it is expected to have type |
| 28 |
"ob ?6" (unable to find a well-typed instantiation for |
| 29 |
"?6": cannot unify"Type" and "category"). *) |
| 30 |
| inr x, inr y => @hom _ x y |
| 31 |
| _, _ => Empty |
| 32 |
end |}. |