1 (*********************************************************************************************************************************)
2 (* GeneralizedArrowFromReification: *)
4 (* Turn a reification into a generalized arrow *)
6 (*********************************************************************************************************************************)
8 Generalizable All Variables.
9 Require Import Preamble.
10 Require Import General.
11 Require Import Categories_ch1_3.
12 Require Import Functors_ch1_4.
13 Require Import Isomorphisms_ch1_5.
14 Require Import ProductCategories_ch1_6_1.
15 Require Import OppositeCategories_ch1_6_2.
16 Require Import Enrichment_ch2_8.
17 Require Import Subcategories_ch7_1.
18 Require Import NaturalTransformations_ch7_4.
19 Require Import NaturalIsomorphisms_ch7_5.
20 Require Import MonoidalCategories_ch7_8.
21 Require Import Coherence_ch7_8.
22 Require Import Enrichment_ch2_8.
23 Require Import RepresentableStructure_ch7_2.
24 Require Import Reification.
25 Require Import GeneralizedArrow.
27 Section GArrowFromReification.
29 Context `(K:SurjectiveEnrichment ke) `(C:MonicMonoidalEnrichment ce cme) (reification : Reification K C (me_i C)).
31 Fixpoint garrow_fobj_ vk : C :=
33 | T_Leaf None => me_i C
34 | T_Leaf (Some a) => match a with (a1,a2) => reification_r reification a1 a2 end
35 | t1,,t2 => me_f C (pair_obj (garrow_fobj_ t1) (garrow_fobj_ t2))
38 Definition garrow_fobj vk := garrow_fobj_ (projT1 (se_decomp _ K vk)).
40 Definition homset_tensor_iso
41 : forall vk:enr_v_mon K, (reification_rstar reification vk) ≅ ehom(ECategory:=C) (me_i C) (garrow_fobj vk).
44 set (se_decomp _ K vk) as sevk.
55 apply (ni_iso (reification_commutes reification e) e0).
59 apply (mf_id (reification_rstar reification)).
60 apply (mf_id (me_mf C)).
64 apply (ni_iso (mf_coherence (reification_rstar reification)) (pair_obj _ _)).
67 apply (ni_iso (mf_coherence (me_mf C)) (pair_obj _ _)).
69 apply (functors_preserve_isos (enr_v_f C) (a:=(pair_obj _ _))(b:=(pair_obj _ _))).
70 apply (iso_prod IHx1 IHx2).
73 Definition garrow_fobj' (vk:enr_v_mon K) : FullImage (HomFunctor C (me_i C)).
74 exists (ehom(ECategory:=C) (me_i C) (garrow_fobj vk)).
75 abstract (exists (garrow_fobj vk); auto).
78 Definition step1_mor {a b}(f:a~~{enr_v_mon K}~~>b) : (garrow_fobj' a)~~{FullImage (HomFunctor C (me_i C))}~~>(garrow_fobj' b).
79 exists (iso_backward (homset_tensor_iso a)
80 >>> reification_rstar reification \ f
81 >>> iso_forward (homset_tensor_iso b)).
85 (* The poorly-named "step1_functor" is a functor from the full subcategory in the range of the reification functor
86 * to the full subcategory in the range of the [host language's] Hom(I,-) functor *)
87 Definition step1_functor : Functor (enr_v_mon K) (FullImage (HomFunctor C (me_i C))) garrow_fobj'.
88 refine {| fmor := fun a b f => step1_mor f |}.
89 abstract (intros; unfold step1_mor; simpl;
90 apply comp_respects; try reflexivity;
91 apply comp_respects; try reflexivity;
92 apply fmor_respects; auto).
93 abstract (intros; unfold step1_mor; simpl;
94 setoid_rewrite fmor_preserves_id;
95 setoid_rewrite right_identity;
100 repeat setoid_rewrite <- associativity;
101 apply comp_respects; try reflexivity;
102 repeat setoid_rewrite associativity;
103 apply comp_respects; try reflexivity;
104 setoid_rewrite juggle2;
105 set (iso_comp1 (homset_tensor_iso b)) as qqq;
108 setoid_rewrite right_identity;
109 apply (fmor_preserves_comp reification)).
112 Definition step1_niso : reification ≃ step1_functor >>>> InclusionFunctor _ (FullImage (HomFunctor C (me_i C))).
113 exists (fun c1 => homset_tensor_iso c1).
116 repeat setoid_rewrite <- associativity;
117 setoid_rewrite iso_comp1;
118 setoid_rewrite left_identity;
122 (* the "step2_functor" is the section of the Hom(I,-) functor *)
123 Definition step2_functor := ff_functor_section_functor _ (ffme_mf_full C) (ffme_mf_faithful C).
125 (* the generalized arrow is the composition of the two steps *)
126 Definition garrow_functor := step1_functor >>>> step2_functor.
128 Lemma garrow_functor_monoidal_iso_i
129 : mon_i C ≅ garrow_functor (mon_i (enr_v_mon K)).
133 Lemma garrow_functor_monoidal_iso :
134 forall X Y:enr_v_mon K,
135 garrow_functor (bin_obj(BinoidalCat:=enr_v_mon K) X Y) ≅ bin_obj(BinoidalCat:=me_mon C) (garrow_functor X) (garrow_functor Y).
139 Definition garrow_functor_monoidal_niso
140 : (garrow_functor **** garrow_functor) >>>> (mon_f C) <~~~> (mon_f (enr_v_mon K)) >>>> garrow_functor.
143 Opaque homset_tensor_iso.
145 Instance garrow_functor_monoidal : MonoidalFunctor (enr_v_mon K) C garrow_functor :=
146 { mf_coherence := garrow_functor_monoidal_niso
147 ; mf_id := garrow_functor_monoidal_iso_i
154 Definition garrow_from_reification : GeneralizedArrow K C.
156 {| ga_functor := garrow_functor
157 ; ga_functor_monoidal := garrow_functor_monoidal
161 End GArrowFromReification.
162 Opaque homset_tensor_iso.