| 1 |
|
| 2 |
Set Asymmetric Patterns. |
| 3 |
Generalizable All Variables. |
| 4 |
Set Implicit Arguments. |
| 5 |
Set Universe Polymorphism. |
| 6 |
|
| 7 |
Record SpecializedCategory (obj : Type) := |
| 8 |
{ |
| 9 |
Object :> _ := obj; |
| 10 |
Morphism : obj -> obj -> Type; |
| 11 |
|
| 12 |
Compose : forall s d d', Morphism d d' -> Morphism s d -> Morphism s d' |
| 13 |
}. |
| 14 |
|
| 15 |
Arguments Compose {obj} [C s d d'] _ _ : rename. |
| 16 |
|
| 17 |
Inductive ReifiedMorphism : forall objC (C : SpecializedCategory objC), C -> C -> Type := |
| 18 |
| ReifiedComposedMorphism : forall objC C s d d', ReifiedMorphism C d d' -> ReifiedMorphism C s d -> @ReifiedMorphism objC C s d'. |
| 19 |
|
| 20 |
Fixpoint ReifiedMorphismDenote objC C s d (m : @ReifiedMorphism objC C s d) : Morphism C s d := |
| 21 |
match m in @ReifiedMorphism objC C s d return Morphism C s d with |
| 22 |
| ReifiedComposedMorphism _ _ _ _ _ m1 m2 => Compose (@ReifiedMorphismDenote _ _ _ _ m1) |
| 23 |
(@ReifiedMorphismDenote _ _ _ _ m2) |
| 24 |
end. |
| 25 |
|
| 26 |
Fixpoint ReifiedMorphismSimplifyWithProof objC C s d (m : @ReifiedMorphism objC C s d) |
| 27 |
: { m' : ReifiedMorphism C s d | ReifiedMorphismDenote m = ReifiedMorphismDenote m' }. |
| 28 |
refine match m with |
| 29 |
| ReifiedComposedMorphism _ _ s0 d0 d0' m1 m2 => _ |
| 30 |
end; clear m. |
| 31 |
(* This fails with an error rather than an anomaly, but morally |
| 32 |
it should work, if destruct were able to do the good generalization |
| 33 |
in advance, before doing the "intros []". *) |
| 34 |
Fail destruct (@ReifiedMorphismSimplifyWithProof T s1 d0 d0' m1) as [ [] ? ]. |
| 35 |
Abort. |