1 (*********************************************************************************************************************************)
2 (* CategoryOfGeneralizedArrows: *)
4 (* There is a category whose objects are surjective monic monoidal enrichments (SMME's) and whose morphisms *)
5 (* are generalized Arrows *)
7 (*********************************************************************************************************************************)
9 Generalizable All Variables.
10 Require Import Preamble.
11 Require Import General.
12 Require Import Categories_ch1_3.
13 Require Import Functors_ch1_4.
14 Require Import Isomorphisms_ch1_5.
15 Require Import ProductCategories_ch1_6_1.
16 Require Import OppositeCategories_ch1_6_2.
17 Require Import Enrichment_ch2_8.
18 Require Import Subcategories_ch7_1.
19 Require Import NaturalTransformations_ch7_4.
20 Require Import NaturalIsomorphisms_ch7_5.
21 Require Import BinoidalCategories.
22 Require Import PreMonoidalCategories.
23 Require Import MonoidalCategories_ch7_8.
24 Require Import Coherence_ch7_8.
25 Require Import Enrichment_ch2_8.
26 Require Import Enrichments.
27 Require Import RepresentableStructure_ch7_2.
28 Require Import GeneralizedArrow.
29 Require Import WeakFunctorCategory.
32 * Technically reifications form merely a *semicategory* (no identity
33 * maps), but one can always freely adjoin identity maps (and nothing
34 * else) to a semicategory to get a category whose non-identity-map
35 * portion is identical to the original semicategory
37 * Also, technically this category has ALL enrichments (not just the
38 * surjective monic monoidal ones), though there maps OUT OF only the
39 * surjective enrichments and INTO only the monic monoidal
40 * enrichments. It's a big pain to do this in Coq, but sort of might
41 * matter in real life: a language with really severe substructural
42 * restrictions might fail to be monoidally enriched, meaning we can't
43 * use it as a host language. But that's for the next paper...
45 Inductive GeneralizedArrowOrIdentity : SMMEs -> SMMEs -> Type :=
46 | gaoi_id : forall smme:SMMEs, GeneralizedArrowOrIdentity smme smme
47 | gaoi_ga : forall s1 s2:SMMEs, GeneralizedArrow s1 s2 -> GeneralizedArrowOrIdentity s1 s2.
49 Definition generalizedArrowOrIdentityFobj (s1 s2:SMMEs) (f:GeneralizedArrowOrIdentity s1 s2) : s1 -> s2 :=
50 match f in GeneralizedArrowOrIdentity S1 S2 return S1 -> S2 with
51 | gaoi_id s => fun x => x
52 | gaoi_ga s1 s2 f => fun a => ehom(ECategory:=s2) (enr_c_i (smme_e s2)) (ga_functor_obj f a)
55 Definition generalizedArrowOrIdentityFunc s1 s2 (f:GeneralizedArrowOrIdentity s1 s2)
56 : Functor s1 s2 (generalizedArrowOrIdentityFobj _ _ f) :=
58 | gaoi_id s => functor_id _
59 | gaoi_ga s1 s2 f => ga_functor f >>>> HomFunctor s2 (enr_c_i s2)
62 Instance compose_generalizedArrows (s0 s1 s2:SMMEs)
63 (g01:GeneralizedArrow s0 s1)(g12:GeneralizedArrow s1 s2) : GeneralizedArrow s0 s2 :=
64 { ga_functor_monoidal := g01 >>⊗>> smme_mon s1 >>⊗>> g12 }.
65 apply ga_host_lang_pure.
68 Definition generalizedArrowOrIdentityComp
69 : forall s1 s2 s3, GeneralizedArrowOrIdentity s1 s2 -> GeneralizedArrowOrIdentity s2 s3 -> GeneralizedArrowOrIdentity s1 s3.
74 apply (gaoi_ga _ _ g).
75 apply (gaoi_ga _ _ (compose_generalizedArrows _ _ _ g g0)).
78 Definition MorphismsOfCategoryOfGeneralizedArrows : @SmallFunctors SMMEs.
79 refine {| small_func := GeneralizedArrowOrIdentity
80 ; small_func_id := fun s => gaoi_id s
81 ; small_func_func := fun smme1 smme2 f => generalizedArrowOrIdentityFunc _ _ f
82 ; small_func_comp := generalizedArrowOrIdentityComp
85 destruct f as [|fobj f]; simpl in *.
87 apply if_left_identity.
88 destruct g as [|gobj g]; simpl in *.
90 apply if_right_identity.
93 apply if_associativity.
96 Definition CategoryOfGeneralizedArrows :=
97 WeakFunctorCategory MorphismsOfCategoryOfGeneralizedArrows.