| 1 |
Set Implicit Arguments. |
| 2 |
Set Universe Polymorphism. |
| 3 |
Generalizable All Variables. |
| 4 |
|
| 5 |
Record SpecializedCategory (obj : Type) := |
| 6 |
{ |
| 7 |
Object :> _ := obj |
| 8 |
}. |
| 9 |
|
| 10 |
Record > Category := |
| 11 |
{ |
| 12 |
CObject : Type; |
| 13 |
UnderlyingCategory :> @SpecializedCategory CObject |
| 14 |
}. |
| 15 |
|
| 16 |
Record SpecializedFunctor `(C : @SpecializedCategory objC) `(D : @SpecializedCategory objD) := |
| 17 |
{ |
| 18 |
ObjectOf :> objC -> objD |
| 19 |
}. |
| 20 |
|
| 21 |
Definition Functor (C D : Category) := SpecializedFunctor C D. |
| 22 |
|
| 23 |
Parameter TerminalCategory : SpecializedCategory unit. |
| 24 |
|
| 25 |
Definition focus A (_ : A) := True. |
| 26 |
|
| 27 |
Definition CommaCategory_Object (A : Category) (S : Functor TerminalCategory A) : Type. |
| 28 |
assert (Hf : focus ((S tt) = (S tt))) by constructor. |
| 29 |
let C1 := constr:(CObject) in |
| 30 |
let C2 := constr:(fun C => @Object (CObject C) C) in |
| 31 |
unify C1 C2. |
| 32 |
progress change CObject with (fun C => @Object (CObject C) C) in *. |
| 33 |
simpl in *. |
| 34 |
let V := match type of Hf with |
| 35 |
| focus ?V => constr:(V) |
| 36 |
end |
| 37 |
in exact V. |
| 38 |
(* Toplevel input, characters 89-96: |
| 39 |
Error: Illegal application: |
| 40 |
The term "ObjectOf" of type |
| 41 |
"forall (objC : Set) (C : SpecializedCategory objC) |
| 42 |
(objD : Type) (D : SpecializedCategory objD), |
| 43 |
SpecializedFunctor C D -> objC -> objD" |
| 44 |
cannot be applied to the terms |
| 45 |
"Object TerminalCategory" : "Type" |
| 46 |
"TerminalCategory" : "SpecializedCategory unit" |
| 47 |
"Object A" : "Type" |
| 48 |
"UnderlyingCategory A" : "SpecializedCategory (CObject A)" |
| 49 |
"S" : "Functor TerminalCategory A" |
| 50 |
"tt" : "unit" |
| 51 |
The 1st term has type "Type" which should be coercible to |
| 52 |
"Set". *) |
| 53 |
Defined. |