(* Title: BicategoryOfSpans Author: Eugene W. Stark , 2019 Maintainer: Eugene W. Stark *) section "Bicategories of Spans" theory BicategoryOfSpans imports Category3.ConcreteCategory IsomorphismClass CanonicalIsos EquivalenceOfBicategories SpanBicategory Tabulation begin text \ In this section, we prove CKS Theorem 4, which characterizes up to equivalence the bicategories of spans in a category with pullbacks. The characterization consists of three conditions: BS1: ``Every 1-cell is isomorphic to a composition \g \ f\<^sup>*\, where f and g are maps''; BS2: ``For every span of maps \(f, g)\ there is a 2-cell \\\ such that \(f, \, g)\ is a tabulation''; and BS3: ``Any two 2-cells between the same pair of maps are equal and invertible.'' One direction of the proof, which is the easier direction once it is established that BS1 and BS3 are respected by equivalence of bicategories, shows that if a bicategory \B\ is biequivalent to the bicategory of spans in some category \C\ with pullbacks, then it satisfies BS1 -- BS3. The other direction, which is harder, shows that a bicategory \B\ satisfying BS1 -- BS3 is biequivalent to the bicategory of spans in a certain category with pullbacks that is constructed from the sub-bicategory of maps of \B\. \ subsection "Definition" text \ We define a \emph{bicategory of spans} to be a bicategory that satisfies the conditions \BS1\ -- \BS3\ stated informally above. \ locale bicategory_of_spans = bicategory + chosen_right_adjoints + assumes BS1: "ide r \ \f g. is_left_adjoint f \ is_left_adjoint g \ isomorphic r (g \ f\<^sup>*)" and BS2: "\ is_left_adjoint f; is_left_adjoint g; src f = src g \ \ \r \. tabulation V H \ \ src trg r \ f g" and BS3: "\ is_left_adjoint f; is_left_adjoint f'; \\ : f \ f'\; \\' : f \ f'\ \ \ iso \ \ iso \' \ \ = \'" text \ Using the already-established fact \equivalence_pseudofunctor.reflects_tabulation\ that tabulations are reflected by equivalence pseudofunctors, it is not difficult to prove that the notion `bicategory of spans' respects equivalence of bicategories. \ lemma bicategory_of_spans_respects_equivalence: assumes "equivalent_bicategories V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D" and "bicategory_of_spans V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C" shows "bicategory_of_spans V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D" proof - interpret C: bicategory_of_spans V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C using assms by simp interpret C: chosen_right_adjoints V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C .. interpret D: bicategory V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D using assms equivalent_bicategories_def equivalence_pseudofunctor.axioms(1) pseudofunctor.axioms(2) by fast interpret D: chosen_right_adjoints V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D .. obtain F \ where F: "equivalence_pseudofunctor V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D F \" using assms equivalent_bicategories_def by blast interpret F: equivalence_pseudofunctor V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D F \ using F by simp interpret E: equivalence_of_bicategories V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C (* 17 sec *) F \ F.right_map F.right_cmp F.unit\<^sub>0 F.unit\<^sub>1 F.counit\<^sub>0 F.counit\<^sub>1 using F.extends_to_equivalence_of_bicategories by simp interpret E': converse_equivalence_of_bicategories V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C F \ F.right_map F.right_cmp F.unit\<^sub>0 F.unit\<^sub>1 F.counit\<^sub>0 F.counit\<^sub>1 .. interpret G: equivalence_pseudofunctor V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C F.right_map F.right_cmp using E'.equivalence_pseudofunctor_left by simp write V\<^sub>C (infixr "\\<^sub>C" 55) write V\<^sub>D (infixr "\\<^sub>D" 55) write H\<^sub>C (infixr "\\<^sub>C" 53) write H\<^sub>D (infixr "\\<^sub>D" 53) write \\<^sub>C ("\\<^sub>C[_, _, _]") write \\<^sub>D ("\\<^sub>D[_, _, _]") write C.in_hhom ("\_ : _ \\<^sub>C _\") write C.in_hom ("\_ : _ \\<^sub>C _\") write D.in_hhom ("\_ : _ \\<^sub>D _\") write D.in_hom ("\_ : _ \\<^sub>D _\") write C.isomorphic (infix "\\<^sub>C" 50) write D.isomorphic (infix "\\<^sub>D" 50) write C.some_right_adjoint ("_\<^sup>*\<^sup>C" [1000] 1000) write D.some_right_adjoint ("_\<^sup>*\<^sup>D" [1000] 1000) show "bicategory_of_spans V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D" proof show "\r'. D.ide r' \ \f' g'. D.is_left_adjoint f' \ D.is_left_adjoint g' \ r' \\<^sub>D g' \\<^sub>D (f')\<^sup>*\<^sup>D" proof - fix r' assume r': "D.ide r'" obtain f g where fg: "C.is_left_adjoint f \ C.is_left_adjoint g \ F.right_map r' \\<^sub>C g \\<^sub>C f\<^sup>*\<^sup>C" using r' C.BS1 [of "F.right_map r'"] by auto have trg_g: "trg\<^sub>C g = E.G.map\<^sub>0 (trg\<^sub>D r')" using fg r' C.isomorphic_implies_ide C.isomorphic_implies_hpar by (metis C.ideD(1) C.trg_hcomp D.ideD(1) E.G.preserves_trg) have trg_f: "trg\<^sub>C f = E.G.map\<^sub>0 (src\<^sub>D r')" using fg r' C.isomorphic_implies_ide C.isomorphic_implies_hpar by (metis C.ideD(1) C.right_adjoint_simps(2) C.src_hcomp D.ideD(1) E.G.preserves_src) define d_src where "d_src \ F.counit\<^sub>0 (src\<^sub>D r')" define e_src where "e_src \ (F.counit\<^sub>0 (src\<^sub>D r'))\<^sup>~\<^sup>D" have d_src: "\d_src : F.map\<^sub>0 (E.G.map\<^sub>0 (src\<^sub>D r')) \\<^sub>D src\<^sub>D r'\ \ D.equivalence_map d_src" using d_src_def r' E.\.map\<^sub>0_in_hhom E.\.components_are_equivalences by simp have e_src: "\e_src : src\<^sub>D r' \\<^sub>D F.map\<^sub>0 (E.G.map\<^sub>0 (src\<^sub>D r'))\ \ D.equivalence_map e_src" using e_src_def r' E.\.map\<^sub>0_in_hhom E.\.components_are_equivalences by simp obtain \_src \_src where eq_src: "equivalence_in_bicategory V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D d_src e_src \_src \_src" using d_src_def e_src_def d_src e_src D.quasi_inverses_some_quasi_inverse D.quasi_inverses_def by blast interpret eq_src: equivalence_in_bicategory V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D d_src e_src \_src \_src using eq_src by simp define d_trg where "d_trg \ F.counit\<^sub>0 (trg\<^sub>D r')" define e_trg where "e_trg \ (F.counit\<^sub>0 (trg\<^sub>D r'))\<^sup>~\<^sup>D" have d_trg: "\d_trg : F.map\<^sub>0 (E.G.map\<^sub>0 (trg\<^sub>D r')) \\<^sub>D trg\<^sub>D r'\ \ D.equivalence_map d_trg" using d_trg_def r' E.\.map\<^sub>0_in_hhom E.\.components_are_equivalences by simp have e_trg: "\e_trg : trg\<^sub>D r' \\<^sub>D F.map\<^sub>0 (E.G.map\<^sub>0 (trg\<^sub>D r'))\ \ D.equivalence_map e_trg" using e_trg_def r' E.\.map\<^sub>0_in_hhom E.\.components_are_equivalences by simp obtain \_trg \_trg where eq_trg: "equivalence_in_bicategory V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D d_trg e_trg \_trg \_trg" using d_trg_def e_trg_def d_trg e_trg D.quasi_inverses_some_quasi_inverse D.quasi_inverses_def by blast interpret eq_trg: equivalence_in_bicategory V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D d_trg e_trg \_trg \_trg using eq_trg by simp interpret eqs: two_equivalences_in_bicategory V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D d_src e_src \_src \_src d_trg e_trg \_trg \_trg .. interpret hom: subcategory V\<^sub>D \\\. \\ : trg\<^sub>D d_src \\<^sub>D trg\<^sub>D d_trg\\ using D.hhom_is_subcategory by simp interpret hom': subcategory V\<^sub>D \\\. \\ : src\<^sub>D d_src \\<^sub>D src\<^sub>D d_trg\\ using D.hhom_is_subcategory by simp interpret e: equivalence_of_categories hom.comp hom'.comp eqs.F eqs.G eqs.\ eqs.\ using eqs.induces_equivalence_of_hom_categories by simp have r'_in_hhom: "D.in_hhom r' (src\<^sub>D e_src) (src\<^sub>D e_trg)" using r' e_src e_trg by (simp add: D.in_hhom_def) define g' where "g' = d_trg \\<^sub>D F g" have g': "D.is_left_adjoint g'" unfolding g'_def using fg r' d_trg trg_g C.left_adjoint_is_ide D.equivalence_is_adjoint D.left_adjoints_compose F.preserves_left_adjoint C.ideD(1) D.in_hhom_def F.preserves_trg by metis have 1: "D.is_right_adjoint (F f\<^sup>*\<^sup>C \\<^sub>D e_src)" proof - have "D.is_right_adjoint e_src" using r' e_src D.equivalence_is_adjoint by simp moreover have "D.is_right_adjoint (F f\<^sup>*\<^sup>C)" using fg C.left_adjoint_extends_to_adjoint_pair F.preserves_adjoint_pair by blast moreover have "src\<^sub>D (F f\<^sup>*\<^sup>C) = trg\<^sub>D e_src" using fg r' trg_f C.right_adjoint_is_ide e_src by auto ultimately show ?thesis using fg r' D.right_adjoints_compose F.preserves_right_adjoint by blast qed obtain f' where f': "D.adjoint_pair f' (F f\<^sup>*\<^sup>C \\<^sub>D e_src)" using 1 by auto have f': "D.is_left_adjoint f' \ F f\<^sup>*\<^sup>C \\<^sub>D e_src \\<^sub>D (f')\<^sup>*\<^sup>D" using f' D.left_adjoint_determines_right_up_to_iso D.left_adjoint_extends_to_adjoint_pair by blast have "r' \\<^sub>D d_trg \\<^sub>D (e_trg \\<^sub>D r' \\<^sub>D d_src) \\<^sub>D e_src" using r' r'_in_hhom D.isomorphic_def eqs.\_in_hom eqs.\_components_are_iso D.isomorphic_symmetric D.ide_char eq_src.antipar(2) eq_trg.antipar(2) by metis also have 1: "... \\<^sub>D d_trg \\<^sub>D F (F.right_map r') \\<^sub>D e_src" proof - have "e_trg \\<^sub>D r' \\<^sub>D d_src \\<^sub>D F (F.right_map r')" proof - have "D.in_hom (F.counit\<^sub>1 r') (r' \\<^sub>D d_src) (F.counit\<^sub>0 (trg\<^sub>D r') \\<^sub>D F (F.right_map r'))" unfolding d_src_def using r' E.\.map\<^sub>1_in_hom(2) [of r'] by simp hence "r' \\<^sub>D d_src \\<^sub>D F.counit\<^sub>0 (trg\<^sub>D r') \\<^sub>D F (F.right_map r')" using r' D.isomorphic_def E.\.iso_map\<^sub>1_ide by auto thus ?thesis using r' e_trg_def E.\.components_are_equivalences D.isomorphic_symmetric D.quasi_inverse_transpose(2) by (metis D.isomorphic_implies_hpar(1) F.preserves_isomorphic d_trg d_trg_def eq_trg.ide_left fg) qed thus ?thesis using D.hcomp_ide_isomorphic D.hcomp_isomorphic_ide D.in_hhom_def D.isomorphic_implies_hpar(4) d_trg e_src eq_src.antipar(1-2) eq_trg.antipar(2) r' by force qed also have 2: "... \\<^sub>D d_trg \\<^sub>D (F g \\<^sub>D F f\<^sup>*\<^sup>C) \\<^sub>D e_src" proof - have "F (F.right_map r') \\<^sub>D F g \\<^sub>D F f\<^sup>*\<^sup>C" by (meson C.hseq_char C.ideD(1) C.isomorphic_implies_ide(2) C.left_adjoint_is_ide C.right_adjoint_simps(1) D.isomorphic_symmetric D.isomorphic_transitive F.preserves_isomorphic F.weakly_preserves_hcomp fg) thus ?thesis using D.hcomp_ide_isomorphic D.hcomp_isomorphic_ide by (metis 1 D.hseqE D.ideD(1) D.isomorphic_implies_hpar(2) eq_src.ide_right eq_trg.ide_left) qed also have 3: "... \\<^sub>D (d_trg \\<^sub>D F g) \\<^sub>D F f\<^sup>*\<^sup>C \\<^sub>D e_src" proof - have "... \\<^sub>D d_trg \\<^sub>D F g \\<^sub>D F f\<^sup>*\<^sup>C \\<^sub>D e_src" by (metis C.left_adjoint_is_ide C.right_adjoint_simps(1) D.hcomp_assoc_isomorphic D.hcomp_ide_isomorphic D.hcomp_simps(1) D.hseq_char D.ideD(1) D.isomorphic_implies_hpar(2) F.preserves_ide calculation eq_src.ide_right eq_trg.ide_left fg) also have "... \\<^sub>D (d_trg \\<^sub>D F g) \\<^sub>D F f\<^sup>*\<^sup>C \\<^sub>D e_src" by (metis C.left_adjoint_is_ide D.hcomp_assoc_isomorphic D.hcomp_simps(2) D.hseq_char D.ideD(1) D.isomorphic_implies_ide(1) D.isomorphic_symmetric F.preserves_ide calculation eq_trg.ide_left f' fg) finally show ?thesis by blast qed also have "... \\<^sub>D g' \\<^sub>D f'\<^sup>*\<^sup>D" using g'_def f' by (metis 3 D.adjoint_pair_antipar(1) D.hcomp_ide_isomorphic D.hseq_char D.ideD(1) D.isomorphic_implies_ide(2) g') finally have "D.isomorphic r' (g' \\<^sub>D f'\<^sup>*\<^sup>D)" by simp thus "\f' g'. D.is_left_adjoint f' \ D.is_left_adjoint g' \ r' \\<^sub>D g' \\<^sub>D f'\<^sup>*\<^sup>D" using f' g' by auto qed show "\f f' \ \'. \ D.is_left_adjoint f; D.is_left_adjoint f'; \\ : f \\<^sub>D f'\; \\' : f \\<^sub>D f'\ \ \ D.iso \ \ D.iso \' \ \ = \'" proof - fix f f' \ \' assume f: "D.is_left_adjoint f" and f': "D.is_left_adjoint f'" and \: "\\ : f \\<^sub>D f'\" and \': "\\' : f \\<^sub>D f'\" have "C.is_left_adjoint (F.right_map f) \ C.is_left_adjoint (F.right_map f')" using f f' E.G.preserves_left_adjoint by blast moreover have "\F.right_map \ : F.right_map f \\<^sub>C F.right_map f'\ \ \F.right_map \' : F.right_map f \\<^sub>C F.right_map f'\" using \ \' E.G.preserves_hom by simp ultimately have "C.iso (F.right_map \) \ C.iso (F.right_map \') \ F.right_map \ = F.right_map \'" using C.BS3 by blast thus "D.iso \ \ D.iso \' \ \ = \'" using \ \' G.reflects_iso G.is_faithful by blast qed show "\f g. \ D.is_left_adjoint f; D.is_left_adjoint g; src\<^sub>D f = src\<^sub>D g \ \ \r \. tabulation V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D r \ f g" proof - fix f g assume f: "D.is_left_adjoint f" assume g: "D.is_left_adjoint g" assume fg: "src\<^sub>D f = src\<^sub>D g" have "C.is_left_adjoint (F.right_map f)" using f E.G.preserves_left_adjoint by blast moreover have "C.is_left_adjoint (F.right_map g)" using g E.G.preserves_left_adjoint by blast moreover have "src\<^sub>C (F.right_map f) = src\<^sub>C (F.right_map g)" using f g D.left_adjoint_is_ide fg by simp ultimately have 1: "\r \. tabulation V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C r \ (F.right_map f) (F.right_map g)" using C.BS2 by simp obtain r \ where \: "tabulation V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C r \ (F.right_map f) (F.right_map g)" using 1 by auto interpret \: tabulation V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C r \ \F.right_map f\ \F.right_map g\ using \ by simp obtain r' where r': "D.ide r' \ D.in_hhom r' (trg\<^sub>D f) (trg\<^sub>D g) \ C.isomorphic (F.right_map r') r" using f g \.ide_base \.tab_in_hom G.locally_essentially_surjective by (metis D.obj_trg E.G.preserves_reflects_arr E.G.preserves_trg \.leg0_simps(2-3) \.leg1_simps(2,4) \.base_in_hom(1)) obtain \ where \: "\\ : r \\<^sub>C F.right_map r'\ \ C.iso \" using r' C.isomorphic_symmetric by blast have \: "tabulation V\<^sub>C H\<^sub>C \\<^sub>C \\<^sub>C src\<^sub>C trg\<^sub>C (F.right_map r') ((\ \\<^sub>C F.right_map f) \\<^sub>C \) (F.right_map f) (F.right_map g)" using \ \.is_preserved_by_base_iso by simp have 1: "\\'. \\' : g \\<^sub>D H\<^sub>D r' f\ \ F.right_map \' = F.right_cmp (r', f) \\<^sub>C (\ \\<^sub>C F.right_map f) \\<^sub>C \" proof - have "D.ide g" by (simp add: D.left_adjoint_is_ide g) moreover have "D.ide (H\<^sub>D r' f)" using f r' D.left_adjoint_is_ide by auto moreover have "src\<^sub>D g = src\<^sub>D (H\<^sub>D r' f)" using fg by (simp add: calculation(2)) moreover have "trg\<^sub>D g = trg\<^sub>D (H\<^sub>D r' f)" using calculation(2) r' by auto moreover have "\F.right_cmp (r', f) \\<^sub>C (\ \\<^sub>C F.right_map f) \\<^sub>C \ : F.right_map g \\<^sub>C F.right_map (r' \\<^sub>D f)\" using f g r' \ D.left_adjoint_is_ide \.ide_base by (intro C.comp_in_homI, auto) ultimately show ?thesis using G.locally_full by simp qed obtain \' where \': "\\' : g \\<^sub>D H\<^sub>D r' f\ \ F.right_map \' = F.right_cmp (r', f) \\<^sub>C (\ \\<^sub>C F.right_map f) \\<^sub>C \" using 1 by auto have "tabulation V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D r' \' f g" proof - have "C.inv (F.right_cmp (r', f)) \\<^sub>C F.right_map \' = (\ \\<^sub>C F.right_map f) \\<^sub>C \" using r' f \' C.comp_assoc C.comp_cod_arr C.invert_side_of_triangle(1) by (metis D.adjoint_pair_antipar(1) D.arrI D.in_hhomE E.G.cmp_components_are_iso E.G.preserves_arr) thus ?thesis using \ \' G.reflects_tabulation by (simp add: D.left_adjoint_is_ide f r') qed thus "\r' \'. tabulation V\<^sub>D H\<^sub>D \\<^sub>D \\<^sub>D src\<^sub>D trg\<^sub>D r' \' f g" by auto qed qed qed subsection "Span(C) is a Bicategory of Spans" text \ We first consider an arbitrary 1-cell \r\ in \Span(C)\, and show that it has a tabulation as a span of maps. This is CKS Proposition 3 (stated more strongly to assert that the ``output leg'' can also be taken to be a map, which the proof shows already). \ locale identity_arrow_in_span_bicategory = (* 20 sec *) span_bicategory C prj0 prj1 + r: identity_arrow_of_spans C r for C :: "'a comp" (infixr "\" 55) and prj0 :: "'a \ 'a \ 'a" ("\

\<^sub>0[_, _]") and prj1 :: "'a \ 'a \ 'a" ("\

\<^sub>1[_, _]") and r :: "'a arrow_of_spans_data" begin text \ CKS say: ``Suppose \r = (r\<^sub>0, R, r\<^sub>1): A \ B\ and put \f = (1, R, r\<^sub>0)\, \g = (1, R, r\<^sub>1)\. Let \k\<^sub>0, k\<^sub>1\ form a kernel pair for \r\<^sub>0\ and define \\\ by \k\<^sub>0\ = k\<^sub>1\ = 1\<^sub>R\.'' \ abbreviation ra where "ra \ r.dom.apex" abbreviation r0 where "r0 \ r.dom.leg0" abbreviation r1 where "r1 \ r.dom.leg1" abbreviation f where "f \ mkIde ra r0" abbreviation g where "g \ mkIde ra r1" abbreviation k0 where "k0 \ \

\<^sub>0[r0, r0]" abbreviation k1 where "k1 \ \

\<^sub>1[r0, r0]" text \ Here \ra\ is the apex \R\ of the span \(r\<^sub>0, R, r\<^sub>1)\, and the spans \f\ and \g\ also have that same 0-cell as their apex. The tabulation 2-cell \\\ has to be an arrow of spans from \g = (1, R, r\<^sub>1)\ to \r \ f\, which is the span \(k\<^sub>0, r\<^sub>1 \ k\<^sub>1)\. \ abbreviation \ where "\ \ \Chn = \ra \r0, r0\ ra\, Dom = \Leg0 = ra, Leg1 = r1\, Cod = \Leg0 = k0, Leg1 = r1 \ k1\\" lemma has_tabulation: shows "tabulation vcomp hcomp assoc unit src trg r \ f g" and "is_left_adjoint f" and "is_left_adjoint g" proof - have ide_f: "ide f" using ide_mkIde r.dom.leg_in_hom(1) C.arr_dom C.dom_dom r.dom.apex_def r.dom.leg_simps(1) by presburger interpret f: identity_arrow_of_spans C f using ide_f ide_char' by auto have ide_g: "ide g" using ide_mkIde r.dom.leg_in_hom by (metis C.arr_dom C.dom_dom r.dom.leg_simps(3) r.dom.leg_simps(4)) interpret g: identity_arrow_of_spans C g using ide_g ide_char' by auto show "is_left_adjoint f" using is_left_adjoint_char [of f] ide_f by simp show "is_left_adjoint g" using is_left_adjoint_char [of g] ide_g by simp have ide_r: "ide r" using ide_char' r.identity_arrow_of_spans_axioms by auto have src_r: "src r = mkObj (C.cod r0)" by (simp add: ide_r src_def) have trg_r: "trg r = mkObj (C.cod r1)" by (simp add: ide_r trg_def) have src_f: "src f = mkObj ra" using ide_f src_def by auto have trg_f: "trg f = mkObj (C.cod r0)" using ide_f trg_def by auto have src_g: "src g = mkObj ra" using ide_g src_def by auto have trg_g: "trg g = mkObj (C.cod r1)" using ide_g trg_def by auto have hseq_rf: "hseq r f" using ide_r ide_f src_r trg_f by simp interpret rf: two_composable_arrows_of_spans C prj0 prj1 r f using hseq_rf hseq_char by unfold_locales auto interpret rf: two_composable_identity_arrows_of_spans C prj0 prj1 r f .. interpret rf: identity_arrow_of_spans C \r \ f\ using rf.ide_composite ide_char' by auto let ?rf = "r \ f" (* TODO: Put this expansion into two_composable_identity_arrows_of_spans. *) have rf: "?rf = \Chn = r0 \\ r0, Dom = \Leg0 = k0, Leg1 = r1 \ k1\, Cod = \Leg0 = k0, Leg1 = r1 \ k1\\" unfolding hcomp_def chine_hcomp_def using hseq_rf C.comp_cod_arr by auto interpret Cod_rf: span_in_category C \\Leg0 = k0, Leg1 = r1 \ k1\\ using ide_r ide_f rf C.comp_cod_arr by unfold_locales auto have Dom_g: "Dom g = \Leg0 = ra, Leg1 = r1\" by simp interpret Dom_g: span_in_category C \\Leg0 = ra, Leg1 = r1\\ using Dom_g g.dom.span_in_category_axioms by simp interpret Dom_\: span_in_category C \Dom \\ using Dom_g g.dom.span_in_category_axioms by simp interpret Cod_\: span_in_category C \Cod \\ using rf Cod_rf.span_in_category_axioms by simp interpret \: arrow_of_spans C \ using Dom_\.apex_def Cod_\.apex_def C.comp_assoc C.comp_arr_dom by unfold_locales auto have \: "\\ : g \ r \ f\" using rf ide_g arr_char dom_char cod_char \.arrow_of_spans_axioms ideD(2) Cod_rf.apex_def g.dom.leg_simps(4) by auto show "tabulation vcomp hcomp assoc unit src trg r \ f g" proof - interpret T: tabulation_data vcomp hcomp assoc unit src trg r \ f g using ide_f \ by unfold_locales auto show ?thesis proof show T1: "\u \. \ ide u; \\ : dom \ \ r \ u\ \ \ \w \ \. ide w \ \\ : f \ w \ u\ \ \\ : dom \ \ g \ w\ \ iso \ \ T.composite_cell w \ \ \ = \" proof - fix u \ assume u: "ide u" assume \: "\\ : dom \ \ r \ u\" show "\w \ \. ide w \ \\ : f \ w \ u\ \ \\ : dom \ \ g \ w\ \ iso \ \ T.composite_cell w \ \ \ = \" proof - interpret u: identity_arrow_of_spans C u using u ide_char' by auto have v: "ide (dom \)" using \ by auto interpret v: identity_arrow_of_spans C \dom \\ using v ide_char' by auto interpret \: arrow_of_spans C \ using \ arr_char by auto have hseq_ru: "hseq r u" using u \ ide_cod by fastforce interpret ru: two_composable_arrows_of_spans C prj0 prj1 r u using hseq_ru hseq_char by unfold_locales auto interpret ru: two_composable_identity_arrows_of_spans C prj0 prj1 r u .. text \ CKS say: ``We must show that \(f, \, g)\ is a wide tabulation of \r\. Take \u = (u\<^sub>0, U, u\<^sub>1): X \ A\, \v = (v\<^sub>0, V, v\<^sub>1): X \ B\, \\: v \ ru\ as in \T1\. Let \P\ be the pullback of \u\<^sub>1, r\<^sub>0\. Let \w = (v\<^sub>0, V, p\<^sub>1\): X \ R\, \\ = p\<^sub>0\: fw \ u\, \\ = 1: v \ gw\; so \\ = (r\)(\w)\\ as required.'' \ let ?R = "r.apex" let ?A = "C.cod r0" let ?B = "C.cod r1" let ?U = "u.apex" let ?u0 = "u.leg0" let ?u1 = "u.leg1" let ?X = "C.cod ?u0" let ?V = "v.apex" let ?v0 = "v.leg0" let ?v1 = "v.leg1" let ?\ = "\.chine" let ?P = "r0 \\ ?u1" let ?p0 = "\

\<^sub>0[r0, ?u1]" let ?p1 = "\

\<^sub>1[r0, ?u1]" let ?w1 = "?p1 \ ?\" define w where "w = mkIde ?v0 ?w1" let ?Q = "?R \\ ?w1" let ?q1 = "\

\<^sub>0[?R, ?w1]\. What CKS say is only correct if the projection \\

\<^sub>0[?R, ?w1]\ is an identity, which can't be guaranteed for an arbitrary choice of pullbacks. \ define \ where "\ = \Chn = ?p0 \ ?\ \ \

\<^sub>0[?R, ?w1], Dom = Dom (f \ w), Cod = Cod u\" interpret Dom_\: span_in_category C \Dom \\ using \_def fw.dom.span_in_category_axioms by simp interpret Cod_\: span_in_category C \Cod \\ using \_def u.cod.span_in_category_axioms by simp have Dom_\_leg0_eq: "Dom_\.leg0 = ?v0 \ \

\<^sub>0[?R, ?w1]" using w_def \_def hcomp_def hseq_fw hseq_char by simp have Dom_\_leg1_eq: "Dom_\.leg1 = r0 \ ?q1" using w_def \_def hcomp_def hseq_fw hseq_char by simp have Cod_\_leg0_eq: "Cod_\.leg0 = ?u0" using w_def \_def hcomp_def hseq_fw hseq_char by simp have Cod_\_leg1_eq: "Cod_\.leg1 = ?u1" using w_def \_def hcomp_def hseq_fw hseq_char by simp have Chn_\_eq: "Chn \ = ?p0 \ ?\ \ \

\<^sub>0[?R, ?w1]" using \_def by simp interpret \: arrow_of_spans C \ proof show 1: "\Chn \ : Dom_\.apex \\<^sub>C Cod_\.apex\" using \_def Chn_\ ru.legs_form_cospan fw_apex_eq by (intro C.in_homI, auto) show "Cod_\.leg0 \ Chn \ = Dom_\.leg0" proof - have "Cod_\.leg0 \ Chn \ = ?u0 \ ?p0 \ ?\ \ \

\<^sub>0[?R, ?w1]" using Cod_\_leg0_eq Chn_\_eq by simp also have "... = ?v0 \ \

\<^sub>0[?R, ?w1]" proof - have "?u0 \ ?p0 \ ?\ \ \

\<^sub>0[?R, ?w1] = (?u0 \ ?p0 \ ?\) \ \

\<^sub>0[?R, ?w1]" using C.comp_assoc by simp also have "... = ?v0 \ \

\<^sub>0[?R, ?w1]" proof - have "?u0 \ ?p0 \ ?\ = (?u0 \ ?p0) \ ?\" using C.comp_assoc by simp also have "... = \.cod.leg0 \ ?\" by (metis \ arrow_of_spans_data.select_convs(2) cod_char in_homE ru.leg0_composite) also have "... = \.dom.leg0" using \.leg0_commutes by simp also have "... = ?v0" using \ dom_char by auto finally show ?thesis by simp qed finally show ?thesis by simp qed also have "... = Dom_\.leg0" using Dom_\_leg0_eq by simp finally show ?thesis by blast qed show "Cod_\.leg1 \ Chn \ = Dom_\.leg1" proof - have "Cod_\.leg1 \ Chn \ = ?u1 \ ?p0 \ ?\ \ \

\<^sub>0[?R, ?w1]" using Cod_\_leg1_eq Chn_\_eq by simp also have "... = r0 \ ?q1" proof - have "?u1 \ ?p0 \ ?\ \ \

\<^sub>0[?R, ?w1] = ((?u1 \ ?p0) \ ?\) \ \

\<^sub>0[?R, ?w1]" using C.comp_assoc by fastforce also have "... = ((r0 \ ?p1) \ ?\) \ \

\<^sub>0[?R, ?w1]" using C.pullback_commutes' ru.legs_form_cospan by simp also have "... = r0 \ ?w1 \ \

\<^sub>0[?R, ?w1]" using C.comp_assoc by fastforce also have "... = r0 \ ?R \ ?q1" using \ C.in_homE C.pullback_commutes' w1 by auto also have "... = r0 \ ?q1" using \ w1 C.comp_cod_arr by auto finally show ?thesis by simp qed also have "... = Dom_\.leg1" using Dom_\_leg1_eq by simp finally show ?thesis by blast qed qed text \ Similarly, CKS say to take \\ = 1: v \ gw\, but obviously this can't be interpreted literally, either, because \v.apex\ and \gw.apex\ are not equal. Instead, we have to define \\\ so that \Chn \ = C.inv \

\<^sub>0[?R, ?w1]\, noting that \\

\<^sub>0[?R, ?w1]\ is the pullback of an identity, hence is an isomorphism. Then \?v0 \ \

\<^sub>0[?R, ?w1] \ Chn \ = ?v0\ and \?v1 \ \

\<^sub>1[?R, ?w1] \ Chn \ = ?v1 \ ?w1\, showing that \\\ is an arrow of spans. \ let ?\' = "\

\<^sub>0[?R, ?w1]" define \ where "\ = \Chn = C.inv ?\', Dom = Dom (dom \), Cod = Cod (g \ w)\" have iso_\: "C.inverse_arrows ?\' (Chn \)" using \_def \ w1 C.iso_pullback_ide by (metis C.inv_is_inverse C.seqE arrow_of_spans_data.select_convs(1) r.chine_eq_apex r.chine_simps(1) r.chine_simps(3) r.cod_simps(1) r.dom.apex_def r.dom.ide_apex r.dom.is_span r1w1 v.dom.leg_simps(3)) text \ $$ \xymatrix{ && X \\ && V \ar[u]_{v_0} \ar[d]_{\omega} \ar@/ul50pt/[ddddll]_{v_1} \ar@/l30pt/[dd]_<>(0.7){w_1}\\ & R\downarrow\downarrow w_1 \ar[ur]^{\nu'} \ar[dd]_{q_1} & r_0\downarrow\downarrow u_1 \ar[d]_{p_1} \ar@/dl10pt/[drr]_<>(0.4){p_0} & R\downarrow\downarrow w_1 \ar[ul]_{\nu'} \ar[dd]^<>(0.7){q_1} \ar@ {.>}[dr]_{\theta}\\ && R && U \ar@/ur20pt/[uuull]_{u_0} \ar[dd]^{u_1} \\ & R \ar[dl]_{r_1} \ar@ {<->}[ur]_{R} \ar@ {.>}[dr]^{\rho} \ar@/dl5pt/[ddr]_<>(0.4){R} && R \ar@ {<->}[ul]^{R} \ar[dr]^{r_0} \ar[ur]_{r_1}\\ B && r_0\downarrow\downarrow r_0 \ar[uu]_{k_0} \ar[d]^{k_1} \ar[uu] \ar[ur]_{k_0} && A \\ & & R \ar[ull]^{r_1} \ar[urr]_{r_0} \\ } $$ \ have w1_eq: "?w1 = ?q1 \ C.inv ?\'" proof - have "?R \ ?q1 = ?w1 \ ?\'" using iso_\ \ w1 C.pullback_commutes [of ?R ?w1] by blast hence "?q1 = ?w1 \ ?\'" using \ w1 C.comp_cod_arr by auto thus ?thesis using iso_\ C.invert_side_of_triangle(2) by (metis C.isoI C.prj1_simps(1) arrow_of_spans_data.select_convs(3) fw.legs_form_cospan(2) span_data.simps(1-2) w_def) qed interpret Dom_\: span_in_category C \Dom \\ using \_def v.dom.span_in_category_axioms by simp interpret Cod_\: span_in_category C \Cod \\ using \_def gw.cod.span_in_category_axioms by simp interpret \: arrow_of_spans C \ proof show 1: "\Chn \ : Dom_\.apex \\<^sub>C Cod_\.apex\" proof show "C.arr (Chn \)" using iso_\ by auto show "C.dom (Chn \) = Dom_\.apex" using \_def iso_\ w1 gw_apex_eq by fastforce show "C.cod (Chn \) = Cod_\.apex" using \_def iso_\ gw_apex_eq C.comp_inv_arr C.pbdom_def by (metis C.cod_comp arrow_of_spans_data.select_convs(3) gw.apex_composite gw.chine_composite gw.chine_simps(1,3)) qed show "Cod_\.leg0 \ Chn \ = Dom_\.leg0" using w_def \_def 1 iso_\ hcomp_def hseq_gw C.comp_arr_inv C.comp_assoc v.leg0_commutes by auto show "Cod_\.leg1 \ Chn \ = Dom_\.leg1" using w_def \_def hcomp_def hseq_gw C.comp_assoc w1_eq r1w1 by auto qed text \ Now we can proceed to establishing the conclusions of \T1\. \ have "ide w \ \\ : f \ w \ u\ \ \\ : dom \ \ dom \ \ w\ \ iso \ \ T.composite_cell w \ \ \ = \" proof (intro conjI) show ide_w: "ide w" using w by blast show \: "\\ : f \ w \ u\" using \_def \.arrow_of_spans_axioms arr_char dom_char cod_char hseq_fw hseq_char hcomp_def fw.chine_eq_apex by auto show \: "\\ : dom \ \ dom \ \ w\" proof - have "\\ : dom \ \ g \ w\" using \_def \ \.arrow_of_spans_axioms arr_char dom_char cod_char hseq_gw hseq_char hcomp_def gw.chine_eq_apex by auto thus ?thesis using T.tab_in_hom by simp qed show "iso \" using iso_\ iso_char arr_char \.arrow_of_spans_axioms by auto show "T.composite_cell w \ \ \ = \" proof (intro arr_eqI) have \w: "\\ \ w : g \ w \ (r \ f) \ w\" using w_def \ ide_w hseq_rf hseq_fw hseq_gw by auto have r\: "\r \ \ : r \ f \ w \ r \ u\" using arfw ide_r \ fw.composite_simps(2) rf.composable by auto have 1: "\T.composite_cell w \ \ \ : dom \ \ r \ u\" using \ \w arfw r\ by auto show 3: "par (T.composite_cell w \ \ \) \" using 1 \ by (elim in_homE, auto) show "Chn (T.composite_cell w \ \ \) = ?\" proof - have 2: "Chn (T.composite_cell w \ \ \) = Chn (r \ \) \ Chn \[r, f, w] \ Chn (\ \ w) \ Chn \" using 1 3 Chn_vcomp C.comp_assoc by (metis (full_types) seqE) also have "... = ?\" proof - let ?LHS = "Chn (r \ \) \ Chn \[r, f, w] \ Chn (\ \ w) \ Chn \" have Chn_r\: "Chn (r \ \) = \r.chine \ \

\<^sub>1[r0, r0 \ ?q1] \r0, ?u1\ \.chine \ \

\<^sub>0[r0, r0 \ ?q1]\" using r\ hcomp_def \_def chine_hcomp_def Dom_\_leg1_eq by (metis arrI arrow_of_spans_data.select_convs(1,3) hseq_char r.cod_simps(2) u.cod_simps(3)) have Chn_arfw: "Chn \[r, f, w] = rfw.chine_assoc" using \_ide ide_f rf.composable fw.composable w by auto have Chn_\w: "Chn (\ \ w) = \?\ \ ?q1 \k0, ?w1\ ?\'\" proof - have "Chn (\ \ w) = chine_hcomp \Chn = ?\, Dom = \Leg0 = ?R, Leg1 = r1\, Cod = \Leg0 = k0, Leg1 = r1 \ k1\\ \Chn = v.apex, Dom = \Leg0 = ?v0, Leg1 = ?w1\, Cod = \Leg0 = ?v0, Leg1 = ?w1\\" using \ ide_w hseq_rf hseq_char hcomp_def src_def trg_def by (metis (no_types, lifting) \w arrI arrow_of_spans_data.select_convs(1) v.dom.apex_def w_def) also have "... = \?\ \ ?q1 \k0, ?w1\ ?V \ ?\'\" unfolding chine_hcomp_def by simp also have "... = \?\ \ ?q1 \k0, ?w1\ ?\'\" proof - have "?V \ ?\' = ?\'" using C.comp_ide_arr v.dom.ide_apex \ w1 by auto thus ?thesis by simp qed finally show ?thesis by blast qed have 3: "C.seq ?p1 ?\" using w1 by blast moreover have 4: "C.seq ?p1 ?LHS" proof show "\?LHS : v.apex \\<^sub>C ru.apex\" by (metis (no_types, lifting) 1 2 Chn_in_hom ru.chine_eq_apex v.chine_eq_apex) show "\?p1 : ru.apex \\<^sub>C ?R\" using P C.prj1_in_hom ru.legs_form_cospan by fastforce qed moreover have "?p0 \ ?LHS = ?p0 \ ?\" proof - have "?p0 \ ?LHS = (?p0 \ Chn (r \ \)) \ Chn \[r, f, w] \ Chn (\ \ w) \ Chn \" using C.comp_assoc by simp also have "... = (\.chine \ \

\<^sub>0[r0, r0 \ ?q1]) \ Chn \[r, f, w] \ Chn (\ \ w) \ Chn \" proof - have "?p0 \ Chn (r \ \) = \.chine \ \

\<^sub>0[r0, r0 \ ?q1]" by (metis C.prj_tuple(1) Chn_r\ \_def arrI Dom_\_leg1_eq arrow_of_spans_data.select_convs(3) chine_hcomp_props(2) hseq_char r.cod_simps(2) r\ u.cod_simps(3)) thus ?thesis by argo qed also have "... = ?p0 \ ?\ \ (rfw.Prj\<^sub>0\<^sub>0 \ Chn \[r, f, w]) \ Chn (\ \ w) \ Chn \" using w_def \_def C.comp_assoc by simp also have "... = ?p0 \ ?\ \ (rfw.Prj\<^sub>0 \ Chn (\ \ w)) \ Chn \" using Chn_arfw rfw.prj_chine_assoc C.comp_assoc by simp also have "... = ?p0 \ ?\ \ ?\' \ Chn \" proof - have "rfw.Prj\<^sub>0 \ Chn (\ \ w) = \

\<^sub>0[k0, ?w1] \ \?\ \ ?q1 \k0, ?w1\ ?\'\" using w_def Chn_\w C.comp_cod_arr by simp also have "... = ?\'" by (metis (no_types, lifting) C.not_arr_null C.prj_tuple(1) C.seqE C.tuple_is_extensional Chn_\w 4) finally have "rfw.Prj\<^sub>0 \ Chn (\ \ w) = ?\'" by blast thus ?thesis by simp qed also have "... = ?p0 \ ?\" using iso_\ C.comp_arr_dom by (metis (no_types, lifting) C.comp_arr_inv C.dom_comp \_def \.chine_simps(1) 3 arrow_of_spans_data.simps(1) w1_eq) finally show ?thesis by blast qed moreover have "?p1 \ ?LHS = ?w1" proof - have "?p1 \ ?LHS = (?p1 \ Chn (r \ \)) \ Chn \[r, f, w] \ Chn (\ \ w) \ Chn \" using C.comp_assoc by simp also have "... = (r.chine \ \

\<^sub>1[r0, r0 \ ?q1]) \ Chn \[r, f, w] \ Chn (\ \ w) \ Chn \" by (metis (no_types, lifting) C.not_arr_null C.prj_tuple(2) C.seqE C.tuple_is_extensional Chn_r\ 4) also have "... = r.chine \ (rfw.Prj\<^sub>1 \ Chn \[r, f, w]) \ Chn (\ \ w) \ Chn \" using w_def Dom_\_leg1_eq C.comp_assoc by simp also have "... = r.chine \ (rfw.Prj\<^sub>1\<^sub>1 \ Chn (\ \ w)) \ Chn \" using Chn_arfw rfw.prj_chine_assoc(1) C.comp_assoc by simp also have "... = r.chine \ ?q1 \ Chn \" proof - have "rfw.Prj\<^sub>1\<^sub>1 \ Chn (\ \ w) = (k1 \ \

\<^sub>1[k0, ?w1]) \ \?\ \ ?q1 \k0, ?w1\ ?\'\" using w_def Chn_\w C.comp_cod_arr by simp also have "... = k1 \ \

\<^sub>1[k0, ?w1] \ \?\ \ ?q1 \k0, ?w1\ ?\'\" using C.comp_assoc by simp also have "... = k1 \ ?\ \ ?q1" by (metis (no_types, lifting) C.not_arr_null C.prj_tuple(2) C.seqE C.tuple_is_extensional Chn_\w 4) also have "... = (k1 \ ?\) \ ?q1" using C.comp_assoc by presburger also have "... = ?R \ ?q1" by simp also have "... = ?q1" by (metis Dom_\_leg1_eq C.comp_ide_arr C.prj1_simps(3) C.prj1_simps_arr C.seqE C.seqI Dom_\.leg_simps(3) r.dom.ide_apex) finally have "rfw.Prj\<^sub>1\<^sub>1 \ Chn (\ \ w) = ?q1" by blast thus ?thesis by simp qed also have "... = (r.chine \ ?p1) \ ?\" using \_def w1_eq C.comp_assoc by simp also have "... = ?w1" using C.comp_cod_arr r.chine_eq_apex ru.prj_simps(1) by auto finally show ?thesis by blast qed ultimately show ?thesis using ru.legs_form_cospan C.prj_joint_monic by blast qed finally show ?thesis by argo qed qed qed thus ?thesis using w_def by auto qed qed show T2: "\u w w' \ \' \. \ ide w; ide w'; \\ : f \ w \ u\; \\' : f \ w' \ u\; \\ : g \ w \ g \ w'\; T.composite_cell w \ = T.composite_cell w' \' \ \ \ \ \!\. \\ : w \ w'\ \ \ = g \ \ \ \ = \' \ (f \ \)" proof - fix u w w' \ \' \ assume ide_w: "ide w" assume ide_w': "ide w'" assume \: "\\ : f \ w \ u\" assume \': "\\' : f \ w' \ u\" assume \: "\\ : g \ w \ g \ w'\" assume E: "T.composite_cell w \ = T.composite_cell w' \' \ \" interpret T: uw\w'\'\ vcomp hcomp assoc unit src trg r \ f g u w \ w' \' \ using ide_w ide_w' \ \' \ E comp_assoc by unfold_locales auto show "\!\. \\ : w \ w'\ \ \ = g \ \ \ \ = \' \ (f \ \)" proof interpret u: identity_arrow_of_spans C u using T.uw\.u_simps(1) ide_char' by auto interpret w: identity_arrow_of_spans C w using ide_w ide_char' by auto interpret w': identity_arrow_of_spans C w' using ide_w' ide_char' by auto let ?u0 = u.leg0 let ?u1 = u.leg1 let ?w0 = w.leg0 let ?w1 = w.leg1 let ?wa = "w.apex" let ?w0' = w'.leg0 let ?w1' = w'.leg1 let ?wa' = "w'.apex" let ?R = ra let ?p0 = "\

\<^sub>0[?R, ?w1]" let ?p0' = "\

\<^sub>0[?R, ?w1']" let ?p1 = "\

\<^sub>1[?R, ?w1]" let ?p1' = "\

\<^sub>1[?R, ?w1']" interpret fw: two_composable_identity_arrows_of_spans C prj0 prj1 f w using hseq_char by unfold_locales auto interpret fw': two_composable_identity_arrows_of_spans C prj0 prj1 f w' using hseq_char by unfold_locales auto have hseq_gw: "hseq g w" using T.leg1_in_hom by auto interpret gw: two_composable_identity_arrows_of_spans C prj0 prj1 g w using hseq_gw hseq_char by unfold_locales auto have hseq_gw': "hseq g w'" using T.leg1_in_hom by auto interpret gw': two_composable_identity_arrows_of_spans C prj0 prj1 g w' using hseq_gw' hseq_char by unfold_locales auto interpret rfw: three_composable_identity_arrows_of_spans C prj0 prj1 r f w .. interpret rfw: identity_arrow_of_spans C \r \ f \ w\ using rfw.composites_are_identities ide_char' by auto interpret rfw': three_composable_arrows_of_spans C prj0 prj1 r f w' .. interpret rfw': three_composable_identity_arrows_of_spans C prj0 prj1 r f w' .. interpret rfw': identity_arrow_of_spans C \r \ f \ w'\ using rfw'.composites_are_identities ide_char' by auto have \w: "\\ \ w : g \ w \ (r \ f) \ w\" using \ hseq_gw by blast interpret \w: two_composable_arrows_of_spans C prj0 prj1 \ w using \w by unfold_locales auto have \w': "\\ \ w' : g \ w' \ (r \ f) \ w'\" using \ hseq_gw' by blast interpret \w': two_composable_arrows_of_spans C prj0 prj1 \ w' using \w' by unfold_locales auto have arfw: "\\[r, f, w] : (r \ f) \ w \ r \ f \ w\" using fw.composable ide_f ide_r ide_w rf.composable by auto have arfw': "\\[r, f, w'] : (r \ f) \ w' \ r \ f \ w'\" using fw'.composable ide_f ide_r ide_w' rf.composable by auto have r\: "\r \ \ : r \ f \ w \ r \ u\" by fastforce interpret Dom_\: span_in_category C \Dom \\ using fw.dom.span_in_category_axioms by (metis \ arrow_of_spans_data.select_convs(2) in_homE dom_char) interpret Cod_\: span_in_category C \Cod \\ using \ u.cod.span_in_category_axioms cod_char by auto interpret \: arrow_of_spans C \ using arr_char T.uw\.\_simps(1) by auto interpret r\: two_composable_arrows_of_spans C prj0 prj1 r \ using r\ by unfold_locales auto have r\': "\r \ \' : r \ f \ w' \ r \ u\" by fastforce interpret Dom_\': span_in_category C \Dom \'\ using fw'.dom.span_in_category_axioms by (metis \' arrow_of_spans_data.select_convs(2) in_homE dom_char) interpret Cod_\': span_in_category C \Cod \'\ using \' u.cod.span_in_category_axioms cod_char by auto interpret \': arrow_of_spans C \' using arr_char T.uw'\'.\_simps(1) by auto interpret r\': two_composable_arrows_of_spans C prj0 prj1 r \' using r\' by unfold_locales auto have 7: "\T.composite_cell w' \' \ \ : g \ w \ r \ u\" using \ \w' arfw' r\' by auto have 8: "\T.composite_cell w \ : g \ w \ r \ u\" using \w arfw r\ by auto interpret ru: two_composable_identity_arrows_of_spans C prj0 prj1 r u using hseq_char by unfold_locales auto interpret Dom_\: span_in_category C \Dom \\ using \ fw.dom.span_in_category_axioms arr_char by (metis comp_arr_dom in_homE gw.cod.span_in_category_axioms seq_char) interpret Cod_\: span_in_category C \Cod \\ using \ fw.cod.span_in_category_axioms arr_char by (metis (no_types, lifting) comp_arr_dom ideD(2) in_homI gw'.cod.span_in_category_axioms gw'.chine_is_identity hseq_gw' seqI' seq_char ide_char) interpret \: arrow_of_spans C \ using \ arr_char by auto text \ CKS say: ``Take \u\, \w\, \w'\, \\\, \\'\ as in \T2\ and note that \fw = (w\<^sub>0, W, r\<^sub>0 w\<^sub>1)\, \gw = (w\<^sub>0, W, r\<^sub>1 w\<^sub>1)\, \emph{etc}. So \\: W \ W'\ satisfies \w\<^sub>0 = w\<^sub>0' \\, \r\<^sub>1 w\<^sub>1 = r\<^sub>1 w\<^sub>1' \\. But the equation \(r\)(\w) = (r\')(\w')\\ gives \w\<^sub>1 = w\<^sub>1'\. So \\ = \ : w \ w'\ is unique with \\ = g \, \ = \' (f \).\'' Once again, there is substantial punning in the proof sketch given by CKS. We can express \fw\ and \gw\ almost in the form they indicate, but projections are required. \ have cospan: "C.cospan ?R ?w1" using hseq_char [of \ w] src_def trg_def by auto have cospan': "C.cospan ?R ?w1'" using hseq_char [of \ w'] src_def trg_def by auto have fw: "f \ w = \Chn = ?R \\ ?w1, Dom = \Leg0 = ?w0 \ ?p0, Leg1 = r0 \ ?p1\, Cod = \Leg0 = ?w0 \ ?p0, Leg1 = r0 \ ?p1\\" using ide_f hseq_char hcomp_def chine_hcomp_def fw.dom.apex_def cospan fw.chine_eq_apex by auto have gw: "g \ w = \Chn = ?R \\ ?w1, Dom = \Leg0 = ?w0 \ ?p0, Leg1 = r1 \ ?p1\, Cod = \Leg0 = ?w0 \ ?p0, Leg1 = r1 \ ?p1\\" using hseq_gw hseq_char hcomp_def chine_hcomp_def gw.dom.apex_def cospan gw.chine_eq_apex by auto have fw': "f \ w' = \Chn = ?R \\ ?w1', Dom = \Leg0 = ?w0' \ ?p0', Leg1 = r0 \ ?p1'\, Cod = \Leg0 = ?w0' \ ?p0', Leg1 = r0 \ ?p1'\\" using ide_f hseq_char hcomp_def chine_hcomp_def fw'.dom.apex_def cospan' fw'.chine_eq_apex by auto have gw': "g \ w' = \Chn = ?R \\ ?w1', Dom = \Leg0 = ?w0' \ ?p0', Leg1 = r1 \ ?p1'\, Cod = \Leg0 = ?w0' \ ?p0', Leg1 = r1 \ ?p1'\\" using hseq_gw' hseq_char hcomp_def chine_hcomp_def gw'.dom.apex_def cospan' gw'.chine_eq_apex by auto text \ Note that \?p0\ and \?p0'\ are only isomorphisms, not identities, and we have \?p1\ (which equals \?w1 \ ?p0\) and \?p1'\ (which equals \?w1' \ ?p0'\) in place of \?w1\ and \?w1'\. \ text \ The following diagram summarizes the various given and defined arrows involved in the proof. We have deviated slightly here from the nomenclature used in in CKS. We prefer to use \W\ and \W'\ to denote the apexes of \w\ and \w'\, respectively. We already have the expressions \?R \\ ?w1\ and \?R \\ ?w1'\ for the apexes of \fw\ and \fw'\ (which are the same as the apexes of \gw\ and \gw'\, respectively) and we will not use any abbreviation for them. \ text \ $$ \xymatrix{ &&& X \\ && W \ar[ur]^{w_0} \ar[dr]_{w_1} \ar@ {.>}[rr]^{\gamma} && W' \ar[ul]_{w_0'} \ar[dl]^{w_1'} && U \ar@/r10pt/[dddl]^{u_1} \ar@/u7pt/[ulll]_{u_0}\\ & R\downarrow\downarrow w_1 \ar[ur]_{p_0} \ar[dr]^{p_1} \ar@/d15pt/[rrrr]_{\beta} \ar@/u100pt/[urrrrr]^{\theta} && R && R \downarrow\downarrow w_1' \ar[ul]^{p_0'} \ar[dl]^{p_1'} \ar[ur]_{\theta'} \\ && R \ar@ {.>}[dr]_{\rho} \ar@/dl7pt/[ddr]_{R} \ar[ur]_{R} \ar[dl]_{r_1} \ar@ {<->}[rr]_{R} && R \ar[ul]^{R} \ar[dr]_{r_0} \\ & B && r_0 \downarrow\downarrow r_0 \ar[d]^{k_1} \ar[ur]_{k_0} && A \\ &&& R \ar@/dr10pt/[urr]_{r_0} \ar@/dl5pt/[ull]^{r_1} } $$ \ have Chn_\: "\\.chine: ?R \\ ?w1 \\<^sub>C ?R \\ ?w1'\" using gw gw' Chn_in_hom \ gw'.chine_eq_apex gw.chine_eq_apex by force have \_eq: "\ = \Chn = \.chine, Dom = \Leg0 = ?w0 \ ?p0, Leg1 = r1 \ ?p1\, Cod = \Leg0 = ?w0' \ ?p0', Leg1 = r1 \ ?p1'\\" using \ gw gw' dom_char cod_char by auto have Dom_\_eq: "Dom \ = \Leg0 = ?w0 \ ?p0, Leg1 = r1 \ ?p1\" using \ gw gw' dom_char cod_char by auto have Cod_\_eq: "Cod \ = \Leg0 = ?w0' \ ?p0', Leg1 = r1 \ ?p1'\" using \ gw gw' dom_char cod_char by auto have \0: "?w0 \ ?p0 = ?w0' \ ?p0' \ \.chine" using Dom_\_eq Cod_\_eq \.leg0_commutes C.comp_assoc by simp have \1: "r1 \ ?p1 = r1 \ ?p1' \ \.chine" using Dom_\_eq Cod_\_eq \.leg1_commutes C.comp_assoc by simp have Dom_\_0: "Dom_\.leg0 = ?w0 \ ?p0" using arrI dom_char fw T.uw\.\_simps(4) by auto have Cod_\_0: "Cod_\.leg0 = ?u0" using \ cod_char by auto have Dom_\_1: "Dom_\.leg1 = r0 \ ?p1" using arrI dom_char fw T.uw\.\_simps(4) by auto have Cod_\_1: "Cod_\.leg1 = ?u1" using T.uw\.\_simps(5) cod_char by auto have Dom_\'_0: "Dom_\'.leg0 = ?w0' \ ?p0'" using dom_char fw' T.uw'\'.\_simps(4) by auto have Cod_\'_0: "Cod_\'.leg0 = ?u0" using T.uw'\'.\_simps(5) cod_char by auto have Dom_\'_1: "Dom_\'.leg1 = r0 \ ?p1'" using dom_char fw' T.uw'\'.\_simps(4) by auto have Cod_\'_1: "Cod_\'.leg1 = ?u1" using T.uw'\'.\_simps(5) cod_char by auto have Dom_\_0: "Dom_\.leg0 = ?R" by simp have Dom_\_1: "Dom_\.leg1 = r1" by simp have Cod_\_0: "Cod_\.leg0 = k0" by simp have Cod_\_1: "Cod_\.leg1 = r1 \ k1" by simp have Chn_r\: "\r\.chine : rfw.chine \\<^sub>C ru.chine\" using r\.chine_composite_in_hom ru.chine_composite rfw.chine_composite Cod_\_1 Dom_\_1 fw.leg1_composite by auto have Chn_r\_eq: "r\.chine = \\

\<^sub>1[r0, r0 \ ?p1] \r0, ?u1\ \.chine \ \

\<^sub>0[r0, r0 \ ?p1]\" using r\.chine_composite Cod_\_1 Dom_\_1 fw.leg1_composite C.comp_cod_arr by (metis arrow_of_spans_data.simps(2) fw r.chine_eq_apex r.cod_simps(2) rfw.prj_simps(10) rfw.prj_simps(16) span_data.simps(2)) have r\_cod_apex_eq: "r\.cod.apex = r0 \\ ?u1" using Cod_\_1 r\.chine_composite_in_hom by auto hence r\'_cod_apex_eq: "r\'.cod.apex = r0 \\ ?u1" using Cod_\'_1 r\'.chine_composite_in_hom by auto have Chn_r\': "\r\'.chine : rfw'.chine \\<^sub>C ru.chine\" using r\'.chine_composite_in_hom ru.chine_composite rfw'.chine_composite Cod_\'_1 Dom_\'_1 fw'.leg1_composite by auto have Chn_r\'_eq: "r\'.chine = \\

\<^sub>1[r0, r0 \ ?p1'] \r0, ?u1\ \'.chine \ \

\<^sub>0[r0, r0 \ ?p1']\" using r\'.chine_composite Cod_\'_1 Dom_\'_1 fw'.leg1_composite C.comp_cod_arr by (metis arrow_of_spans_data.simps(2) fw' r.chine_eq_apex r.cod_simps(2) rfw'.prj_simps(10) rfw'.prj_simps(16) span_data.simps(2)) have Chn_\w: "\\w.chine : ?R \\ ?w1 \\<^sub>C k0 \\ ?w1\" using \w.chine_composite_in_hom by simp have Chn_\w_eq: "\w.chine = \\.chine \ ?p1 \k0, ?w1\ ?p0\" using \w.chine_composite C.comp_cod_arr ide_w by (simp add: chine_hcomp_arr_ide hcomp_def) have Chn_\w': "\\w'.chine : ?R \\ ?w1' \\<^sub>C k0 \\ ?w1'\" using \w'.chine_composite_in_hom by simp have Chn_\w'_eq: "\w'.chine = \\.chine \ ?p1' \k0, ?w1'\ ?p0'\" using \w'.chine_composite C.comp_cod_arr ide_w' Dom_\_0 Cod_\_0 by (metis \w'.composite_is_arrow chine_hcomp_arr_ide chine_hcomp_def hseq_char w'.cod_simps(3)) text \ The following are some collected commutativity properties that are used subsequently. \ have "C.commutative_square r0 ?u1 ?p1 \.chine" using ru.legs_form_cospan(1) Dom_\.is_span Dom_\_1 Cod_\_1 \.leg1_commutes apply (intro C.commutative_squareI) by auto have "C.commutative_square r0 ?u1 (?p1' \ \.chine) (\'.chine \ \.chine)" proof have 1: "r0 \ ?p1' = ?u1 \ \'.chine" using \'.leg1_commutes Cod_\'_1 Dom_\'_1 fw'.leg1_composite by simp show "C.cospan r0 ?u1" using ru.legs_form_cospan(1) by blast show "C.span (?p1' \ \.chine) (\'.chine \ \.chine)" using \.chine_in_hom \'.chine_in_hom by (metis "1" C.dom_comp C.in_homE C.prj1_simps(1) C.prj1_simps(2) C.seqI Cod_\'_1 Dom_\'.leg_simps(3) Chn_\ \'.leg1_commutes cospan') show "C.dom r0 = C.cod (?p1' \ \.chine)" using \.chine_in_hom by (metis C.cod_comp C.prj1_simps(3) \C.span (?p1' \ \.chine) (\'.chine \ \.chine)\ cospan' r.dom.apex_def r.chine_eq_apex r.chine_simps(2)) show "r0 \ ?p1' \ \.chine = ?u1 \ \'.chine \ \.chine" using 1 \.chine_in_hom C.comp_assoc by metis qed have "C.commutative_square r0 ?u1 \

\<^sub>1[r0, r0 \ ?p1] (\.chine \ \

\<^sub>0[r0, r0 \ ?p1])" using ru.legs_form_cospan(1) Dom_\.is_span Dom_\_1 C.comp_assoc C.pullback_commutes' r\.legs_form_cospan(1) apply (intro C.commutative_squareI) apply auto by (metis C.comp_assoc Cod_\_1 \.leg1_commutes) hence "C.commutative_square r0 ?u1 \

\<^sub>1[r0, r0 \ ?p1] (\.chine \ \

\<^sub>0[r0, r0 \ ?p1])" using fw.leg1_composite by auto have "C.commutative_square r0 ?u1 \

\<^sub>1[r0, r0 \ ?p1'] (\'.chine \ \

\<^sub>0[r0, r0 \ ?p1'])" using C.tuple_is_extensional Chn_r\'_eq r\'.chine_simps(1) fw' by force have "C.commutative_square ra ?w1 rfw.Prj\<^sub>0\<^sub>1 rfw.Prj\<^sub>0" using C.pullback_commutes' gw.legs_form_cospan(1) rfw.prj_simps(2) C.comp_assoc C.comp_cod_arr apply (intro C.commutative_squareI) by auto have "C.commutative_square ?R ?w1' rfw'.Prj\<^sub>0\<^sub>1 rfw'.Prj\<^sub>0" using cospan' apply (intro C.commutative_squareI) apply simp_all by (metis C.comp_assoc C.prj0_simps_arr C.pullback_commutes' arrow_of_spans_data.select_convs(2) rfw'.prj_simps(3) span_data.select_convs(1-2)) have "C.commutative_square r0 (r0 \ ?p1) rfw.Prj\<^sub>1\<^sub>1 \rfw.Prj\<^sub>0\<^sub>1 \ra, ?w1\ rfw.Prj\<^sub>0\" proof - have "C.arr rfw.chine_assoc" by (metis C.seqE rfw.prj_chine_assoc(1) rfw.prj_simps(1)) thus ?thesis using C.tuple_is_extensional rfw.chine_assoc_def by fastforce qed have "C.commutative_square r0 (r0 \ ?p1') rfw'.Prj\<^sub>1\<^sub>1 \rfw'.Prj\<^sub>0\<^sub>1 \ra, ?w1'\ rfw'.Prj\<^sub>0\" by (metis (no_types, lifting) C.not_arr_null C.seqE C.tuple_is_extensional arrow_of_spans_data.select_convs(2) rfw'.chine_assoc_def rfw'.prj_chine_assoc(1) rfw'.prj_simps(1) span_data.select_convs(1-2)) have "C.commutative_square k0 ?w1 (\.chine \ ?p1) ?p0" using C.tuple_is_extensional Chn_\w_eq \w.chine_simps(1) by fastforce have "C.commutative_square k0 ?w1' (\.chine \ ?p1') (w'.chine \ ?p0')" using C.tuple_is_extensional \w'.chine_composite \w'.chine_simps(1) by force have "C.commutative_square k0 ?w1' (\.chine \ ?p1') ?p0'" using C.tuple_is_extensional Chn_\w'_eq \w'.chine_simps(1) by force text \ Now, derive the consequences of the equation: \[ \(r \ \) \ \[r, ?f, w] \ (?\ \ w) = (r \ \') \ \[r, ?f, w'] \ (?\ \ w') \ \\ \] The strategy is to expand and simplify the left and right hand side to tuple form, then compose with projections and equate corresponding components. We first work on the right-hand side. \ have R: "Chn (T.composite_cell w' \' \ \) = \?p1' \ \.chine \r0, ?u1\ \'.chine \ \.chine\" proof - have "Chn (T.composite_cell w' \' \ \) = r\'.chine \ Chn \[r, f, w'] \ \w'.chine \ \.chine" proof - have 1: "\T.composite_cell w' \' \ \ : g \ w \ r \ u\" using \ \w' arfw' r\' by auto have "Chn (T.composite_cell w' \' \ \) = Chn (T.composite_cell w' \') \ \.chine" using 1 Chn_vcomp by blast also have "... = (r\'.chine \ Chn (\[r, f, w'] \ (\ \ w'))) \ \.chine" proof - have "seq (r \ \') (\[r, f, w'] \ (\ \ w'))" using 1 by blast thus ?thesis using 1 Chn_vcomp by presburger qed also have "... = (r\'.chine \ Chn \[r, f, w'] \ \w'.chine) \ \.chine" proof - have "seq \[r, f, w'] (\ \ w')" using 1 by blast thus ?thesis using 1 Chn_vcomp by presburger qed finally show ?thesis using C.comp_assoc by auto qed also have "... = \?p1' \ \.chine \r0, ?u1\ \'.chine \ \.chine\" proof - let ?LHS = "r\'.chine \ Chn \[r, f, w'] \ \w'.chine \ \.chine" let ?RHS = "\?p1' \ \.chine \r0, ?u1\ \'.chine \ \.chine\" have LHS: "\?LHS : ?R \\ ?w1 \\<^sub>C r\'.cod.apex\" proof (intro C.comp_in_homI) show "\\.chine : ?R \\ ?w1 \\<^sub>C ?R \\ ?w1'\" using Chn_\ by simp show "\\w'.chine : ?R \\ ?w1' \\<^sub>C Cod_\.leg0 \\ w'.cod.leg1\" using Chn_\w' by simp show "\Chn \[r, f, w'] : Cod_\.leg0 \\ w'.cod.leg1 \\<^sub>C rfw'.chine\" using arfw' by (metis (no_types, lifting) Chn_in_hom Cod_\_0 arrow_of_spans_data.simps(2) rf rf.leg0_composite rfw'.chine_composite(1) span_data.select_convs(1) w'.cod_simps(3)) show "\r\'.chine : rfw'.chine \\<^sub>C r\'.cod.apex\" using Chn_r\' by auto qed have 2: "C.commutative_square r0 ?u1 (?p1' \ \.chine) (\'.chine \ \.chine)" by fact have RHS: "\?RHS : ?R \\ ?w1 \\<^sub>C r\'.cod.apex\" using 2 Chn_\ r\'_cod_apex_eq C.tuple_in_hom [of r0 ?u1 "?p1' \ \.chine" "\'.chine \ \.chine"] by fastforce show ?thesis proof (intro C.prj_joint_monic [of r0 ?u1 ?LHS ?RHS]) show "C.cospan r0 ?u1" using ru.legs_form_cospan(1) by blast show "C.seq ru.prj\<^sub>1 ?LHS" using LHS r\'_cod_apex_eq by auto show "C.seq ru.prj\<^sub>1 ?RHS" using RHS r\'_cod_apex_eq by auto show "ru.prj\<^sub>0 \ ?LHS = ru.prj\<^sub>0 \ ?RHS" proof - have "ru.prj\<^sub>0 \ ?LHS = (ru.prj\<^sub>0 \ r\'.chine) \ Chn \[r, f, w'] \ \w'.chine \ \.chine" using C.comp_assoc by simp also have "... = ((\'.chine \ \

\<^sub>0[r0, r0 \ ?p1']) \ Chn \[r, f, w']) \ \w'.chine \ \.chine" using Chn_r\'_eq C.comp_assoc fw' \C.commutative_square r0 ?u1 \

\<^sub>1[r0, r0 \ ?p1'] (\'.chine \ \

\<^sub>0[r0, r0 \ ?p1'])\ by simp also have "... = \'.chine \ (\

\<^sub>0[r0, r0 \ ?p1'] \ Chn \[r, f, w']) \ \w'.chine \ \.chine" using C.comp_assoc by simp also have "... = \'.chine \ (\rfw'.Prj\<^sub>0\<^sub>1 \?R, ?w1'\ rfw'.Prj\<^sub>0\ \ \w'.chine) \ \.chine" using ide_f hseq_rf hseq_char \_ide C.comp_assoc rfw'.chine_assoc_def fw'.leg1_composite C.prj_tuple(1) \C.commutative_square r0 (r0 \ ?p1') rfw'.Prj\<^sub>1\<^sub>1 \rfw'.Prj\<^sub>0\<^sub>1 \?R, ?w1'\ rfw'.Prj\<^sub>0\\ by simp also have "... = \'.chine \ \.chine" proof - have "\rfw'.Prj\<^sub>0\<^sub>1 \?R, ?w1'\ rfw'.Prj\<^sub>0\ \ \w'.chine = gw'.apex" proof (intro C.prj_joint_monic [of ?R ?w1' "\rfw'.Prj\<^sub>0\<^sub>1 \?R, ?w1'\ rfw'.Prj\<^sub>0\ \ \w'.chine" gw'.apex]) show "C.cospan ?R ?w1'" using fw'.legs_form_cospan(1) by simp show "C.seq ?p1' (\rfw'.Prj\<^sub>0\<^sub>1 \?R, ?w1'\ rfw'.Prj\<^sub>0\ \ \w'.chine)" proof (intro C.seqI' C.comp_in_homI) show "\\w'.chine : Dom_\.leg0 \\ w'.leg1 \\<^sub>C Cod_\.leg0 \\ w'.cod.leg1\" using \w'.chine_composite_in_hom by simp show "\\rfw'.Prj\<^sub>0\<^sub>1 \?R, w'.leg1\ rfw'.Prj\<^sub>0\ : Cod_\.leg0 \\ w'.cod.leg1 \\<^sub>C ?R \\ w'.leg1\" using \C.commutative_square ?R ?w1' rfw'.Prj\<^sub>0\<^sub>1 rfw'.Prj\<^sub>0\ C.tuple_in_hom [of ?R ?w1' rfw'.Prj\<^sub>0\<^sub>1 rfw'.Prj\<^sub>0] rf rf.leg0_composite by auto show "\?p1' : ?R \\ w'.leg1 \\<^sub>C f.apex\" using fw'.prj_in_hom(1) by auto qed show "C.seq ?p1' gw'.apex" using gw'.dom.apex_def gw'.leg0_composite fw'.prj_in_hom by auto show "?p0' \ \rfw'.Prj\<^sub>0\<^sub>1 \?R, ?w1'\ rfw'.Prj\<^sub>0\ \ \w'.chine = ?p0' \ gw'.apex" proof - have "?p0' \ \rfw'.Prj\<^sub>0\<^sub>1 \?R, ?w1'\ rfw'.Prj\<^sub>0\ \ \w'.chine = (?p0' \ \rfw'.Prj\<^sub>0\<^sub>1 \?R, ?w1'\ rfw'.Prj\<^sub>0\) \ \w'.chine" using C.comp_assoc by simp also have "... = rfw'.Prj\<^sub>0 \ \w'.chine" using \C.commutative_square ?R ?w1' rfw'.Prj\<^sub>0\<^sub>1 rfw'.Prj\<^sub>0\ by auto also have "... = \

\<^sub>0[k0, ?w1'] \ \\.chine \ ?p1' \k0, ?w1'\ w'.chine \ ?p0'\" using \w'.chine_composite Dom_\_0 Cod_\_0 C.comp_cod_arr by simp also have "... = w'.chine \ ?p0'" using \C.commutative_square k0 ?w1' (\.chine \ ?p1') (w'.chine \ ?p0')\ by simp also have "... = ?p0' \ gw'.apex" using cospan C.comp_cod_arr C.comp_arr_dom gw'.chine_is_identity gw'.chine_eq_apex gw'.chine_composite fw'.prj_in_hom by auto finally show ?thesis by simp qed show "?p1' \ \rfw'.Prj\<^sub>0\<^sub>1 \ra, ?w1'\ rfw'.Prj\<^sub>0\ \ \w'.chine = ?p1' \ gw'.apex" proof - have "?p1' \ \rfw'.Prj\<^sub>0\<^sub>1 \ra, ?w1'\ rfw'.Prj\<^sub>0\ \ \w'.chine = (?p1' \ \rfw'.Prj\<^sub>0\<^sub>1 \ra, ?w1'\ rfw'.Prj\<^sub>0\) \ \w'.chine" using C.comp_assoc by simp also have "... = rfw'.Prj\<^sub>0\<^sub>1 \ \w'.chine" using \C.commutative_square ?R ?w1' rfw'.Prj\<^sub>0\<^sub>1 rfw'.Prj\<^sub>0\ by simp also have "... = k0 \ \

\<^sub>1[k0, ?w1'] \ \\.chine \ ?p1' \k0, ?w1'\ w'.chine \ ?p0'\" using \w'.chine_composite Cod_\_0 C.comp_assoc C.comp_cod_arr by simp also have "... = k0 \ \.chine \ ?p1'" using \C.commutative_square k0 ?w1' (\.chine \ ?p1') (w'.chine \ ?p0')\ by simp also have "... = (k0 \ \.chine) \ ?p1'" using C.comp_assoc by metis also have "... = ?p1'" using \.leg0_commutes C.comp_cod_arr cospan' by simp also have "... = ?p1' \ gw'.apex" using C.comp_arr_dom cospan' gw'.chine_eq_apex gw'.chine_composite by simp finally show ?thesis by simp qed qed thus ?thesis using Chn_\ C.comp_cod_arr gw'.apex_composite by auto qed also have "... = \

\<^sub>0[r0, ?u1] \ ?RHS" using RHS 2 C.prj_tuple [of r0 ?u1] by simp finally show ?thesis by simp qed show "ru.prj\<^sub>1 \ ?LHS = ru.prj\<^sub>1 \ ?RHS" proof - have "ru.prj\<^sub>1 \ ?LHS = (ru.prj\<^sub>1 \ r\'.chine) \ Chn \[r, f, w'] \ \w'.chine \ \.chine" using C.comp_assoc by simp also have "... = \

\<^sub>1[r0, fw'.leg1] \ Chn \[r, f, w'] \ \w'.chine \ \.chine" using Chn_r\' Chn_r\'_eq fw' \C.commutative_square r0 ?u1 \

\<^sub>1[r0, r0 \ ?p1'] (\'.chine \ \

\<^sub>0[r0, r0 \ ?p1'])\ by simp also have "... = (rfw'.Prj\<^sub>1 \ rfw'.chine_assoc) \ \w'.chine \ \.chine" using ide_f ide_w' hseq_rf hseq_char \_ide fw'.leg1_composite C.comp_assoc by auto also have "... = (rfw'.Prj\<^sub>1\<^sub>1 \ \w'.chine) \ \.chine" using rfw'.prj_chine_assoc C.comp_assoc by simp also have "... = ((k1 \ \

\<^sub>1[k0, ?w1']) \ \w'.chine) \ \.chine" using C.comp_cod_arr by simp also have "... = (k1 \ \

\<^sub>1[k0, ?w1'] \ \w'.chine) \ \.chine" using C.comp_assoc by simp also have "... = (k1 \ \.chine \ ?p1') \ \.chine" using Chn_\w'_eq Dom_\_0 Cod_\_0 \C.commutative_square k0 ?w1' (\.chine \ ?p1') ?p0'\ by simp also have "... = (k1 \ \.chine) \ ?p1' \ \.chine" using C.comp_assoc by metis also have "... = (?R \ ?p1') \ \.chine" using C.comp_assoc by simp also have "... = ?p1' \ \.chine" using C.comp_cod_arr C.prj1_in_hom [of ?R ?w1'] cospan' by simp also have "... = ru.prj\<^sub>1 \ ?RHS" using RHS 2 by simp finally show ?thesis by simp qed qed qed finally show ?thesis by simp qed text \ Now we work on the left-hand side. \ have L: "Chn (T.composite_cell w \) = \?p1 \r0, ?u1\ \.chine\" proof - have "Chn (T.composite_cell w \) = r\.chine \ Chn \[r, f, w] \ \w.chine" using Chn_vcomp arfw C.comp_assoc by auto moreover have "... = \?p1 \r0, ?u1\ \.chine\" proof - let ?LHS = "r\.chine \ Chn \[r, f, w] \ \w.chine" let ?RHS = "\?p1 \r0, ?u1\ \.chine\" have 2: "C.commutative_square r0 ?u1 ?p1 \.chine" by fact have LHS: "\?LHS : ?R \\ ?w1 \\<^sub>C r0 \\ ?u1\" using Chn_r\ Chn_\w rfw.chine_assoc_in_hom by (metis (no_types, lifting) "8" Chn_in_hom Dom_\_0 arrow_of_spans_data.simps(2) calculation gw.chine_composite r\_cod_apex_eq ru.chine_composite) have RHS: "\?RHS : ?R \\ ?w1 \\<^sub>C r0 \\ ?u1\" using 2 C.tuple_in_hom [of r0 ?u1 "?p1" \.chine] cospan r\_cod_apex_eq by simp show ?thesis proof (intro C.prj_joint_monic [of r0 ?u1 ?LHS ?RHS]) show "C.cospan r0 ?u1" using ru.legs_form_cospan(1) by blast show "C.seq ru.prj\<^sub>1 ?LHS" using LHS r\_cod_apex_eq by auto show "C.seq ru.prj\<^sub>1 ?RHS" using RHS r\_cod_apex_eq by auto show "ru.prj\<^sub>0 \ ?LHS = ru.prj\<^sub>0 \ ?RHS" proof - have "ru.prj\<^sub>0 \ ?LHS = (ru.prj\<^sub>0 \ r\.chine) \ Chn \[r, f, w] \ \w.chine" using C.comp_assoc by simp also have "... = (\.chine \ \

\<^sub>0[r0, f.leg1 \ fw.prj\<^sub>1]) \ Chn \[r, f, w] \ \w.chine" using Chn_r\_eq Dom_\_1 Cod_\_1 fw.leg1_composite \C.commutative_square r0 ?u1 \

\<^sub>1[r0, r0 \ ?p1] (\.chine \ \

\<^sub>0[r0, r0 \ ?p1])\ by simp also have "... = \.chine \ (\

\<^sub>0[r0, r0 \ ?p1] \ Chn \[r, f, w]) \ \w.chine" using C.comp_assoc by simp also have "... = \.chine \ \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\ \ \w.chine" proof - have "Chn \[r, f, w] = rfw.chine_assoc" using ide_f ide_w hseq_rf hseq_char \_ide by auto moreover have "\

\<^sub>0[r0, r0 \ ?p1] \ rfw.chine_assoc = \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\" using rfw.chine_assoc_def \C.commutative_square r0 (r0 \ ?p1) rfw.Prj\<^sub>1\<^sub>1 \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\\ by simp ultimately show ?thesis by simp qed also have "... = \.chine \ (?R \\ ?w1)" proof - have "\rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\ \ \w.chine = ?R \\ ?w1" proof (intro C.prj_joint_monic [of ?R ?w1 "\rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\ \ \w.chine" "?R \\ ?w1"]) show "C.cospan ?R ?w1" by fact show "C.seq ?p1 (\rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\ \ \w.chine)" proof - have "C.seq rfw.Prj\<^sub>0\<^sub>1 \w.chine" by (meson C.seqI' Chn_in_hom \w rfw.prj_in_hom(2) \C.commutative_square ?R ?w1 rfw.Prj\<^sub>0\<^sub>1 rfw.Prj\<^sub>0\) thus ?thesis using \C.commutative_square ?R ?w1 rfw.Prj\<^sub>0\<^sub>1 rfw.Prj\<^sub>0\ by (metis (no_types) C.comp_assoc C.prj_tuple(2)) qed show "C.seq ?p1 (?R \\ ?w1)" using gw.dom.apex_def gw.leg0_composite gw.prj_in_hom by auto show "?p0 \ \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\ \ \w.chine = ?p0 \ (?R \\ ?w1)" proof - have "?p0 \ \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\ \ \w.chine = (?p0 \ \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\) \ \w.chine" using C.comp_assoc by simp also have "... = rfw.Prj\<^sub>0 \ \w.chine" using \C.commutative_square ?R ?w1 rfw.Prj\<^sub>0\<^sub>1 rfw.Prj\<^sub>0\ by simp also have "... = \

\<^sub>0[k0, ?w1] \ \\.chine \ ?p1 \k0, ?w1\ ?p0\" using Chn_\w_eq C.comp_cod_arr by simp also have "... = ?p0" using \C.commutative_square k0 ?w1 (\.chine \ ?p1) ?p0\ C.prj_tuple(1) by blast also have "... = ?p0 \ (?R \\ ?w1)" using C.comp_arr_dom gw.chine_eq_apex gw.chine_is_identity by (metis C.arr_dom_iff_arr C.pbdom_def Dom_g gw.chine_composite gw.chine_simps(1) span_data.select_convs(1)) finally show ?thesis by simp qed show "?p1 \ \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\ \ \w.chine = ?p1 \ (?R \\ ?w1)" proof - have "?p1 \ \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\ \ \w.chine = (?p1 \ \rfw.Prj\<^sub>0\<^sub>1 \?R, ?w1\ rfw.Prj\<^sub>0\) \ \w.chine" using C.comp_assoc by simp also have "... = rfw.Prj\<^sub>0\<^sub>1 \ \w.chine" using \C.commutative_square ?R ?w1 rfw.Prj\<^sub>0\<^sub>1 rfw.Prj\<^sub>0\ by simp also have "... = (k0 \ \

\<^sub>1[k0, ?w1]) \ \\.chine \ ?p1 \k0, ?w1\ ?p0\" using Chn_\w_eq C.comp_cod_arr by simp also have "... = k0 \ \

\<^sub>1[k0, ?w1] \ \\.chine \ ?p1 \k0, ?w1\ ?p0\" using C.comp_assoc by simp also have "... = k0 \ \.chine \ ?p1" using \C.commutative_square k0 ?w1 (\.chine \ ?p1) ?p0\ by simp also have "... = (k0 \ \.chine) \ ?p1" using C.comp_assoc by metis also have "... = ?p1 \ (?R \\ ?w1)" using C.comp_arr_dom C.comp_cod_arr cospan by simp finally show ?thesis by blast qed qed thus ?thesis by simp qed also have "... = \.chine" using C.comp_arr_dom \.chine_in_hom gw.chine_eq_apex gw.chine_is_identity Dom_\_0 Cod_\_0 Dom_\.apex_def Cod_\.apex_def by (metis Dom_g \.chine_simps(1) \.chine_simps(2) gw.chine_composite gw.dom.apex_def gw.leg0_composite span_data.select_convs(1)) also have "... = ru.prj\<^sub>0 \ ?RHS" using 2 by simp finally show ?thesis by blast qed show "ru.prj\<^sub>1 \ ?LHS = ru.prj\<^sub>1 \ ?RHS" proof - have "ru.prj\<^sub>1 \ ?LHS = (ru.prj\<^sub>1 \ r\.chine) \ Chn \[r, f, w] \ \w.chine" using C.comp_assoc by simp also have "... = (r.chine \ \

\<^sub>1[r0, r0 \ ?p1]) \ Chn \[r, f, w] \ \w.chine" proof - have "r\.chine \ C.null \ \

\<^sub>1[r.cod.leg0, Cod_\.leg1] \ r\.chine = r.chine \ \

\<^sub>1[r0, Dom_\.leg1]" by (metis (lifting) C.prj_tuple(2) C.tuple_is_extensional r.cod_simps(2) r\.chine_composite) thus ?thesis using Cod_\_1 Dom_\_1 r\.chine_simps(1) fw by fastforce qed also have "... = r.chine \ (rfw.Prj\<^sub>1 \ Chn \[r, f, w]) \ \w.chine" using C.comp_assoc fw.leg1_composite by simp also have "... = r.chine \ rfw.Prj\<^sub>1\<^sub>1 \ \w.chine" using ide_f ide_w hseq_rf hseq_char \_ide rfw.prj_chine_assoc(1) by auto also have "... = r.chine \ k1 \ \

\<^sub>1[k0, ?w1] \ \w.chine" using C.comp_cod_arr C.comp_assoc by simp also have "... = r.chine \ k1 \ \.chine \ \

\<^sub>1[Dom_\.leg0, ?w1]" using Chn_\w_eq \C.commutative_square k0 ?w1 (\.chine \ \

\<^sub>1[ra, w.leg1]) \

\<^sub>0[ra, w.leg1]\ by auto also have "... = r.chine \ (k1 \ \.chine) \ ?p1" using C.comp_assoc Dom_\_0 by metis also have "... = r.chine \ ra \ ?p1" by simp also have "... = r.chine \ ?p1" using C.comp_cod_arr by (metis C.comp_assoc r.cod_simps(1) r.chine_eq_apex r.chine_simps(1) r.chine_simps(3)) also have "... = ?p1" using C.comp_cod_arr r.chine_eq_apex r.chine_is_identity by (metis 2 C.commutative_squareE r.dom.apex_def) also have "... = ru.prj\<^sub>1 \ ?RHS" using 2 by simp finally show ?thesis by simp qed qed qed ultimately show ?thesis by simp qed text \ This is the main point: the equation E boils down to the following: \[ \?p1' \ \.chine = ?p1 \ \'.chine \ \.chine = \.chine\ \] The first equation gets us close to what we need, but we still need \?p1 \ C.inv ?p0 = ?w1\, which follows from the fact that ?p0 is the pullback of ?R. \ have *: "\?p1' \ \.chine \r0, ?u1\ \'.chine \ \.chine\ = \?p1 \r0, ?u1\ \.chine\" using L R E by simp have **: "?p1' \ \.chine = ?p1" by (metis "*" C.in_homE C.not_arr_null C.prj_tuple(2) C.tuple_in_hom C.tuple_is_extensional \C.commutative_square r0 u.leg1 (\

\<^sub>1[ra, w'.leg1] \ \.chine) (\'.chine \ \.chine)\) have ***: "\'.chine \ \.chine = \.chine" by (metis "*" C.prj_tuple(1) \C.commutative_square r0 ?u1 (?p1' \ \.chine) (\'.chine \ \.chine)\ \C.commutative_square r0 ?u1 ?p1 \.chine\) text \ CKS say to take \\ = \\, but obviously this cannot work as literally described, because \\\ : g \ w \ g \ w'\\, whereas we must have \\\ : w \ w'\\. Instead, we have to define \\\ by transporting \\\ along the projections from \?R \\ ?w1\ to \?W\ and \?R \\ ?w1'\ to \?W'\. These are isomorphisms by virtue of their being pullbacks of identities, but they are not themselves necessarily identities. Specifically, we take \Chn \ = ?p0' \ Chn \ \ C.inv ?p0\. \ let ?\ = "\Chn = ?p0' \ \.chine \ C.inv ?p0, Dom = Dom w, Cod = Cod w'\" interpret Dom_\: span_in_category C \Dom ?\\ using w.dom.span_in_category_axioms by simp interpret Cod_\: span_in_category C \Cod ?\\ using w'.cod.span_in_category_axioms by simp text \ It has to be shown that \\\ is an arrow of spans. \ interpret \: arrow_of_spans C ?\ proof show "\Chn ?\ : Dom_\.apex \\<^sub>C Cod_\.apex\" proof - have "\Chn \: gw.apex \\<^sub>C gw'.apex\" using Chn_in_hom \ gw'.chine_eq_apex gw.chine_eq_apex by force moreover have "\?p0' : gw'.apex \\<^sub>C w'.apex\" using cospan' hseq_gw' hseq_char hcomp_def gw'.dom.apex_def w'.dom.apex_def by auto moreover have "\C.inv ?p0 : w.apex \\<^sub>C gw.apex\" using cospan hseq_gw hseq_char hcomp_def gw.dom.apex_def w.dom.apex_def C.iso_pullback_ide by auto ultimately show ?thesis using Dom_\.apex_def Cod_\.apex_def by auto qed text \ The commutativity property for the ``input leg'' follows directly from that for \\\. \ show "Cod_\.leg0 \ Chn ?\ = Dom_\.leg0" using C.comp_assoc C.comp_arr_dom cospan C.iso_pullback_ide C.comp_arr_inv' by (metis C.invert_side_of_triangle(2) Dom_\.leg_simps(1) Dom_\_eq \0 arrow_of_spans_data.select_convs(1,3) arrow_of_spans_data.simps(2) r.dom.ide_apex span_data.select_convs(1) w'.cod_simps(2)) text \ The commutativity property for the ``output leg'' is a bit more subtle. \ show "Cod_\.leg1 \ Chn ?\ = Dom_\.leg1" proof - have "Cod_\.leg1 \ Chn ?\ = ((?w1' \ ?p0') \ \.chine) \ C.inv ?p0" using C.comp_assoc by simp also have "... = ((?R \ ?p1') \ Chn \) \ C.inv ?p0" using cospan' C.pullback_commutes [of ?R ?w1'] by auto also have "... = (?p1' \ \.chine) \ C.inv ?p0" using cospan' C.comp_cod_arr by simp also have "... = ?p1 \ C.inv ?p0" using ** by simp also have "... = ?w1" text \ Sledgehammer found this at a time when I was still struggling to understand what was going on. \ by (metis C.comp_cod_arr C.invert_side_of_triangle(2) C.iso_pullback_ide C.prj1_simps(1,3) C.pullback_commutes' cospan r.dom.ide_apex r.chine_eq_apex r.chine_simps(2)) also have "... = Dom_\.leg1" by auto finally show ?thesis by simp qed qed text \ What remains to be shown is that \\\ is unique with the properties asserted by \T2\; \emph{i.e.} \\\ : w \ w'\ \ \ = g \ \ \ \ = \' \ (f \ \)\. CKS' assertion that the equation \(r\)(\w) = (r\')(\w')\\ gives \w\<^sub>1 = w\<^sub>1'\ does not really seem to be true. The reason \\\ is unique is because it is obtained by transporting \\\ along isomorphisms. \ have \: "\?\ : w \ w'\" using \.arrow_of_spans_axioms arr_char dom_char cod_char by auto have hseq_f\: "hseq f ?\" using \ src_def trg_def arrI fw.composable rf.are_arrows(2) by auto have hseq_g\: "hseq g ?\" using \ src_def trg_def fw.composable gw.are_arrows(1) src_f by auto interpret f\: two_composable_arrows_of_spans C prj0 prj1 f ?\ using hseq_f\ hseq_char by (unfold_locales, simp) interpret f\: arrow_of_spans C \f \ ?\\ using f\.composite_is_arrow arr_char by simp interpret g\: two_composable_arrows_of_spans C prj0 prj1 g ?\ using hseq_g\ hseq_char by (unfold_locales, simp) interpret g\: arrow_of_spans C \g \ ?\\ using g\.composite_is_arrow arr_char by simp have Chn_g\: "Chn (g \ ?\) = \?p1 \?R, ?w1'\ ?p0' \ \.chine\" proof - have "Chn (g \ ?\) = \?R \ ?p1 \?R, ?w1'\ (?p0' \ \.chine \ C.inv ?p0) \ ?p0\" using g\.chine_composite by simp also have "... = \?p1 \?R, ?w1'\ (?p0' \ \.chine \ C.inv ?p0) \ ?p0\" using C.comp_cod_arr cospan by simp also have "... = \?p1 \?R, ?w1'\ ?p0' \ \.chine\" proof - have "(?p0' \ \.chine \ C.inv ?p0) \ ?p0 = ?p0' \ \.chine" using C.comp_assoc C.iso_pullback_ide [of ?R ?w1] C.comp_inv_arr C.comp_arr_dom Chn_\ by (metis C.comp_inv_arr' C.in_homE C.pbdom_def cospan r.dom.ide_apex) thus ?thesis by simp qed ultimately show ?thesis by simp qed have Chn_\_eq: "\.chine = Chn (g \ ?\)" proof - have "Chn (g \ ?\) = \?p1 \?R, ?w1'\ ?p0' \ Chn \\" using Chn_g\ by simp also have "... = \.chine" text \Here was another score by sledgehammer while I was still trying to understand it.\ using ** C.prj_joint_monic by (metis C.prj1_simps(1) C.tuple_prj cospan cospan') finally show ?thesis by simp qed have \_eq_g\: "\ = g \ ?\" proof (intro arr_eqI) show "par \ (g \ ?\)" proof - have "\g \ ?\ : g \ w \ g \ w'\" using ide_g \ T.leg1_simps(3) by (intro hcomp_in_vhom, auto) thus ?thesis using \ by (elim in_homE, auto) qed show "\.chine = Chn (g \ ?\)" using Chn_\_eq by simp qed moreover have "\ = \' \ (f \ ?\)" proof (intro arr_eqI) have f\: "\f \ ?\ : f \ w \ f \ w'\" using \ ide_f by auto show par: "par \ (\' \ (f \ ?\))" using \ \' f\ by (elim in_homE, auto) show "\.chine = Chn (\' \ (f \ ?\))" using par "***" Chn_vcomp calculation f\.chine_composite g\.chine_composite by auto qed ultimately show 2: "\?\ : w \ w'\ \ \ = g \ ?\ \ \ = \' \ (f \ ?\)" using \ by simp show "\\'. \\' : w \ w'\ \ \ = g \ \' \ \ = \' \ (f \ \') \ \' = ?\" proof - fix \' assume 1: "\\' : w \ w'\ \ \ = g \ \' \ \ = \' \ (f \ \')" interpret \': arrow_of_spans C \' using 1 arr_char by auto have hseq_g\': \hseq g \'\ using 1 \ by auto interpret g\': two_composable_arrows_of_spans C prj0 prj1 g \' using hseq_g\' hseq_char by unfold_locales auto interpret g\': arrow_of_spans C \g \ \'\ using g\'.composite_is_arrow arr_char by simp show "\' = ?\" proof (intro arr_eqI) show par: "par \' ?\" using 1 \ by fastforce show "\'.chine = \.chine" proof - have "C.commutative_square ?R ?w1' (g.chine \ ?p1) (\'.chine \ ?p0)" proof show "C.cospan ?R ?w1'" by fact show 3: "C.span (g.chine \ ?p1) (\'.chine \ ?p0)" proof (intro conjI) show "C.seq g.chine ?p1" using cospan by auto show "C.seq \'.chine ?p0" using cospan 2 par arrow_of_spans_data.simps(1) dom_char in_homE w.chine_eq_apex by auto thus "C.dom (g.chine \ ?p1) = C.dom (\'.chine \ ?p0)" using g.chine_eq_apex cospan by simp qed show "C.dom ra = C.cod (g.chine \ ?p1)" using cospan by auto show "?R \ g.chine \ ?p1 = ?w1' \ \'.chine \ ?p0" proof - have "?w1' \ \'.chine \ ?p0 = (?w1' \ \'.chine) \ ?p0" using C.comp_assoc by simp moreover have "... = ?w1 \ ?p0" using 1 \'.leg1_commutes dom_char cod_char by auto also have "... = ?R \ ?p1" using cospan C.pullback_commutes [of ra ?w1] by auto also have "... = ?R \ g.chine \ ?p1" using 3 C.comp_cod_arr g.chine_is_identity g.chine_eq_apex g.dom.apex_def by auto finally show ?thesis by auto qed qed have "C.commutative_square ?R ?w1' (g.chine \ ?p1) (\.chine \ ?p0)" proof show "C.cospan ?R ?w1'" by fact show 3: "C.span (g.chine \ ?p1) (\.chine \ ?p0)" using cospan \.chine_in_hom by auto show "C.dom ?R = C.cod (g.chine \ ?p1)" using cospan by auto show "?R \ g.chine \ ?p1 = ?w1' \ \.chine \ ?p0" proof - have "?w1' \ \.chine \ ?p0 = (?w1' \ \.chine) \ ?p0" using C.comp_assoc by simp moreover have "... = ?w1 \ ?p0" using 1 \.leg1_commutes dom_char cod_char by auto also have "... = ?R \ ?p1" using cospan C.pullback_commutes [of ra ?w1] by auto also have "... = ?R \ g.chine \ ?p1" using 3 C.comp_cod_arr g.chine_is_identity g.chine_eq_apex g.dom.apex_def by auto finally show ?thesis by auto qed qed have "\'.chine \ ?p0 = \.chine \ ?p0" proof - have "\'.chine \ ?p0 = ?p0' \ g\'.chine" using 1 dom_char cod_char g\'.chine_composite \C.commutative_square ?R ?w1' (g.chine \ ?p1) (\'.chine \ ?p0)\ by auto also have "... = ?p0' \ \.chine" using 1 by simp also have "... = ?p0' \ g\.chine" using Chn_\_eq by simp also have "... = \.chine \ ?p0" using g\.chine_composite \C.commutative_square ?R ?w1' (g.chine \ ?p1) (\.chine \ ?p0)\ by simp finally show ?thesis by simp qed thus ?thesis using C.iso_pullback_ide C.iso_is_retraction C.retraction_is_epi C.epiE [of "?p0" \'.chine \.chine] cospan \.chine_in_hom \'.chine_in_hom by auto qed qed qed qed qed qed qed qed end context span_bicategory begin interpretation chosen_right_adjoints vcomp hcomp assoc unit src trg .. notation some_right_adjoint ("_\<^sup>*" [1000] 1000) (* TODO: Why is this needed? *) notation isomorphic (infix "\" 50) text \ \Span(C)\ is a bicategory of spans. \ lemma is_bicategory_of_spans: shows "bicategory_of_spans vcomp hcomp assoc unit src trg" proof text \ Every 1-cell \r\ is isomorphic to the composition of a map and the right adjoint of a map. The proof is to obtain a tabulation of \r\ as a span of maps \(f, g)\ and then observe that \r\ is isomorphic to \g \ f\<^sup>*\. \ show "\r. ide r \ \f g. is_left_adjoint f \ is_left_adjoint g \ r \ g \ f\<^sup>*" proof - fix r assume r: "ide r" interpret r: identity_arrow_of_spans C r using r ide_char' by auto interpret r: identity_arrow_in_span_bicategory C prj0 prj1 r .. have \: "tabulation (\) (\) assoc unit src trg r r.\ r.f r.g \ is_left_adjoint r.f \ is_left_adjoint r.g" using r r.has_tabulation by blast interpret \: tabulation vcomp hcomp assoc unit src trg r r.\ r.f r.g using \ by fast have 1: "r \ r.g \ r.f\<^sup>*" using \ \.yields_isomorphic_representation' \.T0.is_map left_adjoint_extends_to_adjoint_pair isomorphic_def [of "r.g \ r.f\<^sup>*" r] isomorphic_symmetric by auto thus "\f g. is_left_adjoint f \ is_left_adjoint g \ r \ g \ f\<^sup>*" using \ by blast qed text \ Every span of maps extends to a tabulation. \ show "\f g. \ is_left_adjoint f; is_left_adjoint g; src f = src g \ \ \r \. tabulation (\) (\) assoc unit src trg r \ f g" proof - text \ The proof idea is as follows: Let maps \f = (f\<^sub>1, f\<^sub>0)\ and \g = (g\<^sub>1, g\<^sub>0)\ be given. Let \f' = (f\<^sub>1 \ C.inv f\<^sub>0, C.cod f\<^sub>0)\ and \g' = (g\<^sub>1 \ C.inv g\<^sub>0, C.cod g\<^sub>0)\; then \f'\ and \g'\ are maps isomorphic to \f\ and \g\, respectively. By a previous result, \f'\ and \g'\ extend to a tabulation \(f', \, g')\ of \r = (f\<^sub>1 \ C.inv f\<^sub>0, g\<^sub>1 \ C.inv g\<^sub>0)\. Compose with isomorphisms \\\ : f' \ f\\ and \\\ : g \ g'\\ to obtain \(f, (r \ \) \ \ \ \, g)\ and show it must also be a tabulation. \ fix f g assume f: "is_left_adjoint f" assume g: "is_left_adjoint g" assume fg: "src f = src g" show "\r \. tabulation (\) (\) assoc unit src trg r \ f g" proof - text \We have to unpack the hypotheses to get information about f and g.\ obtain f\<^sub>a \\<^sub>f \\<^sub>f where ff\<^sub>a: "adjunction_in_bicategory vcomp hcomp assoc unit src trg f f\<^sub>a \\<^sub>f \\<^sub>f" using f adjoint_pair_def by auto interpret ff\<^sub>a: adjunction_in_bicategory vcomp hcomp assoc unit src trg f f\<^sub>a \\<^sub>f \\<^sub>f using ff\<^sub>a by simp interpret f: arrow_of_spans C f using ide_char [of f] by simp interpret f: identity_arrow_of_spans C f using ide_char [of f] by unfold_locales auto obtain g\<^sub>a \\<^sub>g \\<^sub>g where G: "adjunction_in_bicategory vcomp hcomp assoc unit src trg g g\<^sub>a \\<^sub>g \\<^sub>g" using g adjoint_pair_def by auto interpret gg\<^sub>a: adjunction_in_bicategory vcomp hcomp assoc unit src trg g g\<^sub>a \\<^sub>g \\<^sub>g using G by simp interpret g: arrow_of_spans C g using ide_char [of g] by simp interpret g: identity_arrow_of_spans C g using ide_char [of g] by unfold_locales auto let ?f' = "mkIde (C.cod f.leg0) (f.dom.leg1 \ C.inv f.leg0)" have f': "ide ?f'" proof - have "C.span (C.cod f.leg0) (f.leg1 \ C.inv f.leg0)" using f is_left_adjoint_char by auto thus ?thesis using ide_mkIde by blast qed interpret f': arrow_of_spans C ?f' using f' ide_char by blast interpret f': identity_arrow_of_spans C ?f' using f' ide_char by unfold_locales auto let ?g' = "mkIde (C.cod g.leg0) (g.dom.leg1 \ C.inv g.leg0)" have g': "ide ?g'" proof - have "C.span (C.cod g.leg0) (g.leg1 \ C.inv g.leg0)" using g is_left_adjoint_char by auto thus ?thesis using ide_mkIde by blast qed interpret g': arrow_of_spans C ?g' using g' ide_char by blast interpret g': identity_arrow_of_spans C ?g' using g' ide_char by unfold_locales auto let ?r = "mkIde (f'.leg1) (g'.leg1)" have r: "ide ?r" proof - have "C.span (f'.leg1) (g'.leg1)" using f g fg src_def is_left_adjoint_char by simp thus ?thesis using ide_mkIde by blast qed interpret r: arrow_of_spans C ?r using r ide_char by blast interpret r: identity_arrow_of_spans C ?r using r ide_char by unfold_locales auto interpret r: identity_arrow_in_span_bicategory C prj0 prj1 ?r .. have "r.f = ?f'" using f r.chine_eq_apex is_left_adjoint_char by auto have "r.g = ?g'" using f r.chine_eq_apex fg src_def is_left_adjoint_char by simp interpret \: tabulation \(\)\ \(\)\ assoc unit src trg ?r r.\ r.f r.g using r.has_tabulation by simp have \_eq: "r.\ = \Chn = \C.cod f.leg0 \f'.leg1, f'.leg1\ C.cod f.leg0\, Dom = \Leg0 = C.cod f.leg0, Leg1 = g'.leg1\, Cod = \Leg0 = \

\<^sub>0[f'.leg1, f'.leg1], Leg1 = g'.leg1 \ \

\<^sub>1[f'.leg1, f'.leg1]\\" using \r.f = ?f'\ by auto text \Obtain the isomorphism from \f'\ to \f\.\ let ?\ = "\Chn = C.inv f.leg0, Dom = Dom ?f', Cod = Dom f\" interpret Dom_\: span_in_category C \Dom \Chn = C.inv f.leg0, Dom = Dom (mkIde f.dsrc (f.leg1 \ C.inv f.leg0)), Cod = Dom f\\ using f'.dom.span_in_category_axioms by simp interpret Cod_\: span_in_category C \Cod \Chn = C.inv f.leg0, Dom = Dom (mkIde f.dsrc (f.leg1 \ C.inv f.leg0)), Cod = Dom f\\ using f.dom.span_in_category_axioms by simp interpret \: arrow_of_spans C ?\ proof show "\Chn \Chn = C.inv f.leg0, Dom = Dom (mkIde f.dsrc (f.leg1 \ C.inv f.leg0)), Cod = Dom f\ : Dom_\.apex \\<^sub>C Cod_\.apex\" using f f.dom.apex_def f'.dom.apex_def is_left_adjoint_char by auto show "Cod_\.leg0 \ Chn \Chn = C.inv f.leg0, Dom = Dom (mkIde f.dsrc (f.leg1 \ C.inv f.leg0)), Cod = Dom f\ = Dom_\.leg0" using f f.dom.apex_def is_left_adjoint_char C.comp_arr_inv C.inv_is_inverse by simp show "Cod_\.leg1 \ Chn \Chn = C.inv f.leg0, Dom = Dom (mkIde f.dsrc (f.leg1 \ C.inv f.leg0)), Cod = Dom f\ = Dom_\.leg1" by simp qed have \: "\?\ : ?f' \ f\ \ iso ?\" using f is_left_adjoint_char iso_char arr_char dom_char cod_char \.arrow_of_spans_axioms f'.dom.apex_def f.dom.apex_def by auto text \ Obtain the isomorphism from \g\ to \g'\. Recall: \g' = mkIde (C.cod g.leg0) (g.dom.leg1 \ C.inv g.leg0)\. The isomorphism is given by \g.leg0\. \ let ?\ = "\Chn = g.leg0, Dom = Dom g, Cod = Dom ?g'\" interpret Dom_\: span_in_category C \Dom \Chn = g.leg0, Dom = Dom g, Cod = Dom (mkIde g.dsrc (g.leg1 \ C.inv g.leg0))\\ using g.dom.span_in_category_axioms by simp interpret Cod_\: span_in_category C \Cod \Chn = g.leg0, Dom = Dom g, Cod = Dom (mkIde g.dsrc (g.leg1 \ C.inv g.leg0))\\ using g'.dom.span_in_category_axioms by simp interpret \: arrow_of_spans C ?\ proof show "\Chn \Chn = g.leg0, Dom = Dom g, Cod = Dom (mkIde g.dsrc (g.leg1 \ C.inv g.leg0))\ : Dom_\.apex \\<^sub>C Cod_\.apex\" using g g.dom.apex_def g'.dom.apex_def is_left_adjoint_char by auto show "Cod_\.leg0 \ Chn \Chn = g.leg0, Dom = Dom g, Cod = Dom (mkIde g.dsrc (g.leg1 \ C.inv g.leg0))\ = Dom_\.leg0" using C.comp_cod_arr by simp show "Cod_\.leg1 \ Chn \Chn = g.leg0, Dom = Dom g, Cod = Dom (mkIde g.dsrc (g.leg1 \ C.inv g.leg0))\ = Dom_\.leg1" using g g.dom.apex_def is_left_adjoint_char C.comp_inv_arr C.inv_is_inverse C.comp_assoc C.comp_arr_dom by simp qed have \: "\?\ : g \ ?g'\ \ iso ?\" using g is_left_adjoint_char iso_char arr_char dom_char cod_char \.arrow_of_spans_axioms g.dom.apex_def g'.dom.apex_def by auto have \\: "tabulation (\) (\) assoc unit src trg ?r (r.\ \ ?\) r.f g" using \ \r.g = ?g'\ r.has_tabulation \.preserved_by_output_iso by simp interpret \\: tabulation vcomp hcomp assoc unit src trg ?r \r.\ \ ?\\ r.f g using \\ by auto have "tabulation (\) (\) assoc unit src trg ?r ((?r \ ?\) \ r.\ \ ?\) f g" using \ \r.f = ?f'\ \\.preserved_by_input_iso [of ?\ f] by argo thus ?thesis by auto qed qed text \The sub-bicategory of maps is locally essentially discrete.\ show "\f f' \ \'. \ is_left_adjoint f; is_left_adjoint f'; \\ : f \ f'\; \\' : f \ f'\ \ \ iso \ \ iso \' \ \ = \'" proof - fix f f' \ \' assume f: "is_left_adjoint f" and f': "is_left_adjoint f'" assume \: "\\ : f \ f'\" and \': "\\' : f \ f'\" obtain f\<^sub>a \ \ where f\<^sub>a: "adjunction_in_bicategory vcomp hcomp assoc unit src trg f f\<^sub>a \ \" using f adjoint_pair_def by auto obtain f'\<^sub>a \' \' where f'\<^sub>a: "adjunction_in_bicategory vcomp hcomp assoc unit src trg f' f'\<^sub>a \' \'" using f' adjoint_pair_def adjunction_def by auto interpret f\<^sub>a: adjunction_in_bicategory vcomp hcomp assoc unit src trg f f\<^sub>a \ \ using f\<^sub>a by simp interpret f'\<^sub>a: adjunction_in_bicategory vcomp hcomp assoc unit src trg f' f'\<^sub>a \' \' using f'\<^sub>a by simp interpret f: identity_arrow_of_spans C f using ide_char' [of f] by simp interpret f': identity_arrow_of_spans C f' using ide_char' [of f'] by simp interpret \: arrow_of_spans C \ using \ arr_char by auto interpret \': arrow_of_spans C \' using \' arr_char by auto have 1: "C.iso f.leg0 \ C.iso f'.leg0" using f f' is_left_adjoint_char by simp have 2: "\.chine = C.inv f'.leg0 \ f.leg0" using \ 1 dom_char cod_char \.leg0_commutes C.invert_side_of_triangle by auto moreover have "\'.chine = C.inv f'.leg0 \ f.leg0" using \' 1 dom_char cod_char \'.leg0_commutes C.invert_side_of_triangle by auto ultimately have 3: "\.chine = \'.chine" by simp have "iso \" using 1 2 \ C.isos_compose dom_char cod_char iso_char arr_char by auto hence "iso \'" using 3 iso_char arr_char \'.arrow_of_spans_axioms by simp moreover have "\ = \'" using 3 \ \' dom_char cod_char by fastforce ultimately show "iso \ \ iso \' \ \ = \'" by simp qed qed text \ We can now prove the easier half of the main result (CKS Theorem 4): If \B\ is biequivalent to \Span(C)\, where \C\ is a category with pullbacks, then \B\ is a bicategory of spans. (Well, it is easier given that we have already done the work to show that the notion ``bicategory of spans'' is respected by equivalence of bicategories.) \ theorem equivalent_implies_bicategory_of_spans: assumes "equivalent_bicategories vcomp hcomp assoc unit src trg V\<^sub>1 H\<^sub>1 \\<^sub>1 \\<^sub>1 src\<^sub>1 trg\<^sub>1" shows "bicategory_of_spans V\<^sub>1 H\<^sub>1 \\<^sub>1 \\<^sub>1 src\<^sub>1 trg\<^sub>1" using assms is_bicategory_of_spans bicategory_of_spans_respects_equivalence by blast end subsection "Properties of Bicategories of Spans" text \ We now develop consequences of the axioms for a bicategory of spans, in preparation for proving the other half of the main result. \ context bicategory_of_spans begin notation isomorphic (infix "\" 50) text \ The following is a convenience version of \BS2\ that gives us what we generally want: given specified \f, g\ obtain \\\ that makes \(f, \, g)\ a tabulation of \g \ f\<^sup>*\, not a tabulation of some \r\ isomorphic to \g \ f\<^sup>*\. \ lemma BS2': assumes "is_left_adjoint f" and "is_left_adjoint g" and "src f = src g" and "isomorphic (g \ f\<^sup>*) r" shows "\\. tabulation V H \ \ src trg r \ f g" proof - have 1: "is_left_adjoint f \ is_left_adjoint g \ g \ f\<^sup>* \ r" using assms BS1 by simp obtain \ where \: "\\ : g \ f\<^sup>* \ r\ \ iso \" using 1 isomorphic_def by blast obtain r' \' where \': "tabulation V H \ \ src trg r' \' f g" using assms 1 BS2 by blast interpret \': tabulation V H \ \ src trg r' \' f g using \' by simp let ?\ = "\'.T0.trnr\<^sub>\ r' \'" have \: "\?\ : g \ f\<^sup>* \ r'\ \ iso ?\" using \'.yields_isomorphic_representation by blast have "\\ \ inv ?\ : r' \ r\ \ iso (\ \ inv ?\)" using \ \ isos_compose by blast hence 3: "tabulation V H \ \ src trg r ((\ \ inv ?\ \ f) \ \') f g" using \'.is_preserved_by_base_iso by blast hence "\\. tabulation V H \ \ src trg r \ f g" by blast thus ?thesis using someI_ex [of "\\. tabulation V H \ \ src trg r \ f g"] by simp qed text \ The following observation is made by CKS near the beginning of the proof of Theorem 4: If \w\ is an arbitrary 1-cell, and \g\ and \g \ w\ are maps, then \w\ is in fact a map. It is applied frequently. \ lemma BS4: assumes "is_left_adjoint g" and "ide w" and "is_left_adjoint (g \ w)" shows "is_left_adjoint w" proof - text \ CKS say: ``by (i) there are maps \m, n\ with \w \ nm\<^sup>*\, so, by (ii), we have two tabulations \(1, \, gw)\, \(m, \, gn)\ of \gw\; since tabulations are unique up to equivalence, \m\ is invertible and \w \ nm\<^sup>*\ is a map.'' \ have ex_\: "\\. tabulation V H \ \ src trg (g \ w) \ (src w) (g \ w)" proof - have "(g \ w) \ src w \ g \ w" by (metis assms(3) iso_runit ideD(1) isomorphic_def left_adjoint_is_ide runit_in_hom(2) src_hcomp) moreover have "isomorphic ((g \ w) \ (src w)\<^sup>*) (g \ w)" proof - have "(g \ w) \ src (g \ w) \ g \ w" using calculation isomorphic_implies_ide(2) by auto moreover have "isomorphic (src (g \ w)) (src w)\<^sup>*" proof - interpret src_w: map_in_bicategory V H \ \ src trg \src w\ using assms obj_is_self_adjoint by unfold_locales auto interpret src_w: adjunction_in_bicategory V H \ \ src trg \src w\ \(src w)\<^sup>*\ src_w.\ src_w.\ using src_w.is_map left_adjoint_extends_to_adjunction by simp have "adjoint_pair (src w) (src w)" using assms obj_is_self_adjoint by simp moreover have "adjoint_pair (src w) (src w)\<^sup>*" using adjoint_pair_def src_w.adjunction_in_bicategory_axioms by auto ultimately have "src w \ (src w)\<^sup>*" using left_adjoint_determines_right_up_to_iso by simp moreover have "src w = src (g \ w)" using assms isomorphic_def hcomp_simps(1) left_adjoint_is_ide by simp ultimately show ?thesis by simp qed moreover have "src (g \ w) = trg (src (g \ w))" using assms left_adjoint_is_ide by simp ultimately show ?thesis using assms left_adjoint_is_ide isomorphic_transitive isomorphic_symmetric hcomp_ide_isomorphic by blast qed ultimately show ?thesis using assms obj_is_self_adjoint left_adjoint_is_ide BS2' [of "src w" "g \ w" "g \ w"] by auto qed obtain \ where \: "tabulation V H \ \ src trg (g \ w) \ (src w) (g \ w)" using ex_\ by auto obtain m n where mn: "is_left_adjoint m \ is_left_adjoint n \ isomorphic w (n \ m\<^sup>*)" using assms BS1 [of w] by auto have m\<^sub>a: "adjoint_pair m m\<^sup>* \ isomorphic w (n \ m\<^sup>*)" using mn adjoint_pair_def left_adjoint_extends_to_adjoint_pair by blast have ex_\: "\\. tabulation V H \ \ src trg (g \ w) \ m (g \ n)" proof - have "hseq n m\<^sup>*" using mn isomorphic_implies_ide by auto have "trg (n \ m\<^sup>*) = trg w" using mn m\<^sub>a isomorphic_def by (metis (no_types, lifting) dom_inv in_homE trg_dom trg_inv) hence "trg n = trg w" using mn by (metis assms(2) ideD(1) trg.preserves_reflects_arr trg_hcomp) hence "hseq g n" using assms mn left_adjoint_is_ide ideD(1) by (metis hseq_char) have "hseq g w" using assms left_adjoint_is_ide by simp have "src m = src n" using mn m\<^sub>a \hseq n m\<^sup>*\ adjoint_pair_antipar [of m "m\<^sup>*"] by fastforce have "is_left_adjoint (g \ n)" using assms mn left_adjoints_compose \hseq g n\ by blast moreover have "src m = src (g \ n)" using assms mn \hseq g n\ \src m = src n\ by simp moreover have "(g \ n) \ m\<^sup>* \ g \ w" proof - have 1: "src g = trg (n \ m\<^sup>*)" using assms \trg (n \ m\<^sup>*) = trg w\ \hseq g w\ by fastforce hence "(g \ n) \ m\<^sup>* \ g \ n \ m\<^sup>*" using assms mn m\<^sub>a assoc_in_hom iso_assoc \hseq g n\ \hseq n m\<^sup>*\ isomorphic_def left_adjoint_is_ide right_adjoint_is_ide by (metis hseqE ideD(2) ideD(3)) also have "... \ g \ w" using assms 1 mn m\<^sub>a isomorphic_symmetric hcomp_ide_isomorphic left_adjoint_is_ide by simp finally show ?thesis using isomorphic_transitive by blast qed ultimately show ?thesis using assms mn m\<^sub>a BS2' by blast qed obtain \ where \: "tabulation V H \ \ src trg (g \ w) \ m (g \ n)" using ex_\ by auto interpret \: tabulation V H \ \ src trg \g \ w\ \ \src w\ \g \ w\ using \ by auto interpret \: tabulation V H \ \ src trg \g \ w\ \ m \g \ n\ using \ by auto text \ As usual, the sketch given by CKS seems more suggestive than it is a precise recipe. We can obtain an equivalence map \\e : src w \ src m\\ and \\\ such that \\\ : m \ e \ src w\\. We can also obtain an equivalence map \\e' : src m \ src w\\ and \\'\ such that \\\' : src w \ e' \ m\\. If \\'\ can be taken to be an isomorphism; then we have \e' \ src w \ e' \ m\. Since \e'\ is an equivalence, this shows \m\ is an equivalence, hence its right adjoint \m\<^sup>*\ is also an equivalence and therefore a map. But \w = n \ m\<^sub>a\, so this shows that \w\ is a map. Now, we may assume without loss of generality that \e\ and \e'\ are part of an adjoint equivalence. We have \\\ : m \ e \ src w\\ and \\\' : src w \ e' \ m\\. We may take the transpose of \\\ to obtain \\\ : m \ src w \ e'\\; then \\\' \ \ : m \ m\\ and \\\ \ \' : src w \ e' \ src w \ e'\\. Since \m\ and \src w \ e'\ are maps, by \BS3\ it must be that \\\ and \\'\ are inverses. \ text \ {\bf Note:} CKS don't cite \BS3\ here. I am not sure whether this result can be proved without \BS3\. For example, I am interested in knowing whether it can still be proved under the the assumption that 2-cells between maps are unique, but not necessarily invertible, or maybe even in a more general situation. It looks like the invertibility part of \BS3\ is not used in the proof below. \ have 2: "\e e' \ \ \ \ \' \'. equivalence_in_bicategory (\) (\) \ \ src trg e e' \ \ \ \\' : src w \ e' \ m\ \ \\ : g \ n \ (g \ w) \ e'\ \ iso \ \ \ = \.composite_cell e' \' \ \ \ \\ : m \ e \ src w\ \ \\' : g \ w \ (g \ n) \ e\ \ iso \' \ \ = ((g \ w) \ \) \ \[g \ w, m, e] \ (\ \ e) \ \'" using \ \.apex_unique_up_to_equivalence [of \ "src w" "g \ w"] comp_assoc by metis obtain e e' \ \ \ \ \' \' where *: "equivalence_in_bicategory (\) (\) \ \ src trg e e' \ \ \ \\' : src w \ e' \ m\ \ \\ : g \ n \ (g \ w) \ e'\ \ iso \ \ \ = \.composite_cell e' \' \ \ \ \\ : m \ e \ src w\ \ \\' : g \ w \ (g \ n) \ e\ \ iso \' \ \ = \.composite_cell e \ \ \'" using 2 comp_assoc by auto interpret ee': equivalence_in_bicategory \(\)\ \(\)\ \ \ src trg e e' \ \ using * by simp have equiv_e: "equivalence_map e" using ee'.equivalence_in_bicategory_axioms equivalence_map_def by auto obtain \' where \': "adjoint_equivalence_in_bicategory (\) (\) \ \ src trg e e' \ \'" using equivalence_refines_to_adjoint_equivalence [of e e' \] ee'.unit_in_hom(2) ee'.unit_is_iso ee'.antipar equiv_e by auto interpret ee': adjoint_equivalence_in_bicategory \(\)\ \(\)\ \ \ src trg e e' \ \' using \' by simp interpret e'e: adjoint_equivalence_in_bicategory \(\)\ \(\)\ \ \ src trg e' e \inv \'\ \inv \\ using * ee'.dual_adjoint_equivalence by simp have equiv_e': "equivalence_map e'" using e'e.equivalence_in_bicategory_axioms equivalence_map_def by auto have "hseq m e" using * ide_dom [of \] apply (elim conjE in_homE) by simp have "hseq (src w) e'" using * ide_dom [of \'] apply (elim conjE in_homE) by simp have "e'e.trnr\<^sub>\ m \ \ hom m (src w \ e')" proof - have "src m = trg e" using \hseq m e\ by auto moreover have "src (src w) = trg e'" using \hseq (src w) e'\ by auto moreover have "ide m" using mn left_adjoint_is_ide by simp moreover have "ide (src w)" using assms by simp ultimately show ?thesis using * e'e.adjoint_transpose_right(1) by blast qed hence 3: "\e'e.trnr\<^sub>\ m \ : m \ src w \ e'\" by simp hence "\\' \ e'e.trnr\<^sub>\ m \ : m \ m\ \ \e'e.trnr\<^sub>\ m \ \ \' : src w \ e' \ src w \ e'\" using * by auto moreover have "\m : m \ m\ \ \src w \ e' : src w \ e' \ src w \ e'\" using mn 3 ide_cod [of "e'e.trnr\<^sub>\ m \"] left_adjoint_is_ide by fastforce moreover have 4: "is_left_adjoint (src w \ e')" proof - have "is_left_adjoint (src w)" using assms obj_is_self_adjoint by simp moreover have "is_left_adjoint e'" using e'e.adjunction_in_bicategory_axioms adjoint_pair_def by auto ultimately show ?thesis using left_adjoints_compose \hseq (src w) e'\ by auto qed ultimately have "\' \ e'e.trnr\<^sub>\ m \ = m \ e'e.trnr\<^sub>\ m \ \ \' = src w \ e'" using mn BS3 [of m m "\' \ e'e.trnr\<^sub>\ m \" m] BS3 [of "src w \ e'" "src w \ e'" "e'e.trnr\<^sub>\ m \ \ \'" "src w \ e'"] by auto hence "inverse_arrows \' (e'e.trnr\<^sub>\ m \)" using mn 4 left_adjoint_is_ide inverse_arrows_def by simp hence 5: "iso \'" by auto have "equivalence_map (src w \ e')" using assms obj_is_equivalence_map equiv_e' \hseq (src w) e'\ equivalence_maps_compose by auto hence "equivalence_map m" using * 5 equivalence_map_preserved_by_iso isomorphic_def by auto hence "equivalence_map m\<^sup>*" using mn m\<^sub>a right_adjoint_to_equivalence_is_equivalence by simp hence "is_left_adjoint m\<^sup>*" using equivalence_is_left_adjoint by simp moreover have "hseq n m\<^sup>*" using mn isomorphic_implies_ide by auto ultimately have "is_left_adjoint (n \ m\<^sup>*)" using mn left_adjoints_compose by blast thus ?thesis using mn left_adjoint_preserved_by_iso isomorphic_def isomorphic_symmetric by metis qed end subsection "Choosing Tabulations" context bicategory_of_spans begin notation isomorphic (infix "\" 50) notation iso_class ("\_\") text \ We will ultimately need to have chosen a specific tabulation for each 1-cell. This has to be done carefully, to avoid unnecessary choices. We start out by using \BS1\ to choose a specific factorization of the form \r \ tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*\ for each 1-cell \r\. This has to be done in such a way that all elements of an isomorphism class are assigned the same factorization. \ abbreviation isomorphic_rep where "isomorphic_rep r f g \ is_left_adjoint f \ is_left_adjoint g \ g \ f\<^sup>* \ r" definition tab\<^sub>0 where "tab\<^sub>0 r \ SOME f. \g. isomorphic_rep (iso_class_rep \r\) f g" definition tab\<^sub>1 where "tab\<^sub>1 r \ SOME g. isomorphic_rep (iso_class_rep \r\) (tab\<^sub>0 r) g" definition rep where "rep r \ SOME \. \\ : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\ \ iso \" lemma rep_props: assumes "ide r" shows "\rep r : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\" and "iso (rep r)" and "r \ iso_class_rep \r\" and "isomorphic_rep r (tab\<^sub>0 r) (tab\<^sub>1 r)" and "tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r" proof - have 1: "isomorphic_rep r (tab\<^sub>0 r) (tab\<^sub>1 r)" proof - have "\f g. isomorphic_rep (iso_class_rep \r\) f g" using assms BS1 isomorphic_symmetric rep_iso_class isomorphic_transitive by blast hence "isomorphic_rep (iso_class_rep \r\) (tab\<^sub>0 r) (tab\<^sub>1 r)" using assms tab\<^sub>0_def tab\<^sub>1_def someI_ex [of "\f. \g. isomorphic_rep (iso_class_rep \r\) f g"] someI_ex [of "\g. isomorphic_rep (iso_class_rep \r\) (tab\<^sub>0 r) g"] by simp thus ?thesis using assms isomorphic_symmetric isomorphic_transitive rep_iso_class by blast qed hence "\\. \\ : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\ \ iso \" using isomorphic_def by blast hence 2: "\rep r : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\ \ iso (rep r)" using someI_ex [of "\\. \\ : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\ \ iso \"] rep_def by auto show "\rep r : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\" using 2 by simp show "iso (rep r)" using 2 by simp show "r \ iso_class_rep \r\" using assms rep_iso_class isomorphic_symmetric by simp thus "isomorphic_rep r (tab\<^sub>0 r) (tab\<^sub>1 r)" using 1 isomorphic_transitive by blast thus "tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r" by simp qed lemma tab\<^sub>0_in_hom [intro]: assumes "ide r" shows "\tab\<^sub>0 r : src (tab\<^sub>0 r) \ src r\" and "\tab\<^sub>0 r : tab\<^sub>0 r \ tab\<^sub>0 r\" proof - show "\tab\<^sub>0 r : tab\<^sub>0 r \ tab\<^sub>0 r\" using assms rep_props left_adjoint_is_ide by auto have "trg (tab\<^sub>0 r) = src r" using assms rep_props by (metis ideD(1) isomorphic_implies_hpar(1) isomorphic_implies_hpar(3) right_adjoint_simps(2) src_hcomp) thus "\tab\<^sub>0 r : src (tab\<^sub>0 r) \ src r\" using assms rep_props left_adjoint_is_ide by (intro in_hhomI, auto) qed lemma tab\<^sub>0_simps [simp]: assumes "ide r" shows "ide (tab\<^sub>0 r)" and "is_left_adjoint (tab\<^sub>0 r)" and "trg (tab\<^sub>0 r) = src r" and "dom (tab\<^sub>0 r) = tab\<^sub>0 r" and "cod (tab\<^sub>0 r) = tab\<^sub>0 r" using assms tab\<^sub>0_in_hom rep_props ide_dom left_adjoint_is_ide by auto lemma tab\<^sub>1_in_hom [intro]: assumes "ide r" shows "\tab\<^sub>1 r : src (tab\<^sub>0 r) \ trg r\" and "\tab\<^sub>1 r : tab\<^sub>1 r \ tab\<^sub>1 r\" proof - show "\tab\<^sub>1 r : tab\<^sub>1 r \ tab\<^sub>1 r\" using assms rep_props left_adjoint_is_ide by auto have "trg (tab\<^sub>1 r) = trg r" using assms rep_props by (metis ideD(1) isomorphic_implies_hpar(1) isomorphic_implies_hpar(4) trg_hcomp) moreover have "src (tab\<^sub>0 r) = src (tab\<^sub>1 r)" using assms rep_props by fastforce ultimately show "\tab\<^sub>1 r : src (tab\<^sub>0 r) \ trg r\" using assms rep_props left_adjoint_is_ide by (intro in_hhomI, auto) qed lemma tab\<^sub>1_simps [simp]: assumes "ide r" shows "ide (tab\<^sub>1 r)" and "is_left_adjoint (tab\<^sub>1 r)" and "src (tab\<^sub>1 r) = src (tab\<^sub>0 r)" and "trg (tab\<^sub>1 r) = trg r" and "dom (tab\<^sub>1 r) = tab\<^sub>1 r" and "cod (tab\<^sub>1 r) = tab\<^sub>1 r" using assms tab\<^sub>1_in_hom rep_props ide_dom left_adjoint_is_ide by auto lemma rep_in_hom [intro]: assumes "ide r" shows "\rep r : src r \ trg r\" and "\rep r : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\" proof - show "\rep r : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\" using assms rep_props by auto thus "\rep r : src r \ trg r\" using arrI vconn_implies_hpar(1-4) by force qed lemma rep_simps [simp]: assumes "ide r" shows "arr (rep r)" and "src (rep r) = src r" and "trg (rep r) = trg r" and "dom (rep r) = tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*" and "cod (rep r) = r" using assms rep_in_hom by auto lemma iso_rep: assumes "ide r" shows "iso (rep r)" using assms rep_props by simp end text \ Next, we assign a specific tabulation to each 1-cell r. We can't just do this any old way if we ultimately expect to obtain a mapping that is functorial with respect to vertical composition. What we have to do is to assign the representative \tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*\ its canonical tabulation, obtained as the adjoint transpose of the identity, and then translate this to a tabulation of \r\ via the chosen isomorphism \\rep r : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ r\\. \ locale identity_in_bicategory_of_spans = bicategory_of_spans + fixes r :: 'a assumes is_ide: "ide r" begin interpretation tab\<^sub>0: map_in_bicategory V H \ \ src trg \tab\<^sub>0 r\ using is_ide rep_props by unfold_locales auto interpretation tab\<^sub>1: map_in_bicategory V H \ \ src trg \tab\<^sub>1 r\ using is_ide rep_props by unfold_locales auto text \ A tabulation \(tab\<^sub>0 r, tab, tab\<^sub>1 r)\ of \r\ can be obtained as the adjoint transpose of the isomorphism \\rep r : (tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>* \ r\\. It is essential to define it this way if we expect the mapping from 2-cells of the underlying bicategory to arrows of spans to preserve vertical composition. \ definition tab where "tab \ tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) (rep r)" text \ In view of \BS2'\, the 1-cell \(tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*\ has the canonical tabulation obtained via adjoint transpose of an identity. In fact, this tabulation generates the chosen tabulation of \r\ in the same isomorphism class by translation along the isomorphism \\rep r : (tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>* \ r\\. This fact is used to show that the mapping from 2-cells to arrows of spans preserves identities. \ lemma canonical_tabulation: shows "tabulation V H \ \ src trg ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*) (tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)) (tab\<^sub>0 r) (tab\<^sub>1 r)" proof - have "\\. tabulation V H \ \ src trg ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*) \ (tab\<^sub>0 r) (tab\<^sub>1 r)" by (simp add: bicategory_of_spans.BS2' bicategory_of_spans_axioms is_ide isomorphic_reflexive) thus ?thesis using is_ide tab\<^sub>0.canonical_tabulation by simp qed lemma tab_def_alt: shows "tab = (rep r \ tab\<^sub>0 r) \ tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)" and "(inv (rep r) \ tab\<^sub>0 r) \ tab = tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)" proof - have "tab = tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) (rep r \ ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*))" using tab_def is_ide rep_in_hom [of r] comp_arr_dom by auto also have "... = (rep r \ tab\<^sub>0 r) \ tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)" using is_ide tab\<^sub>0.trnr\<^sub>\_comp by auto finally show 1: "tab = (rep r \ tab\<^sub>0 r) \ tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)" by simp have "(inv (rep r) \ tab\<^sub>0 r) \ tab = ((inv (rep r) \ tab\<^sub>0 r) \ (rep r \ tab\<^sub>0 r)) \ tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)" unfolding 1 using comp_assoc by presburger also have "... = tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)" proof - have 1: "(inv (rep r) \ tab\<^sub>0 r) \ (rep r \ tab\<^sub>0 r) = ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*) \ tab\<^sub>0 r" using whisker_right [of "tab\<^sub>0 r" "inv (rep r)" "rep r"] iso_rep rep_in_hom inv_is_inverse comp_inv_arr by (simp add: comp_inv_arr' is_ide) show ?thesis proof - have "\tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*) : tab\<^sub>1 r \ (tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*) \ tab\<^sub>0 r\" by (meson canonical_tabulation tabulation_data.tab_in_hom(2) tabulation_def) hence "((tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*) \ tab\<^sub>0 r) \ tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*) = tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)" using 1 comp_cod_arr by blast thus ?thesis using 1 by simp qed qed finally show "(inv (rep r) \ tab\<^sub>0 r) \ tab = tab\<^sub>0.trnr\<^sub>\ (tab\<^sub>1 r) ((tab\<^sub>1 r) \ (tab\<^sub>0 r)\<^sup>*)" by blast qed lemma tab_is_tabulation: shows "tabulation V H \ \ src trg r tab (tab\<^sub>0 r) (tab\<^sub>1 r)" by (metis bicategory_of_spans.iso_rep bicategory_of_spans.rep_in_hom(2) bicategory_of_spans_axioms is_ide canonical_tabulation tab_def_alt(1) tabulation.is_preserved_by_base_iso) (* * TODO: If I pull the interpretation "tab" out of the following, Isabelle warns that * the lemma is a redundant introduction rule and is being "ignored" for that purpose. * However, the redundancy is only in the present context: if the enclosing locale is * interpreted elsewhere, then the rule is not redundant. In order to make sure that * the rule is not "ignored", I have put the interpretation "tab" into the proof to * avoid the warning. *) lemma tab_in_hom [intro]: shows "\tab : src (tab\<^sub>0 r) \ trg r\" and "\tab : tab\<^sub>1 r \ r \ tab\<^sub>0 r\" proof - interpret tab: tabulation V H \ \ src trg r tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ using tab_is_tabulation by simp show "\tab : src (tab\<^sub>0 r) \ trg r\" using tab.tab_in_hom by auto show "\tab : tab\<^sub>1 r \ r \ tab\<^sub>0 r\" using tab.tab_in_hom by auto qed lemma tab_simps [simp]: shows "arr tab" and "src tab = src (tab\<^sub>0 r)" and "trg tab = trg r" and "dom tab = tab\<^sub>1 r" and "cod tab = r \ tab\<^sub>0 r" using tab_in_hom by auto end text \ The following makes the chosen tabulation conveniently available whenever we are considering a particular 1-cell. \ sublocale identity_in_bicategory_of_spans \ tabulation V H \ \ src trg r tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ using is_ide tab_is_tabulation by simp context identity_in_bicategory_of_spans begin interpretation tab\<^sub>0: map_in_bicategory V H \ \ src trg \tab\<^sub>0 r\ using is_ide rep_props by unfold_locales auto interpretation tab\<^sub>1: map_in_bicategory V H \ \ src trg \tab\<^sub>1 r\ using is_ide rep_props by unfold_locales auto text \ The fact that adjoint transpose is a bijection allows us to invert the definition of \tab\ in terms of \rep\ to express rep in terms of tab. \ lemma rep_in_terms_of_tab: shows "rep r = T0.trnr\<^sub>\ r tab" using is_ide T0.adjoint_transpose_right(3) [of r "tab\<^sub>1 r" "rep r"] tab_def by fastforce lemma isomorphic_implies_same_tab: assumes "isomorphic r r'" shows "tab\<^sub>0 r = tab\<^sub>0 r'" and "tab\<^sub>1 r = tab\<^sub>1 r'" using assms tab\<^sub>0_def tab\<^sub>1_def iso_class_eqI by auto text \ ``Every 1-cell has a tabulation as a span of maps.'' Has a nice simple ring to it, but maybe not so useful for us, since we generally really need to know that the tabulation has a specific form. \ lemma has_tabulation: shows "\\ f g. is_left_adjoint f \ is_left_adjoint g \ tabulation V H \ \ src trg r \ f g" using is_ide tab_is_tabulation rep_props by blast end subsection "Tabulations in a Bicategory of Spans" context bicategory_of_spans begin abbreviation tab_of_ide where "tab_of_ide r \ identity_in_bicategory_of_spans.tab V H \ \ src trg r" abbreviation prj\<^sub>0 where "prj\<^sub>0 h k \ tab\<^sub>0 (k\<^sup>* \ h)" abbreviation prj\<^sub>1 where "prj\<^sub>1 h k \ tab\<^sub>1 (k\<^sup>* \ h)" lemma prj_in_hom [intro]: assumes "ide h" and "is_left_adjoint k" and "trg h = trg k" shows "\prj\<^sub>0 h k : src (prj\<^sub>0 h k) \ src h\" and "\prj\<^sub>1 h k : src (prj\<^sub>0 h k) \ src k\" and "\prj\<^sub>0 h k : prj\<^sub>0 h k \ prj\<^sub>0 h k\" and "\prj\<^sub>1 h k : prj\<^sub>1 h k \ prj\<^sub>1 h k\" by (intro in_hhomI, auto simp add: assms(1-3)) lemma prj_simps [simp]: assumes "ide h" and "is_left_adjoint k" and "trg h = trg k" shows "trg (prj\<^sub>0 h k) = src h" and "src (prj\<^sub>1 h k) = src (prj\<^sub>0 h k)" and "trg (prj\<^sub>1 h k) = src k" and "dom (prj\<^sub>0 h k) = prj\<^sub>0 h k" and "cod (prj\<^sub>0 h k) = prj\<^sub>0 h k" and "dom (prj\<^sub>1 h k) = prj\<^sub>1 h k" and "cod (prj\<^sub>1 h k) = prj\<^sub>1 h k" and "is_left_adjoint (prj\<^sub>0 h k)" and "is_left_adjoint (prj\<^sub>1 h k)" using assms prj_in_hom by auto end text \ Many of the commutativity conditions that we would otherwise have to worry about when working with tabulations in a bicategory of spans reduce to trivialities. The following locales try to exploit this to make our life more manageable. \ locale span_of_maps = bicategory_of_spans + fixes leg\<^sub>0 :: 'a and leg\<^sub>1 :: 'a assumes leg0_is_map: "is_left_adjoint leg\<^sub>0" and leg1_is_map : "is_left_adjoint leg\<^sub>1" text \ The purpose of the somewhat strange-looking assumptions in this locale is to cater to the form of data that we obtain from \T1\. Under the assumption that we are in a bicategory of spans and that the legs of \r\ and \s\ are maps, the hypothesized 2-cells will be uniquely determined isomorphisms, and an arrow of spans \w\ from \r\ to \s\ will be a map. We want to prove this once and for all under the weakest assumptions we can manage. \ locale arrow_of_spans_of_maps = bicategory_of_spans V H \ \ src trg + r: span_of_maps V H \ \ src trg r\<^sub>0 r\<^sub>1 + s: span_of_maps V H \ \ src trg s\<^sub>0 s\<^sub>1 for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and r\<^sub>0 :: 'a and r\<^sub>1 :: 'a and s\<^sub>0 :: 'a and s\<^sub>1 :: 'a and w :: 'a + assumes is_ide: "ide w" and leg0_lax: "\\. \\ : s\<^sub>0 \ w \ r\<^sub>0\" and leg1_iso: "\\. \\ : r\<^sub>1 \ s\<^sub>1 \ w\ \ iso \" begin notation isomorphic (infix "\" 50) lemma composite_leg1_is_map: shows "is_left_adjoint (s\<^sub>1 \ w)" using r.leg1_is_map leg1_iso left_adjoint_preserved_by_iso' isomorphic_def isomorphic_symmetric by auto lemma is_map: shows "is_left_adjoint w" using is_ide composite_leg1_is_map s.leg1_is_map BS4 [of s\<^sub>1 w] by auto lemma hseq_leg\<^sub>0: shows "hseq s\<^sub>0 w" by (metis ideD(1) ide_dom in_homE leg0_lax) lemma composite_with_leg0_is_map: shows "is_left_adjoint (s\<^sub>0 \ w)" using left_adjoints_compose is_map s.leg0_is_map hseq_leg\<^sub>0 by blast lemma leg0_uniquely_isomorphic: shows "s\<^sub>0 \ w \ r\<^sub>0" and "\!\. \\ : s\<^sub>0 \ w \ r\<^sub>0\" proof - show 1: "s\<^sub>0 \ w \ r\<^sub>0" using leg0_lax composite_with_leg0_is_map r.leg0_is_map BS3 [of "s\<^sub>0 \ w" r\<^sub>0] isomorphic_def by auto have "\\. \\ : s\<^sub>0 \ w \ r\<^sub>0\ \ iso \" using 1 isomorphic_def by simp moreover have "\\ \'. \\ : s\<^sub>0 \ w \ r\<^sub>0\ \ \\' : s\<^sub>0 \ w \ r\<^sub>0\ \ \ = \'" using BS3 r.leg0_is_map composite_with_leg0_is_map by blast ultimately show "\!\. \\ : s\<^sub>0 \ w \ r\<^sub>0\" by blast qed lemma leg1_uniquely_isomorphic: shows "r\<^sub>1 \ s\<^sub>1 \ w" and "\!\. \\ : r\<^sub>1 \ s\<^sub>1 \ w\" proof - show 1: "r\<^sub>1 \ s\<^sub>1 \ w" using leg1_iso isomorphic_def by auto have "\\. \\ : r\<^sub>1 \ s\<^sub>1 \ w\ \ iso \" using leg1_iso isomorphic_def isomorphic_symmetric by simp moreover have "\\ \'. \\ : r\<^sub>1 \ s\<^sub>1 \ w\ \ \\' : r\<^sub>1 \ s\<^sub>1 \ w\ \ \ = \'" using BS3 r.leg1_is_map composite_leg1_is_map by blast ultimately show "\!\. \\ : r\<^sub>1 \ s\<^sub>1 \ w\" by blast qed definition the_\ where "the_\ \ THE \. \\ : s\<^sub>0 \ w \ r\<^sub>0\" definition the_\ where "the_\ \ THE \. \\ : r\<^sub>1 \ s\<^sub>1 \ w\" lemma the_\_props: shows "\the_\ : s\<^sub>0 \ w \ r\<^sub>0\" and "iso the_\" proof - show "\the_\ : s\<^sub>0 \ w \ r\<^sub>0\" unfolding the_\_def using the1I2 [of "\\. \\ : s\<^sub>0 \ w \ r\<^sub>0\" "\\. \\ : s\<^sub>0 \ w \ r\<^sub>0\"] leg0_uniquely_isomorphic by simp thus "iso the_\" using BS3 r.leg0_is_map composite_with_leg0_is_map by simp qed lemma the_\_in_hom [intro]: shows "\the_\ : src r\<^sub>0 \ trg r\<^sub>0\" and "\the_\ : s\<^sub>0 \ w \ r\<^sub>0\" using the_\_props apply auto by (metis cod_trg in_hhom_def in_homE isomorphic_implies_hpar(3) leg0_uniquely_isomorphic(1) src_dom trg.preserves_cod) lemma the_\_simps [simp]: shows "arr the_\" and "src the_\ = src r\<^sub>0" and "trg the_\ = trg r\<^sub>0" and "dom the_\ = s\<^sub>0 \ w" and "cod the_\ = r\<^sub>0" using the_\_in_hom by auto lemma the_\_props: shows "\the_\ : r\<^sub>1 \ s\<^sub>1 \ w\" and "iso the_\" proof - show "\the_\ : r\<^sub>1 \ s\<^sub>1 \ w\" unfolding the_\_def using the1I2 [of "\\. \\ : r\<^sub>1 \ s\<^sub>1 \ w\" "\\. \\ : r\<^sub>1 \ s\<^sub>1 \ w\"] leg1_uniquely_isomorphic by simp thus "iso the_\" using BS3 r.leg1_is_map composite_leg1_is_map by simp qed lemma the_\_in_hom [intro]: shows "\the_\ : src r\<^sub>1 \ trg r\<^sub>1\" and "\the_\ : r\<^sub>1 \ s\<^sub>1 \ w\" using the_\_props apply auto by (metis in_hhom_def in_homE isomorphic_implies_hpar(3) leg1_uniquely_isomorphic(1) src_cod trg_dom) lemma the_\_simps [simp]: shows "arr the_\" and "src the_\ = src r\<^sub>1" and "trg the_\ = trg r\<^sub>1" and "dom the_\ = r\<^sub>1" and "cod the_\ = s\<^sub>1 \ w" using the_\_in_hom by auto end (* * TODO: I could probably avoid repeating the declarations of the locale parameters * if I was willing to accept them being given in their order of appearance. *) locale arrow_of_spans_of_maps_to_tabulation_data = bicategory_of_spans V H \ \ src trg + arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 r\<^sub>1 s\<^sub>0 s\<^sub>1 w + \: tabulation_data V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and r\<^sub>0 :: 'a and r\<^sub>1 :: 'a and s :: 'a and \ :: 'a and s\<^sub>0 :: 'a and s\<^sub>1 :: 'a and w :: 'a text \ The following declaration allows us to inherit the rules and other facts defined in locale @{locale uw\}. It is tedious to prove very much without these in place. \ sublocale arrow_of_spans_of_maps_to_tabulation_data \ uw\ V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 r\<^sub>0 w the_\ using \.tab_in_hom is_ide the_\_props by unfold_locales auto locale arrow_of_spans_of_maps_to_tabulation = arrow_of_spans_of_maps_to_tabulation_data + tabulation V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 locale tabulation_in_maps = span_of_maps V H \ \ src trg s\<^sub>0 s\<^sub>1 + tabulation V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and s :: 'a and \ :: 'a and s\<^sub>0 :: 'a and s\<^sub>1 :: 'a sublocale tabulation_in_maps \ tabulation V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 .. sublocale identity_in_bicategory_of_spans \ tabulation_in_maps V H \ \ src trg r tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ using is_ide rep_props by unfold_locales auto locale cospan_of_maps_in_bicategory_of_spans = bicategory_of_spans + fixes h :: 'a and k :: 'a assumes h_is_map: "is_left_adjoint h" and k_is_map: "is_left_adjoint k" and cospan: "trg h = trg k" begin text \ The following sublocale declaration is perhaps pushing the limits of sensibility, but the purpose is, given a cospan of maps \(h, k)\, to obtain ready access to the composite \k\<^sup>* \ h\ and its chosen tabulation. \ sublocale identity_in_bicategory_of_spans V H \ \ src trg \k\<^sup>* \ h\ using h_is_map k_is_map cospan left_adjoint_is_ide by unfold_locales auto notation isomorphic (infix "\" 50) interpretation E: self_evaluation_map V H \ \ src trg .. notation E.eval ("\_\") interpretation h: map_in_bicategory V H \ \ src trg h using h_is_map by unfold_locales auto interpretation k: map_in_bicategory V H \ \ src trg k using k_is_map by unfold_locales auto text \ Our goal here is to reformulate the biuniversal properties of the chosen tabulation of \k\<^sup>* \ h\ in terms of its transpose, which yields a 2-cell from \k \ tab\<^sub>1 (k\<^sup>* \ h)\ to \h \ tab\<^sub>0 (k\<^sup>* \ h)\. These results do not depend on \BS3\. \ abbreviation p\<^sub>0 where "p\<^sub>0 \ prj\<^sub>0 h k" abbreviation p\<^sub>1 where "p\<^sub>1 \ prj\<^sub>1 h k" lemma p\<^sub>0_in_hom [intro]: shows "\p\<^sub>0 : src p\<^sub>0 \ src h\" by auto lemma p\<^sub>1_in_hom [intro]: shows "\p\<^sub>1 : src p\<^sub>0 \ src k\" using prj_in_hom cospan h.ide_left k_is_map by blast lemma p\<^sub>0_simps [simp]: shows "trg p\<^sub>0 = src h" by simp lemma p\<^sub>1_simps [simp]: shows "trg p\<^sub>1 = src k" using k.antipar(1) by auto definition \ where "\ \ k.trnl\<^sub>\ (h \ p\<^sub>0) (\[k\<^sup>*, h, p\<^sub>0] \ tab)" lemma \_in_hom [intro]: shows "\\ : src p\<^sub>0 \ trg h\" and "\\ : k \ p\<^sub>1 \ h \ p\<^sub>0\" proof - show 1: "\\ : k \ p\<^sub>1 \ h \ p\<^sub>0\" unfolding \_def using k.antipar cospan k.adjoint_transpose_left(2) [of "h \ p\<^sub>0" "p\<^sub>1"] by fastforce show "\\ : src p\<^sub>0 \ trg h\" using 1 k.antipar arrI cospan vconn_implies_hpar(1-2) by force qed lemma \_simps [simp]: shows "arr \" and "src \ = src p\<^sub>0" and "trg \ = trg h" and "dom \ = k \ p\<^sub>1" and "cod \ = h \ p\<^sub>0" using \_in_hom by auto lemma transpose_\: shows "tab = \\<^sup>-\<^sup>1[k\<^sup>*, h, p\<^sub>0] \ k.trnl\<^sub>\ p\<^sub>1 \" proof - have "\\<^sup>-\<^sup>1[k\<^sup>*, h, p\<^sub>0] \ k.trnl\<^sub>\ p\<^sub>1 \ = \\<^sup>-\<^sup>1[k\<^sup>*, h, p\<^sub>0] \ \[k\<^sup>*, h, p\<^sub>0] \ tab" unfolding \_def using k.antipar cospan k.adjoint_transpose_left(4) [of "h \ p\<^sub>0" "p\<^sub>1" "\[k\<^sup>*, h, p\<^sub>0] \ tab"] by fastforce also have "... = (\\<^sup>-\<^sup>1[k\<^sup>*, h, p\<^sub>0] \ \[k\<^sup>*, h, p\<^sub>0]) \ tab" using comp_assoc by presburger also have "... = tab" using k.antipar cospan comp_cod_arr comp_assoc_assoc' by simp finally show ?thesis by simp qed lemma transpose_triangle: assumes "ide w" and "\\ : p\<^sub>0 \ w \ u\" and "\\ : v \ p\<^sub>1 \ w\" shows "k.trnl\<^sub>\ (h \ u) (\[k\<^sup>*, h, u] \ ((k\<^sup>* \ h) \ \) \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w) \ \) = (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] \ (k \ \)" proof - have u: "ide u" using assms(2) by auto have v: "ide v" using assms(3) by auto have 0: "src p\<^sub>0 = trg w" by (metis assms(2) hseqE ideD(1) src.preserves_reflects_arr u vconn_implies_hpar(3)) have 1: "src h = trg u" using assms(1-2) 0 trg_dom trg_cod vconn_implies_hpar(4) by auto have 2: "src k = trg v" using assms(1,3) 0 trg_dom trg_cod hseqI' by (metis ideD(1) leg1_simps(2) leg1_simps(3) p\<^sub>1_simps trg_hcomp vconn_implies_hpar(4)) have 3: "src u = src v \ src u = src w" using assms 0 k.antipar src_dom src_cod hseqI' by (metis ideD(1) leg0_simps(2) leg1_simps(2) leg1_simps(3) src_hcomp vconn_implies_hpar(3)) have 4: "src h = trg \" using assms 1 k.antipar by auto define \ where "\ = \[k\<^sup>*, h, p\<^sub>0 \ w] \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w)" have \: "\\ : p\<^sub>1 \ w \ k\<^sup>* \ h \ p\<^sub>0 \ w\" unfolding \_def using assms 0 k.antipar cospan by (intro comp_in_homI, auto) have "k.trnl\<^sub>\ (h \ u) (\[k\<^sup>*, h, u] \ ((k\<^sup>* \ h) \ \) \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w) \ \) = k.trnl\<^sub>\ (h \ u) ((k\<^sup>* \ h \ \) \ \ \ \)" unfolding \_def using assms 1 k.antipar cospan assoc_naturality [of "k\<^sup>*" h \] comp_assoc by (metis "4" h.ide_left ide_char in_homE k.ide_right) also have "... = k.trnl\<^sub>\ (h \ u) (k\<^sup>* \ h \ \) \ (k \ \ \ \)" proof - have "ide (h \ u)" using "1" u assms h.ide_left by blast moreover have "seq (k\<^sup>* \ h \ \) (\ \ \)" using assms 1 k.antipar cospan \ seqI' apply (intro seqI) apply auto apply blast proof - have "dom (k\<^sup>* \ h \ \) = k\<^sup>* \ h \ p\<^sub>0 \ w" using assms by (metis "4" cospan hcomp_simps(2-3) h.ide_left hseqI' ide_char in_homE k.antipar(2) k.ide_right) also have "... = cod \" using \ by auto finally show "dom (k\<^sup>* \ h \ \) = cod \" by simp qed moreover have "src k = trg (k\<^sup>* \ h \ \)" using assms k.antipar cospan calculation(2) by auto ultimately show ?thesis using k.trnl\<^sub>\_comp by simp qed also have "... = k.trnl\<^sub>\ (h \ u) (k\<^sup>* \ h \ \) \ (k \ \) \ (k \ \)" using assms u \ whisker_left by (metis k.ide_left seqI') also have "... = (\[h \ u] \ (k.\ \ h \ u) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ u] \ (k \ k\<^sup>* \ h \ \)) \ (k \ \) \ (k \ \)" unfolding k.trnl\<^sub>\_def by simp also have "... = (h \ \) \ (\[h \ p\<^sub>0 \ w] \ (k.\ \ h \ p\<^sub>0 \ w) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \)) \ (k \ \)" proof - have "\[h \ u] \ (k.\ \ h \ u) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ u] \ (k \ k\<^sup>* \ h \ \) = \[h \ u] \ (k.\ \ h \ u) \ ((k \ k\<^sup>*) \ h \ \) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w]" using assms 4 k.antipar cospan assoc'_naturality [of k "k\<^sup>*" "h \ \"] by fastforce also have "... = \[h \ u] \ ((k.\ \ h \ u) \ ((k \ k\<^sup>*) \ h \ \)) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w]" using comp_assoc by presburger also have "... = (\[h \ u] \ (trg k \ h \ \)) \ (k.\ \ h \ p\<^sub>0 \ w) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w]" proof - have "(k.\ \ h \ u) \ ((k \ k\<^sup>*) \ h \ \) = k.\ \ (k \ k\<^sup>*) \ (h \ u) \ (h \ \)" using assms 1 k.antipar cospan interchange comp_arr_dom comp_cod_arr by fastforce also have "... = k.\ \ h \ \" using assms k.antipar cospan comp_arr_dom comp_cod_arr k.counit_in_hom whisker_left by (metis h.ide_left in_homE) also have "... = (trg k \ h \ \) \ (k.\ \ h \ p\<^sub>0 \ w)" using assms 4 k.antipar cospan whisker_left comp_arr_dom comp_cod_arr interchange [of "trg k" k.\ "h \ \" "h \ p\<^sub>0 \ w"] by auto finally have "(k.\ \ h \ u) \ ((k \ k\<^sup>*) \ h \ \) = (trg k \ h \ \) \ (k.\ \ h \ p\<^sub>0 \ w)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (h \ \) \ \[h \ p\<^sub>0 \ w] \ (k.\ \ h \ p\<^sub>0 \ w) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w]" proof - have "\[h \ u] \ (trg k \ h \ \) = (h \ \) \ \[h \ p\<^sub>0 \ w]" using assms 1 4 k.antipar cospan lunit_naturality [of "h \ \"] by (metis hcomp_simps(3-4) h.ide_left hseqI' ide_char in_homE trg_hcomp) thus ?thesis using comp_assoc by presburger qed finally have "\[h \ u] \ (k.\ \ h \ u) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ u] \ (k \ k\<^sup>* \ h \ \) = (h \ \) \ \[h \ p\<^sub>0 \ w] \ (k.\ \ h \ p\<^sub>0 \ w) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w]" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] \ (k \ \)" proof - have "\[h \ p\<^sub>0 \ w] \ (k.\ \ h \ p\<^sub>0 \ w) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w] \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w)) = \[h, p\<^sub>0, w] \ \[(h \ p\<^sub>0) \ w] \ (trg h \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ (k.\ \ h \ p\<^sub>0 \ w) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w] \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w))" proof - have "\[h \ p\<^sub>0 \ w] = \[h, p\<^sub>0, w] \ \[(h \ p\<^sub>0) \ w] \ (trg h \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w])" proof - have "\[h, p\<^sub>0, w] \ \[(h \ p\<^sub>0) \ w] \ (trg h \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) = \[h, p\<^sub>0, w] \ \ ((h \ p\<^sub>0) \ w) \ (trg h \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w])" using assms 0 k.antipar cospan comp_cod_arr \_ide_simp by simp also have "... = \[h, p\<^sub>0, w] \ \ (\\<^sup>-\<^sup>1[h, p\<^sub>0, w])" using assms 0 k.antipar cospan \.is_natural_2 [of "\\<^sup>-\<^sup>1[h, p\<^sub>0, w]"] by simp also have "... = \[h, p\<^sub>0, w] \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w] \ \ (h \ p\<^sub>0 \ w)" using assms 0 k.antipar cospan \.is_natural_1 [of "\\<^sup>-\<^sup>1[h, p\<^sub>0, w]"] comp_assoc by simp also have "... = (\[h, p\<^sub>0, w] \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ \ (h \ p\<^sub>0 \ w)" using comp_assoc by presburger also have "... = \ (h \ p\<^sub>0 \ w)" using assms 0 k.antipar cospan comp_cod_arr comp_assoc_assoc' by simp also have "... = \[h \ p\<^sub>0 \ w]" using assms 0 k.antipar cospan \_ide_simp by simp finally show ?thesis by simp qed thus ?thesis using comp_assoc by presburger qed also have "... = \[h, p\<^sub>0, w] \ (\[h \ p\<^sub>0] \ w) \ \\<^sup>-\<^sup>1[trg h, h \ p\<^sub>0, w] \ ((trg h \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ (k.\ \ h \ p\<^sub>0 \ w)) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w] \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w))" using assms 0 k.antipar cospan lunit_hcomp comp_assoc by simp also have "... = \[h, p\<^sub>0, w] \ (\[h \ p\<^sub>0] \ w) \ (\\<^sup>-\<^sup>1[trg h, h \ p\<^sub>0, w] \ (k.\ \ (h \ p\<^sub>0) \ w)) \ ((k \ k\<^sup>*) \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w] \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w))" proof - have "(trg h \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ (k.\ \ h \ p\<^sub>0 \ w) = (k.\ \ (h \ p\<^sub>0) \ w) \ ((k \ k\<^sup>*) \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w])" using assms 0 k.antipar cospan comp_arr_dom comp_cod_arr interchange [of "trg h" k.\ "\\<^sup>-\<^sup>1[h, p\<^sub>0, w]" "h \ p\<^sub>0 \ w"] interchange [of k.\ "k \ k\<^sup>*" "(h \ p\<^sub>0) \ w" "\\<^sup>-\<^sup>1[h, p\<^sub>0, w]"] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \[h, p\<^sub>0, w] \ (\[h \ p\<^sub>0] \ w) \ ((k.\ \ (h \ p\<^sub>0)) \ w) \ \\<^sup>-\<^sup>1[k \ k\<^sup>*, h \ p\<^sub>0, w] \ ((k \ k\<^sup>*) \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w] \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w))" using assms 0 k.antipar cospan assoc'_naturality [of k.\ "h \ p\<^sub>0" w] comp_assoc by simp also have "... = \[h, p\<^sub>0, w] \ (\[h \ p\<^sub>0] \ w) \ ((k.\ \ (h \ p\<^sub>0)) \ w) \ \\<^sup>-\<^sup>1[k \ k\<^sup>*, h \ p\<^sub>0, w] \ ((k \ k\<^sup>*) \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w]) \ (k \ \[k\<^sup>* \ h, p\<^sub>0, w]) \ (k \ tab \ w)" proof - have "k \ \[k\<^sup>*, h, p\<^sub>0 \ w] \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w) = (k \ \[k\<^sup>*, h, p\<^sub>0 \ w]) \ (k \ \[k\<^sup>* \ h, p\<^sub>0, w]) \ (k \ tab \ w)" proof - have "seq \[k\<^sup>*, h, p\<^sub>0 \ w] (\[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w))" using \_def assms 0 k.antipar cospan \ by blast thus ?thesis using assms 0 k.antipar cospan whisker_left by auto qed thus ?thesis using comp_assoc by presburger qed also have "... = \[h, p\<^sub>0, w] \ (\[h \ p\<^sub>0] \ w) \ ((k.\ \ (h \ p\<^sub>0)) \ w) \ (\\<^sup>-\<^sup>1[k \ k\<^sup>*, h \ p\<^sub>0, w] \ ((k \ k\<^sup>*) \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w]) \ (k \ \[k\<^sup>* \ h, p\<^sub>0, w]) \ \[k, (k\<^sup>* \ h) \ p\<^sub>0, w]) \ ((k \ tab) \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" proof - have "k \ tab \ w = \[k, (k\<^sup>* \ h) \ p\<^sub>0, w] \ \\<^sup>-\<^sup>1[k, (k\<^sup>* \ h) \ p\<^sub>0, w] \ (k \ tab \ w)" proof - have "\[k, (k\<^sup>* \ h) \ p\<^sub>0, w] \ \\<^sup>-\<^sup>1[k, (k\<^sup>* \ h) \ p\<^sub>0, w] \ (k \ tab \ w) = (\[k, (k\<^sup>* \ h) \ p\<^sub>0, w] \ \\<^sup>-\<^sup>1[k, (k\<^sup>* \ h) \ p\<^sub>0, w]) \ (k \ tab \ w)" using comp_assoc by presburger also have "... = (k \ ((k\<^sup>* \ h) \ p\<^sub>0) \ w) \ (k \ tab \ w)" using assms k.antipar 0 comp_assoc_assoc' by simp also have "... = k \ tab \ w" using assms k.antipar 0 comp_cod_arr by simp finally show ?thesis by simp qed also have "... = \[k, (k\<^sup>* \ h) \ p\<^sub>0, w] \ ((k \ tab) \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" using assms 0 k.antipar cospan assoc'_naturality [of k tab w] by simp finally have "k \ tab \ w = \[k, (k\<^sup>* \ h) \ p\<^sub>0, w] \ ((k \ tab) \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" by simp thus ?thesis using comp_assoc by presburger qed also have "... = \[h, p\<^sub>0, w] \ (\[h \ p\<^sub>0] \ w) \ ((k.\ \ h \ p\<^sub>0) \ w) \ (\\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0] \ (k \ \[k\<^sup>*, h, p\<^sub>0]) \ w) \ ((k \ tab) \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" proof - have "\\<^sup>-\<^sup>1[k \ k\<^sup>*, h \ p\<^sub>0, w] \ ((k \ k\<^sup>*) \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w]) \ (k \ \[k\<^sup>* \ h, p\<^sub>0, w]) \ \[k, (k\<^sup>* \ h) \ p\<^sub>0, w] = \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0] \ (k \ \[k\<^sup>*, h, p\<^sub>0]) \ w" proof - have "\\<^sup>-\<^sup>1[k \ k\<^sup>*, h \ p\<^sub>0, w] \ ((k \ k\<^sup>*) \ \\<^sup>-\<^sup>1[h, p\<^sub>0, w]) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w]) \ (k \ \[k\<^sup>* \ h, p\<^sub>0, w]) \ \[k, (k\<^sup>* \ h) \ p\<^sub>0, w] = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\k\<^bold>\ \<^bold>\ \<^bold>\k\<^sup>*\<^bold>\, \<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>] \<^bold>\ ((\<^bold>\k\<^bold>\ \<^bold>\ \<^bold>\k\<^sup>*\<^bold>\) \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\h\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\k\<^bold>\, \<^bold>\k\<^sup>*\<^bold>\, \<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\w\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\k\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\k\<^sup>*\<^bold>\, \<^bold>\h\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\w\<^bold>\\<^bold>]) \<^bold>\ (\<^bold>\k\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\k\<^sup>*\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\k\<^bold>\, (\<^bold>\k\<^sup>*\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\) \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]\" using assms 0 k.antipar cospan \_def \'_def by simp also have "... = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\k\<^bold>\, \<^bold>\k\<^sup>*\<^bold>\, \<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\k\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\k\<^sup>*\<^bold>\, \<^bold>\h\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\w\<^bold>\\" using assms 0 k.antipar cospan by (intro E.eval_eqI, simp_all) also have "... = \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0] \ (k \ \[k\<^sup>*, h, p\<^sub>0]) \ w" using assms 0 k.antipar cospan \_def \'_def by simp finally show ?thesis by simp qed thus ?thesis using comp_assoc by presburger qed also have "... = \[h, p\<^sub>0, w] \ (\[h \ p\<^sub>0] \ (k.\ \ h \ p\<^sub>0) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0] \ (k \ \[k\<^sup>*, h, p\<^sub>0]) \ (k \ tab) \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" using assms 0 k.antipar cospan comp_assoc whisker_right by auto also have "... = \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" unfolding \_def k.trnl\<^sub>\_def using assms 0 k.antipar cospan comp_assoc whisker_left by simp finally have "\[h \ p\<^sub>0 \ w] \ (k.\ \ h \ p\<^sub>0 \ w) \ \\<^sup>-\<^sup>1[k, k\<^sup>*, h \ p\<^sub>0 \ w] \ (k \ \[k\<^sup>*, h, p\<^sub>0 \ w] \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w)) = \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" by blast thus ?thesis using \_def comp_assoc by simp qed finally show ?thesis by simp qed text \ \BS3\ implies that \\\ is the unique 2-cell from \k \ p\<^sub>1\ to \h \ p\<^sub>0\ and is an isomorphism. \ lemma \_uniqueness: shows "\\. \\ : k \ p\<^sub>1 \ h \ p\<^sub>0\ \ \ = \" and "iso \" proof - have 2: "is_left_adjoint (k \ p\<^sub>1)" using k.antipar cospan left_adjoints_compose by (simp add: k_is_map) have 3: "is_left_adjoint (h \ p\<^sub>0)" using k.antipar cospan left_adjoints_compose by (simp add: h_is_map) show "\\. \\ : k \ p\<^sub>1 \ h \ p\<^sub>0\ \ \ = \" using \_in_hom 2 3 BS3 by simp show "iso \" using \_in_hom 2 3 BS3 by simp qed text \ As a consequence, the chosen tabulation of \k\<^sup>* \ h\ is the unique 2-cell from \p\<^sub>1\ to \(k\<^sup>* \ h) \ p\<^sub>0\, and therefore if we are given any such 2-cell we may conclude it yields a tabulation of \k\<^sup>* \ h\. \ lemma tab_uniqueness: assumes "\\ : p\<^sub>1 \ (k\<^sup>* \ h) \ p\<^sub>0\" shows "\ = tab" proof - have "\k.trnl\<^sub>\ (h \ p\<^sub>0) (\[k\<^sup>*, h, p\<^sub>0] \ \) : k \ p\<^sub>1 \ h \ p\<^sub>0\" using assms k.antipar cospan k.adjoint_transpose_left(2) [of "h \ p\<^sub>0" "p\<^sub>1"] assoc_in_hom by force hence "tab = \\<^sup>-\<^sup>1[k\<^sup>*, h, p\<^sub>0] \ k.trnl\<^sub>\ p\<^sub>1 (k.trnl\<^sub>\ (h \ p\<^sub>0) (\[k\<^sup>*, h, p\<^sub>0] \ \))" using transpose_\ \_uniqueness(1) by auto also have "... = \\<^sup>-\<^sup>1[k\<^sup>*, h, p\<^sub>0] \ \[k\<^sup>*, h, p\<^sub>0] \ \" using assms k.antipar cospan k.adjoint_transpose_left(4) assoc_in_hom by auto also have "... = (\\<^sup>-\<^sup>1[k\<^sup>*, h, p\<^sub>0] \ \[k\<^sup>*, h, p\<^sub>0]) \ \" using comp_assoc by presburger also have "... = \" using assms k.antipar cospan comp_cod_arr comp_assoc_assoc' by auto finally show ?thesis by simp qed text \ The following lemma reformulates the biuniversal property of the canonical tabulation of \k\<^sup>* \ h\ as a biuniversal property of \\\, regarded as a square that commutes up to isomorphism. \ lemma \_biuniversal_prop: assumes "ide u" and "ide v" shows "\\. \\ : k \ v \ h \ u\ \ \w \ \. ide w \ \\ : p\<^sub>0 \ w \ u\ \ \\ : v \ p\<^sub>1 \ w\ \ iso \ \ (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] \ (k \ \) = \" and "\w w' \ \' \. \ ide w; ide w'; \\ : p\<^sub>0 \ w \ u\; \\' : p\<^sub>0 \ w' \ u\; \\ : p\<^sub>1 \ w \ p\<^sub>1 \ w'\; (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] = (h \ \') \ \[h, p\<^sub>0, w'] \ (\ \ w') \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w'] \ (k \ \) \ \ \!\. \\ : w \ w'\ \ \ = \' \ (p\<^sub>0 \ \) \ p\<^sub>1 \ \ = \" proof - fix \ assume \: "\\ : k \ v \ h \ u\" have 1: "src h = trg u" using assms \ ide_cod by (metis ide_def in_homE seq_if_composable) have 2: "src k = trg v" using assms \ ide_dom by (metis ideD(1) in_homE not_arr_null seq_if_composable) let ?\ = "\\<^sup>-\<^sup>1[k\<^sup>*, h, u] \ k.trnl\<^sub>\ v \" have \: "\?\ : v \ (k\<^sup>* \ h) \ u\" using assms \ 1 2 k.antipar cospan k.adjoint_transpose_left(1) [of "h \ u" v] assoc_in_hom by auto obtain w \ \ where w\\: "ide w \ \\ : p\<^sub>0 \ w \ u\ \ \\ : v \ p\<^sub>1 \ w\ \ iso \ \ ((k\<^sup>* \ h) \ \) \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w) \ \ = ?\" using assms \ T1 [of u ?\] comp_assoc by (metis in_homE) have 0: "src p\<^sub>0 = trg w" using w\\ ide_dom by (metis hseqE ideD(1) in_homE) have "\ = k.trnl\<^sub>\ (h \ u) (\[k\<^sup>*, h, u] \ ((k\<^sup>* \ h) \ \) \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w) \ \)" proof - have "\ = k.trnl\<^sub>\ (h \ u) (\[k\<^sup>*, h, u] \ ?\)" proof - have "k.trnl\<^sub>\ (h \ u) (\[k\<^sup>*, h, u] \ ?\) = k.trnl\<^sub>\ (h \ u) ((\[k\<^sup>*, h, u] \ \\<^sup>-\<^sup>1[k\<^sup>*, h, u]) \ k.trnl\<^sub>\ v \)" using comp_assoc by presburger also have "... = k.trnl\<^sub>\ (h \ u) (k.trnl\<^sub>\ v \)" proof - have "(\[k\<^sup>*, h, u] \ \\<^sup>-\<^sup>1[k\<^sup>*, h, u]) \ k.trnl\<^sub>\ v \ = (k\<^sup>* \ h \ u) \ k.trnl\<^sub>\ v \" using comp_assoc_assoc' by (simp add: "1" assms(1) cospan k.antipar(2)) also have "... = k.trnl\<^sub>\ v \" using "1" \ assms(1) comp_ide_arr cospan k.antipar(2) by fastforce finally show ?thesis by simp qed also have "... = \" using assms \ k.antipar cospan 1 2 k.adjoint_transpose_left(3) by simp finally show ?thesis by simp qed thus ?thesis using w\\ by simp qed also have "... = (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] \ (k \ \)" using assms k.antipar cospan w\\ transpose_triangle [of w \ u \] by auto finally have "(h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] \ (k \ \) = \" by simp thus "\w \ \. ide w \ \\ : p\<^sub>0 \ w \ u\ \ \\ : v \ p\<^sub>1 \ w\ \ iso \ \ (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] \ (k \ \) = \" using w\\ by blast next fix w w' \ \' \ assume w: "ide w" assume w': "ide w'" assume \: "\\ : p\<^sub>0 \ w \ u\" assume \': "\\' : p\<^sub>0 \ w' \ u\" assume \: "\\ : p\<^sub>1 \ w \ p\<^sub>1 \ w'\" assume eq: "(h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] = (h \ \') \ \[h, p\<^sub>0, w'] \ (\ \ w') \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w'] \ (k \ \)" have 0: "src p\<^sub>0 = trg w" using \ ide_dom by (metis ideD(1) in_homE not_arr_null seq_if_composable) interpret uw\w'\': uw\w'\' V H \ \ src trg \k\<^sup>* \ h\ tab \p\<^sub>0\ \p\<^sub>1\ u w \ w' \' using w \ w' \' apply (unfold_locales) by auto show "\!\. \\ : w \ w'\ \ \ = \' \ (p\<^sub>0 \ \) \ p\<^sub>1 \ \ = \" proof - let ?LHS = "\[k\<^sup>*, h, u] \ ((k\<^sup>* \ h) \ \) \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w)" let ?RHS = "\[k\<^sup>*, h, u] \ ((k\<^sup>* \ h) \ \') \ \[k\<^sup>* \ h, p\<^sub>0, w'] \ (tab \ w') \ \" have eq': "?LHS = ?RHS" proof - have "k.trnl\<^sub>\ (h \ u) ?LHS = k.trnl\<^sub>\ (h \ u) (\[k\<^sup>*, h, u] \ ((k\<^sup>* \ h) \ \) \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w) \ (p\<^sub>1 \ w))" using assms 0 w \ \ k.antipar cospan comp_arr_dom by (metis tab_simps(1) tab_simps(4) whisker_right) also have "... = (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] \ (k \ p\<^sub>1 \ w)" using assms w \ \ transpose_triangle by (metis arr_dom ide_hcomp ide_in_hom(2) in_homE ide_leg1 not_arr_null seq_if_composable) also have "... = (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" using assms 0 w k.antipar cospan comp_arr_dom by simp also have "... = (h \ \') \ \[h, p\<^sub>0, w'] \ (\ \ w') \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w'] \ (k \ \)" using eq by blast also have "... = k.trnl\<^sub>\ (h \ u) ?RHS" using assms w' \' \ transpose_triangle by simp finally have 4: "k.trnl\<^sub>\ (h \ u) ?LHS = k.trnl\<^sub>\ (h \ u) ?RHS" by simp have "src k = trg (p\<^sub>1 \ w)" using assms 0 w k.antipar cospan by simp moreover have "src k\<^sup>* = trg (h \ u)" using assms 0 w k.antipar cospan by simp moreover have "ide (h \ u)" using assms 0 w k.antipar cospan by simp moreover have "ide (p\<^sub>1 \ w)" using assms 0 w k.antipar cospan by simp ultimately have "inj_on (k.trnl\<^sub>\ (h \ u)) (hom (p\<^sub>1 \ w) (k\<^sup>* \ h \ u))" using assms 0 w w' k.antipar cospan k.adjoint_transpose_left(6) bij_betw_imp_inj_on by blast moreover have "?LHS \ hom (p\<^sub>1 \ w) (k\<^sup>* \ h \ u)" proof - have "\\[k\<^sup>*, h, u] \ ((k\<^sup>* \ h) \ \) \ \[k\<^sup>* \ h, p\<^sub>0, w] \ (tab \ w) : p\<^sub>1 \ w \ k\<^sup>* \ h \ u\" using k.antipar cospan apply (intro comp_in_homI) by auto thus ?thesis by simp qed moreover have "?RHS \ hom (p\<^sub>1 \ w) (k\<^sup>* \ h \ u)" proof - have "\\[k\<^sup>*, h, u] \ ((k\<^sup>* \ h) \ \') \ \[k\<^sup>* \ h, p\<^sub>0, w'] \ (tab \ w') \ \ : p\<^sub>1 \ w \ k\<^sup>* \ h \ u\" using \ k.antipar cospan apply (intro comp_in_homI) by auto thus ?thesis by blast qed ultimately show "?LHS = ?RHS" using assms 4 k.antipar cospan bij_betw_imp_inj_on inj_on_def [of "k.trnl\<^sub>\ (h \ u)" "hom (p\<^sub>1 \ w) (k\<^sup>* \ h \ u)"] by simp qed moreover have "seq \[k\<^sup>*, h, u] (composite_cell w \)" using assms k.antipar cospan tab_in_hom by fastforce moreover have "seq \[k\<^sup>*, h, u] (composite_cell w' \' \ \)" using assms \ k.antipar cospan tab_in_hom by fastforce ultimately have "composite_cell w \ = composite_cell w' \' \ \" using assms 0 w w' \ k.antipar cospan iso_assoc iso_is_section section_is_mono monoE [of "\[k\<^sup>*, h, u]" "composite_cell w \" "composite_cell w' \' \ \"] comp_assoc by simp thus ?thesis using w w' \ \' \ eq' T2 [of w w' \ u \' \] by metis qed qed text \ Using the uniqueness properties established for \\\, we obtain yet another reformulation of the biuniversal property associated with the chosen tabulation of \k\<^sup>* \ h\, this time as a kind of pseudo-pullback. We will use this to show that the category of isomorphism classes of maps has pullbacks. \ lemma has_pseudo_pullback: assumes "is_left_adjoint u" and "is_left_adjoint v" and "isomorphic (k \ v) (h \ u)" shows "\w. is_left_adjoint w \ isomorphic (p\<^sub>0 \ w) u \ isomorphic v (p\<^sub>1 \ w)" and "\w w'. \ is_left_adjoint w; is_left_adjoint w'; p\<^sub>0 \ w \ u; v \ p\<^sub>1 \ w; p\<^sub>0 \ w' \ u; v \ p\<^sub>1 \ w' \ \ w \ w'" proof - interpret u: map_in_bicategory V H \ \ src trg u using assms(1) by unfold_locales auto interpret v: map_in_bicategory V H \ \ src trg v using assms(2) by unfold_locales auto obtain \ where \: "\\ : k \ v \ h \ u\ \ iso \" using assms(3) by auto obtain w \ \ where w\\: "ide w \ \\ : p\<^sub>0 \ w \ u\ \ \\ : v \ p\<^sub>1 \ w\ \ iso \ \ (h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] \ (k \ \) = \" using assms \ \_biuniversal_prop(1) [of u v \] by auto have "is_left_adjoint w \ isomorphic (p\<^sub>0 \ w) u \ isomorphic v (p\<^sub>1 \ w)" proof (intro conjI) show 1: "is_left_adjoint w" using assms(2) w\\ left_adjoint_preserved_by_iso' isomorphic_def BS4 leg1_is_map by blast show "v \ p\<^sub>1 \ w" using w\\ isomorphic_def by blast show "p\<^sub>0 \ w \ u" proof - have "src p\<^sub>0 = trg w" using w\\ ide_dom by (metis ideD(1) in_homE not_arr_null seq_if_composable) hence "is_left_adjoint (p\<^sub>0 \ w)" using 1 left_adjoints_compose by simp thus ?thesis using assms w\\ 1 BS3 isomorphic_def by metis qed qed thus "\w. is_left_adjoint w \ p\<^sub>0 \ w \ u \ v \ p\<^sub>1 \ w" by blast show "\w w'. \ is_left_adjoint w; is_left_adjoint w'; p\<^sub>0 \ w \ u; v \ p\<^sub>1 \ w; p\<^sub>0 \ w' \ u; v \ p\<^sub>1 \ w' \ \ w \ w'" proof - fix w w' assume w: "is_left_adjoint w" and w': "is_left_adjoint w'" assume 1: "p\<^sub>0 \ w \ u" assume 2: "v \ p\<^sub>1 \ w" assume 3: "p\<^sub>0 \ w' \ u" assume 4: "v \ p\<^sub>1 \ w'" obtain \ where \: "\\ : p\<^sub>0 \ w \ u\" using 1 by auto obtain \' where \': "\\' : p\<^sub>0 \ w' \ u\" using 3 by auto obtain \ where \: "\\: v \ p\<^sub>1 \ w\ \ iso \" using 2 by blast obtain \' where \': "\\': v \ p\<^sub>1 \ w'\ \ iso \'" using 4 by blast let ?\ = "\' \ inv \" have \: "\?\ : p\<^sub>1 \ w \ p\<^sub>1 \ w'\" using \ \' by (elim conjE in_homE, auto) interpret uw\: uw\ V H \ \ src trg \k\<^sup>* \ h\ tab \p\<^sub>0\ \p\<^sub>1\ u w \ using w \ left_adjoint_is_ide by unfold_locales auto interpret uw'\': uw\ V H \ \ src trg \k\<^sup>* \ h\ tab \p\<^sub>0\ \p\<^sub>1\ u w' \' using w' \' left_adjoint_is_ide by unfold_locales auto interpret uw\w'\': uw\w'\' V H \ \ src trg \k\<^sup>* \ h\ tab \p\<^sub>0\ \p\<^sub>1\ u w \ w' \' using w w' \ \' left_adjoint_is_ide by unfold_locales have "(h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w] = (h \ \') \ \[h, p\<^sub>0, w'] \ (\ \ w') \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w'] \ (k \ ?\)" proof - let ?LHS = "(h \ \) \ \[h, p\<^sub>0, w] \ (\ \ w) \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w]" let ?RHS = "(h \ \') \ \[h, p\<^sub>0, w'] \ (\ \ w') \ \\<^sup>-\<^sup>1[k, p\<^sub>1, w'] \ (k \ ?\)" have "\?LHS : k \ p\<^sub>1 \ w \ h \ u\" using w k.antipar by fastforce moreover have "\?RHS : k \ p\<^sub>1 \ w \ h \ u\" using w k.antipar \ by fastforce moreover have "is_left_adjoint (k \ p\<^sub>1 \ w)" using w k.is_map left_adjoints_compose by simp moreover have "is_left_adjoint (h \ u)" using assms h.is_map left_adjoints_compose by auto ultimately show "?LHS = ?RHS" using BS3 by blast qed hence "\!\. \\ : w \ w'\ \ \ = \' \ (p\<^sub>0 \ \) \ p\<^sub>1 \ \ = ?\" using assms left_adjoint_is_ide w w' \ \' \ \' \ \_biuniversal_prop(2) [of u v w w' \ \' ?\] by presburger thus "w \ w'" using w w' BS3 isomorphic_def by metis qed qed end subsubsection "Tabulations in Maps" text \ Here we focus our attention on the properties of tabulations in a bicategory of spans, in the special case in which both legs are maps. \ context tabulation_in_maps begin text \ The following are the conditions under which \w\ is a 1-cell induced via \T1\ by a 2-cell \\\ : dom \ \ s \ r\<^sub>0\\: \w\ is an arrow of spans and \\\ is obtained by composing the tabulation \\\ with \w\ and the isomorphisms that witness \w\ being an arrow of spans. \ abbreviation is_induced_by_cell where "is_induced_by_cell w r\<^sub>0 \ \ arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 (dom \) s\<^sub>0 s\<^sub>1 w \ composite_cell w (arrow_of_spans_of_maps.the_\ V H r\<^sub>0 s\<^sub>0 w) \ (arrow_of_spans_of_maps.the_\ V H (dom \) s\<^sub>1 w) = \" lemma induced_map_unique: assumes "is_induced_by_cell w r\<^sub>0 \" and "is_induced_by_cell w' r\<^sub>0 \" shows "isomorphic w w'" proof - interpret w: arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 \dom \\ s\<^sub>0 s\<^sub>1 w using assms(1) by auto interpret w: arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 \dom \\ s \ s\<^sub>0 s\<^sub>1 w .. interpret w': arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 \dom \\ s\<^sub>0 s\<^sub>1 w' using assms(2) by auto interpret w': arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 \dom \\ s \ s\<^sub>0 s\<^sub>1 w' .. let ?\ = "w'.the_\ \ inv w.the_\" have \: "\?\ : s\<^sub>1 \ w \ s\<^sub>1 \ w'\" using w.the_\_props w'.the_\_props arr_iff_in_hom by auto have 1: "composite_cell w w.the_\ = composite_cell w' w'.the_\ \ (w'.the_\ \ inv w.the_\)" proof - have "composite_cell w' w'.the_\ \ (w'.the_\ \ inv w.the_\) = ((composite_cell w' w'.the_\) \ w'.the_\) \ inv w.the_\" using comp_assoc by presburger also have "... = \ \ inv w.the_\" using assms(2) comp_assoc by simp also have "... = (composite_cell w w.the_\ \ w.the_\) \ inv w.the_\" using assms(1) comp_assoc by simp also have "... = composite_cell w w.the_\ \ w.the_\ \ inv w.the_\" using comp_assoc by presburger also have "... = composite_cell w w.the_\" proof - have "w.the_\ \ inv w.the_\ = s\<^sub>1 \ w" using w.the_\_props comp_arr_inv inv_is_inverse by auto thus ?thesis using composite_cell_in_hom w.ide_w w.the_\_props comp_arr_dom by (metis composite_cell_in_hom in_homE w.w_in_hom(1)) qed finally show ?thesis by auto qed have "\\. \\ : w \ w'\" using 1 \ w.is_ide w'.is_ide w.the_\_props w'.the_\_props T2 [of w w' w.the_\ r\<^sub>0 w'.the_\ ?\] by blast thus ?thesis using BS3 w.is_map w'.is_map by blast qed text \ The object src \s\<^sub>0\ forming the apex of the tabulation satisfies the conditions for being a map induced via \T1\ by the 2-cell \\\ itself. This is ultimately required for the map from 2-cells to arrows of spans to be functorial with respect to vertical composition. \ lemma apex_is_induced_by_cell: shows "is_induced_by_cell (src s\<^sub>0) s\<^sub>0 \" proof - have 1: "arrow_of_spans_of_maps V H \ \ src trg s\<^sub>0 s\<^sub>1 s\<^sub>0 s\<^sub>1 (src s\<^sub>0)" using iso_runit [of s\<^sub>0] iso_runit [of s\<^sub>1] tab_in_hom apply unfold_locales apply simp using ide_leg0 isomorphic_def apply blast using ide_leg1 isomorphic_def leg1_simps(3) runit'_in_vhom [of s\<^sub>1 "src s\<^sub>0"] iso_runit' by blast interpret w: arrow_of_spans_of_maps V H \ \ src trg s\<^sub>0 \dom \\ s\<^sub>0 s\<^sub>1 \src s\<^sub>0\ using 1 tab_in_hom by simp interpret w: arrow_of_spans_of_maps_to_tabulation V H \ \ src trg s\<^sub>0 \dom \\ s \ s\<^sub>0 s\<^sub>1 \src s\<^sub>0\ .. show "is_induced_by_cell (src s\<^sub>0) s\<^sub>0 \" proof (intro conjI) show "arrow_of_spans_of_maps V H \ \ src trg s\<^sub>0 (dom \) s\<^sub>0 s\<^sub>1 (src s\<^sub>0)" using w.arrow_of_spans_of_maps_axioms by simp show "composite_cell (src s\<^sub>0) w.the_\ \ w.the_\ = \" proof - have \: "w.the_\ = \[s\<^sub>0]" using iso_runit [of s\<^sub>0] w.leg0_uniquely_isomorphic w.the_\_props the1_equality [of "\\. \\ : s\<^sub>0 \ src s\<^sub>0 \ s\<^sub>0\ \ iso \"] by auto have \: "w.the_\ = \\<^sup>-\<^sup>1[s\<^sub>1]" using iso_runit' w.leg1_uniquely_isomorphic w.the_\_props leg1_simps(3) the1_equality [of "\\. \\ : s\<^sub>1 \ s\<^sub>1 \ src s\<^sub>0\ \ iso \"] tab_in_vhom' by auto have "composite_cell (src s\<^sub>0) \[s\<^sub>0] \ \\<^sup>-\<^sup>1[s\<^sub>1] = \" proof - have "composite_cell (src s\<^sub>0) \[s\<^sub>0] \ \\<^sup>-\<^sup>1[s\<^sub>1] = ((s \ \[s\<^sub>0]) \ \[s, s\<^sub>0, src s\<^sub>0]) \ (\ \ src s\<^sub>0) \ \\<^sup>-\<^sup>1[s\<^sub>1]" using comp_assoc by presburger also have "... = (\[s \ s\<^sub>0] \ (\ \ src s\<^sub>0)) \ \\<^sup>-\<^sup>1[s\<^sub>1]" using runit_hcomp comp_assoc by simp also have "... = \ \ \[s\<^sub>1] \ \\<^sup>-\<^sup>1[s\<^sub>1]" using runit_naturality tab_in_hom by (metis tab_simps(1) tab_simps(2) tab_simps(4) tab_simps(5) comp_assoc) also have "... = \" using iso_runit tab_in_hom comp_arr_dom comp_arr_inv inv_is_inverse by simp finally show ?thesis by simp qed thus ?thesis using \ \ comp_assoc by simp qed qed qed end subsubsection "Composing Tabulations" text \ Given tabulations \(r\<^sub>0, \, r\<^sub>1)\ of \r\ and \(s\<^sub>0, \, s\<^sub>1)\ of \s\ in a bicategory of spans, where \(r\<^sub>0, r\<^sub>1)\ and \(s\<^sub>0, s\<^sub>1)\ are spans of maps and 1-cells \r\ and \s\ are composable, we can construct a 2-cell that yields a tabulation of \r \ s\. The proof uses the fact that the 2-cell \\\ associated with the cospan \(r\<^sub>0, s\<^sub>1)\ is an isomorphism, which we have proved above (\cospan_of_maps_in_bicategory_of_spans.\_uniqueness\) using \BS3\. However, this is the only use of \BS3\ in the proof, and it seems plausible that it would be possible to establish that \\\ is an isomorphism in more general situations in which the subbicategory of maps is not locally essentially discrete. Alternatively, more general situations could be treated by adding the assertion that \\\ is an isomorphism as part of a weakening of \BS3\. \ locale composite_tabulation_in_maps = bicategory_of_spans V H \ \ src trg + \: tabulation_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 + \: tabulation_in_maps V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and r :: 'a and \ :: 'a and r\<^sub>0 :: 'a and r\<^sub>1 :: 'a and s :: 'a and \ :: 'a and s\<^sub>0 :: 'a and s\<^sub>1 :: 'a + assumes composable: "src r = trg s" begin text \ Interpret \(r\<^sub>0, s\<^sub>1)\ as a @{locale cospan_of_maps_in_bicategory_of_spans}, to obtain the isomorphism \\\ in the central diamond, along with the assertion that it is unique. \ interpretation r\<^sub>0s\<^sub>1: cospan_of_maps_in_bicategory_of_spans V H \ \ src trg s\<^sub>1 r\<^sub>0 using \.leg0_is_map \.leg1_is_map composable by unfold_locales auto text \ We need access to simps, etc. in the preceding interpretation, yet trying to declare it as a sublocale introduces too many conflicts at the moment. As it confusing elsewhere to figure out exactly how, in other contexts, to express the particular interpretation that is needed, to make things easier we include the following lemma. Then we can just recall the lemma to find out how to express the interpretation required in a given context. \ lemma r\<^sub>0s\<^sub>1_is_cospan: shows "cospan_of_maps_in_bicategory_of_spans V H \ \ src trg s\<^sub>1 r\<^sub>0" .. text \ The following define the projections associated with the natural tabulation of \r\<^sub>0\<^sup>* \ s\<^sub>1\. \ abbreviation p\<^sub>0 where "p\<^sub>0 \ r\<^sub>0s\<^sub>1.p\<^sub>0" abbreviation p\<^sub>1 where "p\<^sub>1 \ r\<^sub>0s\<^sub>1.p\<^sub>1" text \ $$ \xymatrix{ && {\rm src}~\phi \ar[dl]_{p_1} \ar[dr]^{p_0} \ddtwocell\omit{^\phi} \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^\sigma}\\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } $$ \ text \ Next, we define the 2-cell that is the composite of the tabulation \\\, the tabulation \\\, and the central diamond that commutes up to unique isomorphism \\\. \ definition tab where "tab \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ (r \ \ \ p\<^sub>0) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, p\<^sub>1] \ (\ \ p\<^sub>1)" lemma tab_in_hom [intro]: shows "\tab : r\<^sub>1 \ p\<^sub>1 \ (r \ s) \ s\<^sub>0 \ p\<^sub>0\" using \.T0.antipar(1) r\<^sub>0s\<^sub>1.\_in_hom composable \.leg0_in_hom(1) \.leg1_in_hom(1) composable tab_def by auto interpretation tabulation_data V H \ \ src trg \r \ s\ tab \s\<^sub>0 \ p\<^sub>0\ \r\<^sub>1 \ p\<^sub>1\ using composable tab_in_hom by unfold_locales auto text \ In the subsequent proof we will use coherence to shortcut a few of the calculations. \ interpretation E: self_evaluation_map V H \ \ src trg .. notation E.eval ("\_\") text \ The following is applied twice in the proof of property \T2\ for the composite tabulation. It's too long to repeat. \ lemma technical: assumes "ide w" and "\\ : (s\<^sub>0 \ p\<^sub>0) \ w \ u\" and "w\<^sub>r = p\<^sub>1 \ w" and "\\<^sub>r = (s \ \) \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" shows "\.composite_cell w\<^sub>r \\<^sub>r = \[r, s, u] \ composite_cell w \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" text \ $$ \xymatrix{ && X \ar[d]^{w} \ar@/ur20pt/[dddrr]^{u} \xtwocell[ddr]{}\omit{^{\theta}} \\ && {\rm src}~\phi \ar[dl]_{p_1} \ar[dr]^{p_0} \ddtwocell\omit{^\phi} \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^\sigma}\\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } $$ \ proof - interpret uw\: uw\ V H \ \ src trg \r \ s\ tab \s\<^sub>0 \ p\<^sub>0\ \r\<^sub>1 \ p\<^sub>1\ u w \ using assms(1-2) composable by unfold_locales auto show ?thesis proof - have "\[r, s, u] \ composite_cell w \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] = (\[r, s, u] \ ((r \ s) \ \)) \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (tab \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using comp_assoc by presburger also have "... = (r \ s \ \) \ \[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (tab \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using assoc_naturality [of r s \] composable comp_assoc by simp also have "... = (r \ s \ \) \ \[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ ((\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0])) \ (r \ \ \ p\<^sub>0) \ \.composite_cell p\<^sub>1 r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" unfolding tab_def using comp_assoc by presburger also have "... = (r \ s \ \) \ ((\[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ w))) \ ((r \ \ \ p\<^sub>0) \ \.composite_cell p\<^sub>1 r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using composable \.T0.antipar(1) comp_assoc whisker_right by auto also have "... = (r \ s \ \) \ ((\[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ w))) \ ((r \ \ \ p\<^sub>0) \ w) \ ((r \ r\<^sub>0s\<^sub>1.\) \ w) \ (\[r, r\<^sub>0, p\<^sub>1] \ w) \ ((\ \ p\<^sub>1) \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using composable \.T0.antipar(1) whisker_right tab_def tab_in_hom(2) composable comp_assoc by force also have "... = (r \ s \ \) \ ((\[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ w))) \ ((r \ \ \ p\<^sub>0) \ w) \ ((r \ r\<^sub>0s\<^sub>1.\) \ w) \ ((\[r, r\<^sub>0, p\<^sub>1] \ w) \ \\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w]) \ (\ \ p\<^sub>1 \ w)" using assoc'_naturality [of \ p\<^sub>1 w] \.T0.antipar(1) r\<^sub>0s\<^sub>1.base_simps(2) comp_assoc by auto also have "... = (r \ s \ \) \ ((\[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ w))) \ ((r \ \ \ p\<^sub>0) \ w) \ (((r \ r\<^sub>0s\<^sub>1.\) \ w) \ \\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w]) \ \.composite_cell (p\<^sub>1 \ w) \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" proof - have "(\[r, r\<^sub>0, p\<^sub>1] \ w) \ \\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w] = \\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w] \ (r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w]" proof - have "(\\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1] \ w) \ \\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w] \ (r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) = \\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w] \ \\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1 \ w]" using pentagon' \.T0.antipar(1) comp_assoc by simp moreover have 1: "seq (\\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1] \ w)(\\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w] \ (r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]))" using \.T0.antipar(1) by (intro seqI hseqI, auto) ultimately have "\\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w] = ((\\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1] \ w) \ \\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w] \ (r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w])) \ \[r, r\<^sub>0, p\<^sub>1 \ w]" using \.T0.antipar(1) iso_assoc invert_side_of_triangle(2) [of "(\\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1] \ w) \ \\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w] \ (r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w])" "\\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w]" "\\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1 \ w]"] by fastforce hence "\\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w] = (\\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1] \ w) \ \\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w] \ (r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w]" using comp_assoc by presburger moreover have "seq (inv (\\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1] \ w)) \\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w]" using \.T0.antipar(1) 1 by fastforce ultimately show ?thesis using \.T0.antipar(1) iso_assoc invert_side_of_triangle(1) [of "\\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w]" "\\<^sup>-\<^sup>1[r, r\<^sub>0, p\<^sub>1] \ w" "\\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w] \ (r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w]"] by fastforce qed thus ?thesis using comp_assoc by presburger qed also have "... = (r \ s \ \) \ ((\[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ w))) \ (((r \ \ \ p\<^sub>0) \ w) \ \\<^sup>-\<^sup>1[r, s\<^sub>1 \ p\<^sub>0, w]) \ (r \ r\<^sub>0s\<^sub>1.\ \ w) \ \.composite_cell (p\<^sub>1 \ w) \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" proof - have "((r \ r\<^sub>0s\<^sub>1.\) \ w) \ \\<^sup>-\<^sup>1[r, r\<^sub>0 \ p\<^sub>1, w] = \\<^sup>-\<^sup>1[r, s\<^sub>1 \ p\<^sub>0, w] \ (r \ r\<^sub>0s\<^sub>1.\ \ w)" using assoc'_naturality [of r r\<^sub>0s\<^sub>1.\ w] r\<^sub>0s\<^sub>1.cospan by auto thus ?thesis using comp_assoc by presburger qed also have "... = (r \ s \ \) \ (\[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ w) \ \\<^sup>-\<^sup>1[r, (s \ s\<^sub>0) \ p\<^sub>0, w]) \ (r \ (\ \ p\<^sub>0) \ w) \ (r \ r\<^sub>0s\<^sub>1.\ \ w) \ \.composite_cell (p\<^sub>1 \ w) \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" proof - have "((r \ \ \ p\<^sub>0) \ w) \ \\<^sup>-\<^sup>1[r, s\<^sub>1 \ p\<^sub>0, w] = \\<^sup>-\<^sup>1[r, (s \ s\<^sub>0) \ p\<^sub>0, w] \ (r \ (\ \ p\<^sub>0) \ w)" using assoc'_naturality [of r "\ \ p\<^sub>0" w] by (simp add: composable) thus ?thesis using comp_assoc by presburger qed also have "... = (r \ s \ \) \ (r \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ ((r \ (\ \ p\<^sub>0) \ w) \ (r \ r\<^sub>0s\<^sub>1.\ \ w) \ (r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w])) \ \[r, r\<^sub>0, p\<^sub>1 \ w] \ (\ \ p\<^sub>1 \ w)" proof - have "\[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ w) \ \\<^sup>-\<^sup>1[r, (s \ s\<^sub>0) \ p\<^sub>0, w] = r \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ \[s \ s\<^sub>0, p\<^sub>0, w]" proof - have "\[r, s, (s\<^sub>0 \ p\<^sub>0) \ w] \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0] \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ w) \ \\<^sup>-\<^sup>1[r, (s \ s\<^sub>0) \ p\<^sub>0, w] = \\<^bold>\\<^bold>[\<^bold>\r\<^bold>\, \<^bold>\s\<^bold>\, (\<^bold>\s\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\w\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^bold>[\<^bold>\r\<^bold>\ \<^bold>\ \<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\r\<^bold>\, \<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\r\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\w\<^bold>\) \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\r\<^bold>\, (\<^bold>\s\<^bold>\ \<^bold>\ \<^bold>\s\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]\" using \_def \'_def composable by simp also have "... = \\<^bold>\r\<^bold>\ \<^bold>\ (\<^bold>\s\<^bold>\ \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\s\<^sub>0\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\w\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^bold>[\<^bold>\s\<^bold>\ \<^bold>\ \<^bold>\s\<^sub>0\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]\" using composable by (intro E.eval_eqI, simp_all) also have "... = r \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ \[s \ s\<^sub>0, p\<^sub>0, w]" using \_def \'_def composable by simp finally show ?thesis by simp qed thus ?thesis using comp_assoc by presburger qed also have "... = (r \ s \ \) \ (r \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ \.composite_cell (p\<^sub>1 \ w) (((\ \ p\<^sub>0) \ w) \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w])" using assms(3) arrI \.T0.antipar(1) whisker_left by auto also have "... = (r \ (s \ \) \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\[s \ s\<^sub>0, p\<^sub>0, w] \ ((\ \ p\<^sub>0) \ w)) \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w] \ (\ \ p\<^sub>1 \ w)" using \.T0.antipar(1) comp_assoc whisker_left by auto also have "... = (r \ (s \ \) \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w] \ (\ \ p\<^sub>1 \ w)" using assoc_naturality [of \ p\<^sub>0 w] comp_assoc by simp finally show ?thesis using assms(3-4) by simp qed qed lemma composite_is_tabulation: shows "tabulation V H \ \ src trg (r \ s) tab (s\<^sub>0 \ p\<^sub>0) (r\<^sub>1 \ p\<^sub>1)" proof show "\u \. \ ide u; \\ : dom \ \ (r \ s) \ u\ \ \ \w \ \. ide w \ \\ : (s\<^sub>0 \ p\<^sub>0) \ w \ u\ \ \\ : dom \ \ (r\<^sub>1 \ p\<^sub>1) \ w\ \ iso \ \ composite_cell w \ \ \ = \" proof - fix u \ assume u: "ide u" assume \: "\\ : dom \ \ (r \ s) \ u\" let ?v = "dom \" have 1: "\\[r, s, u] \ \ : ?v \ r \ s \ u\" proof - (* * TODO: I think this highlights the current issue with assoc_in_hom: * it can't be applied automatically here because there isn't any way to * obtain the equations src r = trg s and src s = trg u from assumption \. * Maybe this can be improved with a little bit of thought, but not while * a lot of other stuff is being changed, too. *) have "src r = trg s \ src s = trg u" by (metis \ arr_cod hseq_char in_homE hcomp_simps(1)) thus ?thesis using u \ by fastforce qed obtain w\<^sub>r \\<^sub>r \\<^sub>r where w\<^sub>r\\<^sub>r\\<^sub>r: "ide w\<^sub>r \ \\\<^sub>r : r\<^sub>0 \ w\<^sub>r \ s \ u\ \ \\\<^sub>r : ?v \ r\<^sub>1 \ w\<^sub>r\ \ iso \\<^sub>r \ \.composite_cell w\<^sub>r \\<^sub>r \ \\<^sub>r = \[r, s, u] \ \" using u \ \.T1 [of "s \ u" "\[r, s, u] \ \"] by (metis 1 \.ide_base \.ide_base arr_cod composable ide_hcomp in_homE match_1 not_arr_null seq_if_composable) text \ $$ \xymatrix{ && X \ar@ {.>}[ddl]^{w_r} \ar@/ul20pt/[dddll]_{v} \xtwocell[dddll]{}\omit{^{<1.5>\nu_r}} \ar@/ur20pt/[dddrr]^{u} \xtwocell[dddr]{}\omit{^{\theta_r}} \\ && \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && \\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } $$ \ text \We need some simps, etc., otherwise the subsequent diagram chase is very painful.\ have w\<^sub>r: "ide w\<^sub>r" using w\<^sub>r\\<^sub>r\\<^sub>r by simp have [simp]: "src w\<^sub>r = src u" using w\<^sub>r\\<^sub>r\\<^sub>r \ 1 comp_arr_dom in_homE seqE hcomp_simps(1) vseq_implies_hpar(1) by (metis src_hcomp) have [simp]: "trg w\<^sub>r = src \" using w\<^sub>r\\<^sub>r\\<^sub>r by (metis 1 arrI not_arr_null seqE seq_if_composable) have \\<^sub>r_in_hom [intro]: "\\\<^sub>r : r\<^sub>0 \ w\<^sub>r \ s \ u\" using w\<^sub>r\\<^sub>r\\<^sub>r by simp have \\<^sub>r_in_hhom [intro]: "\\\<^sub>r : src u \ trg s\" using \\<^sub>r_in_hom src_cod [of \\<^sub>r] trg_cod [of \\<^sub>r] by (metis \src w\<^sub>r = src u\ \.leg1_simps(4) arr_dom in_hhomI in_homE r\<^sub>0s\<^sub>1.cospan src_hcomp trg_hcomp vconn_implies_hpar(1) vconn_implies_hpar(2)) have [simp]: "src \\<^sub>r = src u" using \\<^sub>r_in_hhom by auto have [simp]: "trg \\<^sub>r = trg s" using \\<^sub>r_in_hhom by auto have [simp]: "dom \\<^sub>r = r\<^sub>0 \ w\<^sub>r" using \\<^sub>r_in_hom by blast have [simp]: "cod \\<^sub>r = s \ u" using \\<^sub>r_in_hom by blast have \\<^sub>r_in_hom [intro]: "\\\<^sub>r : ?v \ r\<^sub>1 \ w\<^sub>r\" using w\<^sub>r\\<^sub>r\\<^sub>r by simp have \\<^sub>r_in_hhom [intro]: "\\\<^sub>r : src u \ trg r\" using \\<^sub>r_in_hom src_dom [of \\<^sub>r] trg_dom [of \\<^sub>r] by (metis \src w\<^sub>r = src u\ \.leg1_simps(4) arr_cod in_hhomI in_homE src_hcomp trg_hcomp vconn_implies_hpar(3) vconn_implies_hpar(4)) have [simp]: "src \\<^sub>r = src u" using \\<^sub>r_in_hhom by auto have [simp]: "trg \\<^sub>r = trg r" using \\<^sub>r_in_hhom by auto have [simp]: "dom \\<^sub>r = ?v" using \\<^sub>r_in_hom by auto have [simp]: "cod \\<^sub>r = r\<^sub>1 \ w\<^sub>r" using \\<^sub>r_in_hom by auto have iso_\\<^sub>r: "iso \\<^sub>r" using w\<^sub>r\\<^sub>r\\<^sub>r by simp obtain w\<^sub>s \\<^sub>s \\<^sub>s where w\<^sub>s\\<^sub>s\\<^sub>s: "ide w\<^sub>s \ \\\<^sub>s : s\<^sub>0 \ w\<^sub>s \ u\ \ \\\<^sub>s : r\<^sub>0 \ w\<^sub>r \ s\<^sub>1 \ w\<^sub>s\ \ iso \\<^sub>s \ \.composite_cell w\<^sub>s \\<^sub>s \ \\<^sub>s = \\<^sub>r" using u w\<^sub>r\\<^sub>r\\<^sub>r \.T1 [of u \\<^sub>r] by auto text \ $$ \xymatrix{ && X \ar[ddl]^{w_r} \ar@/ul20pt/[dddll]_{v} \xtwocell[dddll]{}\omit{^{<1.5>\nu_r}} \ar@/ur20pt/[dddrr]^{u} \ar@ {.>}[ddr]_{w_s} \xtwocell[dddrr]{}\omit{^{<-1.5>\theta_s}} \xtwocell[ddd]{}\omit{^{<1>\nu_s}} \\ && \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^\sigma}\\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } $$ \ have w\<^sub>s: "ide w\<^sub>s" using w\<^sub>s\\<^sub>s\\<^sub>s by simp have [simp]: "src w\<^sub>s = src u" using w\<^sub>s\\<^sub>s\\<^sub>s src_cod by (metis \.leg0_simps(2) \.tab_simps(2) \\<^sub>r_in_hom arrI hseqI' ideD(1) seqE seq_if_composable src_hcomp vconn_implies_hpar(3)) have [simp]: "trg w\<^sub>s = src \" using w\<^sub>s\\<^sub>s\\<^sub>s by (metis \.tab_simps(2) arr_dom in_homE not_arr_null seq_if_composable) have \\<^sub>s_in_hom [intro]: "\\\<^sub>s : s\<^sub>0 \ w\<^sub>s \ u\" using w\<^sub>s\\<^sub>s\\<^sub>s by simp have \\<^sub>s_in_hhom [intro]: "\\\<^sub>s : src u \ src s\" using \\<^sub>s_in_hom src_cod trg_cod by (metis \\<^sub>r_in_hom arrI hseqE in_hhom_def seqE vconn_implies_hpar(1) vconn_implies_hpar(3) w\<^sub>s\\<^sub>s\\<^sub>s) have [simp]: "src \\<^sub>s = src u" using \\<^sub>s_in_hhom by auto have [simp]: "trg \\<^sub>s = src s" using \\<^sub>s_in_hhom by auto have [simp]: "dom \\<^sub>s = s\<^sub>0 \ w\<^sub>s" using \\<^sub>s_in_hom by blast have [simp]: "cod \\<^sub>s = u" using \\<^sub>s_in_hom by blast have \\<^sub>s_in_hom [intro]: "\\\<^sub>s : r\<^sub>0 \ w\<^sub>r \ s\<^sub>1 \ w\<^sub>s\" using w\<^sub>s\\<^sub>s\\<^sub>s by simp have \\<^sub>s_in_hhom [intro]: "\\\<^sub>s : src u \ trg s\" using \\<^sub>s_in_hom src_dom trg_cod by (metis \src \\<^sub>r = src u\ \trg \\<^sub>r = trg s\ \\<^sub>r_in_hom in_hhomI in_homE src_dom trg_dom) have [simp]: "src \\<^sub>s = src u" using \\<^sub>s_in_hhom by auto have [simp]: "trg \\<^sub>s = trg s" using \\<^sub>s_in_hhom by auto have [simp]: "dom \\<^sub>s = r\<^sub>0 \ w\<^sub>r" using \\<^sub>s_in_hom by auto have [simp]: "cod \\<^sub>s = s\<^sub>1 \ w\<^sub>s" using \\<^sub>s_in_hom by auto have iso_\\<^sub>s: "iso \\<^sub>s" using w\<^sub>s\\<^sub>s\\<^sub>s by simp obtain w \\<^sub>t \\<^sub>t where w\\<^sub>t\\<^sub>t: "ide w \ \\\<^sub>t : p\<^sub>0 \ w \ w\<^sub>s\ \ \\\<^sub>t : w\<^sub>r \ p\<^sub>1 \ w\ \ iso \\<^sub>t \ (s\<^sub>1 \ \\<^sub>t) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t) = \\<^sub>s" using w\<^sub>r\\<^sub>r\\<^sub>r w\<^sub>s\\<^sub>s\\<^sub>s iso_\\<^sub>s r\<^sub>0s\<^sub>1.\_biuniversal_prop(1) [of w\<^sub>s w\<^sub>r \\<^sub>s] by blast text \ $$ \xymatrix{ && X \ar[ddl]_{w_r} \ar@/ul20pt/[dddll]_{v} \xtwocell[dddll]{}\omit{^{<1.5>\nu_r}} \ar@/ur20pt/[dddrr]^{u} \ar[ddr]^{w_s} \xtwocell[dddrr]{}\omit{^{<-1.5>\theta_s}} \ar@ {.>}[d]^{w} \xtwocell[ddl]{}\omit{^<-2>{\nu_t}} \xtwocell[ddr]{}\omit{^<2>{\theta_t}} \\ && {\rm src}~\phi \ar[dl]_{p_1} \ar[dr]^{p_0} \ddtwocell\omit{^\phi} \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^\sigma}\\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } $$ \ text \{\bf Note:} \w\ is not necessarily a map.\ have w: "ide w" using w\\<^sub>t\\<^sub>t by simp have [simp]: "src w = src u" using w\\<^sub>t\\<^sub>t src_cod by (metis \\<^sub>s_in_hom \src \\<^sub>s = src u\ arrI seqE src_hcomp src_vcomp vseq_implies_hpar(1)) have [simp]: "trg w = src p\<^sub>0" using w\\<^sub>t\\<^sub>t by (metis \\<^sub>s_in_hom arrI not_arr_null r\<^sub>0s\<^sub>1.\_simps(2) seqE seq_if_composable) have \\<^sub>t_in_hom [intro]: "\\\<^sub>t : p\<^sub>0 \ w \ w\<^sub>s\" using w\\<^sub>t\\<^sub>t by simp have \\<^sub>t_in_hhom [intro]: "\\\<^sub>t : src u \ src \\" using \\<^sub>t_in_hom src_cod trg_cod \src w\<^sub>s = src u\ \trg w\<^sub>s = src \\ by fastforce have [simp]: "src \\<^sub>t = src u" using \\<^sub>t_in_hhom by auto have [simp]: "trg \\<^sub>t = src \" using \\<^sub>t_in_hhom by auto have [simp]: "dom \\<^sub>t = p\<^sub>0 \ w" using \\<^sub>t_in_hom by blast have (* [simp]: *) "cod \\<^sub>t = w\<^sub>s" using \\<^sub>t_in_hom by blast have \\<^sub>t_in_hom [intro]: "\\\<^sub>t : w\<^sub>r \ p\<^sub>1 \ w\" using w\\<^sub>t\\<^sub>t by simp have \\<^sub>t_in_hhom [intro]: "\\\<^sub>t : src u \ src \\" using \\<^sub>t_in_hom src_dom trg_dom \src w\<^sub>r = src u\ \trg w\<^sub>r = src \\ by fastforce have [simp]: "src \\<^sub>t = src u" using \\<^sub>t_in_hhom by auto have [simp]: "trg \\<^sub>t = src \" using \\<^sub>t_in_hhom by auto have (* [simp]: *) "dom \\<^sub>t = w\<^sub>r" using \\<^sub>t_in_hom by auto have [simp]: "cod \\<^sub>t = p\<^sub>1 \ w" using \\<^sub>t_in_hom by auto have iso_\\<^sub>t: "iso \\<^sub>t" using w\\<^sub>t\\<^sub>t by simp define \ where "\ = \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t) \ \[s\<^sub>0, p\<^sub>0, w]" have \: "\\ : (s\<^sub>0 \ p\<^sub>0) \ w \ u\" proof (unfold \_def, intro comp_in_homI) show "\\[s\<^sub>0, p\<^sub>0, w] : (s\<^sub>0 \ p\<^sub>0) \ w \ s\<^sub>0 \ p\<^sub>0 \ w\" using w\\<^sub>t\\<^sub>t by auto show "\s\<^sub>0 \ \\<^sub>t : s\<^sub>0 \ p\<^sub>0 \ w \ s\<^sub>0 \ w\<^sub>s\" using w\\<^sub>t\\<^sub>t by auto show "\\\<^sub>s : s\<^sub>0 \ w\<^sub>s \ u\" using w\<^sub>s\\<^sub>s\\<^sub>s by simp qed define \ where "\ = \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" have \: "\\ : ?v \ (r\<^sub>1 \ p\<^sub>1) \ w\" proof (unfold \_def, intro comp_in_homI) show "\\\<^sub>r : ?v \ r\<^sub>1 \ w\<^sub>r\" using w\<^sub>r\\<^sub>r\\<^sub>r by blast show "\r\<^sub>1 \ \\<^sub>t : r\<^sub>1 \ w\<^sub>r \ r\<^sub>1 \ p\<^sub>1 \ w\" using w\\<^sub>t\\<^sub>t by (intro hcomp_in_vhom, auto) show "\\\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] : r\<^sub>1 \ p\<^sub>1 \ w \ (r\<^sub>1 \ p\<^sub>1) \ w\" using w\\<^sub>t\\<^sub>t assoc_in_hom by (simp add: \.T0.antipar(1)) qed have iso_\: "iso \" using \ w\\<^sub>t\\<^sub>t w\<^sub>r\\<^sub>r\\<^sub>r \.T0.antipar(1) by (unfold \_def, intro isos_compose) auto have *: "arr ((s \ \\<^sub>s) \ \[s, s\<^sub>0, w\<^sub>s] \ (\ \ w\<^sub>s) \ (s\<^sub>1 \ \\<^sub>t) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t))" using w\<^sub>s\\<^sub>s\\<^sub>s w\\<^sub>t\\<^sub>t \\<^sub>r_in_hom comp_assoc by auto have "((r \ s) \ \) \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (tab \ w) \ \ = \" proof - have "seq (r \ \\<^sub>r) (\[r, r\<^sub>0, w\<^sub>r] \ (\ \ w\<^sub>r) \ \\<^sub>r)" using w\<^sub>r\\<^sub>r\\<^sub>r \.base_simps(2) composable by fastforce hence "\ = \\<^sup>-\<^sup>1[r, s, u] \ \.composite_cell w\<^sub>r \\<^sub>r \ \\<^sub>r" using w\<^sub>r\\<^sub>r\\<^sub>r invert_side_of_triangle(1) iso_assoc by (metis 1 \.ide_base \.ide_base arrI assoc'_eq_inv_assoc composable hseq_char' seqE seq_if_composable u vconn_implies_hpar(2) vconn_implies_hpar(4) w\<^sub>s\\<^sub>s\\<^sub>s) also have "... = \\<^sup>-\<^sup>1[r, s, u] \ \.composite_cell w\<^sub>r (\.composite_cell w\<^sub>s \\<^sub>s \ \\<^sub>s) \ \\<^sub>r" using w\<^sub>s\\<^sub>s\\<^sub>s by simp also have "... = \\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ \[s, s\<^sub>0, w\<^sub>s] \ (\ \ w\<^sub>s) \ (s\<^sub>1 \ \\<^sub>t) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t)) \ \[r, r\<^sub>0, w\<^sub>r] \ (\ \ w\<^sub>r) \ \\<^sub>r" using w\\<^sub>t\\<^sub>t comp_assoc by simp text \Rearrange to create \\\ and \\\, leaving \tab\ in the middle.\ also have "... = \\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ \[s, s\<^sub>0, w\<^sub>s] \ ((\ \ w\<^sub>s) \ (s\<^sub>1 \ \\<^sub>t)) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t)) \ \[r, r\<^sub>0, w\<^sub>r] \ (\ \ w\<^sub>r) \ \\<^sub>r" using comp_assoc by presburger also have "... = \\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ (\[s, s\<^sub>0, w\<^sub>s] \ ((s \ s\<^sub>0) \ \\<^sub>t)) \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t)) \ \[r, r\<^sub>0, w\<^sub>r] \ (\ \ w\<^sub>r) \ \\<^sub>r" proof - have "(\ \ w\<^sub>s) \ (s\<^sub>1 \ \\<^sub>t) = \ \ \\<^sub>t" using comp_arr_dom comp_cod_arr interchange by (metis \cod \\<^sub>t = w\<^sub>s\ \.tab_simps(1) \.tab_simps(4) arrI w\\<^sub>t\\<^sub>t) also have "... = ((s \ s\<^sub>0) \ \\<^sub>t) \ (\ \ p\<^sub>0 \ w)" using comp_arr_dom comp_cod_arr interchange w\<^sub>s\\<^sub>s\\<^sub>s w\\<^sub>t\\<^sub>t \.tab_in_hom by (metis \dom \\<^sub>t = p\<^sub>0 \ w\ \.tab_simps(5) arrI) finally have "(\ \ w\<^sub>s) \ (s\<^sub>1 \ \\<^sub>t) = ((s \ s\<^sub>0) \ \\<^sub>t) \ (\ \ p\<^sub>0 \ w)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t)) \ \[r, r\<^sub>0, w\<^sub>r] \ (\ \ w\<^sub>r) \ \\<^sub>r" using assoc_naturality [of s s\<^sub>0 \\<^sub>t] w\\<^sub>t\\<^sub>t comp_assoc \cod \\<^sub>t = w\<^sub>s\ arrI by force also have "... = \\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t)) \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t)) \ \[r, r\<^sub>0, w\<^sub>r] \ (\ \ w\<^sub>r) \ \\<^sub>r" proof - have "r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t) = (r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t)) \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t))" proof - have "seq ((s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t)) (\[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t))" proof - have "seq (s \ \\<^sub>s) ((s \ s\<^sub>0 \ \\<^sub>t) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t))" using \\\[r, s, u] \ \ : dom \ \ r \ s \ u\\ calculation by blast thus ?thesis using comp_assoc by presburger qed thus ?thesis using whisker_left [of r "(s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t)" "\[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ (r\<^sub>0 \ \\<^sub>t)"] w\<^sub>s\\<^sub>s\\<^sub>s w\\<^sub>t\\<^sub>t comp_assoc by simp qed thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t)) \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ ((r \ r\<^sub>0 \ \\<^sub>t) \ \[r, r\<^sub>0, w\<^sub>r]) \ (\ \ w\<^sub>r) \ \\<^sub>r" proof - have "seq (\[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) (r\<^sub>0 \ \\<^sub>t)" using 1 r\<^sub>0s\<^sub>1.p\<^sub>1_simps w\\<^sub>t\\<^sub>t apply (intro seqI' comp_in_homI) by auto hence "r \ (\[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ (r\<^sub>0 \ \\<^sub>t) = (r \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ (r \ r\<^sub>0 \ \\<^sub>t)" using whisker_left by simp thus ?thesis using comp_assoc by simp qed also have "... = \\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t)) \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w] \ (((r \ r\<^sub>0) \ \\<^sub>t) \ (\ \ w\<^sub>r)) \ \\<^sub>r" proof - have "(r \ r\<^sub>0 \ \\<^sub>t) \ \[r, r\<^sub>0, w\<^sub>r] = \[r, r\<^sub>0, p\<^sub>1 \ w] \ ((r \ r\<^sub>0) \ \\<^sub>t)" using assoc_naturality [of r r\<^sub>0 \\<^sub>t] \\<^sub>t_in_hom by auto thus ?thesis using comp_assoc by presburger qed also have "... = (\\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t))) \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w] \ (\ \ p\<^sub>1 \ w) \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" proof - have "((r \ r\<^sub>0) \ \\<^sub>t) \ (\ \ w\<^sub>r) = \ \ \\<^sub>t" using comp_arr_dom comp_cod_arr interchange by (metis \dom \\<^sub>t = w\<^sub>r\ \.tab_simps(1) \.tab_simps(5) arrI w\\<^sub>t\\<^sub>t) also have "... = (\ \ p\<^sub>1 \ w) \ (r\<^sub>1 \ \\<^sub>t)" using comp_arr_dom comp_cod_arr interchange by (metis \cod \\<^sub>t = p\<^sub>1 \ w\ \trg \\<^sub>t = src \\ \.T0.antipar(1) \.tab_simps(1) \.tab_simps(2) \.tab_simps(4) r\<^sub>0s\<^sub>1.base_simps(2) trg.preserves_reflects_arr trg_hcomp) finally have "((r \ r\<^sub>0) \ \\<^sub>t) \ (\ \ w\<^sub>r) = (\ \ p\<^sub>1 \ w) \ (r\<^sub>1 \ \\<^sub>t)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ ((\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w]) \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w] \ (\ \ p\<^sub>1 \ w) \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" proof - have "\\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t)) = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w]" proof - have "seq (s \ \\<^sub>s) (s \ s\<^sub>0 \ \\<^sub>t)" using \\<^sub>s_in_hom \\<^sub>s_in_hhom \\<^sub>t_in_hom \\<^sub>t_in_hhom 1 calculation by blast moreover have "src r = trg (s \ \\<^sub>s)" using composable hseqI by force ultimately have "\\<^sup>-\<^sup>1[r, s, u] \ (r \ (s \ \\<^sub>s) \ (s \ s\<^sub>0 \ \\<^sub>t)) = (\\<^sup>-\<^sup>1[r, s, u] \ (r \ s \ \\<^sub>s)) \ (r \ s \ s\<^sub>0 \ \\<^sub>t)" using whisker_left comp_assoc by simp also have "... = ((r \ s) \ \\<^sub>s) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ w\<^sub>s] \ (r \ s \ s\<^sub>0 \ \\<^sub>t)" using assoc_naturality comp_assoc by (metis \cod \\<^sub>s = u\ \dom \\<^sub>s = s\<^sub>0 \ w\<^sub>s\ \trg \\<^sub>s = src s\ \.base_simps(2-4) \.base_simps(2-4) arrI assoc'_naturality composable w\<^sub>s\\<^sub>s\\<^sub>s) also have "... = (((r \ s) \ \\<^sub>s) \ ((r \ s) \ s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w]" proof - have "\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ w\<^sub>s] \ (r \ s \ s\<^sub>0 \ \\<^sub>t) = ((r \ s) \ s\<^sub>0 \ \\<^sub>t) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w]" using arrI hseq_char assoc'_naturality [of r s "s\<^sub>0 \ \\<^sub>t"] \cod \\<^sub>t = w\<^sub>s\ composable by auto thus ?thesis using comp_assoc by auto qed also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w]" using \_def \ whisker_left by (metis (full_types) arrI cod_comp ide_base seqE seqI) finally show ?thesis by simp qed thus ?thesis using comp_assoc by presburger qed also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ ((r \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ \[s \ s\<^sub>0, p\<^sub>0, w] \ ((\ \ p\<^sub>0) \ w) \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w])) \ \[r, r\<^sub>0, p\<^sub>1 \ w] \ (\ \ p\<^sub>1 \ w) \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" proof - have "(\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] = \[s \ s\<^sub>0, p\<^sub>0, w] \ ((\ \ p\<^sub>0) \ w)" using assoc_naturality [of \ p\<^sub>0 w] by (simp add: w\\<^sub>t\\<^sub>t) thus ?thesis using comp_assoc by presburger qed also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (r \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ (r \ (\ \ p\<^sub>0) \ w) \ (r \ r\<^sub>0s\<^sub>1.\ \ w) \ ((r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w]) \ (\ \ p\<^sub>1 \ w) \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" using r\<^sub>0s\<^sub>1.p\<^sub>1_simps w\\<^sub>t\\<^sub>t whisker_left comp_assoc by force also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (r \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ (r \ (\ \ p\<^sub>0) \ w) \ (r \ r\<^sub>0s\<^sub>1.\ \ w) \ (\[r, r\<^sub>0 \ p\<^sub>1, w] \ (\[r, r\<^sub>0, p\<^sub>1] \ w) \ (\\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w]) \ (\ \ p\<^sub>1 \ w)) \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" proof - have "(r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w] = \[r, r\<^sub>0 \ p\<^sub>1, w] \ (\[r, r\<^sub>0, p\<^sub>1] \ w) \ \\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w]" proof - have 1: "(r \ \[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0 \ p\<^sub>1, w] \ (\[r, r\<^sub>0, p\<^sub>1] \ w) = \[r, r\<^sub>0, p\<^sub>1 \ w] \ \[r \ r\<^sub>0, p\<^sub>1, w]" using pentagon by (simp add: \.T0.antipar(1) w) moreover have 2: "seq \[r, r\<^sub>0, p\<^sub>1 \ w] \[r \ r\<^sub>0, p\<^sub>1, w]" using \.T0.antipar(1) w by simp moreover have "inv (r \ \[r\<^sub>0, p\<^sub>1, w]) = r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using \.T0.antipar(1) w by simp ultimately have "\[r, r\<^sub>0 \ p\<^sub>1, w] \ (\[r, r\<^sub>0, p\<^sub>1] \ w) = ((r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w]) \ \[r \ r\<^sub>0, p\<^sub>1, w]" using \.T0.antipar(1) w comp_assoc invert_side_of_triangle(1) [of "\[r, r\<^sub>0, p\<^sub>1 \ w] \ \[r \ r\<^sub>0, p\<^sub>1, w]" "r \ \[r\<^sub>0, p\<^sub>1, w]" "\[r, r\<^sub>0 \ p\<^sub>1, w] \ (\[r, r\<^sub>0, p\<^sub>1] \ w)"] by simp hence "(r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w] = (\[r, r\<^sub>0 \ p\<^sub>1, w] \ (\[r, r\<^sub>0, p\<^sub>1] \ w)) \ \\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w]" using \.T0.antipar(1) w invert_side_of_triangle(2) [of "\[r, r\<^sub>0 \ p\<^sub>1, w] \ (\[r, r\<^sub>0, p\<^sub>1] \ w)" "(r \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]) \ \[r, r\<^sub>0, p\<^sub>1 \ w]" "\[r \ r\<^sub>0, p\<^sub>1, w]"] using \trg w = src p\<^sub>0\ by simp thus ?thesis using comp_assoc by presburger qed thus ?thesis using comp_assoc by presburger qed also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (r \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ (r \ (\ \ p\<^sub>0) \ w) \ ((r \ r\<^sub>0s\<^sub>1.\ \ w) \ \[r, r\<^sub>0 \ p\<^sub>1, w]) \ (\[r, r\<^sub>0, p\<^sub>1] \ w) \ ((\ \ p\<^sub>1) \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" proof - have "\\<^sup>-\<^sup>1[r \ r\<^sub>0, p\<^sub>1, w] \ (\ \ p\<^sub>1 \ w) = ((\ \ p\<^sub>1) \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using assoc'_naturality [of \ p\<^sub>1 w] by (simp add: \.T0.antipar(1) w\\<^sub>t\\<^sub>t) thus ?thesis using comp_assoc by presburger qed also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (r \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ ((r \ (\ \ p\<^sub>0) \ w) \ \[r, s\<^sub>1 \ p\<^sub>0, w]) \ ((r \ r\<^sub>0s\<^sub>1.\) \ w) \ (\[r, r\<^sub>0, p\<^sub>1] \ w) \ ((\ \ p\<^sub>1) \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" proof - have "(r \ r\<^sub>0s\<^sub>1.\ \ w) \ \[r, r\<^sub>0 \ p\<^sub>1, w] = \[r, s\<^sub>1 \ p\<^sub>0, w] \ ((r \ r\<^sub>0s\<^sub>1.\) \ w)" using assoc_naturality [of r r\<^sub>0s\<^sub>1.\ w] r\<^sub>0s\<^sub>1.cospan w\\<^sub>t\\<^sub>t by auto thus ?thesis using comp_assoc by presburger qed also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (r \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ \[r, (s \ s\<^sub>0) \ p\<^sub>0, w] \ (((r \ \ \ p\<^sub>0) \ w) \ ((r \ r\<^sub>0s\<^sub>1.\) \ w) \ (\[r, r\<^sub>0, p\<^sub>1] \ w) \ ((\ \ p\<^sub>1) \ w)) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" proof - have "(r \ (\ \ p\<^sub>0) \ w) \ \[r, s\<^sub>1 \ p\<^sub>0, w] = \[r, (s \ s\<^sub>0) \ p\<^sub>0, w] \ ((r \ \ \ p\<^sub>0) \ w)" proof - have "arr w \ dom w = w \ cod w = w" using ide_char w by blast then show ?thesis using assoc_naturality [of r "\ \ p\<^sub>0" w] composable by auto qed thus ?thesis using comp_assoc by presburger qed also have "... = ((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (r \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ \[r, (s \ s\<^sub>0) \ p\<^sub>0, w] \ ((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ w) \ (\[r, s, s\<^sub>0 \ p\<^sub>0] \ w)) \ (tab \ w) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] \ (r\<^sub>1 \ \\<^sub>t) \ \\<^sub>r" proof - have "((r \ \ \ p\<^sub>0) \ w) \ ((r \ r\<^sub>0s\<^sub>1.\) \ w) \ (\[r, r\<^sub>0, p\<^sub>1] \ w) \ ((\ \ p\<^sub>1) \ w) = (r \ \ \ p\<^sub>0) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, p\<^sub>1] \ (\ \ p\<^sub>1) \ w" using w \.T0.antipar(1) composable whisker_right by auto also have "... = (((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ (\[r, s, s\<^sub>0 \ p\<^sub>0] \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0]) \ (r \ \[s, s\<^sub>0, p\<^sub>0])) \ (r \ \ \ p\<^sub>0)) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, p\<^sub>1] \ (\ \ p\<^sub>1) \ w" proof - have "((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ (\[r, s, s\<^sub>0 \ p\<^sub>0] \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0]) \ (r \ \[s, s\<^sub>0, p\<^sub>0])) \ (r \ \ \ p\<^sub>0) = r \ \ \ p\<^sub>0" proof - have "((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ (\[r, s, s\<^sub>0 \ p\<^sub>0] \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0]) \ (r \ \[s, s\<^sub>0, p\<^sub>0])) \ (r \ \ \ p\<^sub>0) = ((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ ((r \ s \ s\<^sub>0 \ p\<^sub>0) \ (r \ \[s, s\<^sub>0, p\<^sub>0]))) \ (r \ \ \ p\<^sub>0)" using comp_assoc_assoc' by (simp add: composable) also have "... = ((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ (r \ \[s, s\<^sub>0, p\<^sub>0])) \ (r \ \ \ p\<^sub>0)" using comp_cod_arr by (simp add: composable) also have "... = ((r \ (s \ s\<^sub>0) \ p\<^sub>0)) \ (r \ \ \ p\<^sub>0)" using whisker_left comp_assoc_assoc' assoc_in_hom hseqI' by (metis \.ide_base \.base_simps(2) \.ide_base \.ide_leg0 \.leg0_simps(2-3) \.leg1_simps(3) r\<^sub>0s\<^sub>1.ide_leg0 r\<^sub>0s\<^sub>1.leg0_simps(2) r\<^sub>0s\<^sub>1.p\<^sub>0_simps hcomp_simps(1)) also have "... = r \ \ \ p\<^sub>0" using comp_cod_arr by (simp add: composable) finally show ?thesis by blast qed thus ?thesis by simp qed also have "... = (r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ \[r, s, s\<^sub>0 \ p\<^sub>0] \ (\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0]) \ (r \ \[s, s\<^sub>0, p\<^sub>0]) \ (r \ \ \ p\<^sub>0) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, p\<^sub>1] \ (\ \ p\<^sub>1) \ w" using comp_assoc by presburger also have "... = (r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ \[r, s, s\<^sub>0 \ p\<^sub>0] \ tab \ w" using tab_def by simp also have "... = ((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ w) \ (\[r, s, s\<^sub>0 \ p\<^sub>0] \ w) \ (tab \ w)" using w \.T0.antipar(1) composable comp_assoc whisker_right by auto finally have "((r \ \ \ p\<^sub>0) \ w) \ ((r \ r\<^sub>0s\<^sub>1.\) \ w) \ (\[r, r\<^sub>0, p\<^sub>1] \ w) \ ((\ \ p\<^sub>1) \ w) = ((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ w) \ (\[r, s, s\<^sub>0 \ p\<^sub>0] \ w) \ (tab \ w)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ ((r \ s) \ \[s\<^sub>0, p\<^sub>0, w])) \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (tab \ w) \ \" proof - have "\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (r \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ \[r, (s \ s\<^sub>0) \ p\<^sub>0, w] \ ((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ w) \ (\[r, s, s\<^sub>0 \ p\<^sub>0] \ w) = ((r \ s) \ \[s\<^sub>0, p\<^sub>0, w]) \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w]" proof - have "\\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ p\<^sub>0 \ w] \ (r \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (r \ \[s \ s\<^sub>0, p\<^sub>0, w]) \ \[r, (s \ s\<^sub>0) \ p\<^sub>0, w] \ ((r \ \\<^sup>-\<^sup>1[s, s\<^sub>0, p\<^sub>0]) \ w) \ (\[r, s, s\<^sub>0 \ p\<^sub>0] \ w) = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\r\<^bold>\, \<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\w\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\r\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\w\<^bold>\\<^bold>]) \<^bold>\ (\<^bold>\r\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\s\<^bold>\ \<^bold>\ \<^bold>\s\<^sub>0\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\r\<^bold>\, (\<^bold>\s\<^bold>\ \<^bold>\ \<^bold>\s\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>] \<^bold>\ ((\<^bold>\r\<^bold>\ \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\w\<^bold>\) \<^bold>\ (\<^bold>\\<^bold>[\<^bold>\r\<^bold>\, \<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\w\<^bold>\)\" using w comp_assoc \'_def \_def composable by simp also have "... = \((\<^bold>\r\<^bold>\ \<^bold>\ \<^bold>\s\<^bold>\) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\s\<^sub>0\<^bold>\, \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\r\<^bold>\ \<^bold>\ \<^bold>\s\<^bold>\, \<^bold>\s\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\p\<^sub>0\<^bold>\, \<^bold>\w\<^bold>\\<^bold>]\" using w composable apply (intro E.eval_eqI) by simp_all also have "... = ((r \ s) \ \[s\<^sub>0, p\<^sub>0, w]) \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w]" using w comp_assoc \'_def \_def composable by simp finally show ?thesis by simp qed thus ?thesis using \_def comp_assoc by simp qed also have "... = ((r \ s) \ \) \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (tab \ w) \ \" proof - have "((r \ s) \ \\<^sub>s \ (s\<^sub>0 \ \\<^sub>t)) \ ((r \ s) \ \[s\<^sub>0, p\<^sub>0, w]) = (r \ s) \ \" using \_def w whisker_left composable by (metis \ arrI ide_base comp_assoc) thus ?thesis using comp_assoc by presburger qed finally show "((r \ s) \ \) \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w] \ (tab \ w) \ \ = \" by simp qed thus "\w \ \. ide w \ \\ : (s\<^sub>0 \ p\<^sub>0) \ w \ u\ \ \\ : dom \ \ (r\<^sub>1 \ p\<^sub>1) \ w\ \ iso \ \ composite_cell w \ \ \ = \" using w\\<^sub>t\\<^sub>t \ \ iso_\ comp_assoc by metis qed show "\u w w' \ \' \. \ ide w; ide w'; \\ : (s\<^sub>0 \ p\<^sub>0) \ w \ u\; \\' : (s\<^sub>0 \ p\<^sub>0) \ w' \ u\; \\ : (r\<^sub>1 \ p\<^sub>1) \ w \ (r\<^sub>1 \ p\<^sub>1) \ w'\; composite_cell w \ = composite_cell w' \' \ \ \ \ \!\. \\ : w \ w'\ \ \ = (r\<^sub>1 \ p\<^sub>1) \ \ \ \ = \' \ ((s\<^sub>0 \ p\<^sub>0) \ \)" proof - fix u w w' \ \' \ assume w: "ide w" assume w': "ide w'" assume \: "\\ : (s\<^sub>0 \ p\<^sub>0) \ w \ u\" assume \': "\\' : (s\<^sub>0 \ p\<^sub>0) \ w' \ u\" assume \: "\\ : (r\<^sub>1 \ p\<^sub>1) \ w \ (r\<^sub>1 \ p\<^sub>1) \ w'\" assume eq: "composite_cell w \ = composite_cell w' \' \ \" interpret uw\w'\'\: uw\w'\'\ V H \ \ src trg \r \ s\ tab \s\<^sub>0 \ p\<^sub>0\ \r\<^sub>1 \ p\<^sub>1\ u w \ w' \' \ using w w' \ \' \ eq composable tab_in_hom comp_assoc by unfold_locales auto text \ $$ \begin{array}{ll} \xymatrix{ && X \ar[d]_{w'} \xtwocell[ddl]{}\omit{^{\beta}} \ar@/ul20pt/[dddll]_<>(0.25){w}|<>(0.33)@ {>}_<>(0.5){p_1}|<>(0.67)@ {>}_<>(0.75){r_1} \ar@/ur20pt/[dddrr]^{u} \xtwocell[ddr]{}\omit{^{\theta'}}\\ && {\rm src}~\phi \ar[dl]^{p_1} \ar[dr]_{p_0} \ddtwocell\omit{^\phi} \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^\sigma}\\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } \\ \hspace{5cm} = \qquad \xy/50pt/ \xymatrix{ && X \ar[d]_{w} \ar@/ur20pt/[dddrr]^{u} \xtwocell[ddr]{}\omit{^{\theta}}\\ && {\rm src}~\phi \ar[dl]^{p_1} \ar[dr]_{p_0} \ddtwocell\omit{^\phi} \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^\sigma}\\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } \endxy \end{array} $$ \ text \ First apply property \\.T2\ using \\\\<^sub>r : r\<^sub>1 \ p\<^sub>1 \ w \ r\<^sub>1 \ p\<^sub>1 \ w'\\ (obtained by composing \\\ with associativities) and ``everything to the right'' as \\\<^sub>r\ and \\\<^sub>r'\. This yields \\\\<^sub>r : p\<^sub>1 \ w \ p\<^sub>1 \ w'\\. Next, apply property \\.T2\ to obtain \\\\<^sub>s : p\<^sub>0 \ w \ p\<^sub>0 \ w'\\. For this use \\\\<^sub>s : s\<^sub>0 \ p\<^sub>0 \ w \ u\\ and \\\\<^sub>s' : s\<^sub>0 \ p\<^sub>0 \ w'\\ obtained by composing \\\ and \\'\ with associativities. We also need \\\\<^sub>s : s\<^sub>1 \ p\<^sub>0 \ w \ s\<^sub>1 \ p\<^sub>0 \ w'\\. To get this, transport \r\<^sub>0 \ \\<^sub>r\ across \\\; we need \\\ to be an isomorphism in order to do this. Finally, apply the biuniversal property of \\\ to get \\\ : w \ w'\\ and verify the required equation. \ let ?w\<^sub>r = "p\<^sub>1 \ w" have w\<^sub>r: "ide ?w\<^sub>r" by simp let ?w\<^sub>r' = "p\<^sub>1 \ w'" have w\<^sub>r': "ide ?w\<^sub>r'" by simp define \\<^sub>r where "\\<^sub>r = (s \ \) \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" have \\<^sub>r: "\\\<^sub>r : r\<^sub>0 \ ?w\<^sub>r \ s \ u\" unfolding \\<^sub>r_def using \.T0.antipar(1) by fastforce define \\<^sub>r' where "\\<^sub>r' = (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \[s, s\<^sub>0, p\<^sub>0 \ w'] \ (\ \ p\<^sub>0 \ w') \ \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w']" have \\<^sub>r': "\\\<^sub>r' : r\<^sub>0 \ ?w\<^sub>r' \ s \ u\" unfolding \\<^sub>r'_def using \.T0.antipar(1) by fastforce define \\<^sub>r where "\\<^sub>r = \[r\<^sub>1, p\<^sub>1, w'] \ \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" have \\<^sub>r: "\\\<^sub>r : r\<^sub>1 \ ?w\<^sub>r \ r\<^sub>1 \ ?w\<^sub>r'\" unfolding \\<^sub>r_def using \.T0.antipar(1) by force have eq\<^sub>r: "\.composite_cell ?w\<^sub>r \\<^sub>r = \.composite_cell ?w\<^sub>r' \\<^sub>r' \ \\<^sub>r" text \ $$ \begin{array}{ll} \xymatrix{ && X \ar[ddl]^{w_r'} \xtwocell[dddll]{}\omit{^<2>{\beta_r}} \ar@/ul20pt/[dddll]_<>(0.33){w_r}|<>(0.67)@ {>}_<>(0.75){r_1} \ar@/ur20pt/[dddrr]^{u} \xtwocell[dddr]{}\omit{^{\theta_r'}}\\ && \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && \\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } \\ \hspace{5cm} =\qquad \xy/50pt/ \xymatrix{ && X \ar[ddl]^{w_r} \ar@/ur20pt/[dddrr]^{u} \xtwocell[dddr]{}\omit{^{\theta_r}}\\ && \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \dtwocell\omit{^\rho} && \\ {\rm trg}~r && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} && {\rm src}~s \ar[ll]^{s} } \endxy \end{array} $$ \ proof - have "\.composite_cell ?w\<^sub>r \\<^sub>r = \[r, s, u] \ composite_cell w \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using \\<^sub>r_def technical uw\w'\'\.uw\.uw\ by blast also have "... = \[r, s, u] \ (((r \ s) \ \') \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w'] \ (tab \ w') \ \) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using eq comp_assoc by simp also have "... = (r \ \\<^sub>r') \ \[r, r\<^sub>0, ?w\<^sub>r'] \ (\ \ ?w\<^sub>r') \ \\<^sub>r" proof - have "\[r, s, u] \ (composite_cell w' \' \ \) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] = \[r, s, u] \ composite_cell w' \' \ \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using comp_assoc by presburger also have "... = (r \ (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \[s, s\<^sub>0, p\<^sub>0 \ w'] \ (\ \ p\<^sub>0 \ w') \ \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w']) \ \[r, r\<^sub>0, p\<^sub>1 \ w'] \ (\ \ p\<^sub>1 \ w') \ \[r\<^sub>1, p\<^sub>1, w'] \ \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" proof - have "\[r, s, u] \ composite_cell w' \' \ \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] = \[r, s, u] \ composite_cell w' \' \ ((\\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ \[r\<^sub>1, p\<^sub>1, w']) \ \) \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" proof - have "(\\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ \[r\<^sub>1, p\<^sub>1, w']) \ \ = \" using comp_cod_arr \.T0.antipar(1) \ comp_assoc_assoc' by simp thus ?thesis by argo qed also have "... = (\[r, s, u] \ ((r \ s) \ \') \ \[r \ s, s\<^sub>0 \ p\<^sub>0, w'] \ (tab \ w') \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w']) \ \[r\<^sub>1, p\<^sub>1, w'] \ \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using comp_assoc by presburger also have "... = ((r \ (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \[s, s\<^sub>0, p\<^sub>0 \ w'] \ (\ \ p\<^sub>0 \ w') \ \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w']) \ \[r, r\<^sub>0, p\<^sub>1 \ w'] \ (\ \ p\<^sub>1 \ w')) \ \[r\<^sub>1, p\<^sub>1, w'] \ \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using \\<^sub>r'_def technical [of w' \' u ?w\<^sub>r' \\<^sub>r'] comp_assoc by fastforce finally show ?thesis using comp_assoc by simp qed finally show ?thesis using \\<^sub>r'_def \\<^sub>r_def comp_assoc by auto qed finally show ?thesis using comp_assoc by presburger qed have 1: "\!\. \\ : ?w\<^sub>r \ ?w\<^sub>r'\ \ \\<^sub>r = \\<^sub>r' \ (r\<^sub>0 \ \) \ \\<^sub>r = r\<^sub>1 \ \" using eq\<^sub>r \.T2 [of ?w\<^sub>r ?w\<^sub>r' \\<^sub>r "s \ u" \\<^sub>r' \\<^sub>r] w\<^sub>r w\<^sub>r' \\<^sub>r \\<^sub>r' \\<^sub>r by blast obtain \\<^sub>r where \\<^sub>r: "\\\<^sub>r : ?w\<^sub>r \ ?w\<^sub>r'\ \ \\<^sub>r = \\<^sub>r' \ (r\<^sub>0 \ \\<^sub>r) \ \\<^sub>r = r\<^sub>1 \ \\<^sub>r" using 1 by blast let ?w\<^sub>s = "p\<^sub>0 \ w" have w\<^sub>s: "ide ?w\<^sub>s" by simp let ?w\<^sub>s' = "p\<^sub>0 \ w'" have w\<^sub>s': "ide ?w\<^sub>s'" by simp define \\<^sub>s where "\\<^sub>s = \ \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]" have \\<^sub>s: "\\\<^sub>s : s\<^sub>0 \ p\<^sub>0 \ w \ u\" using \\<^sub>s_def by auto define \\<^sub>s' where "\\<^sub>s' = \' \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']" have \\<^sub>s': "\\\<^sub>s' : s\<^sub>0 \ p\<^sub>0 \ w' \ u\" using \\<^sub>s'_def by auto define \\<^sub>s where "\\<^sub>s = \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ \\<^sub>r) \ \[r\<^sub>0, p\<^sub>1, w] \ (inv r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" have \\<^sub>s: "\\\<^sub>s : s\<^sub>1 \ ?w\<^sub>s \ s\<^sub>1 \ ?w\<^sub>s'\" unfolding \\<^sub>s_def using \\<^sub>r r\<^sub>0s\<^sub>1.\_in_hom(2) r\<^sub>0s\<^sub>1.\_uniqueness(2) \.T0.antipar(1) apply (intro comp_in_homI) apply auto by auto have eq\<^sub>s: "\.composite_cell (p\<^sub>0 \ w) (\ \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) = \.composite_cell (p\<^sub>0 \ w') (\' \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \\<^sub>s" text \ $$ \begin{array}{ll} \xy/67pt/ \xymatrix{ && X \ar[d]^{w'} \ar@/l10pt/[dl]_{w} \ddltwocell\omit{^{\gamma_r}} \ar@/ur20pt/[dddrr]^{u} \xtwocell[ddr]{}\omit{^{\theta_s'}}\\ & {\rm src}~\phi \ar[dr]_{p_1} \ar[d]_{p_0} & {\rm src}~\phi \ar[d]^{p_1} \ar[dr]_{p_0} \ddrtwocell\omit{^\phi} \xtwocell[ddl]{}\omit{^\;\;\;\;\phi^{-1}} \\ & {\rm src}~\sigma \ar[dr]_{s_1} & {\rm src}~\rho \ar[d]^{r_0} & {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^\sigma}\\ && {\rm src}~r = {\rm trg}~s && {\rm src}~s \ar[ll]^{s} } \endxy \\ \hspace{5cm}= \xy/50pt/ \xymatrix{ & X \ar@/dl15pt/[ddr]_<>(0.5){w_s} \ar@/ur20pt/[dddrr]^{u} \xtwocell[ddr]{}\omit{^{\theta_s}}\\ & \\ && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^\sigma}\\ & {\rm src}~r = {\rm trg}~s && {\rm src}~s \ar[ll]^{s} } \endxy \end{array} $$ \ proof - have "\.composite_cell (p\<^sub>0 \ w') (\' \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \\<^sub>s = (\\<^sub>r' \ (r\<^sub>0 \ \\<^sub>r)) \ \[r\<^sub>0, p\<^sub>1, w] \ (inv r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" using \\<^sub>s_def \\<^sub>r'_def whisker_left comp_assoc by simp also have "... = \\<^sub>r \ \[r\<^sub>0, p\<^sub>1, w] \ (inv r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" using \\<^sub>r by simp also have "... = ((s \ \) \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w])) \ \[s, s\<^sub>0, ?w\<^sub>s] \ (\ \ ?w\<^sub>s) \ \[s\<^sub>1, p\<^sub>0, w] \ ((r\<^sub>0s\<^sub>1.\ \ w) \ (\\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ \[r\<^sub>0, p\<^sub>1, w]) \ (inv r\<^sub>0s\<^sub>1.\ \ w)) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" using \\<^sub>r_def comp_assoc by simp also have "... = (s \ \) \ \.composite_cell (p\<^sub>0 \ w) \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]" proof - have "(\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ ((r\<^sub>0s\<^sub>1.\ \ w) \ (\\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ \[r\<^sub>0, p\<^sub>1, w]) \ (inv r\<^sub>0s\<^sub>1.\ \ w)) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w] = \ \ p\<^sub>0 \ w" proof - have "\\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ \[r\<^sub>0, p\<^sub>1, w] = cod (inv r\<^sub>0s\<^sub>1.\ \ w)" using r\<^sub>0s\<^sub>1.\_uniqueness(2) \.T0.antipar(1) comp_assoc_assoc' by simp text \Here the fact that \\\ is a retraction is used.\ moreover have "(r\<^sub>0s\<^sub>1.\ \ w) \ (inv r\<^sub>0s\<^sub>1.\ \ w) = cod \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" using r\<^sub>0s\<^sub>1.\_uniqueness(2) comp_arr_inv' whisker_right [of w r\<^sub>0s\<^sub>1.\ "inv r\<^sub>0s\<^sub>1.\"] by simp moreover have "\[s\<^sub>1, p\<^sub>0, w] \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w] = dom (\ \ p\<^sub>0 \ w)" using r\<^sub>0s\<^sub>1.base_simps(2) hseq_char comp_assoc_assoc' by auto moreover have "hseq (inv r\<^sub>0s\<^sub>1.\) w" using r\<^sub>0s\<^sub>1.\_uniqueness(2) by (intro hseqI, auto) moreover have "hseq \ (p\<^sub>0 \ w)" by (intro hseqI, auto) ultimately show ?thesis using comp_arr_dom comp_cod_arr by simp qed thus ?thesis using comp_assoc by simp qed also have "... = \.composite_cell (p\<^sub>0 \ w) (\ \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w])" using \\<^sub>s_def whisker_left by (metis \.ide_base \\<^sub>s arrI comp_assoc) finally show ?thesis by simp qed hence 2: "\!\. \\ : ?w\<^sub>s \ ?w\<^sub>s'\ \ \\<^sub>s = \\<^sub>s' \ (s\<^sub>0 \ \) \ \\<^sub>s = s\<^sub>1 \ \" using \.T2 [of ?w\<^sub>s ?w\<^sub>s' \\<^sub>s u \\<^sub>s' \\<^sub>s] w\<^sub>s w\<^sub>s' \\<^sub>s \\<^sub>s' \\<^sub>s by (metis \\<^sub>s'_def \\<^sub>s_def) obtain \\<^sub>s where \\<^sub>s: "\\\<^sub>s : ?w\<^sub>s \ ?w\<^sub>s'\ \ \\<^sub>s = \\<^sub>s' \ (s\<^sub>0 \ \\<^sub>s) \ \\<^sub>s = s\<^sub>1 \ \\<^sub>s" using 2 by blast have eq\<^sub>t: "(s\<^sub>1 \ \\<^sub>s) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] = (s\<^sub>1 \ ?w\<^sub>s') \ \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ \\<^sub>r)" text \ $$ \xy/78pt/ \xymatrix{ & X \ar[d]^{w'} \ar@/ul15pt/[ddl]_{w_r} \xtwocell[ddl]{}\omit{^{\gamma_r}} \\ & {\rm src}~\phi \ar[dl]_{p_1} \ar[dr]^{p_0} \ddtwocell\omit{^\phi} \\ {\rm src}~\rho \ar[dr]^{r_0} && {\rm src}~\sigma \ar[dl]_{s_1} \\ & {\rm src}~r = {\rm trg}~s & } \endxy \qquad = \qquad \xy/78pt/ \xymatrix{ & X \ar[d]^{w} \ar@/ur15pt/[ddr]^{w_s'} \xtwocell[ddr]{}\omit{^{\gamma_s}} \\ & {\rm src}~\phi \ar[dl]_{p_1} \ar[dr]^{p_0} \ddtwocell\omit{^\phi} \\ {\rm src}~\rho \ar[dr]^{r_0} && {\rm src}~\sigma \ar[dl]_{s_1} \\ & {\rm src}~r = {\rm trg}~s & } \endxy $$ \ proof - have "(s\<^sub>1 \ ?w\<^sub>s') \ \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ \\<^sub>r) = \\<^sub>s \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" proof - have "\\<^sub>s \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] = (\[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w']) \ (r\<^sub>0 \ \\<^sub>r) \ \[r\<^sub>0, p\<^sub>1, w] \ ((inv r\<^sub>0s\<^sub>1.\ \ w) \ (\\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w] \ \[s\<^sub>1, p\<^sub>0, w]) \ (r\<^sub>0s\<^sub>1.\ \ w)) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using \\<^sub>s_def comp_assoc by metis also have "... = (\[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w']) \ (r\<^sub>0 \ \\<^sub>r)" proof - have "(r\<^sub>0 \ \\<^sub>r) \ \[r\<^sub>0, p\<^sub>1, w] \ ((inv r\<^sub>0s\<^sub>1.\ \ w) \ (\\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w] \ \[s\<^sub>1, p\<^sub>0, w]) \ (r\<^sub>0s\<^sub>1.\ \ w)) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] = r\<^sub>0 \ \\<^sub>r" proof - have "(r\<^sub>0 \ \\<^sub>r) \ \[r\<^sub>0, p\<^sub>1, w] \ ((inv r\<^sub>0s\<^sub>1.\ \ w) \ (\\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w] \ \[s\<^sub>1, p\<^sub>0, w]) \ (r\<^sub>0s\<^sub>1.\ \ w)) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] = (r\<^sub>0 \ \\<^sub>r) \ \[r\<^sub>0, p\<^sub>1, w] \ ((inv r\<^sub>0s\<^sub>1.\ \ w) \ (r\<^sub>0s\<^sub>1.\ \ w)) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using r\<^sub>0s\<^sub>1.\_uniqueness(2) comp_assoc_assoc' comp_cod_arr by simp (* Used here that \ is a section. *) also have "... = (r\<^sub>0 \ \\<^sub>r) \ \[r\<^sub>0, p\<^sub>1, w] \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using r\<^sub>0s\<^sub>1.\_uniqueness(2) comp_inv_arr' \.T0.antipar(1) whisker_right [of w "inv r\<^sub>0s\<^sub>1.\" r\<^sub>0s\<^sub>1.\] comp_cod_arr by simp also have "... = r\<^sub>0 \ \\<^sub>r" proof - have "hseq r\<^sub>0 \\<^sub>r" using \\<^sub>s \\<^sub>s_def by blast thus ?thesis using comp_assoc_assoc' comp_arr_dom by (metis (no_types) \\<^sub>r \.ide_leg0 comp_assoc_assoc'(1) hcomp_simps(3) hseq_char ide_char in_homE r\<^sub>0s\<^sub>1.ide_leg1 r\<^sub>0s\<^sub>1.p\<^sub>1_simps w w\<^sub>r) qed finally show ?thesis by blast qed thus ?thesis by simp qed also have "... = \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ \\<^sub>r)" using comp_assoc by presburger also have "... = (s\<^sub>1 \ ?w\<^sub>s') \ \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ \\<^sub>r)" proof - have "(s\<^sub>1 \ ?w\<^sub>s') \ \[s\<^sub>1, p\<^sub>0, w'] = \[s\<^sub>1, p\<^sub>0, w']" using comp_cod_arr by simp thus ?thesis using comp_assoc by metis qed finally show ?thesis by simp qed also have "... = (s\<^sub>1 \ \\<^sub>s) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using \\<^sub>s by simp finally show ?thesis by simp qed have 3: "\!\. \\ : w \ w'\ \ \\<^sub>s = (p\<^sub>0 \ w') \ (p\<^sub>0 \ \) \ p\<^sub>1 \ \ = \\<^sub>r" using w w' w\<^sub>s' w\<^sub>r \\<^sub>r \\<^sub>s eq\<^sub>t r\<^sub>0s\<^sub>1.\_biuniversal_prop(2) [of ?w\<^sub>s' ?w\<^sub>r w w' \\<^sub>s "p\<^sub>0 \ w'" \\<^sub>r] by blast obtain \ where \: "\\ : w \ w'\ \ \\<^sub>s = (p\<^sub>0 \ w') \ (p\<^sub>0 \ \) \ p\<^sub>1 \ \ = \\<^sub>r" using 3 by blast show "\!\. \\ : w \ w'\ \ \ = (r\<^sub>1 \ p\<^sub>1) \ \ \ \ = \' \ ((s\<^sub>0 \ p\<^sub>0) \ \)" proof - have "\\. \\ : w \ w'\ \ \ = (r\<^sub>1 \ p\<^sub>1) \ \ \ \ = \' \ ((s\<^sub>0 \ p\<^sub>0) \ \)" proof - have "\ = \' \ ((s\<^sub>0 \ p\<^sub>0) \ \)" proof - have "\' \ ((s\<^sub>0 \ p\<^sub>0) \ \) = (\\<^sub>s' \ \[s\<^sub>0, p\<^sub>0, w']) \ ((s\<^sub>0 \ p\<^sub>0) \ \)" using \\<^sub>s'_def comp_arr_dom comp_assoc comp_assoc_assoc'(2) by auto also have "... = (\\<^sub>s' \ (s\<^sub>0 \ p\<^sub>0 \ \)) \ \[s\<^sub>0, p\<^sub>0, w]" using assoc_naturality [of s\<^sub>0 p\<^sub>0 \] comp_assoc by (metis \ \\<^sub>r \.leg0_simps(4-5) r\<^sub>0s\<^sub>1.leg0_simps(4-5) r\<^sub>0s\<^sub>1.leg1_simps(3) hseqE in_homE leg0_simps(2)) also have "... = \\<^sub>s \ \[s\<^sub>0, p\<^sub>0, w]" by (metis \ \\<^sub>s arrI comp_ide_arr w\<^sub>s') also have "... = \" using \\<^sub>s_def comp_assoc comp_arr_dom comp_assoc_assoc' by simp finally show ?thesis by simp qed moreover have "\ = (r\<^sub>1 \ p\<^sub>1) \ \" proof - have "\ = \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ \\<^sub>r \ \[r\<^sub>1, p\<^sub>1, w]" proof - have "\\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ \\<^sub>r \ \[r\<^sub>1, p\<^sub>1, w] = (\\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ \[r\<^sub>1, p\<^sub>1, w']) \ \ \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w] \ \[r\<^sub>1, p\<^sub>1, w]" using \\<^sub>r_def comp_assoc by simp also have "... = \" using comp_arr_dom comp_cod_arr by (metis \.ide_leg1 r\<^sub>0s\<^sub>1.ide_leg1 comp_assoc_assoc'(2) hseqE ideD(1) uw\w'\'\.\_simps(1) uw\w'\'\.\_simps(4-5) leg1_simps(2) w w' w\<^sub>r w\<^sub>r') finally show ?thesis by simp qed also have "... = \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ (r\<^sub>1 \ \\<^sub>r) \ \[r\<^sub>1, p\<^sub>1, w]" using \\<^sub>r by simp also have "... = \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ \[r\<^sub>1, p\<^sub>1, w'] \ ((r\<^sub>1 \ p\<^sub>1) \ \)" using assoc_naturality [of r\<^sub>1 p\<^sub>1 \] by (metis \ \\<^sub>r \.ide_leg1 r\<^sub>0s\<^sub>1.leg1_simps(5-6) hseqE ide_char in_homE leg1_simps(2)) also have "... = (\\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ \[r\<^sub>1, p\<^sub>1, w']) \ ((r\<^sub>1 \ p\<^sub>1) \ \)" using comp_assoc by presburger also have "... = (r\<^sub>1 \ p\<^sub>1) \ \" using comp_cod_arr by (metis \.ide_leg1 r\<^sub>0s\<^sub>1.ide_leg1 calculation comp_assoc_assoc'(2) comp_ide_arr hseqE ideD(1) ide_cod local.uw\w'\'\.\_simps(1) local.uw\w'\'\.\_simps(5) w' w\<^sub>r') finally show ?thesis by simp qed ultimately show "\\. \\ : w \ w'\ \ \ = (r\<^sub>1 \ p\<^sub>1) \ \ \ \ = \' \ ((s\<^sub>0 \ p\<^sub>0) \ \)" using \ by blast qed moreover have "\\'. \\' : w \ w'\ \ \ = (r\<^sub>1 \ p\<^sub>1) \ \' \ \ = \' \ ((s\<^sub>0 \ p\<^sub>0) \ \') \ \' = \" proof - fix \' assume \': "\\' : w \ w'\ \ \ = (r\<^sub>1 \ p\<^sub>1) \ \' \ \ = \' \ ((s\<^sub>0 \ p\<^sub>0) \ \')" show "\' = \" proof - let ?P\<^sub>r = "\\. \\ : ?w\<^sub>r \ ?w\<^sub>r'\ \ \\<^sub>r = \\<^sub>r' \ (r\<^sub>0 \ \) \ \\<^sub>r = r\<^sub>1 \ \" let ?P\<^sub>s = "\\. \\ : ?w\<^sub>s \ ?w\<^sub>s'\ \ \\<^sub>s = \\<^sub>s' \ (s\<^sub>0 \ \) \ \\<^sub>s = s\<^sub>1 \ \" let ?\\<^sub>r' = "p\<^sub>1 \ \'" let ?\\<^sub>s' = "p\<^sub>0 \ \'" let ?P\<^sub>t = "\\. \\ : w \ w'\ \ \\<^sub>s = (p\<^sub>0 \ w') \ (p\<^sub>0 \ \) \ p\<^sub>1 \ \ = \\<^sub>r" have "hseq p\<^sub>0 \'" proof (intro hseqI) show "\\' : src \ \ src p\<^sub>0\" using \' by (metis hseqE hseqI' in_hhom_def uw\w'\'\.\_simps(1) src_hcomp src_vcomp leg0_simps(2) leg1_simps(3) uw\w'\'\.uw\.\_simps(1) vseq_implies_hpar(1)) show "\p\<^sub>0 : src p\<^sub>0 \ src s\<^sub>0\" by simp qed hence "hseq p\<^sub>1 \'" using hseq_char by simp have "\?\\<^sub>r' : ?w\<^sub>r \ ?w\<^sub>r'\" using \' by auto moreover have "\\<^sub>r = \\<^sub>r' \ (r\<^sub>0 \ ?\\<^sub>r')" proof - text \ Note that @{term \\<^sub>r} is the composite of ``everything to the right'' of @{term "\ \ ?w\<^sub>r"}, and similarly for @{term \\<^sub>r'}. We can factor @{term \\<^sub>r} as @{term "(s \ \) \ X w"}, where @{term "X w"} is a composite of @{term \} and @{term \}. We can similarly factor @{term \\<^sub>r'} as @{term "(s \ \') \ X w'"}. Then @{term "\\<^sub>r' \ (r\<^sub>0 \ ?\\<^sub>r') = (s \ \') \ X w' \ (r\<^sub>0 \ ?\\<^sub>r')"}, which equals @{term "(s \ \') \ (s \ (s\<^sub>0 \ p\<^sub>0) \ ?\\<^sub>r') \ X w = \\<^sub>r"}. \ let ?X = "\w. (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" have "\\<^sub>r' \ (r\<^sub>0 \ ?\\<^sub>r') = (s \ \') \ ?X w' \ (r\<^sub>0 \ ?\\<^sub>r')" using \\<^sub>r'_def comp_assoc by simp also have "... = (s \ \') \ (s \ (s\<^sub>0 \ p\<^sub>0) \ \') \ ?X w" proof - have "(s \ \') \ ((s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \[s, s\<^sub>0, p\<^sub>0 \ w'] \ (\ \ p\<^sub>0 \ w') \ \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w']) \ (r\<^sub>0 \ p\<^sub>1 \ \') = (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \[s, s\<^sub>0, p\<^sub>0 \ w'] \ (\ \ p\<^sub>0 \ w') \ \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ p\<^sub>1 \ \')" using comp_assoc by presburger also have "... = (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \[s, s\<^sub>0, p\<^sub>0 \ w'] \ (\ \ p\<^sub>0 \ w') \ \[s\<^sub>1, p\<^sub>0, w'] \ ((r\<^sub>0s\<^sub>1.\ \ w') \ ((r\<^sub>0 \ p\<^sub>1) \ \')) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using assoc'_naturality [of r\<^sub>0 p\<^sub>1 \'] comp_assoc by (metis \' \\p\<^sub>1 \ \' : p\<^sub>1 \ w \ p\<^sub>1 \ w'\\ \.T0.antipar(1) \.leg0_in_hom(2) r\<^sub>0s\<^sub>1.leg1_simps(4-6) r\<^sub>0s\<^sub>1.base_simps(2) hcomp_in_vhomE in_homE trg_hcomp) also have "... = (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \[s, s\<^sub>0, p\<^sub>0 \ w'] \ (\ \ p\<^sub>0 \ w') \ (\[s\<^sub>1, p\<^sub>0, w'] \ ((s\<^sub>1 \ p\<^sub>0) \ \')) \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" proof - have "(r\<^sub>0s\<^sub>1.\ \ w') \ ((r\<^sub>0 \ p\<^sub>1) \ \') = r\<^sub>0s\<^sub>1.\ \ \'" using \' interchange [of r\<^sub>0s\<^sub>1.\ "r\<^sub>0 \ p\<^sub>1" w' \'] comp_arr_dom comp_cod_arr by auto also have "... = ((s\<^sub>1 \ p\<^sub>0) \ \') \ (r\<^sub>0s\<^sub>1.\ \ w)" using \' interchange \hseq p\<^sub>0 \'\ comp_arr_dom comp_cod_arr by (metis comp_arr_ide r\<^sub>0s\<^sub>1.\_simps(1,5) seqI' uw\w'\'\.uw\.w_in_hom(2) w) finally have "(r\<^sub>0s\<^sub>1.\ \ w') \ ((r\<^sub>0 \ p\<^sub>1) \ \') = ((s\<^sub>1 \ p\<^sub>0) \ \') \ (r\<^sub>0s\<^sub>1.\ \ w)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ \[s, s\<^sub>0, p\<^sub>0 \ w'] \ ((\ \ p\<^sub>0 \ w') \ (s\<^sub>1 \ p\<^sub>0 \ \')) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using \' assoc_naturality [of s\<^sub>1 p\<^sub>0 \'] comp_assoc by (metis \.leg1_simps(2) \.leg1_simps(3,5-6) r\<^sub>0s\<^sub>1.leg0_simps(4-5) hcomp_in_vhomE hseqE in_homE uw\w'\'\.\_simps(1) leg0_in_hom(2) leg1_simps(3)) also have "... = (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ (\[s, s\<^sub>0, p\<^sub>0 \ w'] \ ((s \ s\<^sub>0) \ p\<^sub>0 \ \')) \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" proof - have "(\ \ p\<^sub>0 \ w') \ (s\<^sub>1 \ p\<^sub>0 \ \') = \ \ p\<^sub>0 \ \'" using \' interchange [of \ s\<^sub>1 "p\<^sub>0 \ w'" "p\<^sub>0 \ \'"] whisker_left \hseq p\<^sub>0 \'\comp_arr_dom comp_cod_arr by (metis \.tab_simps(1) \.tab_simps(4) hcomp_simps(4) in_homE r\<^sub>0s\<^sub>1.leg0_simps(5)) also have "... = ((s \ s\<^sub>0) \ p\<^sub>0 \ \') \ (\ \ p\<^sub>0 \ w)" using \' interchange [of "s \ s\<^sub>0" \ "p\<^sub>0 \ \'" "p\<^sub>0 \ w"] whisker_left comp_arr_dom comp_cod_arr \hseq p\<^sub>0 \'\ by (metis \.tab_simps(1) \.tab_simps(5) hcomp_simps(3) in_homE r\<^sub>0s\<^sub>1.leg0_simps(4)) finally have "(\ \ p\<^sub>0 \ w') \ (s\<^sub>1 \ p\<^sub>0 \ \') = ((s \ s\<^sub>0) \ p\<^sub>0 \ \') \ (\ \ p\<^sub>0 \ w)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (s \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ ((s \ s\<^sub>0 \ p\<^sub>0 \ \') \ \[s, s\<^sub>0, p\<^sub>0 \ w]) \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using \' assoc_naturality [of s s\<^sub>0 "p\<^sub>0 \ \'"] \hseq p\<^sub>0 \'\ by force also have "... = (s \ \') \ ((s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ (s \ s\<^sub>0 \ p\<^sub>0 \ \')) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using comp_assoc by presburger also have "... = (s \ \') \ ((s \ (s\<^sub>0 \ p\<^sub>0) \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w])) \ \[s, s\<^sub>0, p\<^sub>0 \ w] \ (\ \ p\<^sub>0 \ w) \ \[s\<^sub>1, p\<^sub>0, w] \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" proof - have "(s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ (s \ s\<^sub>0 \ p\<^sub>0 \ \') = (s \ (s\<^sub>0 \ p\<^sub>0) \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w])" proof - have "(s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w']) \ (s \ s\<^sub>0 \ p\<^sub>0 \ \') = s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w'] \ (s\<^sub>0 \ p\<^sub>0 \ \')" proof - have "seq \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w'] (s\<^sub>0 \ p\<^sub>0 \ \')" proof (* It seems to be too time-consuming for auto to solve these. *) show "\s\<^sub>0 \ p\<^sub>0 \ \' : s\<^sub>0 \ p\<^sub>0 \ w \ s\<^sub>0 \ p\<^sub>0 \ w'\" using \' by (intro hcomp_in_vhom, auto) show "\\\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w'] : s\<^sub>0 \ p\<^sub>0 \ w' \ (s\<^sub>0 \ p\<^sub>0) \ w'\" by auto qed thus ?thesis using w w' \' whisker_left by simp qed also have "... = s \ ((s\<^sub>0 \ p\<^sub>0) \ \') \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]" using \' \hseq p\<^sub>0 \'\ assoc'_naturality [of s\<^sub>0 p\<^sub>0 \'] by fastforce also have "... = (s \ (s\<^sub>0 \ p\<^sub>0) \ \') \ (s \ \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w])" proof - have "seq ((s\<^sub>0 \ p\<^sub>0) \ \') \\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w]" proof (* Same here. *) show "\\\<^sup>-\<^sup>1[s\<^sub>0, p\<^sub>0, w] : s\<^sub>0 \ p\<^sub>0 \ w \ (s\<^sub>0 \ p\<^sub>0) \ w\" by auto show "\(s\<^sub>0 \ p\<^sub>0) \ \' : (s\<^sub>0 \ p\<^sub>0) \ w \ (s\<^sub>0 \ p\<^sub>0) \ w'\" using \' by (intro hcomp_in_vhom, auto) qed thus ?thesis using w w' \' whisker_left by simp qed finally show ?thesis by blast qed thus ?thesis by simp qed also have "... = (s \ \') \ (s \ (s\<^sub>0 \ p\<^sub>0) \ \') \ ?X w" using comp_assoc by presburger finally show ?thesis by simp qed also have "... = \\<^sub>r" using \\<^sub>r_def \' uw\w'\'\.uw\.\_simps(1) whisker_left \.ide_base comp_assoc by simp finally show ?thesis by simp qed moreover have "\\<^sub>r = r\<^sub>1 \ ?\\<^sub>r'" proof - have "\\<^sub>r = \[r\<^sub>1, p\<^sub>1, w'] \ ((r\<^sub>1 \ p\<^sub>1) \ \') \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w]" using \\<^sub>r_def \' by simp also have "... = \[r\<^sub>1, p\<^sub>1, w'] \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w'] \ (r\<^sub>1 \ p\<^sub>1 \ \')" using \' assoc'_naturality by (metis \.leg1_simps(5-6) r\<^sub>0s\<^sub>1.leg1_simps(5-6) hcomp_in_vhomE hseqE in_homE uw\w'\'\.\_simps(1) leg1_in_hom(2)) also have "... = (\[r\<^sub>1, p\<^sub>1, w'] \ \\<^sup>-\<^sup>1[r\<^sub>1, p\<^sub>1, w']) \ (r\<^sub>1 \ p\<^sub>1 \ \')" using comp_assoc by presburger also have "... = r\<^sub>1 \ p\<^sub>1 \ \'" using comp_cod_arr by (metis (no_types, lifting) \\<^sub>r \.ide_leg1 r\<^sub>0s\<^sub>1.ide_leg1 arrI calculation comp_assoc_assoc'(1) comp_ide_arr ide_hcomp hseq_char' ideD(1) seq_if_composable hcomp_simps(2) leg1_simps(2) w' w\<^sub>r') finally show ?thesis by simp qed ultimately have P\<^sub>r': "?P\<^sub>r ?\\<^sub>r'" by simp have eq\<^sub>r: "\\<^sub>r = ?\\<^sub>r'" using 1 \\<^sub>r P\<^sub>r' by blast have "\?\\<^sub>s' : ?w\<^sub>s \ ?w\<^sub>s'\" using \' by auto moreover have "\\<^sub>s = \\<^sub>s' \ (s\<^sub>0 \ ?\\<^sub>s')" using \' \hseq p\<^sub>0 \'\ \.leg0_simps(2,4-5) \.leg1_simps(3) \\<^sub>s'_def \\<^sub>s_def assoc'_naturality hseqE in_homE comp_assoc r\<^sub>0s\<^sub>1.leg0_simps(4-5) r\<^sub>0s\<^sub>1.p\<^sub>0_simps by metis moreover have "\\<^sub>s = s\<^sub>1 \ ?\\<^sub>s'" proof - have "\[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ \\<^sub>r) \ \[r\<^sub>0, p\<^sub>1, w] \ (inv r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w] = \[s\<^sub>1, p\<^sub>0, w'] \ (r\<^sub>0s\<^sub>1.\ \ w') \ (\\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ p\<^sub>1 \ \')) \ \[r\<^sub>0, p\<^sub>1, w] \ (inv r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" using eq\<^sub>r comp_assoc by simp also have "... = \[s\<^sub>1, p\<^sub>0, w'] \ ((r\<^sub>0s\<^sub>1.\ \ w') \ ((r\<^sub>0 \ p\<^sub>1) \ \')) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ \[r\<^sub>0, p\<^sub>1, w] \ (inv r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" proof - have "\\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w'] \ (r\<^sub>0 \ p\<^sub>1 \ \') = ((r\<^sub>0 \ p\<^sub>1) \ \') \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w]" using \' assoc'_naturality \hseq p\<^sub>1 \'\ by (metis \.leg0_simps(2,4-5) \.leg1_simps(3) r\<^sub>0s\<^sub>1.leg1_simps(5-6) hseqE in_homE leg1_simps(2)) thus ?thesis using comp_assoc by presburger qed also have "... = (\[s\<^sub>1, p\<^sub>0, w'] \ ((s\<^sub>1 \ p\<^sub>0) \ \')) \ (r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ \[r\<^sub>0, p\<^sub>1, w] \ (inv r\<^sub>0s\<^sub>1.\ \ w) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" proof - have "(r\<^sub>0s\<^sub>1.\ \ w') \ ((r\<^sub>0 \ p\<^sub>1) \ \') = r\<^sub>0s\<^sub>1.\ \ \'" using \' interchange [of r\<^sub>0s\<^sub>1.\ "r\<^sub>0 \ p\<^sub>1" w' \'] comp_arr_dom comp_cod_arr by auto also have "... = ((s\<^sub>1 \ p\<^sub>0) \ \') \ (r\<^sub>0s\<^sub>1.\ \ w)" using \' interchange \hseq p\<^sub>0 \'\ comp_arr_dom comp_cod_arr by (metis in_homE r\<^sub>0s\<^sub>1.\_simps(1,5)) finally have "(r\<^sub>0s\<^sub>1.\ \ w') \ ((r\<^sub>0 \ p\<^sub>1) \ \') = ((s\<^sub>1 \ p\<^sub>0) \ \') \ (r\<^sub>0s\<^sub>1.\ \ w)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (s\<^sub>1 \ ?\\<^sub>s') \ \[s\<^sub>1, p\<^sub>0, w] \ ((r\<^sub>0s\<^sub>1.\ \ w) \ (\\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ \[r\<^sub>0, p\<^sub>1, w]) \ (inv r\<^sub>0s\<^sub>1.\ \ w)) \ \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" proof - have "\[s\<^sub>1, p\<^sub>0, w'] \ ((s\<^sub>1 \ p\<^sub>0) \ \') = (s\<^sub>1 \ ?\\<^sub>s') \ \[s\<^sub>1, p\<^sub>0, w]" using \' assoc_naturality [of s\<^sub>1 p\<^sub>0 \'] \hseq p\<^sub>0 \'\ by auto thus ?thesis using comp_assoc by presburger qed also have "... = s\<^sub>1 \ ?\\<^sub>s'" proof - have "\\<^sup>-\<^sup>1[r\<^sub>0, p\<^sub>1, w] \ \[r\<^sub>0, p\<^sub>1, w] = cod (inv r\<^sub>0s\<^sub>1.\ \ w)" using r\<^sub>0s\<^sub>1.\_uniqueness(2) \.T0.antipar(1) comp_assoc_assoc' by simp text \Here the fact that \\\ is a retraction is used.\ moreover have "(r\<^sub>0s\<^sub>1.\ \ w) \ (inv r\<^sub>0s\<^sub>1.\ \ w) = cod \\<^sup>-\<^sup>1[s\<^sub>1, p\<^sub>0, w]" using r\<^sub>0s\<^sub>1.\_uniqueness(2) comp_arr_inv' whisker_right [of w r\<^sub>0s\<^sub>1.\ "inv r\<^sub>0s\<^sub>1.\"] by simp moreover have "cod (inv r\<^sub>0s\<^sub>1.\ \ w) \ (inv r\<^sub>0s\<^sub>1.\ \ w) = inv r\<^sub>0s\<^sub>1.\ \ w" using \\<^sub>s_def \\<^sub>s by (meson arrI comp_cod_arr seqE) ultimately show ?thesis using \' \hseq p\<^sub>0 \'\ comp_arr_dom comp_cod_arr comp_assoc_assoc' whisker_left [of s\<^sub>1 "p\<^sub>0 \ \'" "p\<^sub>0 \ w"] whisker_left [of p\<^sub>0] by (metis \.ide_leg1 assoc'_simps(1) hseqE ideD(1) in_homE r\<^sub>0s\<^sub>1.ide_leg0 r\<^sub>0s\<^sub>1.p\<^sub>0_simps w w\<^sub>s) qed finally show ?thesis using \\<^sub>s_def by simp qed ultimately have P\<^sub>s': "?P\<^sub>s ?\\<^sub>s'" by simp have eq\<^sub>s: "\\<^sub>s = ?\\<^sub>s'" using 2 \\<^sub>s P\<^sub>s' by blast have "?P\<^sub>t \'" using \' comp_cod_arr \\p\<^sub>0 \ \' : p\<^sub>0 \ w \ p\<^sub>0 \ w'\\ eq\<^sub>r eq\<^sub>s by auto thus "\' = \" using 3 \ by blast qed qed ultimately show ?thesis by blast qed qed qed end sublocale composite_tabulation_in_maps \ tabulation V H \ \ src trg \r \ s\ tab \s\<^sub>0 \ p\<^sub>0\ \r\<^sub>1 \ p\<^sub>1\ using composite_is_tabulation by simp sublocale composite_tabulation_in_maps \ tabulation_in_maps V H \ \ src trg \r \ s\ tab \s\<^sub>0 \ p\<^sub>0\ \r\<^sub>1 \ p\<^sub>1\ using T0.is_map \.leg1_is_map \.T0.antipar(2) composable \.leg1_is_map \.T0.antipar apply unfold_locales apply simp apply (intro left_adjoints_compose) by auto subsection "The Classifying Category of Maps" text \ \sloppypar We intend to show that if \B\ is a bicategory of spans, then \B\ is biequivalent to \Span(Maps(B))\, for a specific category \Maps(B)\ derived from \B\. The category \Maps(B)\ is constructed in this section as the ``classifying category'' of maps of \B\, which has the same objects as \B\ and which has as 1-cells the isomorphism classes of maps of \B\. We show that, if \B\ is a bicategory of spans, then \Maps(B)\ has pullbacks. \ locale maps_category = B: bicategory_of_spans begin no_notation B.in_hhom ("\_ : _ \ _\") no_notation B.in_hom ("\_ : _ \\<^sub>B _\") notation B.in_hhom ("\_ : _ \\<^sub>B _\") notation B.in_hom ("\_ : _ \\<^sub>B _\") notation B.isomorphic (infix "\\<^sub>B" 50) notation B.iso_class ("\_\\<^sub>B") text \ I attempted to modularize the construction here, by refactoring ``classifying category'' out as a separate locale, but it ended up causing extra work because to apply it we first need to obtain the full sub-bicategory of 2-cells between maps, then construct its classifying category, and then we have to re-prove everything about it, to get rid of any mention of the sub-bicategory construction. So the construction is being done here as a ``one-off'' special case construction, with the necessary properties proved just once. \ text \ The ``hom-categories'' of \Maps(C)\ have as arrows the isomorphism classes of maps of \B\. \ abbreviation Hom where "Hom a b \ {F. \f. \f : a \\<^sub>B b\ \ B.is_left_adjoint f \ F = \f\\<^sub>B}" lemma in_HomD: assumes "F \ Hom a b" shows "F \ {}" and "B.is_iso_class F" and "f \ F \ B.ide f" and "f \ F \ \f : a \\<^sub>B b\" and "f \ F \ B.is_left_adjoint f" and "f \ F \ F = \f\\<^sub>B" proof - show "F \ {}" using assms B.ide_in_iso_class B.left_adjoint_is_ide B.iso_class_is_nonempty by auto show 1: "B.is_iso_class F" using assms B.is_iso_classI B.left_adjoint_is_ide by fastforce show "f \ F \ B.ide f" using assms 1 B.iso_class_memb_is_ide by blast obtain f' where f': "\f' : a \\<^sub>B b\ \ B.is_left_adjoint f' \ F = \f'\\<^sub>B" using assms by auto show "f \ F \ \f : a \\<^sub>B b\" using assms f' B.iso_class_def B.isomorphic_implies_hpar by auto show "f \ F \ B.is_left_adjoint f" using assms f' B.iso_class_def B.left_adjoint_preserved_by_iso [of f'] by auto show "f \ F \ F = \f\\<^sub>B" by (metis B.adjoint_pair_antipar(1) f' B.ide_in_iso_class B.is_iso_classI B.iso_class_elems_isomorphic B.iso_class_eqI) qed definition Comp where "Comp G F \ {h. B.is_iso_class F \ B.is_iso_class G \ (\f g. f \ F \ g \ G \ g \ f \\<^sub>B h)}" lemma in_CompI [intro]: assumes "B.is_iso_class F" and "B.is_iso_class G" and "f \ F" and "g \ G" and "g \ f \\<^sub>B h" shows "h \ Comp G F" unfolding Comp_def using assms by auto lemma in_CompE [elim]: assumes "h \ Comp G F" and "\f g. \ B.is_iso_class F; B.is_iso_class G; f \ F; g \ G; g \ f \\<^sub>B h \ \ T" shows T using assms Comp_def by auto lemma is_iso_class_Comp: assumes "Comp G F \ {}" shows "B.is_iso_class (Comp G F)" proof - obtain h where h: "h \ Comp G F" using assms by auto have ide_h: "B.ide h" using h Comp_def B.isomorphic_implies_hpar(2) by auto obtain f g where fg: "B.is_iso_class F \ B.is_iso_class G \ f \ F \ g \ G \ g \ f \\<^sub>B h" using h Comp_def by auto have "Comp G F = \g \ f\\<^sub>B \ B.ide (g \ f)" proof (intro conjI) show "B.ide (g \ f)" using fg B.iso_class_memb_is_ide B.isomorphic_implies_ide(1) by auto show "Comp G F = \g \ f\\<^sub>B" proof show "\g \ f\\<^sub>B \ Comp G F" unfolding Comp_def B.iso_class_def using fg by auto show "Comp G F \ \g \ f\\<^sub>B" proof fix h' assume h': "h' \ Comp G F" obtain f' g' where f'g': "f' \ F \ g' \ G \ g' \ f' \\<^sub>B h'" using h' Comp_def by auto have 1: "f' \\<^sub>B f \ g' \\<^sub>B g" using f'g' fg B.iso_class_elems_isomorphic by auto moreover have "B.ide f \ B.ide f' \ B.ide g \ B.ide g'" using 1 B.isomorphic_implies_hpar by auto ultimately have "g' \ f' \\<^sub>B g \ f" using f'g' fg B.hcomp_isomorphic_ide B.hcomp_ide_isomorphic B.isomorphic_transitive B.isomorphic_implies_hpar by (meson B.hseqE B.ideD(1)) hence "h' \\<^sub>B g \ f" using f'g' B.isomorphic_symmetric B.isomorphic_transitive by blast thus "h' \ B.iso_class (g \ f)" using B.iso_class_def B.isomorphic_symmetric by simp qed qed qed thus ?thesis using assms B.is_iso_class_def B.ide_in_iso_class by auto qed lemma Comp_is_extensional: assumes "Comp G F \ {}" shows "B.is_iso_class F" and "B.is_iso_class G" and "F \ {}" and "G \ {}" using assms Comp_def by auto lemma Comp_eqI [intro]: assumes "h \ Comp G F" and "h' \ Comp G' F'" and "h \\<^sub>B h'" shows "Comp G F = Comp G' F'" proof - obtain f g where fg: "f \ F \ g \ G \ g \ f \\<^sub>B h" using assms comp_def by auto obtain f' g' where f'g': "f' \ F' \ g' \ G' \ g' \ f' \\<^sub>B h'" using assms by auto have "h \ Comp G F \ Comp G' F'" by (meson IntI assms in_CompE in_CompI B.isomorphic_symmetric B.isomorphic_transitive) hence "Comp G F \ Comp G' F' \ {}" by auto thus ?thesis using assms is_iso_class_Comp by (metis empty_iff B.iso_class_eq) qed lemma Comp_eq_iso_class_memb: assumes "h \ Comp G F" shows "Comp G F = \h\\<^sub>B" proof show "Comp G F \ \h\\<^sub>B" proof fix h' assume h': "h' \ Comp G F" obtain f g where fg: "f \ F \ g \ G \ g \ f \\<^sub>B h" using assms by auto obtain f' g' where f'g': "f' \ F \ g' \ G \ g' \ f' \\<^sub>B h'" using h' by auto have "f \\<^sub>B f' \ g \\<^sub>B g'" using assms fg f'g' in_HomD(6) B.iso_class_elems_isomorphic by auto moreover have "B.ide f \ B.ide f' \ B.ide g \ B.ide g'" using assms fg f'g' in_HomD [of F] in_HomD [of G] by (meson calculation B.isomorphic_implies_ide(1) B.isomorphic_implies_ide(2)) moreover have "src g = trg f \ src g = trg f' \ src g' = trg f \ src g' = trg f'" using fg f'g' by (metis B.seq_if_composable calculation(1) B.ideD(1) B.isomorphic_implies_hpar(1) B.isomorphic_implies_hpar(3) B.not_arr_null) ultimately have "g \ f \\<^sub>B g' \ f'" using fg f'g' B.hcomp_ide_isomorphic B.hcomp_isomorphic_ide B.isomorphic_transitive by metis thus "h' \ \h\\<^sub>B" using fg f'g' B.isomorphic_symmetric B.isomorphic_transitive B.iso_class_def [of h] by blast qed show "\h\\<^sub>B \ Comp G F" proof (unfold B.iso_class_def Comp_def) obtain f g where 1: "f \ F \ g \ G \ g \ f \\<^sub>B h" using assms in_HomD Comp_def by (meson in_CompE) show "{h'. B.isomorphic h h'} \ {h. B.is_iso_class F \ B.is_iso_class G \ (\f g. f \ F \ g \ G \ g \ f \\<^sub>B h)}" using assms 1 B.isomorphic_transitive by blast qed qed interpretation concrete_category \Collect B.obj\ Hom B.iso_class \\_ _ _. Comp\ proof show "\a. a \ Collect B.obj \ \a\\<^sub>B \ Hom a a" by (metis (mono_tags, lifting) B.ide_in_hom(1) mem_Collect_eq B.objE B.obj_is_self_adjoint(1)) show "\a b c F G. \ a \ Collect B.obj; b \ Collect B.obj; c \ Collect B.obj; F \ Hom a b; G \ Hom b c \ \ Comp G F \ Hom a c" proof - fix a b c F G assume a: "a \ Collect B.obj" and b: "b \ Collect B.obj" and c: "c \ Collect B.obj" and F: "F \ Hom a b" and G: "G \ Hom b c" obtain f where f: "\f : a \\<^sub>B b\ \ B.is_left_adjoint f \ F = \f\\<^sub>B" using F by blast obtain g where g: "\g : b \\<^sub>B c\ \ B.is_left_adjoint g \ G = \g\\<^sub>B" using G by blast have "{h. B.is_iso_class F \ B.is_iso_class G \ (\f g. f \ F \ \f : a \\<^sub>B b\ \ g \ G \ \g : b \\<^sub>B c\ \ g \ f \\<^sub>B h)} = \g \ f\\<^sub>B" proof show "{h. B.is_iso_class F \ B.is_iso_class G \ (\f g. f \ F \ \f : a \\<^sub>B b\ \ g \ G \ \g : b \\<^sub>B c\ \ g \ f \\<^sub>B h)} \ \g \ f\\<^sub>B" proof fix h assume "h \ {h. B.is_iso_class F \ B.is_iso_class G \ (\f g. f \ F \ \f : a \\<^sub>B b\ \ g \ G \ \g : b \\<^sub>B c\ \ g \ f \\<^sub>B h)}" hence h: "B.is_iso_class F \ B.is_iso_class G \ (\f g. f \ F \ \f : a \\<^sub>B b\ \ g \ G \ \g : b \\<^sub>B c\ \ g \ f \\<^sub>B h)" by simp show "h \ \g \ f\\<^sub>B" proof - obtain f' g' where f'g': "g' \ G \ f' \ F \ g' \ f' \\<^sub>B h" using h by auto obtain \ where \: "\\ : f \\<^sub>B f'\ \ B.iso \" using f f'g' F B.iso_class_def by auto obtain \ where \: "\\ : g \\<^sub>B g'\ \ B.iso \" using g f'g' G B.iso_class_def by auto have 1: "\\ \ \ : g \ f \\<^sub>B g' \ f'\" using f g \ \ by auto moreover have "B.iso (\ \ \)" using f g \ \ 1 B.iso_hcomp by auto ultimately show ?thesis using f'g' B.iso_class_def B.isomorphic_def by auto qed qed show "\g \ f\\<^sub>B \ {h. B.is_iso_class F \ B.is_iso_class G \ (\f g. f \ F \ \f : a \\<^sub>B b\ \ g \ G \ \g : b \\<^sub>B c\ \ g \ f \\<^sub>B h)}" using f g B.iso_class_def B.isomorphic_reflexive B.left_adjoint_is_ide B.is_iso_classI by blast qed hence 1: "\gf. gf \ B.iso_class (g \ f) \ B.is_iso_class F \ B.is_iso_class G \ (\f g. f \ F \ \f : a \\<^sub>B b\ \ g \ G \ \g : b \\<^sub>B c\ \ g \ f \\<^sub>B gf)" by blast show "Comp G F \ Hom a c" proof - have gf: "B.is_left_adjoint (g \ f)" by (meson f g B.hseqE B.hseqI B.left_adjoints_compose) obtain gf' where gf': "B.adjoint_pair (g \ f) gf'" using gf by blast hence "\g \ f\\<^sub>B = Comp G F" using 1 Comp_eq_iso_class_memb B.ide_in_iso_class B.left_adjoint_is_ide by blast thus ?thesis using f g gf' by blast qed qed show "\a b F. \ a \ Collect B.obj; F \ Hom a b \ \ Comp F \a\\<^sub>B = F" proof - fix a b F assume a: "a \ Collect B.obj" assume F: "F \ Hom a b" obtain f where f: "\f : a \\<^sub>B b\ \ B.is_left_adjoint f \ F = \f\\<^sub>B" using F by auto have *: "\f'. f' \ F \ \f' : a \\<^sub>B b\ \ B.ide f' \ f \\<^sub>B f'" using f B.iso_class_def by force show "Comp F \a\\<^sub>B = F" proof show "Comp F \a\\<^sub>B \ F" proof fix h assume "h \ Comp F \a\\<^sub>B" hence h: "\f' a'. f' \ F \ a' \ \a\\<^sub>B \ f' \ a' \\<^sub>B h" unfolding Comp_def by auto obtain f' a' where f'a': "f' \ F \ a' \ \a\\<^sub>B \ f' \ a' \\<^sub>B h" using h by auto have "B.isomorphic f h" proof - have "B.isomorphic f (f \ a)" using f B.iso_runit' [of f] B.isomorphic_def B.left_adjoint_is_ide by blast also have "f \ a \\<^sub>B f' \ a" using f f'a' B.iso_class_def B.hcomp_isomorphic_ide apply (elim conjE B.in_hhomE) by auto also have "f' \ a \\<^sub>B f' \ a'" using f'a' * [of f'] B.iso_class_def B.hcomp_ide_isomorphic by auto also have "f' \ a' \\<^sub>B h" using f'a' by simp finally show ?thesis by blast qed thus "h \ F" using f B.iso_class_def by simp qed show "F \ Comp F \a\\<^sub>B" proof fix h assume h: "h \ F" have "f \ F" using f B.iso_class_def B.right_adjoint_determines_left_up_to_iso by auto moreover have "a \ B.iso_class a" using a B.iso_class_def B.isomorphic_reflexive by auto moreover have "f \ a \\<^sub>B h" proof - have "f \ a \\<^sub>B f" using f B.iso_runit [of f] B.isomorphic_def B.left_adjoint_is_ide by blast also have "f \\<^sub>B h" using h * by simp finally show ?thesis by blast qed ultimately show "h \ Comp F \a\\<^sub>B" unfolding Comp_def using a f F B.is_iso_classI B.left_adjoint_is_ide by auto qed qed qed show "\a b F. \ b \ Collect B.obj; F \ Hom a b \ \ Comp \b\\<^sub>B F = F" proof - fix a b F assume b: "b \ Collect B.obj" assume F: "F \ Hom a b" obtain f where f: "\f : a \\<^sub>B b\ \ B.is_left_adjoint f \ F = \f\\<^sub>B" using F by auto have *: "\f'. f' \ F \ \f' : a \\<^sub>B b\ \ B.ide f' \ f \\<^sub>B f'" using f B.iso_class_def by force show "Comp \b\\<^sub>B F = F" proof show "Comp \b\\<^sub>B F \ F" proof fix h assume "h \ Comp \b\\<^sub>B F" hence h: "\b' f'. b' \ \b\\<^sub>B \ f' \ F \ b' \ f' \\<^sub>B h" unfolding Comp_def by auto obtain b' f' where b'f': "b' \ \b\\<^sub>B \ f' \ F \ b' \ f' \\<^sub>B h" using h by auto have "f \\<^sub>B h" proof - have "f \\<^sub>B b \ f" using f B.iso_lunit' [of f] B.isomorphic_def B.left_adjoint_is_ide by blast also have "... \\<^sub>B b \ f'" using f b'f' B.iso_class_def B.hcomp_ide_isomorphic by (elim conjE B.in_hhomE, auto) also have "... \\<^sub>B b' \ f'" using b'f' * [of f'] B.iso_class_def B.hcomp_isomorphic_ide by auto also have "... \\<^sub>B h" using b'f' by simp finally show ?thesis by blast qed thus "h \ F" using f B.iso_class_def by simp qed show "F \ Comp \b\\<^sub>B F" proof fix h assume h: "h \ F" have "f \ F" using f B.iso_class_def B.right_adjoint_determines_left_up_to_iso by auto moreover have "b \ B.iso_class b" using b B.iso_class_def B.isomorphic_reflexive by auto moreover have "b \ f \\<^sub>B h" proof - have "b \ f \\<^sub>B f" using f B.iso_lunit [of f] B.isomorphic_def B.left_adjoint_is_ide by blast also have "f \\<^sub>B h" using h * by simp finally show ?thesis by blast qed ultimately show "h \ Comp \b\\<^sub>B F" unfolding Comp_def using b f F B.is_iso_classI B.left_adjoint_is_ide by auto qed qed qed show "\a b c d F G H. \ a \ Collect B.obj; b \ Collect B.obj; c \ Collect B.obj; d \ Collect B.obj; F \ Hom a b; G \ Hom b c; H \ Hom c d \ \ Comp H (Comp G F) = Comp (Comp H G) F" proof - fix a b c d F G H assume F: "F \ Hom a b" and G: "G \ Hom b c" and H: "H \ Hom c d" show "Comp H (Comp G F) = Comp (Comp H G) F" proof show "Comp H (Comp G F) \ Comp (Comp H G) F" proof fix x assume x: "x \ Comp H (Comp G F)" obtain f g h gf where 1: "B.is_iso_class F \ B.is_iso_class G \ B.is_iso_class H \ h \ H \ g \ G \ f \ F \ gf \ Comp G F \ g \ f \\<^sub>B gf \ h \ gf \\<^sub>B x" using x unfolding Comp_def by blast have hgf: "B.ide f \ B.ide g \ B.ide h" using 1 F G H B.isomorphic_implies_hpar in_HomD B.left_adjoint_is_ide by (metis (mono_tags, lifting)) have "h \ g \ f \\<^sub>B x" proof - have "h \ g \ f \\<^sub>B h \ gf" using 1 hgf B.hcomp_ide_isomorphic by (metis (full_types) B.isomorphic_implies_hpar(1) B.isomorphic_reflexive B.isomorphic_symmetric B.seq_if_composable) also have "h \ gf \\<^sub>B x" using 1 by simp finally show ?thesis by blast qed moreover have "(h \ g) \ f \\<^sub>B h \ g \ f" using 1 hgf B.iso_assoc B.assoc_in_hom B.isomorphic_def by (metis B.hseq_char B.ideD(1-3) B.isomorphic_implies_hpar(1) B.trg_hcomp calculation) moreover have hg: "\h \ g : b \\<^sub>B d\" using G H 1 in_HomD(4) by blast moreover have "h \ g \ Comp H G" unfolding Comp_def using 1 hgf F G H in_HomD [of F a b] in_HomD [of G b c] in_HomD [of H c d] B.isomorphic_reflexive B.hcomp_ide_isomorphic B.hseqI' by (metis (no_types, lifting) B.hseqE B.hseqI mem_Collect_eq) ultimately show "x \ Comp (Comp H G) F" using 1 F G H hgf B.is_iso_class_def is_iso_class_Comp [of H G] B.isomorphic_reflexive [of "h \ g"] apply (intro in_CompI) apply auto[7] apply blast apply simp by (meson B.isomorphic_symmetric B.isomorphic_transitive) qed show "Comp (Comp H G) F \ Comp H (Comp G F)" proof fix x assume x: "x \ Comp (Comp H G) F" obtain f g h hg where 1: "B.is_iso_class F \ B.is_iso_class G \ B.is_iso_class H \ h \ H \ g \ G \ f \ F \ hg \ Comp H G \ h \ g \\<^sub>B hg \ hg \ f \\<^sub>B x" using x unfolding Comp_def by blast have hgf: "B.ide f \ B.ide g \ B.ide h \ src h = trg g \ src g = trg f" using 1 F G H in_HomD B.left_adjoint_is_ide by (metis (no_types, lifting) B.hseq_char' B.ideD(1) B.ide_dom B.in_homE B.isomorphic_def B.isomorphic_symmetric B.seqI' B.seq_if_composable B.src_dom B.src_hcomp B.vseq_implies_hpar(1)) have 2: "(h \ g) \ f \\<^sub>B x" proof - have "(h \ g) \ f \\<^sub>B hg \ f" using 1 F G H hgf by (simp add: B.hcomp_isomorphic_ide) also have "hg \ f \\<^sub>B x" using 1 by simp finally show ?thesis by blast qed moreover have "(h \ g) \ f \\<^sub>B h \ g \ f" using hgf B.iso_assoc B.assoc_in_hom B.isomorphic_def by auto moreover have "g \ f \ Comp G F" using 1 F G hgf B.isomorphic_reflexive by blast ultimately show "x \ Comp H (Comp G F)" using 1 hgf is_iso_class_Comp [of G F] B.isomorphic_reflexive [of "g \ f"] apply (intro in_CompI) apply auto[6] apply simp apply auto[1] by (meson B.isomorphic_symmetric B.isomorphic_transitive) qed qed qed qed lemma is_concrete_category: shows "concrete_category (Collect B.obj) Hom B.iso_class (\_ _ _. Comp)" .. sublocale concrete_category \Collect B.obj\ Hom B.iso_class \\_ _ _. Comp\ using is_concrete_category by simp abbreviation comp (infixr "\" 55) where "comp \ COMP" notation in_hom ("\_ : _ \ _\") no_notation B.in_hom ("\_ : _ \\<^sub>B _\") lemma Map_memb_in_hhom: assumes "\F : A \ B\" and "f \ Map F" shows "\f : Dom A \\<^sub>B Dom B\" proof - have "\f : Dom F \\<^sub>B Cod F\" using assms arr_char [of F] in_HomD [of "Map F" "Dom F" "Cod F"] by blast moreover have "Dom F = Dom A" using assms by auto moreover have "Cod F = Dom B" using assms by auto ultimately show ?thesis by simp qed lemma MkArr_in_hom': assumes "B.is_left_adjoint f" and "\f : a \\<^sub>B b\" shows "\MkArr a b \f\\<^sub>B : MkIde a \ MkIde b\" using assms MkArr_in_hom by blast text \ The isomorphisms in \Maps(B)\ are the isomorphism classes of equivalence maps in \B\. \ lemma iso_char: shows "iso F \ arr F \ (\f. f \ Map F \ B.equivalence_map f)" proof assume F: "iso F" have "\f. f \ Map F \ B.equivalence_map f" proof - fix f assume f: "f \ Map F" obtain G where G: "inverse_arrows F G" using F by auto obtain g where g: "g \ Map G" using G arr_char [of G] in_HomD(1) by blast have f: "f \ Map F \ \f : Dom F \\<^sub>B Cod F\ \ B.ide f \ B.is_left_adjoint f" by (metis (mono_tags, lifting) F iso_is_arr is_concrete_category concrete_category.arr_char f in_HomD(2,4-5) B.iso_class_memb_is_ide) have g: "g \ Map G \ \g : Cod F \\<^sub>B Dom F\ \ B.ide g \ B.is_left_adjoint g" by (metis (no_types, lifting) F G Cod_cod Cod_dom arr_inv cod_inv dom_inv inverse_unique iso_is_arr is_concrete_category concrete_category.Map_in_Hom g in_HomD(2,4-5) B.iso_class_memb_is_ide) have "src (g \ f) \\<^sub>B g \ f" proof - have "g \ f \ Map (G \ F)" proof - have 1: "f \ Map F \ g \ Map G \ g \ f \\<^sub>B g \ f" using F G f g B.isomorphic_reflexive by force have 2: "Dom G = Cod F \ Cod G = Dom F" using F G arr_char by (metis (no_types, lifting) Cod.simps(1) Cod_dom arr_inv cod_char comp_inv_arr dom_inv inverse_unique iso_is_arr is_concrete_category concrete_category.Cod_comp) have "g \ f \ Comp (Map G) (Map F)" using 1 F iso_is_arr Map_in_Hom [of F] in_HomD(2) apply (intro in_CompI, auto) proof - show "B.is_iso_class (Map G)" using G iso_is_arr Map_in_Hom [of G] in_HomD(2) [of "Map G"] by blast qed thus ?thesis using F G f g comp_char [of G F] by auto qed moreover have "Dom F \ Map (G \ F)" by (metis (no_types, lifting) F G Map_dom comp_inv_arr iso_is_arr g B.ide_in_iso_class B.in_hhomE B.objE) moreover have "Map (G \ F) = \Dom F\\<^sub>B" by (simp add: F G comp_inv_arr iso_is_arr) moreover have "Dom F = src (g \ f)" using f g by fastforce ultimately show ?thesis using f g B.iso_class_elems_isomorphic B.is_iso_classI by (metis B.hseqI B.ide_src) qed moreover have "f \ g \\<^sub>B trg f" proof - have "f \ g \ Map (F \ G)" proof - have 1: "f \ Map F \ g \ Map G \ f \ g \\<^sub>B f \ g" using F G f g B.isomorphic_reflexive by force have 2: "Dom G = Cod F \ Cod G = Dom F" using F G arr_char by (metis (no_types, lifting) Cod.simps(1) Cod_dom arr_inv cod_char comp_inv_arr dom_inv inverse_unique iso_is_arr is_concrete_category concrete_category.Cod_comp) hence "f \ g \ Comp (Map F) (Map G)" using 1 F iso_is_arr Map_in_Hom [of F] in_HomD(2) apply (intro in_CompI, auto) proof - show "B.is_iso_class (Map G)" using G iso_is_arr Map_in_Hom [of G] in_HomD(2) [of "Map G"] by blast qed thus ?thesis using F G f g comp_char [of F G] by auto qed moreover have "Cod F \ Map (F \ G)" by (metis (no_types, lifting) F G Map_cod comp_arr_inv dom_inv inverse_unique iso_is_arr g B.ide_in_iso_class B.in_hhomE B.src.preserves_ide) moreover have "Map (F \ G) = \Cod F\\<^sub>B" by (metis (no_types, lifting) F G Map_cod comp_arr_inv dom_inv inverse_unique iso_is_arr) moreover have "Cod F = trg (f \ g)" using f g by fastforce ultimately show ?thesis using B.iso_class_elems_isomorphic by (metis f g B.is_iso_classI B.in_hhomE B.src.preserves_ide) qed ultimately show "B.equivalence_map f" using f g B.equivalence_mapI B.quasi_inversesI [of f g] by fastforce qed thus "arr F \ (\f. f \ Map F \ B.equivalence_map f)" using F by blast next assume F: "arr F \ (\f. f \ Map F \ B.equivalence_map f)" show "iso F" proof - obtain f where f: "f \ Map F" using F arr_char in_HomD(1) by blast have f_in_hhom: "\f : Dom F \\<^sub>B Cod F\" using f F arr_char in_HomD(4) [of "Map F" "Dom F" "Cod F" f] by simp have "Map F = B.iso_class f" using f F arr_char in_HomD(6) [of "Map F" "Dom F" "Cod F" f] by simp obtain g \ \' where \': "equivalence_in_bicategory V H \ \ src trg f g \ \'" using f F B.equivalence_map_def by auto interpret \': equivalence_in_bicategory V H \ \ src trg f g \ \' using \' by auto obtain \ where \: "adjoint_equivalence_in_bicategory V H \ \ src trg f g \ \" using f F \'.ide_right \'.antipar \'.unit_in_hom \'.unit_is_iso B.equivalence_map_def B.equivalence_refines_to_adjoint_equivalence [of f g \] by auto interpret \: adjoint_equivalence_in_bicategory V H \ \ src trg f g \ \ using \ by simp have g_in_hhom: "\g : Cod F \\<^sub>B Dom F\" using \.ide_right \.antipar f_in_hhom by auto have fg: "B.quasi_inverses f g" using B.quasi_inverses_def \.equivalence_in_bicategory_axioms by auto have g: "\g : Cod F \\<^sub>B Dom F\ \ B.is_left_adjoint g \ \g\\<^sub>B = \g\\<^sub>B" using \'.dual_equivalence B.equivalence_is_left_adjoint B.equivalence_map_def g_in_hhom by blast have F_as_MkArr: "F = MkArr (Dom F) (Cod F) \f\\<^sub>B" using F MkArr_Map \Map F = B.iso_class f\ by fastforce have F_in_hom: "in_hom F (MkIde (Dom F)) (MkIde (Cod F))" using F arr_char dom_char cod_char by (intro in_homI, auto) let ?G = "MkArr (Cod F) (Dom F) \g\\<^sub>B" have "arr ?G" using MkArr_in_hom' g by blast hence G_in_hom: "\?G : MkIde (Cod F) \ MkIde (Dom F)\" using arr_char MkArr_in_hom by simp have "inverse_arrows F ?G" proof show "ide (?G \ F)" proof - have "?G \ F = dom F" proof (intro arr_eqI) show 1: "seq ?G F" using F_in_hom G_in_hom by blast show "arr (dom F)" using F_in_hom ide_dom by fastforce show "Dom (?G \ F) = Dom (dom F)" using F_in_hom G_in_hom 1 comp_char by auto show "Cod (?G \ F) = Cod (dom F)" using F_in_hom G_in_hom 1 comp_char by auto show "Map (?G \ F) = Map (dom F)" proof - have "Map (?G \ F) = Comp \g\\<^sub>B \f\\<^sub>B" using 1 comp_char [of ?G F] \Map F = B.iso_class f\ by simp also have "... = \g \ f\\<^sub>B" proof - have "g \ f \ Comp \g\\<^sub>B \f\\<^sub>B" by (metis \.ide_left \.ide_right \.unit_in_vhom \.unit_simps(3) B.arrI B.ide_cod B.ide_in_iso_class in_CompI B.is_iso_classI B.isomorphic_reflexive) thus ?thesis using Comp_eq_iso_class_memb F_in_hom G_in_hom arr_char arr_char \Map F = B.iso_class f\ by auto qed also have "... = \src f\\<^sub>B" using \.unit_in_hom \.unit_is_iso B.isomorphic_def B.iso_class_def B.isomorphic_symmetric by (intro B.iso_class_eqI, blast) also have "... = \Dom F\\<^sub>B" using \.ide_left f_in_hhom B.ide_in_iso_class B.in_hhomE B.src.preserves_ide B.isomorphic_reflexive by (intro B.iso_class_eqI, fastforce) also have "... = Map (dom F)" using F_in_hom dom_char by auto finally show ?thesis by blast qed qed thus ?thesis using F by simp qed show "ide (F \ ?G)" proof - have "F \ ?G = cod F" proof (intro arr_eqI) show 1: "seq F ?G" using F_in_hom G_in_hom by blast show "arr (cod F)" using F_in_hom ide_cod by fastforce show "Dom (F \ ?G) = Dom (cod F)" using F_in_hom G_in_hom 1 comp_char by auto show "Cod (F \ ?G) = Cod (cod F)" using F_in_hom G_in_hom 1 comp_char by auto show "Map (F \ ?G) = Map (cod F)" proof - have "Map (F \ ?G) = Comp \f\\<^sub>B \g\\<^sub>B" using 1 comp_char [of F ?G] \Map F = \f\\<^sub>B\ by simp also have "... = \f \ g\\<^sub>B" proof - have "f \ g \ Comp \f\\<^sub>B \g\\<^sub>B" by (metis \.antipar(1) \.ide_left \.ide_right B.ide_hcomp B.ide_in_iso_class in_CompI B.is_iso_classI B.isomorphic_reflexive) thus ?thesis using Comp_eq_iso_class_memb F_in_hom G_in_hom arr_char arr_char \Map F = \f\\<^sub>B\ by auto qed also have "... = \trg f\\<^sub>B" proof - have "trg f \ \f \ g\\<^sub>B" using \.counit_in_hom \.counit_is_iso B.isomorphic_def B.iso_class_def B.isomorphic_symmetric by blast thus ?thesis using B.iso_class_eqI by (metis \.antipar(1) \.ide_left \.ide_right B.ide_hcomp B.ide_in_iso_class B.is_iso_classI B.iso_class_elems_isomorphic) qed also have "... = \Cod F\\<^sub>B" using f_in_hhom by auto also have "... = Map (cod F)" using F_in_hom dom_char by auto finally show ?thesis by blast qed qed thus ?thesis using F by simp qed qed thus ?thesis by auto qed qed lemma iso_char': shows "iso F \ arr F \ (\f. f \ Map F \ B.equivalence_map f)" proof - have "arr F \ (\f. f \ Map F \ B.equivalence_map f) \ (\f. f \ Map F \ B.equivalence_map f)" proof assume F: "arr F" show "(\f. f \ Map F \ B.equivalence_map f) \ (\f. f \ Map F \ B.equivalence_map f)" using F arr_char in_HomD(1) by blast show "(\f. f \ Map F \ B.equivalence_map f) \ (\f. f \ Map F \ B.equivalence_map f)" by (metis (no_types, lifting) F is_concrete_category concrete_category.arr_char B.equivalence_map_preserved_by_iso in_HomD(2) B.iso_class_elems_isomorphic) qed thus ?thesis using iso_char by blast qed text \ The following mapping takes a map in \B\ to the corresponding arrow of \Maps(B)\. \ abbreviation CLS ("\\_\\") where "\\f\\ \ MkArr (src f) (trg f) \f\\<^sub>B" lemma ide_CLS_obj: assumes "B.obj a" shows "ide \\a\\" by (simp add: assms B.obj_simps) lemma CLS_in_hom: assumes "B.is_left_adjoint f" shows "\\\f\\ : \\src f\\ \ \\trg f\\\" using assms B.left_adjoint_is_ide MkArr_in_hom MkArr_in_hom' by simp lemma CLS_eqI: assumes "B.ide f" shows "\\f\\ = \\g\\ \ f \\<^sub>B g" by (metis arr.inject assms B.ide_in_iso_class B.iso_class_def B.iso_class_eqI B.isomorphic_implies_hpar(3) B.isomorphic_implies_hpar(4) B.isomorphic_symmetric mem_Collect_eq) lemma CLS_hcomp: assumes "B.ide f" and "B.ide g" and "src f = trg g" shows "\\f \ g\\ = MkArr (src g) (trg f) (Comp \f\\<^sub>B \g\\<^sub>B)" proof - have "\\f \ g\\ = MkArr (src g) (trg f) \f \ g\\<^sub>B" using assms B.left_adjoint_is_ide by simp moreover have "\f \ g\\<^sub>B = Comp \f\\<^sub>B \g\\<^sub>B" proof show "\f \ g\\<^sub>B \ Comp \f\\<^sub>B \g\\<^sub>B" by (metis assms(1-2) B.ide_in_iso_class in_CompI B.is_iso_classI B.iso_class_def mem_Collect_eq subsetI) show "Comp \f\\<^sub>B \g\\<^sub>B \ \f \ g\\<^sub>B" by (metis Comp_eq_iso_class_memb \\f \ g\\<^sub>B \ Comp \f\\<^sub>B \g\\<^sub>B\ assms(1-3) B.ide_hcomp B.ide_in_iso_class subset_iff) qed ultimately show ?thesis by simp qed lemma comp_CLS: assumes "B.is_left_adjoint f" and "B.is_left_adjoint g" and "f \ g \\<^sub>B h" shows "\\f\\ \ \\g\\ = \\h\\" proof - have hseq_fg: "B.hseq f g" using assms B.isomorphic_implies_hpar(1) by simp have "seq \\f\\ \\g\\" using assms hseq_fg CLS_in_hom [of f] CLS_in_hom [of g] apply (elim B.hseqE) by auto hence "\\f\\ \ \\g\\ = MkArr (src g) (trg f) (Comp \f\\<^sub>B \g\\<^sub>B)" using comp_char [of "CLS f" "CLS g"] by simp also have "... = \\f \ g\\" using assms hseq_fg CLS_hcomp apply (elim B.hseqE) using B.adjoint_pair_antipar(1) by auto also have "... = \\h\\" using assms B.isomorphic_symmetric by (simp add: assms(3) B.iso_class_eqI B.isomorphic_implies_hpar(3) B.isomorphic_implies_hpar(4)) finally show ?thesis by simp qed text \ The following mapping that takes an arrow of \Maps(B)\ and chooses some representative map in \B\. \ definition REP where "REP F \ if arr F then SOME f. f \ Map F else B.null" lemma REP_in_Map: assumes "arr A" shows "REP A \ Map A" proof - have "Map A \ {}" using assms arr_char in_HomD(1) by blast thus ?thesis using assms REP_def someI_ex [of "\f. f \ Map A"] by auto qed lemma REP_in_hhom [intro]: assumes "in_hom F A B" shows "\REP F : src (REP A) \\<^sub>B src (REP B)\" and "B.is_left_adjoint (REP F)" proof - have "Map F \ {}" using assms in_hom_char arr_char null_char in_HomD(1) [of "Map F" "Dom F" "Cod F"] by blast hence 1: "REP F \ Map F" using assms REP_def someI_ex [of "\f. f \ Map F"] by auto hence 2: "B.arr (REP F)" using assms 1 in_hom_char [of F A B] B.iso_class_def Map_memb_in_hhom B.in_hhom_def by blast hence "\REP F : Dom A \\<^sub>B Dom B\" using assms 1 in_hom_char [of F A B] Map_memb_in_hhom by auto thus "\REP F : src (REP A) \\<^sub>B src (REP B)\" using assms by (metis (no_types, lifting) Map_memb_in_hhom ideD(1) in_homI in_hom_char REP_in_Map B.in_hhom_def) have "REP F \ \REP F\\<^sub>B" using assms 1 2 arr_char [of F] in_HomD(6) B.ide_in_iso_class B.iso_class_memb_is_ide in_hom_char by blast thus "B.is_left_adjoint (REP F)" using assms 1 2 arr_char in_HomD(5) [of "Map F" "Dom F" "Cod F" "REP F"] by auto qed lemma ide_REP: assumes "arr A" shows "B.ide (REP A)" using assms REP_in_hhom(2) B.adjoint_pair_antipar(1) by blast lemma REP_simps [simp]: assumes "arr A" shows "B.ide (REP A)" and "src (REP A) = Dom A" and "trg (REP A) = Cod A" and "B.dom (REP A) = REP A" and "B.cod (REP A) = REP A" proof - show "B.ide (REP A)" using assms ide_REP by blast show "src (REP A) = Dom A" using assms REP_in_hhom by (metis (no_types, lifting) Map_memb_in_hhom Dom_dom in_homI REP_in_Map B.in_hhom_def) show "trg (REP A) = Cod A" using assms REP_in_hhom by (metis (no_types, lifting) Map_memb_in_hhom Dom_cod in_homI REP_in_Map B.in_hhom_def) show "B.dom (REP A) = REP A" using assms in_homI REP_in_hhom(2) B.adjoint_pair_antipar(1) B.ideD(2) by blast show "B.cod (REP A) = REP A" using assms in_homI REP_in_hhom(2) B.adjoint_pair_antipar(1) B.ideD(3) by blast qed lemma isomorphic_REP_src: assumes "ide A" shows "REP A \\<^sub>B src (REP A)" using assms by (metis (no_types, lifting) ideD(1) ide_char REP_in_Map ide_REP REP_simps(2) B.is_iso_classI B.ide_in_iso_class B.iso_class_elems_isomorphic B.src.preserves_ide) lemma isomorphic_REP_trg: assumes "ide A" shows "REP A \\<^sub>B trg (REP A)" using assms ide_char isomorphic_REP_src by auto lemma CLS_REP: assumes "arr F" shows "\\REP F\\ = F" by (metis (mono_tags, lifting) MkArr_Map is_concrete_category REP_in_Map REP_simps(2) REP_simps(3) assms concrete_category.Map_in_Hom in_HomD(6)) lemma REP_CLS: assumes "B.is_left_adjoint f" shows "REP \\f\\ \\<^sub>B f" by (metis (mono_tags, lifting) CLS_in_hom Map.simps(1) in_homE REP_in_Map assms B.iso_class_def B.isomorphic_symmetric mem_Collect_eq) lemma isomorphic_hcomp_REP: assumes "seq F G" shows "REP F \ REP G \\<^sub>B REP (F \ G)" proof - have 1: "Dom F = Cod G" using assms seq_char by simp have 2: "Map F = B.iso_class (REP F)" using assms seq_char arr_char REP_in_Map in_HomD(6) by meson have 3: "Map G = B.iso_class (REP G)" using assms seq_char arr_char REP_in_Map in_HomD(6) [of "Map G" "Dom G" "Cod G" "REP G"] by auto have "Map (F \ G) = Comp \REP F\\<^sub>B \REP G\\<^sub>B" using assms seq_char null_char by (metis (no_types, lifting) CLS_REP Map.simps(1) Map_comp) have "Comp \REP F\\<^sub>B \REP G\\<^sub>B = \REP F \ REP G\\<^sub>B" proof - have "REP F \ REP G \ Comp \REP F\\<^sub>B \REP G\\<^sub>B" proof - have "REP F \ Map F \ REP G \ Map G" using assms seq_char REP_in_Map by auto moreover have "REP F \ REP G \\<^sub>B REP F \ REP G" using assms seq_char 2 B.isomorphic_reflexive by auto ultimately show ?thesis using assms 1 2 3 B.iso_class_def B.is_iso_class_def by (intro in_CompI, auto) qed moreover have "\REP F\\<^sub>B \ Hom (Cod G) (Cod F)" using assms 1 2 arr_char [of F] by auto moreover have "\REP G\\<^sub>B \ Hom (Dom G) (Cod G)" using assms 1 3 arr_char [of G] by auto ultimately show ?thesis using Comp_eq_iso_class_memb assms arr_char arr_char REP_in_Map by (simp add: Comp_def) qed moreover have "REP (F \ G) \ Comp \REP F\\<^sub>B \REP G\\<^sub>B" proof - have "Map (F \ G) = Comp (Map F) (Map G)" using assms 1 comp_char [of F G] by simp thus ?thesis using assms 1 2 3 REP_in_Map [of "F \ G"] by simp qed ultimately show ?thesis using B.iso_class_def by simp qed text \ We now show that \Maps(B)\ has pullbacks. For this we need to exhibit functions \PRJ\<^sub>0\ and \PRJ\<^sub>1\ that produce the legs of the pullback of a cospan \(H, K)\ and verify that they have the required universal property. These are obtained by choosing representatives \h\ and \k\ of \H\ and \K\, respectively, and then taking \PRJ\<^sub>0 = CLS (tab\<^sub>0 (k\<^sup>* \ h))\ and \PRJ\<^sub>1 = CLS (tab\<^sub>1 (k\<^sup>* \ h))\. That these constitute a pullback in \Maps(B)\ follows from the fact that \tab\<^sub>0 (k\<^sup>* \ h)\ and \tab\<^sub>1 (k\<^sup>* \ h)\ form a pseudo-pullback of \(h, k)\ in the underlying bicategory. For our purposes here, it is not sufficient simply to show that \Maps(B)\ has pullbacks and then to treat it as an abstract ``category with pullbacks'' where the pullbacks are chosen arbitrarily. Instead, we have to retain the connection between a pullback in Maps and the tabulation of \k\<^sup>* \ h\ that is ultimately used to obtain it. If we don't do this, then it becomes problematic to define the compositor of a pseudofunctor from the underlying bicategory \B\ to \Span(Maps(B))\, because the components will go from the apex of a composite span (obtained by pullback) to the apex of a tabulation (chosen arbitrarily using \BS2\) and these need not be in agreement with each other. \ definition PRJ\<^sub>0 where "PRJ\<^sub>0 \ \K H. if cospan K H then \\B.tab\<^sub>0 ((REP K)\<^sup>* \ (REP H))\\ else null" definition PRJ\<^sub>1 where "PRJ\<^sub>1 \ \K H. if cospan K H then \\B.tab\<^sub>1 ((REP K)\<^sup>* \ (REP H))\\ else null" interpretation elementary_category_with_pullbacks comp PRJ\<^sub>0 PRJ\<^sub>1 proof show "\H K. \ cospan K H \ PRJ\<^sub>0 K H = null" unfolding PRJ\<^sub>0_def by auto show "\H K. \ cospan K H \ PRJ\<^sub>1 K H = null" unfolding PRJ\<^sub>1_def by auto show "\H K. cospan K H \ commutative_square K H (PRJ\<^sub>1 K H) (PRJ\<^sub>0 K H)" proof - fix H K assume HK: "cospan K H" define h where "h = REP H" define k where "k = REP K" have h: "h \ Map H" using h_def HK REP_in_Map by blast have k: "k \ Map K" using k_def HK REP_in_Map by blast have 1: "B.is_left_adjoint h \ B.is_left_adjoint k \ B.ide h \ B.ide k \ trg h = trg k" using h k h_def k_def HK arr_char cod_char B.in_hhom_def B.left_adjoint_is_ide in_HomD(5) [of "Map H" "Dom H" "Cod H" h] in_HomD(5) [of "Map K" "Dom K" "Cod K" k] apply auto by (metis (no_types, lifting) HK Dom_cod) interpret h: map_in_bicategory \(\)\ \(\)\ \ \ src trg h using 1 by unfold_locales auto interpret k: map_in_bicategory \(\)\ \(\)\ \ \ src trg k using 1 by unfold_locales auto interpret hk: cospan_of_maps_in_bicategory_of_spans \(\)\ \(\)\ \ \ src trg h k using 1 by unfold_locales auto let ?f = "B.tab\<^sub>0 (k\<^sup>* \ h)" let ?g = "B.tab\<^sub>1 (k\<^sup>* \ h)" have span: "span \\?f\\ \\?g\\" using dom_char CLS_in_hom [of ?f] CLS_in_hom [of ?g] by auto have seq: "seq H \\?f\\" using HK seq_char hk.leg0_is_map CLS_in_hom h_def hk.p\<^sub>0_simps hk.satisfies_T0 by fastforce have seq': "seq K \\?g\\" using HK k arr_char dom_char cod_char in_HomD(5) hk.leg1_is_map CLS_in_hom by (metis (no_types, lifting) Cod.simps(1) seq_char REP_simps(2) hk.p\<^sub>1_simps k_def span) show "commutative_square K H (PRJ\<^sub>1 K H) (PRJ\<^sub>0 K H)" proof show "cospan K H" using HK by simp show "dom K = cod (PRJ\<^sub>1 K H)" using seq' PRJ\<^sub>1_def HK h_def k_def by auto show "span (PRJ\<^sub>1 K H) (PRJ\<^sub>0 K H)" unfolding PRJ\<^sub>0_def PRJ\<^sub>1_def using HK span h_def k_def by simp show "K \ PRJ\<^sub>1 K H = H \ PRJ\<^sub>0 K H" proof - have iso: "h \ ?f \\<^sub>B k \ ?g" using hk.\_uniqueness B.isomorphic_symmetric B.isomorphic_def by blast have *: "Comp (Map H) \?f\\<^sub>B = Comp (Map K) \?g\\<^sub>B" proof (intro Comp_eqI) show "h \ ?f \ Comp (Map H) \B.tab\<^sub>0 (k\<^sup>* \ h)\\<^sub>B" proof (unfold Comp_def) have "B.is_iso_class \?f\\<^sub>B" by (simp add: B.is_iso_classI) moreover have "B.is_iso_class (Map H)" using CLS_REP HK Map.simps(1) B.is_iso_classI h.ide_left h_def by (metis (no_types, lifting)) moreover have "?f \ \B.tab\<^sub>0 (k\<^sup>* \ h)\\<^sub>B" by (simp add: B.ide_in_iso_class(1)) moreover have "\?f : src (B.tab\<^sub>0 (k\<^sup>* \ h)) \\<^sub>B Dom H\" using seq seq_char by simp moreover have "h \ Map H" by fact moreover have "\h : Dom H \\<^sub>B Cod H\" by (simp add: HK h_def) moreover have "h \ ?f \\<^sub>B h \ ?f" using B.isomorphic_reflexive by auto ultimately show "h \ B.tab\<^sub>0 (k\<^sup>* \ h) \ {h'. B.is_iso_class \B.tab\<^sub>0 (k\<^sup>* \ h)\\<^sub>B \ B.is_iso_class (Map H) \ (\f g. f \ \B.tab\<^sub>0 (k\<^sup>* \ h)\\<^sub>B \ g \ Map H \ g \ f \\<^sub>B h')}" by auto qed show "k \ ?g \ Comp (Map K) \B.tab\<^sub>1 (k\<^sup>* \ h)\\<^sub>B" proof (unfold Comp_def) have "B.is_iso_class \?g\\<^sub>B" by (simp add: B.is_iso_classI) moreover have "B.is_iso_class (Map K)" by (metis (no_types, lifting) CLS_REP HK Map.simps(1) B.is_iso_classI k.ide_left k_def) moreover have "?g \ \B.tab\<^sub>1 (k\<^sup>* \ h)\\<^sub>B" by (simp add: B.ide_in_iso_class(1)) moreover have "\?g : src (B.tab\<^sub>1 (k\<^sup>* \ h)) \\<^sub>B Dom K\" using seq seq_char B.in_hhom_def seq' by auto moreover have "k \ Map K" by fact moreover have "\k : Dom K \\<^sub>B Cod K\" by (simp add: HK k_def) moreover have "k \ ?g \\<^sub>B k \ ?g" using B.isomorphic_reflexive iso B.isomorphic_implies_hpar(2) by auto ultimately show "k \ B.tab\<^sub>1 (k\<^sup>* \ h) \ {h'. B.is_iso_class \B.tab\<^sub>1 (k\<^sup>* \ h)\\<^sub>B \ B.is_iso_class (Map K) \ (\f g. f \ \B.tab\<^sub>1 (k\<^sup>* \ h)\\<^sub>B \ g \ Map K \ g \ f \\<^sub>B h')}" by auto qed show "h \ ?f \\<^sub>B k \ ?g" using iso by simp qed have "K \ PRJ\<^sub>1 K H = K \ \\?g\\" unfolding PRJ\<^sub>1_def using HK h_def k_def by simp also have "... = MkArr (src ?g) (Cod K) (Comp (Map K) \?g\\<^sub>B)" using seq' comp_char [of K "\\?g\\"] by simp also have "... = MkArr (src ?f) (Cod H) (Comp (Map H) \?f\\<^sub>B)" using * HK cod_char by auto also have "... = comp H \\?f\\" using seq comp_char [of H "\\?f\\"] by simp also have "... = comp H (PRJ\<^sub>0 K H)" unfolding PRJ\<^sub>0_def using HK h_def k_def by simp finally show ?thesis by simp qed qed qed show "\H K U V. commutative_square K H V U \ \!E. comp (PRJ\<^sub>1 K H) E = V \ comp (PRJ\<^sub>0 K H) E = U" proof - fix H K U V assume cs: "commutative_square K H V U" have HK: "cospan K H" using cs by auto (* TODO: Is there any way to avoid this repetition? *) define h where "h = REP H" define k where "k = REP K" have h: "h \ Map H" using h_def HK REP_in_Map by blast have k: "k \ Map K" using k_def HK REP_in_Map by blast have 1: "B.is_left_adjoint h \ B.is_left_adjoint k \ B.ide h \ B.ide k \ trg h = trg k" using h k h_def k_def HK arr_char cod_char B.in_hhom_def B.left_adjoint_is_ide in_HomD(5) [of "Map H" "Dom H" "Cod H" h] in_HomD(5) [of "Map K" "Dom K" "Cod K" k] apply auto by (metis (no_types, lifting) HK Dom_cod) interpret h: map_in_bicategory \(\)\ \(\)\ \ \ src trg h using 1 by unfold_locales auto interpret k: map_in_bicategory \(\)\ \(\)\ \ \ src trg k using 1 by unfold_locales auto interpret hk: cospan_of_maps_in_bicategory_of_spans \(\)\ \(\)\ \ \ src trg h k using 1 by unfold_locales auto let ?f = "B.tab\<^sub>0 (k\<^sup>* \ h)" let ?g = "B.tab\<^sub>1 (k\<^sup>* \ h)" have seq_HU: "seq H U" using cs by auto have seq_KV: "seq K V" using cs by auto let ?u = "REP U" let ?v = "REP V" have u: "B.ide ?u" using ide_REP seq_HU by auto have v: "B.ide ?v" using ide_REP seq_KV by auto have u_is_map: "B.is_left_adjoint ?u" using u seq_HU REP_in_Map arr_char [of U] in_HomD(5) [of "Map U" "Dom U" "Cod U" ?u] by auto have v_is_map: "B.is_left_adjoint ?v" using v seq_KV REP_in_Map arr_char [of V] in_HomD(5) [of "Map V" "Dom V" "Cod V" ?v] by auto have *: "h \ ?u \\<^sub>B k \ ?v" proof - have "h \ ?u \\<^sub>B REP (H \ U)" proof - have "h \ ?u \\<^sub>B REP H \ ?u" proof - have "h \\<^sub>B REP H" using h h_def HK arr_char REP_in_Map B.iso_class_elems_isomorphic in_HomD(5) [of "Map H" "Dom H" "Cod H" h] B.isomorphic_reflexive by auto thus ?thesis using h_def seq_HU B.isomorphic_implies_hpar(1) B.isomorphic_reflexive by (simp add: seq_char) qed also have "... \\<^sub>B REP (H \ U)" using seq_HU isomorphic_hcomp_REP isomorphic_def by blast finally show ?thesis by blast qed also have "... \\<^sub>B REP (K \ V)" using seq_HU cs B.isomorphic_reflexive by auto also have "... \\<^sub>B (k \ ?v)" proof - have "... \\<^sub>B REP K \ ?v" using seq_KV isomorphic_hcomp_REP B.isomorphic_def B.isomorphic_symmetric by blast also have "... \\<^sub>B k \ ?v" proof - have "k \\<^sub>B REP K" using k k_def HK arr_char REP_in_Map B.iso_class_elems_isomorphic in_HomD(5) [of "Map K" "Dom K" "Cod K" k] B.isomorphic_reflexive by auto thus ?thesis using k_def seq_KV B.isomorphic_implies_hpar(1) B.isomorphic_reflexive by (simp add: seq_char) qed finally show ?thesis by blast qed finally show ?thesis by blast qed have hseq_hu: "src h = trg ?u" using * B.isomorphic_implies_hpar by (meson B.hseqE B.ideD(1)) have hseq_kv: "src k = trg ?v" using * B.isomorphic_implies_hpar by (meson B.hseqE B.ideD(1)) obtain w where w: "B.is_left_adjoint w \ ?f \ w \\<^sub>B ?u \ ?v \\<^sub>B (?g \ w)" using * u_is_map v_is_map hk.has_pseudo_pullback [of ?u ?v] B.isomorphic_symmetric by blast have w_in_hom: "\w : src ?u \\<^sub>B src ?f\ \ B.ide w" using w B.left_adjoint_is_ide B.src_cod B.trg_cod B.isomorphic_def by (metis B.hseqE B.ideD(1) B.in_hhom_def B.isomorphic_implies_hpar(3) B.isomorphic_implies_ide(1) B.src_hcomp) let ?W = "CLS w" have W: "\?W : dom U \ dom \\?f\\\" proof show "arr ?W" using w CLS_in_hom by blast thus "dom ?W = dom U" using w_in_hom dom_char REP_in_hhom(1) CLS_in_hom by (metis (no_types, lifting) Dom.simps(1) commutative_squareE dom_char REP_simps(2) cs B.in_hhomE) show "cod ?W = dom \\?f\\" proof - have "src ?f = trg w" by (metis (lifting) B.in_hhomE w_in_hom) thus ?thesis using CLS_in_hom [of ?f] CLS_in_hom [of w] hk.satisfies_T0 w by fastforce qed qed show "\!E. PRJ\<^sub>1 K H \ E = V \ PRJ\<^sub>0 K H \ E = U" proof - have "PRJ\<^sub>1 K H \ ?W = V \ PRJ\<^sub>0 K H \ ?W = U" proof - have "\\?f\\ \ ?W = U" using w w_in_hom u CLS_in_hom comp_CLS B.isomorphic_symmetric CLS_REP hk.leg0_is_map by (metis (mono_tags, lifting) commutative_square_def cs) moreover have "\\?g\\ \ ?W = V" using w w_in_hom v CLS_in_hom comp_CLS B.isomorphic_symmetric CLS_REP hk.leg1_is_map by (metis (mono_tags, lifting) commutative_square_def cs) ultimately show ?thesis using HK h_def k_def PRJ\<^sub>0_def PRJ\<^sub>1_def by auto qed moreover have "\W'. PRJ\<^sub>1 K H \ W' = V \ PRJ\<^sub>0 K H \ W' = U \ W' = ?W" proof - fix W' assume "PRJ\<^sub>1 K H \ W' = V \ PRJ\<^sub>0 K H \ W' = U" hence W': "\W' : dom U \ dom \\?f\\\ \ \\?f\\ \ W' = U \ \\?g\\ \ W' = V" using PRJ\<^sub>0_def PRJ\<^sub>1_def HK h_def k_def apply simp using cs arr_iff_in_hom by blast let ?w' = "REP W'" have w': "B.ide ?w'" using W' ide_REP by auto have fw'_iso_u: "?f \ ?w' \\<^sub>B ?u" proof - have "?f \ ?w' \\<^sub>B REP \\?f\\ \ ?w'" by (metis (no_types, lifting) Cod.simps(1) in_hom_char REP_CLS REP_simps(3) W W' B.hcomp_isomorphic_ide hk.satisfies_T0 B.in_hhomE B.isomorphic_symmetric w' w_in_hom) also have "REP \\?f\\ \ ?w' \\<^sub>B ?u" using W' isomorphic_hcomp_REP cs by blast finally show ?thesis by blast qed have gw'_iso_v: "?g \ ?w' \\<^sub>B ?v" proof - have "?g \ ?w' \\<^sub>B REP \\?g\\ \ ?w'" proof - have "?g \\<^sub>B REP \\?g\\" using REP_CLS B.isomorphic_symmetric hk.leg1_is_map by blast moreover have "B.ide (REP W')" using W' by auto moreover have "src ?f = trg ?w'" using w_in_hom W W' in_hom_char arr_char B.in_hhom_def by (meson fw'_iso_u B.hseqE B.ideD(1) B.isomorphic_implies_ide(1)) ultimately show ?thesis using B.hcomp_isomorphic_ide by simp qed also have "... \\<^sub>B ?v" using W' isomorphic_hcomp_REP cs by blast finally show ?thesis by blast qed show "W' = ?W" proof - have "W' = \\?w'\\" using w' W' CLS_REP by auto also have "... = ?W" proof - have "?w' \\<^sub>B w" using * w W' hk.has_pseudo_pullback(2) u_is_map v_is_map B.isomorphic_symmetric fw'_iso_u gw'_iso_v by blast thus ?thesis using CLS_eqI B.iso_class_eqI w' by blast qed finally show ?thesis by blast qed qed ultimately show ?thesis by auto qed qed qed lemma is_elementary_category_with_pullbacks: shows "elementary_category_with_pullbacks comp PRJ\<^sub>0 PRJ\<^sub>1" .. lemma is_category_with_pullbacks: shows "category_with_pullbacks comp" .. sublocale elementary_category_with_pullbacks comp PRJ\<^sub>0 PRJ\<^sub>1 using is_elementary_category_with_pullbacks by simp end text \ Here we relate the projections of the chosen pullbacks in \Maps(B)\ to the projections associated with the chosen tabulations in \B\. \ context composite_tabulation_in_maps begin interpretation Maps: maps_category V H \ \ src trg .. interpretation r\<^sub>0s\<^sub>1: cospan_of_maps_in_bicategory_of_spans V H \ \ src trg s\<^sub>1 r\<^sub>0 using \.leg0_is_map \.leg1_is_map composable by unfold_locales auto lemma prj_char: shows "Maps.PRJ\<^sub>0 \\r\<^sub>0\\ \\s\<^sub>1\\ = \\prj\<^sub>0 s\<^sub>1 r\<^sub>0\\" and "Maps.PRJ\<^sub>1 \\r\<^sub>0\\ \\s\<^sub>1\\ = \\prj\<^sub>1 s\<^sub>1 r\<^sub>0\\" proof - have "Maps.arr (Maps.MkArr (src s\<^sub>0) (trg s) \s\<^sub>1\)" using \.leg1_in_hom Maps.CLS_in_hom \.leg1_is_map Maps.arr_char by auto moreover have "Maps.arr (Maps.MkArr (src r\<^sub>0) (trg s) \r\<^sub>0\)" using Maps.CLS_in_hom composable r\<^sub>0s\<^sub>1.k_is_map by fastforce moreover have "Maps.cod (Maps.MkArr (src r\<^sub>0) (trg s) \r\<^sub>0\) = Maps.cod (Maps.MkArr (src s\<^sub>0) (trg s) \s\<^sub>1\)" unfolding Maps.arr_char using \.leg1_in_hom \.leg0_in_hom by (simp add: Maps.cod_char calculation(1) calculation(2)) ultimately have "Maps.PRJ\<^sub>0 \\r\<^sub>0\\ \\s\<^sub>1\\ = \\tab\<^sub>0 ((Maps.REP (Maps.MkArr (src r\<^sub>0) (trg s) \r\<^sub>0\))\<^sup>* \ Maps.REP (Maps.MkArr (src s\<^sub>0) (trg s) \s\<^sub>1\))\\ \ Maps.PRJ\<^sub>1 (Maps.CLS r\<^sub>0) (Maps.CLS s\<^sub>1) = \\tab\<^sub>1 ((Maps.REP (Maps.MkArr (src r\<^sub>0) (trg s) \r\<^sub>0\))\<^sup>* \ Maps.REP (Maps.MkArr (src s\<^sub>0) (trg s) \s\<^sub>1\))\\" unfolding Maps.PRJ\<^sub>0_def Maps.PRJ\<^sub>1_def using Maps.CLS_in_hom \.leg1_is_map \.leg0_is_map composable by simp moreover have "r\<^sub>0\<^sup>* \ s\<^sub>1 \ (Maps.REP (Maps.MkArr (src r\<^sub>0) (trg s) \r\<^sub>0\))\<^sup>* \ Maps.REP (Maps.MkArr (src s\<^sub>0) (trg s) \s\<^sub>1\)" proof - have "r\<^sub>0 \ Maps.REP (Maps.MkArr (src r\<^sub>0) (trg s) \r\<^sub>0\)" using Maps.REP_CLS composable isomorphic_symmetric r\<^sub>0s\<^sub>1.k_is_map by fastforce hence 3: "isomorphic r\<^sub>0\<^sup>* (Maps.REP (Maps.MkArr (src r\<^sub>0) (trg s) \r\<^sub>0\))\<^sup>*" using \.leg0_is_map by (simp add: isomorphic_to_left_adjoint_implies_isomorphic_right_adjoint) moreover have 4: "s\<^sub>1 \ Maps.REP (Maps.MkArr (src s\<^sub>0) (trg s) \s\<^sub>1\)" using Maps.REP_CLS isomorphic_symmetric r\<^sub>0s\<^sub>1.h_is_map by fastforce ultimately show ?thesis proof - have 1: "src r\<^sub>0\<^sup>* = trg s\<^sub>1" using \.T0.antipar(2) r\<^sub>0s\<^sub>1.cospan by argo have 2: "ide s\<^sub>1" by simp have "src (Maps.REP (Maps.MkArr (src r\<^sub>0) (trg s) \r\<^sub>0\))\<^sup>* = trg s\<^sub>1" by (metis 3 \.T0.antipar(2) isomorphic_implies_hpar(3) r\<^sub>0s\<^sub>1.cospan) thus ?thesis using 1 2 by (meson 3 4 hcomp_ide_isomorphic hcomp_isomorphic_ide isomorphic_implies_ide(2) isomorphic_transitive) qed qed ultimately have 1: "Maps.PRJ\<^sub>0 \\r\<^sub>0\\ \\s\<^sub>1\\ = \\prj\<^sub>0 s\<^sub>1 r\<^sub>0\\ \ Maps.PRJ\<^sub>1 \\r\<^sub>0\\ \\s\<^sub>1\\ = \\prj\<^sub>1 s\<^sub>1 r\<^sub>0\\" using r\<^sub>0s\<^sub>1.isomorphic_implies_same_tab by simp show "Maps.PRJ\<^sub>0 \\r\<^sub>0\\ \\s\<^sub>1\\ = \\prj\<^sub>0 s\<^sub>1 r\<^sub>0\\" using 1 by simp show "Maps.PRJ\<^sub>1 \\r\<^sub>0\\ \\s\<^sub>1\\ = \\prj\<^sub>1 s\<^sub>1 r\<^sub>0\\" using 1 by simp qed end context identity_in_bicategory_of_spans begin interpretation Maps: maps_category V H \ \ src trg .. interpretation Span: span_bicategory Maps.comp Maps.PRJ\<^sub>0 Maps.PRJ\<^sub>1 .. notation isomorphic (infix "\" 50) text \ A 1-cell \r\ in a bicategory of spans is a map if and only if the ``input leg'' \tab\<^sub>0 r\ of the chosen tabulation of \r\ is an equivalence map. Since a tabulation of \r\ is unique up to equivalence, and equivalence maps compose, the result actually holds if ``chosen tabulation'' is replaced by ``any tabulation''. \ lemma is_map_iff_tab\<^sub>0_is_equivalence: shows "is_left_adjoint r \ equivalence_map (tab\<^sub>0 r)" proof assume 1: "equivalence_map (tab\<^sub>0 r)" have 2: "quasi_inverses (tab\<^sub>0 r) (tab\<^sub>0 r)\<^sup>*" proof - obtain g' \' \' where \'\': "equivalence_in_bicategory V H \ \ src trg (tab\<^sub>0 r) g' \' \'" using 1 equivalence_map_def by auto have "adjoint_pair (tab\<^sub>0 r) g'" using \'\' quasi_inverses_def quasi_inverses_are_adjoint_pair by blast moreover have "adjoint_pair (tab\<^sub>0 r) (tab\<^sub>0 r)\<^sup>*" using T0.adjunction_in_bicategory_axioms adjoint_pair_def by auto ultimately have "g' \ (tab\<^sub>0 r)\<^sup>*" using left_adjoint_determines_right_up_to_iso by simp thus ?thesis using \'\' quasi_inverses_def quasi_inverses_isomorphic_right by blast qed obtain \' \' where \'\': "equivalence_in_bicategory V H \ \ src trg (tab\<^sub>0 r) (tab\<^sub>0 r)\<^sup>* \' \'" using 2 quasi_inverses_def by auto interpret \'\': equivalence_in_bicategory V H \ \ src trg \tab\<^sub>0 r\ \(tab\<^sub>0 r)\<^sup>*\ \' \' using \'\' by auto have "is_left_adjoint (tab\<^sub>0 r)\<^sup>*" using 2 quasi_inverses_are_adjoint_pair quasi_inverses_symmetric by blast hence "is_left_adjoint (tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*)" using left_adjoints_compose by simp thus "is_left_adjoint r" using yields_isomorphic_representation isomorphic_def left_adjoint_preserved_by_iso' by meson next assume 1: "is_left_adjoint r" have 2: "is_left_adjoint (tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*)" using 1 yields_isomorphic_representation left_adjoint_preserved_by_iso' isomorphic_symmetric isomorphic_def by meson hence "is_left_adjoint (tab\<^sub>0 r)\<^sup>*" using is_ide BS4 [of "tab\<^sub>1 r" "(tab\<^sub>0 r)\<^sup>*"] by auto hence "is_left_adjoint ((tab\<^sub>0 r)\<^sup>* \ tab\<^sub>0 r) \ is_left_adjoint (tab\<^sub>0 r \ (tab\<^sub>0 r)\<^sup>*)" using left_adjoints_compose T0.antipar by simp hence 3: "iso \ \ iso \" using BS3 [of "src (tab\<^sub>0 r)" "(tab\<^sub>0 r)\<^sup>* \ tab\<^sub>0 r" \ \] BS3 [of "tab\<^sub>0 r \ (tab\<^sub>0 r)\<^sup>*" "trg (tab\<^sub>0 r)" \ \] T0.unit_in_hom T0.counit_in_hom obj_is_self_adjoint by auto hence "equivalence_in_bicategory V H \ \ src trg (tab\<^sub>0 r) (tab\<^sub>0 r)\<^sup>* \ \" apply unfold_locales by auto thus "equivalence_map (tab\<^sub>0 r)" using equivalence_map_def by blast qed text \ The chosen tabulation (and indeed, any other tabulation, which is equivalent) of an object is symmetric in the sense that its two legs are isomorphic. \ lemma obj_has_symmetric_tab: assumes "obj r" shows "tab\<^sub>0 r \ tab\<^sub>1 r" proof - have "tab\<^sub>0 r \ r \ tab\<^sub>0 r" proof - have "trg (tab\<^sub>0 r) = r" using assms by auto moreover have "\\\<^sup>-\<^sup>1[tab\<^sub>0 r] : tab\<^sub>0 r \ trg (tab\<^sub>0 r) \ tab\<^sub>0 r\ \ iso \\<^sup>-\<^sup>1[tab\<^sub>0 r]" using assms by simp ultimately show ?thesis unfolding isomorphic_def by metis qed also have "... \ tab\<^sub>1 r" proof - have "\tab : tab\<^sub>1 r \ r \ tab\<^sub>0 r\" using tab_in_hom by simp moreover have "is_left_adjoint (r \ tab\<^sub>0 r)" using assms left_adjoints_compose obj_is_self_adjoint by simp ultimately show ?thesis using BS3 [of "tab\<^sub>1 r" "r \ tab\<^sub>0 r" tab tab] isomorphic_symmetric isomorphic_def by auto qed finally show ?thesis by simp qed text \ The chosen tabulation of \r\ determines a span in \Maps(B)\. \ lemma determines_span: assumes "ide r" shows "span_in_category Maps.comp \Leg0 = \\tab\<^sub>0 r\\, Leg1 = \\tab\<^sub>1 r\\\" using assms Maps.CLS_in_hom [of "tab\<^sub>0 r"] Maps.CLS_in_hom [of "tab\<^sub>1 r"] tab\<^sub>0_in_hom tab\<^sub>1_in_hom apply unfold_locales by fastforce end subsection "Arrows of Tabulations in Maps" text \ Here we consider the situation of two tabulations: a tabulation \\\ of \r\ and a tabulation \\\ of \s\, both ``legs'' of each tabulation being maps, together with an arbitrary 2-cell \\\ : r \ s\\. The 2-cell \\\ at the base composes with the tabulation \\\ to yield a 2-cell \\ = (\ \ r\<^sub>0) \ \\ ``over'' s. By property \T1\ of tabulation \\\, this induces a map from the apex of \\\ to the apex of \\\, which together with the other data forms a triangular prism whose sides commute up to (unique) isomorphism. \ text \ $$ \xymatrix{ && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \dtwocell\omit{^<-1>\sigma} & \\ &{\rm trg}~s && {\rm src}~s \ar[ll]^{s} \\ & \rrtwocell\omit{^\mu} &&\\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \ar@ {.>}[uuur]^<>(0.3){{\rm chine}} \dtwocell\omit{^\rho}& \\ {\rm trg}~r \ar@ {=}[uuur] && {\rm src}~r \ar[ll]^{r} \ar@ {=}[uuur] } $$ \ locale arrow_of_tabulations_in_maps = bicategory_of_spans V H \ \ src trg + \: tabulation_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 + \: tabulation_in_maps V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and r :: 'a and \ :: 'a and r\<^sub>0 :: 'a and r\<^sub>1 :: 'a and s :: 'a and \ :: 'a and s\<^sub>0 :: 'a and s\<^sub>1 :: 'a and \ :: 'a + assumes in_hom: "\\ : r \ s\" begin abbreviation (input) \ where "\ \ (\ \ r\<^sub>0) \ \" lemma \_in_hom [intro]: shows "\\ : src \ \ trg \\" and "\\ : r\<^sub>1 \ s \ r\<^sub>0\" proof - show "\\ : r\<^sub>1 \ s \ r\<^sub>0\" using in_hom \.leg0_in_hom(2) \.tab_in_vhom' by auto thus "\\ : src \ \ trg \\" by (metis \.tab_simps(3) \.base_in_hom(2) \.tab_simps(3) \.base_in_hom(2) arrI in_hom seqI' vcomp_in_hhom vseq_implies_hpar(1-2)) qed lemma \_simps [simp]: shows "arr \" and "src \ = src \" and "trg \ = trg \" and "dom \ = r\<^sub>1" and "cod \ = s \ r\<^sub>0" using \_in_hom by auto abbreviation is_induced_map where "is_induced_map w \ \.is_induced_by_cell w r\<^sub>0 \" text \ The following is an equivalent restatement, in elementary terms, of the conditions for being an induced map. \ abbreviation (input) is_induced_map' where "is_induced_map' w \ ide w \ (\\ \. \\ : s\<^sub>0 \ w \ r\<^sub>0\ \ \\ : r\<^sub>1 \ s\<^sub>1 \ w\ \ iso \ \ \ = (s \ \) \ \[s, s\<^sub>0, w] \ (\ \ w) \ \)" lemma is_induced_map_iff: shows "is_induced_map w \ is_induced_map' w" proof assume w: "is_induced_map' w" show "is_induced_map w" proof have 1: "dom \ = r\<^sub>1" by auto interpret w: arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 \dom \\ s \ s\<^sub>0 s\<^sub>1 w proof - have "arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 r\<^sub>1 s \ s\<^sub>0 s\<^sub>1 w" using w apply unfold_locales by auto thus "arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 (dom \) s \ s\<^sub>0 s\<^sub>1 w" using 1 by simp qed show "arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 (dom \) s\<^sub>0 s\<^sub>1 w" using w.arrow_of_spans_of_maps_axioms by auto show "\.composite_cell w w.the_\ \ w.the_\ = \" proof - obtain \ \ where \\: "\\ : s\<^sub>0 \ w \ r\<^sub>0\ \ \\ : r\<^sub>1 \ s\<^sub>1 \ w\ \ iso \ \ \ = (s \ \) \ \[s, s\<^sub>0, w] \ (\ \ w) \ \" using w w.the_\_props(1) by auto have "(s \ \) \ \[s, s\<^sub>0, w] \ (\ \ w) \ \ = \" using \\ by argo moreover have "\ = w.the_\ \ \ = w.the_\" using \\ 1 w.the_\_props(1) w.leg0_uniquely_isomorphic w.leg1_uniquely_isomorphic by auto ultimately show ?thesis using comp_assoc by simp qed qed next assume w: "is_induced_map w" show "is_induced_map' w" proof - interpret w: arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 r\<^sub>1 s\<^sub>0 s\<^sub>1 w using w in_hom by auto interpret w: arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 r\<^sub>1 s \ s\<^sub>0 s\<^sub>1 w .. have "dom \ = r\<^sub>1" by auto thus ?thesis using w comp_assoc w.the_\_props(1) w.the_\_props(2) w.uw\ by metis qed qed lemma exists_induced_map: shows "\w. is_induced_map w" proof - obtain w \ \ where w\\: "ide w \ \\ : s\<^sub>0 \ w \ r\<^sub>0\ \ \\ : r\<^sub>1 \ s\<^sub>1 \ w\ \ iso \ \ \ = (s \ \) \ \[s, s\<^sub>0, w] \ (\ \ w) \ \" using \_in_hom \.ide_leg0 \.T1 comp_assoc by (metis in_homE) thus ?thesis using is_induced_map_iff by blast qed lemma induced_map_unique: assumes "is_induced_map w" and "is_induced_map w'" shows "w \ w'" using assms \.induced_map_unique by blast definition chine where "chine \ SOME w. is_induced_map w" lemma chine_is_induced_map: shows "is_induced_map chine" unfolding chine_def using exists_induced_map someI_ex [of is_induced_map] by simp lemma chine_in_hom [intro]: shows "\chine : src r\<^sub>0 \ src s\<^sub>0\" and "\chine: chine \ chine\" proof - show "\chine : src r\<^sub>0 \ src s\<^sub>0\" using chine_is_induced_map by (metis \_simps(1) \_simps(4) \.leg1_simps(3) \.ide_base \.ide_leg0 \.leg0_simps(3) \.tab_simps(2) arrow_of_spans_of_maps.is_ide arrow_of_spans_of_maps.the_\_simps(2) assoc_simps(2) hseqE in_hhom_def seqE src_vcomp vseq_implies_hpar(1)) show "\chine: chine \ chine\" using chine_is_induced_map by (meson arrow_of_spans_of_maps.is_ide ide_in_hom(2)) qed lemma chine_simps [simp]: shows "arr chine" and "ide chine" and "src chine = src r\<^sub>0" and "trg chine = src s\<^sub>0" and "dom chine = chine" and "cod chine = chine" using chine_in_hom apply auto by (meson arrow_of_spans_of_maps.is_ide chine_is_induced_map) end sublocale arrow_of_tabulations_in_maps \ arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 r\<^sub>1 s\<^sub>0 s\<^sub>1 chine using chine_is_induced_map is_induced_map_iff by unfold_locales auto sublocale arrow_of_tabulations_in_maps \ arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 r\<^sub>1 s \ s\<^sub>0 s\<^sub>1 chine .. context arrow_of_tabulations_in_maps begin text \ The two factorizations of the composite 2-cell \\\ amount to a naturality condition. \ lemma \_naturality: shows "(\ \ r\<^sub>0) \ \ = (s \ the_\) \ \[s, s\<^sub>0, chine] \ (\ \ chine) \ the_\" using chine_is_induced_map is_induced_map_iff by (metis leg0_uniquely_isomorphic(2) leg1_uniquely_isomorphic(2) the_\_props(1) uw\) lemma induced_map_preserved_by_iso: assumes "is_induced_map w" and "isomorphic w w'" shows "is_induced_map w'" proof - interpret w: arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 r\<^sub>1 s\<^sub>0 s\<^sub>1 w using assms in_hom by auto interpret w: arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 r\<^sub>1 s \ s\<^sub>0 s\<^sub>1 w .. obtain \ where \: "\\ : w \ w'\ \ iso \" using assms(2) isomorphic_def by auto show ?thesis proof interpret w': arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 \dom \\ s\<^sub>0 s\<^sub>1 w' proof show "is_left_adjoint r\<^sub>0" by (simp add: \.satisfies_T0) show "is_left_adjoint (dom \)" by (simp add: \.leg1_is_map) show "ide w'" using assms by force show "\\. \\ : s\<^sub>0 \ w' \ r\<^sub>0\" using \ w.the_\_props \.leg0_in_hom(2) assms(2) comp_in_homI hcomp_in_vhom inv_in_hom isomorphic_implies_hpar(4) w.the_\_simps(4) w.w_simps(4) by metis have "\(s\<^sub>1 \ \) \ w.the_\ : r\<^sub>1 \ s\<^sub>1 \ w'\ \ iso ((s\<^sub>1 \ \) \ w.the_\)" proof (intro conjI) show "\(s\<^sub>1 \ \) \ w.the_\ : r\<^sub>1 \ s\<^sub>1 \ w'\" using \ w.the_\_props by (intro comp_in_homI, auto) thus "iso ((s\<^sub>1 \ \) \ w.the_\)" using \ w.the_\_props by (meson \.ide_leg1 arrI iso_hcomp hseqE ide_is_iso isos_compose seqE) qed hence "\\. \\ : r\<^sub>1 \ s\<^sub>1 \ w'\ \ iso \" by auto thus "\\. \\ : dom \ \ s\<^sub>1 \ w'\ \ iso \" by auto qed interpret w': arrow_of_spans_of_maps_to_tabulation V H \ \ src trg r\<^sub>0 \dom \\ s \ s\<^sub>0 s\<^sub>1 w' .. show "arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 (dom \) s\<^sub>0 s\<^sub>1 w'" using w'.arrow_of_spans_of_maps_axioms by auto show "\.composite_cell w' w'.the_\ \ w'.the_\ = \" proof - have 1: "w'.the_\ = w.the_\ \ (s\<^sub>0 \ inv \)" proof - have "\w.the_\ \ (s\<^sub>0 \ inv \) : s\<^sub>0 \ w' \ r\<^sub>0\" using w.the_\_props \ by (intro comp_in_homI, auto) moreover have "\w'.the_\ : s\<^sub>0 \ w' \ r\<^sub>0\" using w'.the_\_props by simp ultimately show ?thesis using w'.leg0_uniquely_isomorphic(2) by blast qed moreover have "w'.the_\ = (s\<^sub>1 \ \) \ w.the_\" proof - have "\(s\<^sub>1 \ \) \ w.the_\ : dom \ \ s\<^sub>1 \ w'\" using w.the_\_props \ by (intro comp_in_homI, auto) moreover have "iso ((s\<^sub>1 \ \) \ w.the_\)" using w.the_\_props \ iso_hcomp by (meson \.ide_leg1 arrI calculation hseqE ide_is_iso isos_compose seqE) ultimately show ?thesis using w'.the_\_props w'.leg1_uniquely_isomorphic(2) by blast qed ultimately have "\.composite_cell w' w'.the_\ \ w'.the_\ = \.composite_cell w' (w.the_\ \ (s\<^sub>0 \ inv \)) \ (s\<^sub>1 \ \) \ w.the_\" by simp also have "... = (s \ w.the_\ \ (s\<^sub>0 \ inv \)) \ \[s, s\<^sub>0, w'] \ (\ \ w') \ (s\<^sub>1 \ \) \ w.the_\" using comp_assoc by presburger also have "... = (s \ w.the_\) \ ((s \ s\<^sub>0 \ inv \) \ \[s, s\<^sub>0, w'] \ (\ \ w') \ (s\<^sub>1 \ \)) \ w.the_\" using 1 comp_assoc w'.the_\_simps(1) whisker_left by auto also have "... = (s \ w.the_\) \ (\[s, s\<^sub>0, w] \ (\ \ w)) \ w.the_\" proof - have "(s \ s\<^sub>0 \ inv \) \ \[s, s\<^sub>0, w'] \ (\ \ w') \ (s\<^sub>1 \ \) = \[s, s\<^sub>0, w] \ (\ \ w)" proof - have "(s \ s\<^sub>0 \ inv \) \ \[s, s\<^sub>0, w'] \ (\ \ w') \ (s\<^sub>1 \ \) = \[s, s\<^sub>0, w] \ ((s \ s\<^sub>0) \ inv \) \ (\ \ w') \ (s\<^sub>1 \ \)" proof - have "(s \ s\<^sub>0 \ inv \) \ \[s, s\<^sub>0, w'] = \[s, s\<^sub>0, w] \ ((s \ s\<^sub>0) \ inv \)" using assms \ assoc_naturality [of s s\<^sub>0 "inv \"] w.w_simps(4) by (metis \.leg0_simps(2-5) \.base_simps(2-4) arr_inv cod_inv dom_inv in_homE trg_cod) thus ?thesis using comp_assoc by metis qed also have "... = \[s, s\<^sub>0, w] \ (\ \ w) \ (s\<^sub>1 \ inv \) \ (s\<^sub>1 \ \)" proof - have "((s \ s\<^sub>0) \ inv \) \ (\ \ w') = (\ \ w) \ (s\<^sub>1 \ inv \)" using \ comp_arr_dom comp_cod_arr in_hhom_def interchange [of "s \ s\<^sub>0" \ "inv \" w'] interchange [of \ s\<^sub>1 w "inv \"] by auto thus ?thesis using comp_assoc by metis qed also have "... = \[s, s\<^sub>0, w] \ (\ \ w)" proof - have "(\ \ w) \ (s\<^sub>1 \ inv \) \ (s\<^sub>1 \ \) = \ \ w" proof - have "(\ \ w) \ (s\<^sub>1 \ inv \) \ (s\<^sub>1 \ \) = (\ \ w) \ (s\<^sub>1 \ inv \ \ \)" using \ whisker_left in_hhom_def by auto also have "... = (\ \ w) \ (s\<^sub>1 \ w)" using \ comp_inv_arr' by auto also have "... = \ \ w" using whisker_right [of w \ s\<^sub>1] comp_arr_dom in_hhom_def by auto finally show ?thesis by blast qed thus ?thesis by simp qed finally show ?thesis by simp qed thus ?thesis by simp qed also have "... = \" using assms(1) comp_assoc w.is_ide w.the_\_props(1) w.the_\_props(1) by simp finally show ?thesis using comp_assoc by auto qed qed qed end text \ In the special case that \\\ is an identity 2-cell, the induced map from the apex of \\\ to the apex of \\\ is an equivalence map. \ locale identity_arrow_of_tabulations_in_maps = arrow_of_tabulations_in_maps + assumes is_ide: "ide \" begin lemma r_eq_s: shows "r = s" using is_ide by (metis ide_char in_hom in_homE) lemma \_eq_\: shows "\ = \" by (meson \_simps(1) comp_ide_arr ide_hcomp hseq_char' ide_u is_ide seqE seq_if_composable) lemma chine_is_equivalence: shows "equivalence_map chine" proof - obtain w w' \ \ \ \ \' \' where e: "equivalence_in_bicategory (\) (\) \ \ src trg w' w \ \ \ \w : src s\<^sub>0 \ src r\<^sub>0\ \ \w' : src r\<^sub>0 \ src s\<^sub>0\ \ \\ : r\<^sub>0 \ w \ s\<^sub>0\ \ \\ : s\<^sub>1 \ r\<^sub>1 \ w\ \ iso \ \ \ = (s \ \) \ \[s, r\<^sub>0, w] \ (\ \ w) \ \ \ \\' : s\<^sub>0 \ w' \ r\<^sub>0\ \ \\' : r\<^sub>1 \ s\<^sub>1 \ w'\ \ iso \' \ \ = (s \ \') \ \[s, s\<^sub>0, w'] \ (\ \ w') \ \'" using r_eq_s \.apex_unique_up_to_equivalence [of \ r\<^sub>0 r\<^sub>1] \.tabulation_axioms by blast have w': "equivalence_map w'" using e equivalence_map_def by auto hence "is_induced_map w'" using e r_eq_s \_eq_\ is_induced_map_iff comp_assoc equivalence_map_is_ide by metis hence "isomorphic chine w'" using induced_map_unique chine_is_induced_map by simp thus ?thesis using w' equivalence_map_preserved_by_iso isomorphic_symmetric by blast qed end text \ The following gives an interpretation of @{locale arrow_of_tabulations_in_maps} in the special case that the tabulations are those that we have chosen for the domain and codomain of the underlying 2-cell \\\ : r \ s\\. In this case, we can recover \\\ from \\\ via adjoint transpose. \ locale arrow_in_bicategory_of_spans = bicategory_of_spans V H \ \ src trg + r: identity_in_bicategory_of_spans V H \ \ src trg r + s: identity_in_bicategory_of_spans V H \ \ src trg s for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and r :: 'a and s :: 'a and \ :: 'a + assumes in_hom: "\\ : r \ s\" begin abbreviation (input) r\<^sub>0 where "r\<^sub>0 \ tab\<^sub>0 r" abbreviation (input) r\<^sub>1 where "r\<^sub>1 \ tab\<^sub>1 r" abbreviation (input) s\<^sub>0 where "s\<^sub>0 \ tab\<^sub>0 s" abbreviation (input) s\<^sub>1 where "s\<^sub>1 \ tab\<^sub>1 s" lemma is_arrow_of_tabulations_in_maps: shows "arrow_of_tabulations_in_maps V H \ \ src trg r r.tab r\<^sub>0 r\<^sub>1 s s.tab s\<^sub>0 s\<^sub>1 \" using in_hom by unfold_locales auto end sublocale identity_in_bicategory_of_spans \ arrow_in_bicategory_of_spans V H \ \ src trg r r r apply unfold_locales using is_ide by auto context arrow_in_bicategory_of_spans begin interpretation arrow_of_tabulations_in_maps V H \ \ src trg r r.tab r\<^sub>0 r\<^sub>1 s s.tab s\<^sub>0 s\<^sub>1 \ using is_arrow_of_tabulations_in_maps by simp interpretation r: arrow_of_tabulations_in_maps V H \ \ src trg r r.tab r\<^sub>0 r\<^sub>1 r r.tab r\<^sub>0 r\<^sub>1 r using r.is_arrow_of_tabulations_in_maps by simp lemma \_in_terms_of_\: shows "\ = r.T0.trnr\<^sub>\ (cod \) \ \ inv (r.T0.trnr\<^sub>\ r r.tab)" proof - have \: "arr \" using in_hom by auto have "\ \ r.T0.trnr\<^sub>\ r r.tab = r.T0.trnr\<^sub>\ s \" proof - have "\ \ r.T0.trnr\<^sub>\ r r.tab = (\ \ \[r]) \ (r \ r.\) \ \[r, tab\<^sub>0 r, (tab\<^sub>0 r)\<^sup>*] \ (r.tab \ (tab\<^sub>0 r)\<^sup>*)" unfolding r.T0.trnr\<^sub>\_def using comp_assoc by presburger also have "... = \[s] \ ((\ \ src \) \ (r \ r.\)) \ \[r, tab\<^sub>0 r, (tab\<^sub>0 r)\<^sup>*] \ (r.tab \ (tab\<^sub>0 r)\<^sup>*)" using \ runit_naturality comp_assoc by (metis in_hom in_homE) also have "... = \[s] \ (s \ r.\) \ ((\ \ tab\<^sub>0 r \ (tab\<^sub>0 r)\<^sup>*) \ \[r, tab\<^sub>0 r, (tab\<^sub>0 r)\<^sup>*]) \ (r.tab \ (tab\<^sub>0 r)\<^sup>*)" proof - have "(\ \ src \) \ (r \ r.\) = \ \ r.\" using \ interchange comp_arr_dom comp_cod_arr by (metis in_hom in_homE r.T0.counit_simps(1) r.T0.counit_simps(3) r.u_simps(3) src_dom) also have "... = (s \ r.\) \ (\ \ tab\<^sub>0 r \ (tab\<^sub>0 r)\<^sup>*)" using in_hom interchange [of s \ r.\ "tab\<^sub>0 r \ (tab\<^sub>0 r)\<^sup>*"] comp_arr_dom comp_cod_arr r.T0.counit_simps(1) r.T0.counit_simps(2) by auto finally have "(\ \ src \) \ (r \ r.\) = (s \ r.\) \ (\ \ tab\<^sub>0 r \ (tab\<^sub>0 r)\<^sup>*)" by blast thus ?thesis using comp_assoc by presburger qed also have "... = \[s] \ (s \ r.\) \ \[s, tab\<^sub>0 r, (tab\<^sub>0 r)\<^sup>*] \ ((\ \ tab\<^sub>0 r) \ (tab\<^sub>0 r)\<^sup>*) \ (r.tab \ (tab\<^sub>0 r)\<^sup>*)" proof - have "(\ \ tab\<^sub>0 r \ (tab\<^sub>0 r)\<^sup>*) \ \[r, tab\<^sub>0 r, (tab\<^sub>0 r)\<^sup>*] = \[s, tab\<^sub>0 r, (tab\<^sub>0 r)\<^sup>*] \ ((\ \ tab\<^sub>0 r) \ (tab\<^sub>0 r)\<^sup>*)" using \ assoc_naturality [of \ "tab\<^sub>0 r" "(tab\<^sub>0 r)\<^sup>*"] by (metis ide_char in_hom in_homE r.T0.antipar(1) r.T0.ide_right r.u_simps(3) src_dom u_simps(2) u_simps(4-5)) thus ?thesis using comp_assoc by presburger qed also have "... = \[s] \ (s \ r.\) \ \[s, tab\<^sub>0 r, (tab\<^sub>0 r)\<^sup>*] \ ((\ \ tab\<^sub>0 r) \ r.tab \ (tab\<^sub>0 r)\<^sup>*)" using \ whisker_right \_simps(1) by auto also have "... = r.T0.trnr\<^sub>\ s \" unfolding r.T0.trnr\<^sub>\_def by simp finally show ?thesis by blast qed thus ?thesis using \ r.yields_isomorphic_representation invert_side_of_triangle(2) by (metis in_hom in_homE seqI') qed end subsubsection "Vertical Composite" locale vertical_composite_of_arrows_of_tabulations_in_maps = bicategory_of_spans V H \ \ src trg + \: tabulation_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 + \: tabulation_in_maps V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 + \: tabulation_in_maps V H \ \ src trg t \ t\<^sub>0 t\<^sub>1 + \: arrow_of_tabulations_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 s \ s\<^sub>0 s\<^sub>1 \ + \: arrow_of_tabulations_in_maps V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 t \ t\<^sub>0 t\<^sub>1 \ for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and r :: 'a and \ :: 'a and r\<^sub>0 :: 'a and r\<^sub>1 :: 'a and s :: 'a and \ :: 'a and s\<^sub>0 :: 'a and s\<^sub>1 :: 'a and t :: 'a and \ :: 'a and t\<^sub>0 :: 'a and t\<^sub>1 :: 'a and \ :: 'a and \ :: 'a begin text \ $$ \xymatrix{ &&& {\rm src}~\tau \ar[dl]_{t_1} \ar[dr]^{t_0} \dtwocell\omit{^<-1>\tau} & \\ &&{\rm trg}~t && {\rm src}~t \ar[ll]^{s} \\ && \rrtwocell\omit{^\pi} && \\ && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \ar[uuur]^<>(0.3){\pi.{\rm chine}} \dtwocell\omit{^<-1>\sigma} & \\ &{\rm trg}~s \ar@ {=}[uuur] && {\rm src}~s \ar[ll]^{s} \ar@ {=}[uuur] \\ & \rrtwocell\omit{^\mu} &&\\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \ar[uuur]^<>(0.3){\mu.{\rm chine}} \dtwocell\omit{^\rho} & \\ {\rm trg}~r \ar@ {=}[uuur] && {\rm src}~r \ar[ll]^{r} \ar@ {=}[uuur] } $$ \ notation isomorphic (infix "\" 50) interpretation arrow_of_tabulations_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 t \ t\<^sub>0 t\<^sub>1 \\ \ \\ using \.in_hom \.in_hom by (unfold_locales, blast) lemma is_arrow_of_tabulations_in_maps: shows "arrow_of_tabulations_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 t \ t\<^sub>0 t\<^sub>1 (\ \ \)" .. lemma chine_char: shows "chine \ \.chine \ \.chine" proof - have "is_induced_map (\.chine \ \.chine)" proof - let ?f = "\.chine" have f: "\?f : src \ \ src \\ \ is_left_adjoint ?f \ ide ?f \ \.is_induced_map ?f" using \.chine_is_induced_map \.is_map by auto let ?g = "\.chine" have g: "\?g : src \ \ src \\ \ is_left_adjoint ?g \ ide ?g \ \.is_induced_map ?g" using \.chine_is_induced_map \.is_map by auto let ?\ = "\.the_\ \ (\.the_\ \ ?f) \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f]" let ?\ = "\[t\<^sub>1, ?g, ?f] \ (\.the_\ \ ?f) \ \.the_\" have \: "\?\ : t\<^sub>0 \ ?g \ ?f \ r\<^sub>0\" using f g \.the_\_props \.the_\_props by (intro comp_in_homI hcomp_in_vhom, auto+) have \: "\?\ : r\<^sub>1 \ t\<^sub>1 \ ?g \ ?f\" using f g \.the_\_props \.the_\_props by (intro comp_in_homI hcomp_in_vhom, auto) interpret gf: arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 r\<^sub>1 t\<^sub>0 t\<^sub>1 \?g \ ?f\ proof show "ide (?g \ ?f)" by simp show "\\. \\ : t\<^sub>0 \ ?g \ ?f \ r\<^sub>0\" using \ by blast show "\\. \\ : r\<^sub>1 \ t\<^sub>1 \ ?g \ ?f\ \ iso \" using \ \.the_\_props \.the_\_props \.the_\_props \.the_\_props isos_compose [of "\.the_\" "\.the_\"] \.is_ide \ \ide (\.chine \ \.chine)\ \.uw\ \.w_simps(4) \.ide_leg1 \.leg1_simps(3) arrI hseq_char ideD(1) ide_is_iso iso_assoc iso_hcomp isos_compose seqE by metis qed show ?thesis proof (intro conjI) have \_eq: "?\ = gf.the_\" using \ gf.the_\_props gf.leg0_uniquely_isomorphic by auto have \_eq: "?\ = gf.the_\" using \ gf.the_\_props gf.leg1_uniquely_isomorphic by auto have A: "src ?g = trg ?f" using f g by fastforce show "arrow_of_spans_of_maps V H \ \ src trg r\<^sub>0 (dom \) t\<^sub>0 t\<^sub>1 (?g \ ?f)" using gf.arrow_of_spans_of_maps_axioms by simp have "((t \ gf.the_\) \ \[t, t\<^sub>0, ?g \ ?f] \ (\ \ ?g \ ?f)) \ gf.the_\ = \" proof - have "\ = (\ \ r\<^sub>0) \ (\ \ r\<^sub>0) \ \" using whisker_right comp_assoc by (metis \_simps(1) hseqE ide_u seqE) also have "... = ((\ \ r\<^sub>0) \ (s \ \.the_\)) \ \[s, s\<^sub>0, ?f] \ (\ \ ?f) \ \.the_\" using \.\_naturality comp_assoc by simp also have "... = (t \ \.the_\) \ ((\ \ s\<^sub>0 \ ?f) \ \[s, s\<^sub>0, ?f]) \ (\ \ ?f) \ \.the_\" proof - have "(\ \ r\<^sub>0) \ (s \ \.the_\) = \ \ \.the_\" using f comp_arr_dom comp_cod_arr \.the_\_props \.in_hom interchange [of \ s r\<^sub>0 \.the_\] by (metis in_homE) also have "... = (t \ \.the_\) \ (\ \ s\<^sub>0 \ ?f)" using f comp_arr_dom comp_cod_arr \.the_\_props \.in_hom interchange [of t \ \.the_\ "s\<^sub>0 \ ?f"] by (metis in_homE) finally have "(\ \ r\<^sub>0) \ (s \ \.the_\) = (t \ \.the_\) \ (\ \ s\<^sub>0 \ ?f)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (t \ \.the_\) \ \[t, s\<^sub>0, ?f] \ (((\ \ s\<^sub>0) \ ?f) \ (\ \ ?f)) \ \.the_\" proof - have "(\ \ s\<^sub>0 \ ?f) \ \[s, s\<^sub>0, ?f] = \[t, s\<^sub>0, ?f] \ ((\ \ s\<^sub>0) \ ?f)" using f assoc_naturality [of \ s\<^sub>0 ?f] \.in_hom by auto thus ?thesis using comp_assoc by presburger qed also have "... = (t \ \.the_\) \ \[t, s\<^sub>0, ?f] \ (\.\ \ ?f) \ \.the_\" using whisker_right comp_assoc by simp also have "... = (t \ \.the_\) \ \[t, s\<^sub>0, ?f] \ ((t \ \.the_\) \ \[t, t\<^sub>0, ?g] \ (\ \ ?g) \ \.the_\ \ ?f) \ \.the_\" using \.\_naturality by simp also have "... = (t \ \.the_\) \ \[t, s\<^sub>0, ?f] \ (((t \ \.the_\) \ ?f) \ (\[t, t\<^sub>0, ?g] \ ?f) \ ((\ \ ?g) \ ?f) \ (\.the_\ \ ?f)) \ \.the_\" using f g \.the_\_props \.the_\_props whisker_right by (metis \.\_simps(1) \.\_naturality seqE) also have "... = (t \ \.the_\) \ (\[t, s\<^sub>0, ?f] \ ((t \ \.the_\) \ ?f)) \ (\[t, t\<^sub>0, ?g] \ ?f) \ ((\ \ ?g) \ ?f) \ (\.the_\ \ ?f) \ \.the_\" using comp_assoc by presburger also have "... = (t \ \.the_\) \ (t \ \.the_\ \ ?f) \ (\[t, t\<^sub>0 \ ?g, ?f] \ (\[t, t\<^sub>0, ?g] \ ?f)) \ ((\ \ ?g) \ ?f) \ (\.the_\ \ ?f) \ \.the_\" using f \.the_\_props assoc_naturality [of t "\.the_\" ?f] \.\_simps(3) comp_assoc by auto also have "... = (t \ \.the_\) \ (t \ \.the_\ \ ?f) \ (t \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f]) \ \[t, t\<^sub>0, ?g \ ?f] \ (\[t \ t\<^sub>0, ?g, ?f] \ ((\ \ ?g) \ ?f)) \ (\.the_\ \ ?f) \ \.the_\" proof - have "seq \[t, t\<^sub>0, ?g \ ?f] \[t \ t\<^sub>0, ?g, ?f]" using f g by fastforce moreover have "inv (t \ \[t\<^sub>0, ?g, ?f]) = t \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f]" using f g by simp moreover have "iso (t \ \[t\<^sub>0, ?g, ?f])" using f g by simp have "\[t, t\<^sub>0 \ ?g, ?f] \ (\[t, t\<^sub>0, ?g] \ ?f) = (t \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f]) \ \[t, t\<^sub>0, ?g \ ?f] \ \[t \ t\<^sub>0, ?g, ?f]" proof - have "seq \[t, t\<^sub>0, ?g \ ?f] \[t \ t\<^sub>0, ?g, ?f]" using f g by fastforce moreover have "inv (t \ \[t\<^sub>0, ?g, ?f]) = t \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f]" using f g by simp moreover have "iso (t \ \[t\<^sub>0, ?g, ?f])" using f g by simp ultimately show ?thesis using A f g pentagon invert_side_of_triangle(1) by (metis \.w_simps(4) \.ide_base \.ide_leg0 \.leg0_simps(3)) qed thus ?thesis using comp_assoc by presburger qed also have "... = ((t \ \.the_\) \ (t \ \.the_\ \ ?f)) \ (t \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f]) \ \[t, t\<^sub>0, ?g \ ?f] \ (\ \ ?g \ ?f) \ \[t\<^sub>1, ?g, ?f] \ (\.the_\ \ ?f) \ \.the_\" using f g assoc_naturality [of \ ?g ?f] comp_assoc by simp also have "... = (t \ \.the_\ \ (\.the_\ \ ?f) \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f]) \ \[t, t\<^sub>0, ?g \ ?f] \ (\ \ ?g \ ?f) \ \[t\<^sub>1, ?g, ?f] \ (\.the_\ \ ?f) \ \.the_\" proof - have 1: "seq \.the_\ ((\.the_\ \ ?f) \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f])" using \_eq by auto hence "t \ (\.the_\ \ ?f) \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f] = (t \ \.the_\ \ ?f) \ (t \ \\<^sup>-\<^sup>1[t\<^sub>0, ?g, ?f])" using whisker_left \.ide_base by blast thus ?thesis using 1 whisker_left \.ide_base comp_assoc by presburger qed also have "... = ((t \ gf.the_\) \ \[t, t\<^sub>0, ?g \ ?f] \ (\ \ ?g \ ?f)) \ gf.the_\" using \_eq \_eq by (simp add: comp_assoc) finally show ?thesis using comp_assoc by presburger qed thus "((t \ gf.the_\) \ \[t, t\<^sub>0, ?g \ ?f] \ (\ \ ?g \ ?f)) \ arrow_of_spans_of_maps.the_\ (\) (\) (dom ((\ \ \ \ r\<^sub>0) \ \)) t\<^sub>1 (?g \ ?f) = \" by simp qed qed thus ?thesis using chine_is_induced_map induced_map_unique by simp qed end sublocale vertical_composite_of_arrows_of_tabulations_in_maps \ arrow_of_tabulations_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 t \ t\<^sub>0 t\<^sub>1 "\ \ \" using is_arrow_of_tabulations_in_maps by simp subsubsection "Horizontal Composite" locale horizontal_composite_of_arrows_of_tabulations_in_maps = bicategory_of_spans V H \ \ src trg + \: tabulation_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 + \: tabulation_in_maps V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 + \: tabulation_in_maps V H \ \ src trg t \ t\<^sub>0 t\<^sub>1 + \: tabulation_in_maps V H \ \ src trg u \ u\<^sub>0 u\<^sub>1 + \\: composite_tabulation_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 s \ s\<^sub>0 s\<^sub>1 + \\: composite_tabulation_in_maps V H \ \ src trg t \ t\<^sub>0 t\<^sub>1 u \ u\<^sub>0 u\<^sub>1 + \: arrow_of_tabulations_in_maps V H \ \ src trg r \ r\<^sub>0 r\<^sub>1 t \ t\<^sub>0 t\<^sub>1 \ + \: arrow_of_tabulations_in_maps V H \ \ src trg s \ s\<^sub>0 s\<^sub>1 u \ u\<^sub>0 u\<^sub>1 \ for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and r :: 'a and \ :: 'a and r\<^sub>0 :: 'a and r\<^sub>1 :: 'a and s :: 'a and \ :: 'a and s\<^sub>0 :: 'a and s\<^sub>1 :: 'a and t :: 'a and \ :: 'a and t\<^sub>0 :: 'a and t\<^sub>1 :: 'a and u :: 'a and \ :: 'a and u\<^sub>0 :: 'a and u\<^sub>1 :: 'a and \ :: 'a and \ :: 'a begin text \ $$ \xymatrix{ &&& {\rm src}~t_0u_1.\phi \ar[dl]_{\tau\mu.p_1} \ar[dr]^{\tau\mu.p_0} \ddtwocell\omit{^{t_0u_1.\phi}} \\ && {\rm src}~\tau \ar[dl]_{t_1} \ar[dr]^<>(0.4){t_0} \dtwocell\omit{^<-1>\tau} && {\rm src}~\mu \ar[dl]_{u_1} \ar[dr]^{u_0} \dtwocell\omit{^<-1>\mu} & \\ & {\rm trg}~t && {\rm src}~t = {\rm trg}~u \ar[ll]^{t} && {\rm src}~u \ar[ll]^{u} \\ & \xtwocell[r]{}\omit{^\omega} & {\rm src}~r_0s_1.\phi \ar[uuur]_<>(0.2){{\rm chine}} \ar[dl]^{\rho\sigma.p_1} \ar[dr]_{\rho\sigma.p_0\hspace{20pt}} \ddtwocell\omit{^{r_0s_1.\phi}} & \rrtwocell\omit{^\chi} && \\ & {\rm src}~\rho \ar[dl]_{r_1} \ar[dr]^{r_0} \ar[uuur]^<>(0.4){\omega.{\rm chine}} \dtwocell\omit{^\rho} && {\rm src}~\sigma \ar[dl]_{s_1} \ar[dr]^{s_0} \ar[uuur]^<>(0.4){\chi.{\rm chine}} \dtwocell\omit{^<-1>\sigma} & \\ {\rm trg}~r \ar@ {=}[uuur] && {\rm src}~r = {\rm trg}~s \ar[ll]^{r} \ar@ {=}[uuur] && {\rm src}~s \ar[ll]^{s} \ar@ {=}[uuur] \\ } $$ \ notation isomorphic (infix "\" 50) interpretation arrow_of_tabulations_in_maps V H \ \ src trg \r \ s\ \\.tab \s\<^sub>0 \ \\.p\<^sub>0\ \r\<^sub>1 \ \\.p\<^sub>1\ \t \ u\ \\.tab \u\<^sub>0 \ \\.p\<^sub>0\ \t\<^sub>1 \ \\.p\<^sub>1\ \\ \ \\ using \\.composable \.in_hom \.in_hom by unfold_locales auto lemma is_arrow_of_tabulations_in_maps: shows "arrow_of_tabulations_in_maps V H \ \ src trg (r \ s) \\.tab (s\<^sub>0 \ \\.p\<^sub>0) (r\<^sub>1 \ \\.p\<^sub>1) (t \ u) \\.tab (u\<^sub>0 \ \\.p\<^sub>0) (t\<^sub>1 \ \\.p\<^sub>1) (\ \ \)" .. sublocale arrow_of_tabulations_in_maps V H \ \ src trg \r \ s\ \\.tab \s\<^sub>0 \ \\.p\<^sub>0\ \r\<^sub>1 \ \\.p\<^sub>1\ \t \ u\ \\.tab \u\<^sub>0 \ \\.p\<^sub>0\ \t\<^sub>1 \ \\.p\<^sub>1\ \\ \ \\ using is_arrow_of_tabulations_in_maps by simp interpretation Maps: maps_category V H \ \ src trg .. notation Maps.comp (infixr "\" 55) interpretation r\<^sub>0s\<^sub>1: cospan_of_maps_in_bicategory_of_spans \(\)\ \(\)\ \ \ src trg s\<^sub>1 r\<^sub>0 using \.leg0_is_map \.leg1_is_map \\.composable apply unfold_locales by auto interpretation r\<^sub>0s\<^sub>1: arrow_of_tabulations_in_maps \(\)\ \(\)\ \ \ src trg \r\<^sub>0\<^sup>* \ s\<^sub>1\ r\<^sub>0s\<^sub>1.tab r\<^sub>0s\<^sub>1.p\<^sub>0 r\<^sub>0s\<^sub>1.p\<^sub>1 \r\<^sub>0\<^sup>* \ s\<^sub>1\ r\<^sub>0s\<^sub>1.tab r\<^sub>0s\<^sub>1.p\<^sub>0 r\<^sub>0s\<^sub>1.p\<^sub>1 \r\<^sub>0\<^sup>* \ s\<^sub>1\ using r\<^sub>0s\<^sub>1.is_arrow_of_tabulations_in_maps by simp interpretation t\<^sub>0u\<^sub>1: cospan_of_maps_in_bicategory_of_spans \(\)\ \(\)\ \ \ src trg u\<^sub>1 t\<^sub>0 using \.leg0_is_map \.leg1_is_map \\.composable apply unfold_locales by auto interpretation t\<^sub>0u\<^sub>1: arrow_of_tabulations_in_maps \(\)\ \(\)\ \ \ src trg \t\<^sub>0\<^sup>* \ u\<^sub>1\ t\<^sub>0u\<^sub>1.tab t\<^sub>0u\<^sub>1.p\<^sub>0 t\<^sub>0u\<^sub>1.p\<^sub>1 \t\<^sub>0\<^sup>* \ u\<^sub>1\ t\<^sub>0u\<^sub>1.tab t\<^sub>0u\<^sub>1.p\<^sub>0 t\<^sub>0u\<^sub>1.p\<^sub>1 \t\<^sub>0\<^sup>* \ u\<^sub>1\ using t\<^sub>0u\<^sub>1.is_arrow_of_tabulations_in_maps by simp interpretation E: self_evaluation_map V H \ \ src trg .. notation E.eval ("\_\") no_notation in_hom ("\_ : _ \ _\") text \ The following lemma states that the rectangular faces of the ``top prism'' commute up to isomorphism. This was not already proved in @{locale composite_tabulation_in_maps}, because there we did not consider any composite structure of the ``source'' 2-cell. There are common elements, though to the proof that the composite of tabulations is a tabulation and the present lemma. The proof idea is to use property \T2\ of the ``base'' tabulations to establish the existence of the desired isomorphisms. The proofs have to be carried out in sequence, starting from the ``output'' side, because the arrow \\\ required in the hypotheses of \T2\ depends, for the ``input'' tabulation, on the isomorphism constructed for the ``output'' tabulation. \ lemma prj_chine: shows "\\.p\<^sub>0 \ chine \ \.chine \ \\.p\<^sub>0" and "\\.p\<^sub>1 \ chine \ \.chine \ \\.p\<^sub>1" proof - have 1: "arrow_of_spans_of_maps V H \ \ src trg (s\<^sub>0 \ \\.p\<^sub>0) (r\<^sub>1 \ \\.p\<^sub>1) (u\<^sub>0 \ \\.p\<^sub>0) (t\<^sub>1 \ \\.p\<^sub>1) chine \ (((t \ u) \ the_\) \ \[t \ u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\\.tab \ chine)) \ the_\ = ((\ \ \) \ s\<^sub>0 \ \\.p\<^sub>0) \ \\.tab" using chine_is_induced_map by simp let ?u\<^sub>\ = "u \ s\<^sub>0 \ \\.p\<^sub>0" let ?w\<^sub>\ = "\.chine \ \\.p\<^sub>1" let ?w\<^sub>\' = "\\.p\<^sub>1 \ chine" have u\<^sub>\: "ide ?u\<^sub>\" using \.u_simps(3) by auto have w\<^sub>\: "ide ?w\<^sub>\ \ is_left_adjoint ?w\<^sub>\" by (simp add: \.is_map \.T0.antipar(1) left_adjoints_compose) have w\<^sub>\': "ide ?w\<^sub>\' \ is_left_adjoint ?w\<^sub>\'" by (simp add: is_map left_adjoints_compose) let ?\\<^sub>\ = "\[u, s\<^sub>0, \\.p\<^sub>0] \ ((\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1]" let ?\\<^sub>\' = "(u \ the_\) \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ (t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]" let ?\\<^sub>\ = "\[t\<^sub>1, \\.p\<^sub>1, chine] \ the_\ \ (inv \.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>1, \.chine, \\.p\<^sub>1]" have \\<^sub>\: "\?\\<^sub>\ : t\<^sub>0 \ ?w\<^sub>\ \ ?u\<^sub>\\" using \.T0.antipar(1) \.the_\_in_hom \.u_simps(3) by (intro comp_in_homI, auto) have \\<^sub>\': "\?\\<^sub>\' : t\<^sub>0 \ ?w\<^sub>\' \ ?u\<^sub>\\" proof (intro comp_in_homI) show "\\\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine] : t\<^sub>0 \ \\.p\<^sub>1 \ chine \ (t\<^sub>0 \ \\.p\<^sub>1) \ chine\" using t\<^sub>0u\<^sub>1.p\<^sub>1_simps assoc'_in_hom by simp show "\t\<^sub>0u\<^sub>1.\ \ chine : (t\<^sub>0 \ \\.p\<^sub>1) \ chine \ (u\<^sub>1 \ \\.p\<^sub>0) \ chine\" using \.T0.antipar(1) by (intro hcomp_in_vhom, auto) show "\(\ \ \\.p\<^sub>0) \ chine : (u\<^sub>1 \ \\.p\<^sub>0) \ chine \ ((u \ u\<^sub>0) \ \\.p\<^sub>0) \ chine\" by (intro hcomp_in_vhom, auto) show "\\[u, u\<^sub>0, \\.p\<^sub>0] \ chine : ((u \ u\<^sub>0) \ \\.p\<^sub>0) \ chine \ (u \ u\<^sub>0 \ \\.p\<^sub>0) \ chine\" using assoc_in_hom by auto show "\\[u, u\<^sub>0 \ \\.p\<^sub>0, chine] : (u \ u\<^sub>0 \ \\.p\<^sub>0) \ chine \ u \ (u\<^sub>0 \ \\.p\<^sub>0) \ chine\" by auto show "\u \ the_\ : u \ (u\<^sub>0 \ \\.p\<^sub>0) \ chine \ ?u\<^sub>\\" by (intro hcomp_in_vhom, auto) qed have \\<^sub>\: "\?\\<^sub>\ : t\<^sub>1 \ ?w\<^sub>\ \ t\<^sub>1 \ ?w\<^sub>\'\" proof (intro comp_in_homI) show "\\\<^sup>-\<^sup>1[t\<^sub>1, \.chine, \\.p\<^sub>1] : t\<^sub>1 \ ?w\<^sub>\ \ (t\<^sub>1 \ \.chine) \ \\.p\<^sub>1\" using \.T0.antipar(1) by auto show "\inv \.the_\ \ \\.p\<^sub>1 : (t\<^sub>1 \ \.chine) \ \\.p\<^sub>1 \ r\<^sub>1 \ \\.p\<^sub>1\" using \.the_\_props \.T0.antipar(1) by (intro hcomp_in_vhom, auto) show "\the_\ : r\<^sub>1 \ \\.p\<^sub>1 \ (t\<^sub>1 \ \\.p\<^sub>1) \ chine\" using the_\_in_hom(2) by simp show "\\[t\<^sub>1, \\.p\<^sub>1, chine] : (t\<^sub>1 \ \\.p\<^sub>1) \ chine \ t\<^sub>1 \ ?w\<^sub>\'\" using t\<^sub>0u\<^sub>1.p\<^sub>1_simps assoc_in_hom by simp qed define LHS where "LHS = (t \ ?\\<^sub>\) \ \[t, t\<^sub>0, ?w\<^sub>\] \ (\ \ ?w\<^sub>\)" have LHS: "\LHS : t\<^sub>1 \ ?w\<^sub>\ \ t \ ?u\<^sub>\\" proof (unfold LHS_def, intro comp_in_homI) show "\\ \ ?w\<^sub>\ : t\<^sub>1 \ \.chine \ \\.p\<^sub>1 \ (t \ t\<^sub>0) \ ?w\<^sub>\\" using \.T0.antipar(1) by (intro hcomp_in_vhom, auto) show "\\[t, t\<^sub>0, ?w\<^sub>\] : (t \ t\<^sub>0) \ ?w\<^sub>\ \ t \ t\<^sub>0 \ ?w\<^sub>\\" using \.T0.antipar(1) by auto show "\t \ ?\\<^sub>\ : t \ t\<^sub>0 \ ?w\<^sub>\ \ t \ ?u\<^sub>\\" proof - have "src t = trg (t\<^sub>0 \ \.chine \ r\<^sub>0s\<^sub>1.p\<^sub>1)" by (metis \.u_simps(3) \.ide_base \.ide_leg0 \.leg1_simps(3) \\.composable \\<^sub>\ arrI assoc_simps(3) r\<^sub>0s\<^sub>1.ide_u r\<^sub>0s\<^sub>1.p\<^sub>0_simps trg_vcomp vconn_implies_hpar(2)) thus ?thesis using \\<^sub>\ by blast qed qed define RHS where "RHS = ((t \ ?\\<^sub>\') \ \[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\')) \ ?\\<^sub>\" have RHS: "\RHS : t\<^sub>1 \ ?w\<^sub>\ \ t \ ?u\<^sub>\\" unfolding RHS_def proof show "\?\\<^sub>\ : t\<^sub>1 \ ?w\<^sub>\ \ t\<^sub>1 \ ?w\<^sub>\'\" using \\<^sub>\ by simp show "\(t \ ?\\<^sub>\') \ \[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\') : t\<^sub>1 \ ?w\<^sub>\' \ t \ ?u\<^sub>\\" proof show "\\[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\') : t\<^sub>1 \ ?w\<^sub>\' \ t \ t\<^sub>0 \ ?w\<^sub>\'\" using \.T0.antipar(1) by fastforce show "\t \ ?\\<^sub>\' : t \ t\<^sub>0 \ ?w\<^sub>\' \ t \ ?u\<^sub>\\" using w\<^sub>\' \\<^sub>\' \.leg0_simps(2) \.leg0_simps(3) hseqI' ideD(1) t\<^sub>0u\<^sub>1.p\<^sub>1_simps trg_hcomp \.base_in_hom(2) hcomp_in_vhom by presburger qed qed have eq: "LHS = RHS" proof - have "\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ LHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] \ (\.the_\ \ \\.p\<^sub>1) = \" proof - text \ Here we use \\.\_naturality\ to replace @{term \.chine} in favor of @{term \}. We have to bring @{term \.the_\}, @{term \}, and @{term \.the_\} together, with @{term \\.p\<^sub>1} on the right. \ have "\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ LHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] \ (\.the_\ \ \\.p\<^sub>1) = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \[u, s\<^sub>0, \\.p\<^sub>0] \ ((\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1]) \ \[t, t\<^sub>0, \.chine \ \\.p\<^sub>1] \ (\ \ \.chine \ \\.p\<^sub>1) \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] \ (\.the_\ \ \\.p\<^sub>1)" unfolding LHS_def using comp_assoc by presburger also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \[u, s\<^sub>0, \\.p\<^sub>0]) \ (t \ (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ (t \ \.the_\ \ \\.p\<^sub>1) \ (t \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1]) \ \[t, t\<^sub>0, \.chine \ \\.p\<^sub>1] \ ((\ \ \.chine \ \\.p\<^sub>1) \ \[t\<^sub>1, \.chine, \\.p\<^sub>1]) \ (\.the_\ \ \\.p\<^sub>1)" proof - have "t \ \[u, s\<^sub>0, \\.p\<^sub>0] \ ((\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] = (t \ \[u, s\<^sub>0, \\.p\<^sub>0]) \ (t \ (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ (t \ \.the_\ \ \\.p\<^sub>1) \ (t \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1])" using whisker_left \.ide_base \\<^sub>\ arrI seqE by (metis (full_types)) thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \[u, s\<^sub>0, \\.p\<^sub>0]) \ (t \ (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ (t \ \.the_\ \ \\.p\<^sub>1) \ ((t \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1]) \ \[t, t\<^sub>0, \.chine \ \\.p\<^sub>1] \ \[t \ t\<^sub>0, \.chine, \\.p\<^sub>1]) \ ((\ \ \.chine) \ \\.p\<^sub>1) \ (\.the_\ \ \\.p\<^sub>1)" proof - have "(\ \ \.chine \ \\.p\<^sub>1) \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] = \[t \ t\<^sub>0, \.chine, \\.p\<^sub>1] \ ((\ \ \.chine) \ \\.p\<^sub>1)" using assoc_naturality by (metis \.w_simps(2-6) \.leg1_simps(3) \\.leg1_simps(2) \.tab_simps(1) \.tab_simps(2,4-5) hseqE r\<^sub>0s\<^sub>1.leg1_simps(5) r\<^sub>0s\<^sub>1.leg1_simps(6)) thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \[u, s\<^sub>0, \\.p\<^sub>0]) \ (t \ (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ ((t \ \.the_\ \ \\.p\<^sub>1) \ \[t, t\<^sub>0 \ \.chine, \\.p\<^sub>1]) \ (\[t, t\<^sub>0, \.chine] \ \\.p\<^sub>1) \ ((\ \ \.chine) \ \\.p\<^sub>1) \ (\.the_\ \ \\.p\<^sub>1)" proof - have "(t \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1]) \ \[t, t\<^sub>0, \.chine \ \\.p\<^sub>1] \ \[t \ t\<^sub>0, \.chine, \\.p\<^sub>1] = \[t, t\<^sub>0 \ \.chine, \\.p\<^sub>1] \ (\[t, t\<^sub>0, \.chine] \ \\.p\<^sub>1)" proof - have "seq \[t, t\<^sub>0, \.chine \ \\.p\<^sub>1] \[t \ t\<^sub>0, \.chine, \\.p\<^sub>1]" by (simp add: \.T0.antipar(1)) moreover have "inv (t \ \[t\<^sub>0, \.chine, \\.p\<^sub>1]) = t \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1]" using \.T0.antipar(1) by simp ultimately show ?thesis using pentagon \.T0.antipar(1) iso_hcomp invert_side_of_triangle(1) [of "\[t, t\<^sub>0, \.chine \ \\.p\<^sub>1] \ \[t \ t\<^sub>0, \.chine, \\.p\<^sub>1]" "t \ \[t\<^sub>0, \.chine, \\.p\<^sub>1]" "\[t, t\<^sub>0 \ \.chine, \\.p\<^sub>1] \ (\[t, t\<^sub>0, \.chine] \ \\.p\<^sub>1)"] by simp qed thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \[u, s\<^sub>0, \\.p\<^sub>0]) \ (t \ (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ \[t, r\<^sub>0, \\.p\<^sub>1] \ (((t \ \.the_\) \ \\.p\<^sub>1) \ (\[t, t\<^sub>0, \.chine] \ \\.p\<^sub>1) \ ((\ \ \.chine) \ \\.p\<^sub>1)) \ (\.the_\ \ \\.p\<^sub>1)" proof - have "(t \ \.the_\ \ \\.p\<^sub>1) \ \[t, t\<^sub>0 \ \.chine, \\.p\<^sub>1] = \[t, r\<^sub>0, \\.p\<^sub>1] \ ((t \ \.the_\) \ \\.p\<^sub>1)" using assoc_naturality [of t \.the_\ \\.p\<^sub>1] \.\_simps(3) \\.leg1_simps(2) hseq_char by auto thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \[u, s\<^sub>0, \\.p\<^sub>0]) \ (t \ (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ \[t, r\<^sub>0, \\.p\<^sub>1] \ ((\ \ r\<^sub>0) \ \ \ \\.p\<^sub>1)" using whisker_right \.T0.antipar(1) \.\_simps(1) \.\_naturality comp_assoc by fastforce also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ ((t \ \[u, s\<^sub>0, \\.p\<^sub>0]) \ (t \ (\ \ s\<^sub>0) \ \\.p\<^sub>0)) \ (t \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ \[t, r\<^sub>0, \\.p\<^sub>1] \ ((\ \ r\<^sub>0) \ \ \ \\.p\<^sub>1)" proof - have "t \ (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0 = (t \ (\ \ s\<^sub>0) \ \\.p\<^sub>0) \ (t \ \ \ \\.p\<^sub>0)" using whisker_left whisker_right \.T0.antipar(1) by (metis (full_types) \.\_simps(1) \.ide_base \\<^sub>\ arrI r\<^sub>0s\<^sub>1.ide_u seqE) thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \ \ s\<^sub>0 \ \\.p\<^sub>0) \ (t \ \[s, s\<^sub>0, \\.p\<^sub>0]) \ (t \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ \[t, r\<^sub>0, \\.p\<^sub>1] \ ((\ \ r\<^sub>0) \ \ \ \\.p\<^sub>1)" proof - have "(t \ \[u, s\<^sub>0, \\.p\<^sub>0]) \ (t \ (\ \ s\<^sub>0) \ \\.p\<^sub>0) = t \ \[u, s\<^sub>0, \\.p\<^sub>0] \ ((\ \ s\<^sub>0) \ \\.p\<^sub>0)" using \.in_hom whisker_left by auto also have "... = t \ (\ \ s\<^sub>0 \ \\.p\<^sub>0) \ \[s, s\<^sub>0, \\.p\<^sub>0]" using assoc_naturality [of \ s\<^sub>0 \\.p\<^sub>0] \.in_hom by auto also have "... = (t \ \ \ s\<^sub>0 \ \\.p\<^sub>0) \ (t \ \[s, s\<^sub>0, \\.p\<^sub>0])" proof - have "seq (\ \ s\<^sub>0 \ \\.p\<^sub>0) \[s, s\<^sub>0, \\.p\<^sub>0]" using \.in_hom apply (intro seqI hseqI) apply auto proof - show "\\ : src u \ trg \\" by (metis \.\_simps(1) \.u_simps(3) hseqE in_hhom_def seqE) show "dom (\ \ s\<^sub>0 \ \\.p\<^sub>0) = s \ s\<^sub>0 \ \\.p\<^sub>0" by (metis \_simps(1) \.in_hom hcomp_simps(1,3) hseq_char in_homE seqE u_simps(4)) qed thus ?thesis using whisker_left by simp qed finally show ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \ \ s\<^sub>0 \ \\.p\<^sub>0) \ (t \ \[s, s\<^sub>0, \\.p\<^sub>0]) \ (t \ \ \ \\.p\<^sub>0) \ (t \ r\<^sub>0s\<^sub>1.\) \ (\[t, r\<^sub>0, \\.p\<^sub>1] \ ((\ \ r\<^sub>0) \ \\.p\<^sub>1)) \ (\ \ \\.p\<^sub>1)" using whisker_right comp_assoc by simp also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ \ \ s\<^sub>0 \ \\.p\<^sub>0) \ (t \ \[s, s\<^sub>0, \\.p\<^sub>0]) \ (t \ \ \ \\.p\<^sub>0) \ ((t \ r\<^sub>0s\<^sub>1.\) \ (\ \ r\<^sub>0 \ \\.p\<^sub>1)) \ \[r, r\<^sub>0, \\.p\<^sub>1] \ (\ \ \\.p\<^sub>1)" using assoc_naturality [of \ r\<^sub>0 \\.p\<^sub>1] \.in_hom \.T0.antipar(1) comp_assoc by fastforce also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ ((t \ \ \ s\<^sub>0 \ \\.p\<^sub>0) \ (t \ \[s, s\<^sub>0, \\.p\<^sub>0]) \ (t \ \ \ \\.p\<^sub>0)) \ (\ \ s\<^sub>1 \ \\.p\<^sub>0) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, \\.p\<^sub>1] \ (\ \ \\.p\<^sub>1)" proof - have "(t \ r\<^sub>0s\<^sub>1.\) \ (\ \ r\<^sub>0 \ \\.p\<^sub>1) = \ \ r\<^sub>0s\<^sub>1.\" using comp_cod_arr comp_arr_dom \.in_hom interchange comp_ide_arr by (metis \.base_in_hom(2) \.ide_base r\<^sub>0s\<^sub>1.\_simps(1) r\<^sub>0s\<^sub>1.\_simps(4) seqI') also have "... = (\ \ s\<^sub>1 \ \\.p\<^sub>0) \ (r \ r\<^sub>0s\<^sub>1.\)" using r\<^sub>0s\<^sub>1.\_in_hom comp_cod_arr comp_arr_dom \.in_hom interchange by (metis in_homE) finally have "(t \ r\<^sub>0s\<^sub>1.\) \ (\ \ r\<^sub>0 \ \\.p\<^sub>1) = (\ \ s\<^sub>1 \ \\.p\<^sub>0) \ (r \ r\<^sub>0s\<^sub>1.\)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ ((t \ (\ \ s\<^sub>0 \ \\.p\<^sub>0) \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0)) \ (\ \ s\<^sub>1 \ \\.p\<^sub>0)) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, \\.p\<^sub>1] \ (\ \ \\.p\<^sub>1)" using whisker_left \.T0.antipar(1) \\.composable \.in_hom comp_assoc by auto also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (\ \ (\ \ s\<^sub>0 \ \\.p\<^sub>0) \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0)) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, \\.p\<^sub>1] \ (\ \ \\.p\<^sub>1)" proof - have "(t \ (\ \ s\<^sub>0 \ \\.p\<^sub>0) \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0)) \ (\ \ s\<^sub>1 \ \\.p\<^sub>0) = \ \ (\ \ s\<^sub>0 \ \\.p\<^sub>0) \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0)" proof - have "\(\ \ s\<^sub>0 \ \\.p\<^sub>0) \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0) : s\<^sub>1 \ \\.p\<^sub>0 \ u \ s\<^sub>0 \ \\.p\<^sub>0\" using \.in_hom \.in_hom by force thus ?thesis by (metis (no_types) \.in_hom comp_arr_dom comp_cod_arr in_homE interchange) qed thus ?thesis using comp_assoc by presburger qed also have "... = (\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (\ \ \ \ s\<^sub>0 \ \\.p\<^sub>0)) \ (r \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0)) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, \\.p\<^sub>1] \ (\ \ \\.p\<^sub>1)" proof - have "\ \ (\ \ s\<^sub>0 \ \\.p\<^sub>0) \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0) = (\ \ \ \ s\<^sub>0 \ \\.p\<^sub>0) \ (r \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0))" proof - have "seq (\ \ s\<^sub>0 \ \\.p\<^sub>0) (\[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0))" using \.in_hom by force thus ?thesis using comp_arr_dom comp_cod_arr \.in_hom \.in_hom interchange by (metis in_homE) qed thus ?thesis using comp_assoc by presburger qed also have "... = ((\ \ \) \ s\<^sub>0 \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ \\.p\<^sub>0] \ (r \ \[s, s\<^sub>0, \\.p\<^sub>0] \ (\ \ \\.p\<^sub>0)) \ (r \ r\<^sub>0s\<^sub>1.\) \ \[r, r\<^sub>0, \\.p\<^sub>1] \ (\ \ \\.p\<^sub>1)" proof - have "\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (\ \ \ \ s\<^sub>0 \ \\.p\<^sub>0) = ((\ \ \) \ s\<^sub>0 \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[r, s, s\<^sub>0 \ \\.p\<^sub>0]" using assoc_naturality \.in_hom \.in_hom by (metis \\.leg0_simps(3) assoc'_naturality hcomp_in_vhomE in_hom in_homE u_simps(2) u_simps(4) u_simps(5)) thus ?thesis using comp_assoc by presburger qed also have "... = \" using whisker_left \\.tab_def comp_assoc by simp finally show ?thesis by auto qed also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ RHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] \ (\.the_\ \ \\.p\<^sub>1)" proof - text \Now cancel @{term \.the_\} and its inverse.\ have "\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ RHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] \ (\.the_\ \ \\.p\<^sub>1) = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ (u \ the_\) \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ (t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t, t\<^sub>0, \\.p\<^sub>1 \ chine] \ (\ \ \\.p\<^sub>1 \ chine) \ \[t\<^sub>1, \\.p\<^sub>1, chine] \ the_\ \ (inv \.the_\ \ \\.p\<^sub>1) \ ((\\<^sup>-\<^sup>1[t\<^sub>1, \.chine, \\.p\<^sub>1]) \ \[t\<^sub>1, \.chine, \\.p\<^sub>1]) \ (\.the_\ \ \\.p\<^sub>1)" unfolding RHS_def using comp_assoc by presburger also have "... = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ (u \ the_\) \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ (t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t, t\<^sub>0, \\.p\<^sub>1 \ chine] \ (\ \ \\.p\<^sub>1 \ chine) \ \[t\<^sub>1, \\.p\<^sub>1, chine] \ the_\" proof - have "the_\ \ (inv \.the_\ \ \\.p\<^sub>1) \ ((\\<^sup>-\<^sup>1[t\<^sub>1, \.chine, \\.p\<^sub>1]) \ \[t\<^sub>1, \.chine, \\.p\<^sub>1]) \ (\.the_\ \ \\.p\<^sub>1) = the_\ \ (inv \.the_\ \ \\.p\<^sub>1) \ ((t\<^sub>1 \ \.chine) \ \\.p\<^sub>1) \ (\.the_\ \ \\.p\<^sub>1)" using comp_inv_arr \.T0.antipar(1) comp_assoc_assoc' by simp also have "... = the_\ \ (inv \.the_\ \ \\.p\<^sub>1) \ (\.the_\ \ \\.p\<^sub>1)" using comp_cod_arr \.T0.antipar(1) by simp also have "... = the_\ \ (r\<^sub>1 \ \\.p\<^sub>1)" using whisker_right [of \\.p\<^sub>1] r\<^sub>0s\<^sub>1.ide_leg1 \.the_\_props(2) \.the_\_simps(4) \.leg1_simps(2) comp_inv_arr' by metis also have "... = the_\" using comp_arr_dom by simp finally show ?thesis using comp_assoc by simp qed text \ Now reassociate to move @{term the_\} to the left and get other terms composed with @{term chine}, where they can be reduced to @{term \\.tab}. \ also have "... = (\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ (t \ u \ the_\)) \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ (t \ (\ \ \\.p\<^sub>0) \ chine) \ (t \ t\<^sub>0u\<^sub>1.\ \ chine) \ (t \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t, t\<^sub>0, \\.p\<^sub>1 \ chine] \ (\ \ \\.p\<^sub>1 \ chine) \ \[t\<^sub>1, \\.p\<^sub>1, chine] \ the_\" proof - have "arr ((u \ the_\) \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ (t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine])" using \\<^sub>\' by blast moreover have "arr (\[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ (t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine])" using calculation by blast moreover have "arr ((\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ (t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine])" using calculation by blast moreover have "arr (((\ \ \\.p\<^sub>0) \ chine) \ (t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine])" using calculation by blast moreover have "arr ((t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine])" using calculation by blast ultimately have "t \ (u \ the_\) \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ (t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine] = (t \ u \ the_\) \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ (t \ (\ \ \\.p\<^sub>0) \ chine) \ (t \ t\<^sub>0u\<^sub>1.\ \ chine) \ (t \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine])" using whisker_left \.T0.antipar(1) \.ide_base by presburger thus ?thesis using comp_assoc by presburger qed also have "... = ((t \ u) \ the_\) \ \\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ (t \ (\ \ \\.p\<^sub>0) \ chine) \ (t \ t\<^sub>0u\<^sub>1.\ \ chine) \ (t \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t, t\<^sub>0, \\.p\<^sub>1 \ chine] \ ((\ \ \\.p\<^sub>1 \ chine) \ \[t\<^sub>1, \\.p\<^sub>1, chine]) \ the_\" using assoc'_naturality [of t u the_\] \\.composable \_simps(3) comp_assoc by auto also have "... = ((t \ u) \ the_\) \ \\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ (t \ (\ \ \\.p\<^sub>0) \ chine) \ (t \ t\<^sub>0u\<^sub>1.\ \ chine) \ ((t \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t, t\<^sub>0, \\.p\<^sub>1 \ chine] \ \[t \ t\<^sub>0, \\.p\<^sub>1, chine]) \ ((\ \ \\.p\<^sub>1) \ chine) \ the_\" proof - have "(\ \ \\.p\<^sub>1 \ chine) \ \[t\<^sub>1, \\.p\<^sub>1, chine] = \[t \ t\<^sub>0, \\.p\<^sub>1, chine] \ ((\ \ \\.p\<^sub>1) \ chine)" using assoc_naturality by (metis \.leg1_simps(3) \.tab_simps(1,2,4) \.tab_simps(5) \\.leg0_simps(2) \\.leg1_simps(2) hseqE src_hcomp t\<^sub>0u\<^sub>1.leg1_simps(3,5-6) w_simps(2) w_simps(4-6)) thus ?thesis using comp_assoc by presburger qed also have "... = ((t \ u) \ the_\) \ \\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ (t \ (\ \ \\.p\<^sub>0) \ chine) \ ((t \ t\<^sub>0u\<^sub>1.\ \ chine) \ \[t, t\<^sub>0 \ \\.p\<^sub>1, chine]) \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine) \ ((\ \ \\.p\<^sub>1) \ chine) \ the_\" proof - have "(t \ \\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t, t\<^sub>0, \\.p\<^sub>1 \ chine] \ \[t \ t\<^sub>0, \\.p\<^sub>1, chine] = \[t, t\<^sub>0 \ \\.p\<^sub>1, chine] \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine)" using pentagon t\<^sub>0u\<^sub>1.p\<^sub>1_simps uw\ \.T0.antipar(1) iso_hcomp comp_assoc_assoc' invert_side_of_triangle(1) [of "\[t, t\<^sub>0, \\.p\<^sub>1 \ chine] \ \[t \ t\<^sub>0, \\.p\<^sub>1, chine]" "t \ \[t\<^sub>0, \\.p\<^sub>1, chine]" "\[t, t\<^sub>0 \ \\.p\<^sub>1, chine] \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine)"] by auto thus ?thesis using comp_assoc by presburger qed also have "... = ((t \ u) \ the_\) \ \\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((t \ (\ \ \\.p\<^sub>0) \ chine) \ \[t, u\<^sub>1 \ \\.p\<^sub>0, chine]) \ ((t \ t\<^sub>0u\<^sub>1.\) \ chine) \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine) \ ((\ \ \\.p\<^sub>1) \ chine) \ the_\" proof - have "(t \ t\<^sub>0u\<^sub>1.\ \ chine) \ \[t, t\<^sub>0 \ \\.p\<^sub>1, chine] = \[t, u\<^sub>1 \ \\.p\<^sub>0, chine] \ ((t \ t\<^sub>0u\<^sub>1.\) \ chine)" using assoc_naturality [of t t\<^sub>0u\<^sub>1.\ chine] t\<^sub>0u\<^sub>1.cospan by auto thus ?thesis using comp_assoc by presburger qed also have "... = ((t \ u) \ the_\) \ \\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ \[t, (u \ u\<^sub>0) \ \\.p\<^sub>0, chine] \ ((t \ \ \ \\.p\<^sub>0) \ chine) \ ((t \ t\<^sub>0u\<^sub>1.\) \ chine) \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine) \ ((\ \ \\.p\<^sub>1) \ chine) \ the_\" proof - have "(t \ (\ \ \\.p\<^sub>0) \ chine) \ \[t, u\<^sub>1 \ \\.p\<^sub>0, chine] = \[t, (u \ u\<^sub>0) \ \\.p\<^sub>0, chine] \ ((t \ (\ \ \\.p\<^sub>0)) \ chine)" using assoc_naturality [of t "\ \ \\.p\<^sub>0" chine] by (simp add: \\.composable) thus ?thesis using comp_assoc by presburger qed also have "... = ((t \ u) \ the_\) \ \\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ \[t, (u \ u\<^sub>0) \ \\.p\<^sub>0, chine] \ ((t \ \\<^sup>-\<^sup>1[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ ((t \ \[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ ((t \ \ \ \\.p\<^sub>0) \ chine) \ ((t \ t\<^sub>0u\<^sub>1.\) \ chine) \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine) \ ((\ \ \\.p\<^sub>1) \ chine) \ the_\" proof - have "(((t \ \\<^sup>-\<^sup>1[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ ((t \ \[u, u\<^sub>0, \\.p\<^sub>0]) \ chine)) \ ((t \ \ \ \\.p\<^sub>0) \ chine) = ((t \ ((u \ u\<^sub>0) \ \\.p\<^sub>0)) \ chine) \ ((t \ \ \ \\.p\<^sub>0) \ chine)" using whisker_right whisker_left [of t "\\<^sup>-\<^sup>1[u, u\<^sub>0, \\.p\<^sub>0]" "\[u, u\<^sub>0, \\.p\<^sub>0]"] \\.composable comp_assoc_assoc' by simp also have "... = (t \ \ \ \\.p\<^sub>0) \ chine" using comp_cod_arr \\.composable by simp finally have "(((t \ \\<^sup>-\<^sup>1[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ ((t \ \[u, u\<^sub>0, \\.p\<^sub>0]) \ chine)) \ ((t \ \ \ \\.p\<^sub>0) \ chine) = (t \ \ \ \\.p\<^sub>0) \ chine" by simp thus ?thesis using comp_assoc by metis qed also have "... = ((t \ u) \ the_\) \ \\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ \[t, (u \ u\<^sub>0) \ \\.p\<^sub>0, chine] \ ((t \ \\<^sup>-\<^sup>1[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ (((\[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine) \ (\\<^sup>-\<^sup>1[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine)) \ ((t \ \[u, u\<^sub>0, \\.p\<^sub>0]) \ chine)) \ ((t \ \ \ \\.p\<^sub>0) \ chine) \ ((t \ t\<^sub>0u\<^sub>1.\) \ chine) \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine) \ ((\ \ \\.p\<^sub>1) \ chine) \ the_\" proof - have "((\[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine) \ (\\<^sup>-\<^sup>1[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine)) \ ((t \ \[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) = ((t \ \[u, u\<^sub>0, \\.p\<^sub>0]) \ chine)" using comp_inv_arr' comp_cod_arr \\.composable comp_assoc_assoc' whisker_right [of chine "\[t, u, u\<^sub>0 \ \\.p\<^sub>0]" "\\<^sup>-\<^sup>1[t, u, u\<^sub>0 \ \\.p\<^sub>0]"] by simp thus ?thesis using comp_assoc by simp qed also have "... = ((t \ u) \ the_\) \ \\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ \[t, (u \ u\<^sub>0) \ \\.p\<^sub>0, chine] \ ((t \ \\<^sup>-\<^sup>1[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ (\[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine) \ ((\\<^sup>-\<^sup>1[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine) \ ((t \ \[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ ((t \ \ \ \\.p\<^sub>0) \ chine) \ ((t \ t\<^sub>0u\<^sub>1.\) \ chine) \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine) \ ((\ \ \\.p\<^sub>1) \ chine)) \ the_\" using comp_assoc by presburger also have "... = ((t \ u) \ the_\) \ (\\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ \[t, (u \ u\<^sub>0) \ \\.p\<^sub>0, chine] \ ((t \ \\<^sup>-\<^sup>1[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ (\[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine)) \ (\\.tab \ chine) \ the_\" proof - have "(\\<^sup>-\<^sup>1[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine) \ ((t \ \[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ ((t \ \ \ \\.p\<^sub>0) \ chine) \ ((t \ t\<^sub>0u\<^sub>1.\) \ chine) \ (\[t, t\<^sub>0, \\.p\<^sub>1] \ chine) \ ((\ \ \\.p\<^sub>1) \ chine) = \\.tab \ chine" using uw\ whisker_right [of chine] by (metis \\.tab_def \\.tab_in_vhom' arrI seqE) thus ?thesis using comp_assoc by presburger qed also have "... = ((t \ u) \ the_\) \ \[t \ u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\\.tab \ chine) \ the_\" proof - have "\\<^sup>-\<^sup>1[t, u, (u\<^sub>0 \ \\.p\<^sub>0) \ chine] \ (t \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine]) \ (t \ \[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ \[t, (u \ u\<^sub>0) \ \\.p\<^sub>0, chine] \ ((t \ \\<^sup>-\<^sup>1[u, u\<^sub>0, \\.p\<^sub>0]) \ chine) \ (\[t, u, u\<^sub>0 \ \\.p\<^sub>0] \ chine) = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\t\<^bold>\, \<^bold>\u\<^bold>\, (\<^bold>\u\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\\\.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\chine\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\t\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\u\<^bold>\, \<^bold>\u\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\\\.p\<^sub>0\<^bold>\, \<^bold>\chine\<^bold>\\<^bold>]) \<^bold>\ (\<^bold>\t\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\u\<^bold>\, \<^bold>\u\<^sub>0\<^bold>\, \<^bold>\\\.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\chine\<^bold>\) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\t\<^bold>\, (\<^bold>\u\<^bold>\ \<^bold>\ \<^bold>\u\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\\\.p\<^sub>0\<^bold>\, \<^bold>\chine\<^bold>\\<^bold>] \<^bold>\ ((\<^bold>\t\<^bold>\ \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\u\<^bold>\, \<^bold>\u\<^sub>0\<^bold>\, \<^bold>\\\.p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\chine\<^bold>\) \<^bold>\ (\<^bold>\\<^bold>[\<^bold>\t\<^bold>\, \<^bold>\u\<^bold>\, \<^bold>\u\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\\\.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\chine\<^bold>\)\" using \'_def \_def \\.composable by simp also have "... = \\<^bold>\\<^bold>[\<^bold>\t\<^bold>\ \<^bold>\ \<^bold>\u\<^bold>\, \<^bold>\u\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\\\.p\<^sub>0\<^bold>\, \<^bold>\chine\<^bold>\\<^bold>]\" using \\.composable apply (intro E.eval_eqI) by simp_all also have "... = \[t \ u, u\<^sub>0 \ \\.p\<^sub>0, chine]" using \'_def \_def \\.composable by simp finally show ?thesis by simp qed also have "... = \" using \_naturality by simp finally show ?thesis by simp qed finally have "\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ LHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] \ (\.the_\ \ \\.p\<^sub>1) = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0] \ RHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] \ (\.the_\ \ \\.p\<^sub>1)" by blast (* * TODO: This is common enough that there should be "cancel_iso_left" and * "cancel_iso_right" rules for doing it. *) hence "(LHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1]) \ (\.the_\ \ \\.p\<^sub>1) = (RHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1]) \ (\.the_\ \ \\.p\<^sub>1)" using u\<^sub>\ r\<^sub>0s\<^sub>1.ide_u LHS RHS iso_is_section [of "\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ \\.p\<^sub>0]"] section_is_mono monoE \\.composable comp_assoc by (metis (no_types, lifting) \_simps(1) \.ide_base \\\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ r\<^sub>0s\<^sub>1.p\<^sub>0] \ LHS \ \[t\<^sub>1, \.chine, r\<^sub>0s\<^sub>1.p\<^sub>1] \ (\.the_\ \ r\<^sub>0s\<^sub>1.p\<^sub>1) = ((\ \ \) \ s\<^sub>0 \ r\<^sub>0s\<^sub>1.p\<^sub>0) \ \\.tab\ \.ide_base hseq_char ideD(1) ide_u iso_assoc') hence 1: "LHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1] = RHS \ \[t\<^sub>1, \.chine, \\.p\<^sub>1]" using epiE LHS RHS iso_is_retraction retraction_is_epi \\.composable \.the_\_props iso_hcomp by (metis \_simps(1) \.the_\_simps(2) \((\ \ \) \ s\<^sub>0 \ r\<^sub>0s\<^sub>1.p\<^sub>0) \ \\.tab = \\<^sup>-\<^sup>1[t, u, s\<^sub>0 \ r\<^sub>0s\<^sub>1.p\<^sub>0] \ RHS \ \[t\<^sub>1, \.chine, r\<^sub>0s\<^sub>1.p\<^sub>1] \ (\.the_\ \ r\<^sub>0s\<^sub>1.p\<^sub>1)\ \.leg1_simps(3) ide_is_iso local.comp_assoc r\<^sub>0s\<^sub>1.ide_leg1 r\<^sub>0s\<^sub>1.p\<^sub>1_simps seqE) show "LHS = RHS" proof - have "epi \[t\<^sub>1, \.chine, \\.p\<^sub>1]" using iso_is_retraction retraction_is_epi \.T0.antipar(1) by simp moreover have "seq LHS \[t\<^sub>1, \.chine, \\.p\<^sub>1]" using LHS \.T0.antipar(1) by auto moreover have "seq RHS \[t\<^sub>1, \.chine, \\.p\<^sub>1]" using RHS \.T0.antipar(1) by auto ultimately show ?thesis using epiE 1 by blast qed qed have 1: "\!\. \\ : ?w\<^sub>\ \ ?w\<^sub>\'\ \ ?\\<^sub>\ = t\<^sub>1 \ \ \ ?\\<^sub>\ = ?\\<^sub>\' \ (t\<^sub>0 \ \)" using LHS_def RHS_def u\<^sub>\ w\<^sub>\ w\<^sub>\' \\<^sub>\ \\<^sub>\ \\<^sub>\' eq \.T2 [of ?w\<^sub>\ ?w\<^sub>\' ?\\<^sub>\ ?u\<^sub>\ ?\\<^sub>\' ?\\<^sub>\] by fastforce obtain \\<^sub>\ where \\<^sub>\: "\\\<^sub>\ : ?w\<^sub>\ \ ?w\<^sub>\'\ \ ?\\<^sub>\ = t\<^sub>1 \ \\<^sub>\ \ ?\\<^sub>\ = ?\\<^sub>\' \ (t\<^sub>0 \ \\<^sub>\)" using 1 by auto text \ At this point we could show that @{term \\<^sub>\} is invertible using \BS3\, but we want to avoid using \BS3\ if possible and we also want to establish a characterization of @{term "inv \\<^sub>\"}. So we show the invertibility of @{term \\<^sub>\} directly, using a few more applications of \T2\. \ have iso_\\<^sub>\: "iso ?\\<^sub>\" using uw\ \\<^sub>\ the_\_props \.the_\_props hseqI' iso_assoc' \.hseq_leg\<^sub>0 apply (intro isos_compose) apply (metis \.is_ide \\.leg1_simps(2) \.ide_leg1 \.leg1_simps(2) \.leg1_simps(3) hseqE r\<^sub>0s\<^sub>1.ide_leg1 hcomp_simps(1) vconn_implies_hpar(3)) apply (metis \\.leg1_simps(2) hseqE ide_is_iso r\<^sub>0s\<^sub>1.ide_leg1 src_inv iso_inv_iso iso_hcomp vconn_implies_hpar(1)) apply blast apply blast apply blast apply (metis \.ide_leg1 \.leg1_simps(3) hseqE ide_char iso_assoc t\<^sub>0u\<^sub>1.ide_leg1 t\<^sub>0u\<^sub>1.p\<^sub>1_simps w\<^sub>\') by blast hence eq': "((t \ ?\\<^sub>\') \ \[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\')) = ((t \ ?\\<^sub>\) \ \[t, t\<^sub>0, ?w\<^sub>\] \ (\ \ ?w\<^sub>\)) \ inv ?\\<^sub>\" proof - have "seq ((t \ ?\\<^sub>\') \ \[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\')) ?\\<^sub>\" using LHS RHS_def eq by blast hence "(t \ ?\\<^sub>\') \ \[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\') = (((t \ ?\\<^sub>\') \ \[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\')) \ ?\\<^sub>\) \ inv ?\\<^sub>\" by (meson invert_side_of_triangle(2) iso_\\<^sub>\) thus ?thesis using LHS_def RHS_def eq by argo qed have 2: "\!\. \\ : ?w\<^sub>\' \ ?w\<^sub>\\ \ inv ?\\<^sub>\ = t\<^sub>1 \ \ \ ?\\<^sub>\' = ?\\<^sub>\ \ (t\<^sub>0 \ \)" using u\<^sub>\ w\<^sub>\ w\<^sub>\' \\<^sub>\ \\<^sub>\ \\<^sub>\' eq' \.T2 [of ?w\<^sub>\' ?w\<^sub>\ ?\\<^sub>\'?u\<^sub>\ ?\\<^sub>\ "inv ?\\<^sub>\"] iso_\\<^sub>\ comp_assoc by blast obtain \\<^sub>\' where \\<^sub>\': "\\\<^sub>\' : ?w\<^sub>\' \ ?w\<^sub>\\ \ inv ?\\<^sub>\ = t\<^sub>1 \ \\<^sub>\' \ ?\\<^sub>\' = ?\\<^sub>\ \ (t\<^sub>0 \ \\<^sub>\')" using 2 by auto have "inverse_arrows \\<^sub>\ \\<^sub>\'" proof have "\\\<^sub>\' \ \\<^sub>\ : ?w\<^sub>\ \ ?w\<^sub>\\" using \\<^sub>\ \\<^sub>\' by auto moreover have "t\<^sub>1 \ \\<^sub>\' \ \\<^sub>\ = t\<^sub>1 \ ?w\<^sub>\" using \\<^sub>\ \\<^sub>\' whisker_left \\<^sub>\ iso_\\<^sub>\ comp_inv_arr' by (metis (no_types, lifting) \.ide_leg1 calculation in_homE) moreover have "?\\<^sub>\ = ?\\<^sub>\ \ (t\<^sub>0 \ \\<^sub>\' \ \\<^sub>\)" proof - have "?\\<^sub>\ = ?\\<^sub>\' \ (t\<^sub>0 \ \\<^sub>\)" using \\<^sub>\ by simp also have "... = ?\\<^sub>\ \ (t\<^sub>0 \ \\<^sub>\') \ (t\<^sub>0 \ \\<^sub>\)" using \\<^sub>\' comp_assoc by simp also have "... = ?\\<^sub>\ \ (t\<^sub>0 \ \\<^sub>\' \ \\<^sub>\)" using \\<^sub>\ \\<^sub>\' whisker_left by (metis (full_types) \.ide_leg0 seqI') finally show ?thesis by simp qed moreover have "\\. \\ : ?w\<^sub>\ \ ?w\<^sub>\\ \ t\<^sub>1 \ \ = t\<^sub>1 \ ?w\<^sub>\ \ ?\\<^sub>\ = ?\\<^sub>\ \ (t\<^sub>0 \ \) \ \ = ?w\<^sub>\" proof - have "\!\. \\ : ?w\<^sub>\ \ ?w\<^sub>\\ \ t\<^sub>1 \ ?w\<^sub>\ = t\<^sub>1 \ \ \ ?\\<^sub>\ = ?\\<^sub>\ \ (t\<^sub>0 \ \)" proof - have "(t \ ?\\<^sub>\) \ \[t, t\<^sub>0, ?w\<^sub>\] \ (\ \ ?w\<^sub>\) = ((t \ ?\\<^sub>\) \ \[t, t\<^sub>0, ?w\<^sub>\] \ (\ \ ?w\<^sub>\)) \ (t\<^sub>1 \ ?w\<^sub>\)" by (metis LHS LHS_def comp_arr_dom in_homE) thus ?thesis using w\<^sub>\ \\<^sub>\ \.w_simps(4) \.leg1_in_hom(2) \.leg1_simps(3) hcomp_in_vhom ideD(1) trg_hcomp ide_in_hom(2) \.T2 by presburger qed thus "\\. \\ : ?w\<^sub>\ \ ?w\<^sub>\\ \ t\<^sub>1 \ \ = t\<^sub>1 \ ?w\<^sub>\ \ ?\\<^sub>\ = ?\\<^sub>\ \ (t\<^sub>0 \ \) \ \ = ?w\<^sub>\" by (metis \\<^sub>\ comp_arr_dom ide_in_hom(2) in_homE w\<^sub>\) qed ultimately have "\\<^sub>\' \ \\<^sub>\ = ?w\<^sub>\" by simp thus "ide (\\<^sub>\' \ \\<^sub>\)" using w\<^sub>\ by simp have "\\\<^sub>\ \ \\<^sub>\' : ?w\<^sub>\' \ ?w\<^sub>\'\" using \\<^sub>\ \\<^sub>\' by auto moreover have "t\<^sub>1 \ \\<^sub>\ \ \\<^sub>\' = t\<^sub>1 \ ?w\<^sub>\'" by (metis \\<^sub>\ \\<^sub>\ \\<^sub>\' \.ide_leg1 calculation comp_arr_inv' in_homE iso_\\<^sub>\ whisker_left) moreover have "?\\<^sub>\' = ?\\<^sub>\' \ (t\<^sub>0 \ \\<^sub>\ \ \\<^sub>\')" proof - have "?\\<^sub>\' = ?\\<^sub>\ \ (t\<^sub>0 \ \\<^sub>\')" using \\<^sub>\' by simp also have "... = ?\\<^sub>\' \ (t\<^sub>0 \ \\<^sub>\) \ (t\<^sub>0 \ \\<^sub>\')" using \\<^sub>\ comp_assoc by simp also have "... = ?\\<^sub>\' \ (t\<^sub>0 \ \\<^sub>\ \ \\<^sub>\')" using \\<^sub>\ \\<^sub>\' whisker_left \.ide_leg0 by fastforce finally show ?thesis by simp qed moreover have "\\. \\ : ?w\<^sub>\' \ ?w\<^sub>\'\ \ t\<^sub>1 \ \ = t\<^sub>1 \ ?w\<^sub>\' \ ?\\<^sub>\' = ?\\<^sub>\' \ (t\<^sub>0 \ \) \ \ = ?w\<^sub>\'" proof - have "\!\. \\ : ?w\<^sub>\' \ ?w\<^sub>\'\ \ t\<^sub>1 \ ?w\<^sub>\' = t\<^sub>1 \ \ \ ?\\<^sub>\' = ?\\<^sub>\' \ (t\<^sub>0 \ \)" proof - have "(t \ ?\\<^sub>\') \ \[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\') = ((t \ ?\\<^sub>\') \ \[t, t\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\')) \ (t\<^sub>1 \ ?w\<^sub>\')" proof - have 1: "t\<^sub>1 \ \\<^sub>\ \ \\<^sub>\' = (t\<^sub>1 \ \\<^sub>\) \ (t\<^sub>1 \ \\<^sub>\')" by (meson \\<^sub>\ \\<^sub>\' \.ide_leg1 seqI' whisker_left) have "((LHS \ inv ?\\<^sub>\) \ (t\<^sub>1 \ \\<^sub>\)) \ (t\<^sub>1 \ \\<^sub>\') = LHS \ inv ?\\<^sub>\" using LHS_def RHS_def \\<^sub>\ \\<^sub>\' eq eq' by argo thus ?thesis unfolding LHS_def using 1 by (simp add: calculation(2) eq' comp_assoc) qed thus ?thesis using w\<^sub>\' \\<^sub>\' \.w_simps(4) \.leg1_in_hom(2) \.leg1_simps(3) hcomp_in_vhom ideD(1) trg_hcomp ide_in_hom(2) \.T2 \.T0.antipar(1) t\<^sub>0u\<^sub>1.base_simps(2) t\<^sub>0u\<^sub>1.leg1_simps(4) by presburger qed thus "\\. \\ : ?w\<^sub>\' \ ?w\<^sub>\'\ \ t\<^sub>1 \ \ = t\<^sub>1 \ ?w\<^sub>\' \ ?\\<^sub>\' = ?\\<^sub>\' \ (t\<^sub>0 \ \) \ \ = ?w\<^sub>\'" by (metis \\<^sub>\' comp_arr_dom ide_in_hom(2) in_homE w\<^sub>\') qed ultimately have "\\<^sub>\ \ \\<^sub>\' = ?w\<^sub>\'" by simp thus "ide (\\<^sub>\ \ \\<^sub>\')" using w\<^sub>\' by simp qed thus "\\.p\<^sub>1 \ chine \ \.chine \ \\.p\<^sub>1" using w\<^sub>\ w\<^sub>\' \\<^sub>\ isomorphic_symmetric isomorphic_def by blast have iso_\\<^sub>\: "iso \\<^sub>\" using \inverse_arrows \\<^sub>\ \\<^sub>\'\ by auto have \\<^sub>\'_eq: "\\<^sub>\' = inv \\<^sub>\" using \inverse_arrows \\<^sub>\ \\<^sub>\'\ inverse_unique by blast let ?w\<^sub>\ = "\\.p\<^sub>0 \ chine" let ?w\<^sub>\' = "\.chine \ \\.p\<^sub>0" let ?u\<^sub>\ = "s\<^sub>0 \ \\.p\<^sub>0" let ?\\<^sub>\ = "the_\ \ \\<^sup>-\<^sup>1[u\<^sub>0, \\.p\<^sub>0, chine]" let ?\\<^sub>\' = "(\.the_\ \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[u\<^sub>0, \.chine, \\.p\<^sub>0]" let ?\\<^sub>\ = "\[u\<^sub>1, \.chine, \\.p\<^sub>0] \ (\.the_\ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" have w\<^sub>\: "ide ?w\<^sub>\ \ is_left_adjoint ?w\<^sub>\" using is_map left_adjoints_compose by simp have w\<^sub>\': "ide ?w\<^sub>\' \ is_left_adjoint ?w\<^sub>\'" using \.is_map left_adjoints_compose by (simp add: is_map left_adjoints_compose) have 1: "\!\. \\ : ?w\<^sub>\ \ ?w\<^sub>\'\ \ ?\\<^sub>\ = u\<^sub>1 \ \ \ ?\\<^sub>\ = ?\\<^sub>\' \ (u\<^sub>0 \ \)" proof - have \\<^sub>\: "\?\\<^sub>\ : u\<^sub>0 \ ?w\<^sub>\ \ ?u\<^sub>\\" by auto have \\<^sub>\': "\?\\<^sub>\' : u\<^sub>0 \ ?w\<^sub>\' \ ?u\<^sub>\\" by fastforce have \\<^sub>\: "\?\\<^sub>\ : u\<^sub>1 \ ?w\<^sub>\ \ u\<^sub>1 \ ?w\<^sub>\'\" proof (intro comp_in_homI) show "\\\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine] : u\<^sub>1 \ \\.p\<^sub>0 \ chine \ (u\<^sub>1 \ \\.p\<^sub>0) \ chine\" by auto show "\inv t\<^sub>0u\<^sub>1.\ \ chine : (u\<^sub>1 \ \\.p\<^sub>0) \ chine \ (t\<^sub>0 \ \\.p\<^sub>1) \ chine\" using t\<^sub>0u\<^sub>1.\_uniqueness(2) hcomp_in_vhom by (simp add: t\<^sub>0u\<^sub>1.\_in_hom(2) w_in_hom(2)) show "\\[t\<^sub>0, \\.p\<^sub>1, chine] : (t\<^sub>0 \ \\.p\<^sub>1) \ chine \ t\<^sub>0 \ \\.p\<^sub>1 \ chine\" using \.T0.antipar(1) by auto show "\t\<^sub>0 \ inv \\<^sub>\ : t\<^sub>0 \ \\.p\<^sub>1 \ chine \ t\<^sub>0 \ \.chine \ \\.p\<^sub>1\" using \\<^sub>\ iso_\\<^sub>\ using \.T0.antipar(1) by auto show "\\\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] : t\<^sub>0 \ \.chine \ \\.p\<^sub>1 \ (t\<^sub>0 \ \.chine) \ \\.p\<^sub>1\" using \.T0.antipar(1) by auto show "\\.the_\ \ \\.p\<^sub>1 : (t\<^sub>0 \ \.chine) \ \\.p\<^sub>1 \ r\<^sub>0 \ \\.p\<^sub>1\" using \.T0.antipar(1) by auto show "\r\<^sub>0s\<^sub>1.\ : r\<^sub>0 \ \\.p\<^sub>1 \ s\<^sub>1 \ \\.p\<^sub>0\" by auto show "\\.the_\ \ \\.p\<^sub>0 : s\<^sub>1 \ \\.p\<^sub>0 \ (u\<^sub>1 \ \.chine) \ \\.p\<^sub>0\" by auto show "\\[u\<^sub>1, \.chine, \\.p\<^sub>0] : (u\<^sub>1 \ \.chine) \ \\.p\<^sub>0 \ u\<^sub>1 \ \.chine \ \\.p\<^sub>0\" by auto qed text \ The proof of the equation below needs to make use of the equation \\\<^sub>\' = \\<^sub>\ \ (t\<^sub>0 \ \\<^sub>\')\ from the previous section. So the overall strategy is to work toward an expression of the form \\\<^sub>\ \ (t\<^sub>0 \ \\<^sub>\')\ and perform the replacement to eliminate \\\<^sub>\'\. \ have eq\<^sub>\: "(u \ ?\\<^sub>\) \ \[u, u\<^sub>0, ?w\<^sub>\] \ (\ \ ?w\<^sub>\) = ((u \ ?\\<^sub>\') \ \[u, u\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\')) \ ?\\<^sub>\" proof - let ?LHS = "(u \ ?\\<^sub>\) \ \[u, u\<^sub>0, ?w\<^sub>\] \ (\ \ ?w\<^sub>\)" let ?RHS = "((u \ ?\\<^sub>\') \ \[u, u\<^sub>0, ?w\<^sub>\'] \ (\ \ ?w\<^sub>\')) \ ?\\<^sub>\" have "?RHS = (u \ (\.the_\ \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[u\<^sub>0, \.chine, \\.p\<^sub>0]) \ \[u, u\<^sub>0, \.chine \ \\.p\<^sub>0] \ (\ \ \.chine \ \\.p\<^sub>0) \ \[u\<^sub>1, \.chine, \\.p\<^sub>0] \ (\.the_\ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using comp_assoc by presburger also have "... = (u \ \.the_\ \ \\.p\<^sub>0) \ ((u \ \\<^sup>-\<^sup>1[u\<^sub>0, \.chine, \\.p\<^sub>0]) \ \[u, u\<^sub>0, \.chine \ \\.p\<^sub>0]) \ (\ \ \.chine \ \\.p\<^sub>0) \ \[u\<^sub>1, \.chine, \\.p\<^sub>0] \ (\.the_\ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" proof - have "u \ (\.the_\ \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[u\<^sub>0, \.chine, \\.p\<^sub>0] = (u \ \.the_\ \ \\.p\<^sub>0) \ (u \ \\<^sup>-\<^sup>1[u\<^sub>0, \.chine, \\.p\<^sub>0])" using whisker_left \.ide_base \\<^sub>\' by blast thus ?thesis using comp_assoc by presburger qed also have "... = ((u \ \.the_\ \ \\.p\<^sub>0) \ \[u, u\<^sub>0 \ \.chine, \\.p\<^sub>0]) \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[u \ u\<^sub>0, \.chine, \\.p\<^sub>0] \ (\ \ \.chine \ \\.p\<^sub>0) \ \[u\<^sub>1, \.chine, \\.p\<^sub>0] \ (\.the_\ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" proof - have "seq (u \ \[u\<^sub>0, \.chine, \\.p\<^sub>0]) (\[u, u\<^sub>0 \ \.chine, \\.p\<^sub>0] \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0))" by auto moreover have "src u = trg \[u\<^sub>0, \.chine, \\.p\<^sub>0]" by simp moreover have "inv (u \ \[u\<^sub>0, \.chine, \\.p\<^sub>0]) = u \ \\<^sup>-\<^sup>1[u\<^sub>0, \.chine, \\.p\<^sub>0]" by simp moreover have "iso (u \ \[u\<^sub>0, \.chine, \\.p\<^sub>0])" by simp moreover have "iso \[u \ u\<^sub>0, \.chine, \\.p\<^sub>0]" by simp ultimately have "(u \ \\<^sup>-\<^sup>1[u\<^sub>0, \.chine, \\.p\<^sub>0]) \ \[u, u\<^sub>0, \.chine \ \\.p\<^sub>0] = \[u, u\<^sub>0 \ \.chine, \\.p\<^sub>0] \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[u \ u\<^sub>0, \.chine, \\.p\<^sub>0]" using pentagon hseqI' comp_assoc invert_opposite_sides_of_square [of "u \ \[u\<^sub>0, \.chine, \\.p\<^sub>0]" "\[u, u\<^sub>0 \ \.chine, \\.p\<^sub>0] \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0)" "\[u, u\<^sub>0, \.chine \ \\.p\<^sub>0]" "\[u \ u\<^sub>0, \.chine, \\.p\<^sub>0]"] inv_hcomp \.is_ide \.w_simps(3) \.w_simps(4) \.base_simps(2) \.ide_base \.ide_leg0 \.leg0_simps(2) \.leg0_simps(3) \.leg1_simps(3) assoc'_eq_inv_assoc ide_hcomp r\<^sub>0s\<^sub>1.ide_u r\<^sub>0s\<^sub>1.p\<^sub>0_simps hcomp_simps(1) by presburger thus ?thesis using comp_assoc by presburger qed also have "... = \[u, s\<^sub>0, \\.p\<^sub>0] \ ((u \ \.the_\) \ \\.p\<^sub>0) \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0) \ (\\<^sup>-\<^sup>1[u \ u\<^sub>0, \.chine, \\.p\<^sub>0] \ (\ \ \.chine \ \\.p\<^sub>0)) \ \[u\<^sub>1, \.chine, \\.p\<^sub>0] \ (\.the_\ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" proof - have "(u \ \.the_\ \ \\.p\<^sub>0) \ \[u, u\<^sub>0 \ \.chine, \\.p\<^sub>0] = \[u, s\<^sub>0, \\.p\<^sub>0] \ ((u \ \.the_\) \ \\.p\<^sub>0)" using assoc_naturality [of u \.the_\ \\.p\<^sub>0] \.\_simps(3) by auto thus ?thesis using comp_assoc by presburger qed also have "... = \[u, s\<^sub>0, \\.p\<^sub>0] \ ((u \ \.the_\) \ \\.p\<^sub>0) \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0) \ ((\ \ \.chine) \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[u\<^sub>1, \.chine, \\.p\<^sub>0] \ \[u\<^sub>1, \.chine, \\.p\<^sub>0] \ (\.the_\ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" proof - have "\\<^sup>-\<^sup>1[u \ u\<^sub>0, \.chine, \\.p\<^sub>0] \ (\ \ \.chine \ \\.p\<^sub>0) = ((\ \ \.chine) \ \\.p\<^sub>0) \ \\<^sup>-\<^sup>1[u\<^sub>1, \.chine, \\.p\<^sub>0]" using assoc'_naturality [of \ \.chine \\.p\<^sub>0] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \[u, s\<^sub>0, \\.p\<^sub>0] \ ((u \ \.the_\) \ \\.p\<^sub>0) \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0) \ ((\ \ \.chine) \ \\.p\<^sub>0) \ ((\\<^sup>-\<^sup>1[u\<^sub>1, \.chine, \\.p\<^sub>0] \ \[u\<^sub>1, \.chine, \\.p\<^sub>0]) \ (\.the_\ \ \\.p\<^sub>0)) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using comp_assoc by metis also have "... = \[u, s\<^sub>0, \\.p\<^sub>0] \ (((u \ \.the_\) \ \\.p\<^sub>0) \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0) \ ((\ \ \.chine) \ \\.p\<^sub>0) \ (\.the_\ \ \\.p\<^sub>0)) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1] \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" proof - have "(\\<^sup>-\<^sup>1[u\<^sub>1, \.chine, \\.p\<^sub>0] \ \[u\<^sub>1, \.chine, \\.p\<^sub>0]) \ (\.the_\ \ \\.p\<^sub>0) = \.the_\ \ \\.p\<^sub>0" using comp_inv_arr' comp_cod_arr by auto thus ?thesis using comp_assoc by simp qed also have "... = (\[u, s\<^sub>0, \\.p\<^sub>0] \ ((\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0) \ r\<^sub>0s\<^sub>1.\ \ (\.the_\ \ \\.p\<^sub>1) \ \\<^sup>-\<^sup>1[t\<^sub>0, \.chine, \\.p\<^sub>1]) \ (t\<^sub>0 \ inv \\<^sub>\) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" proof - have "arr ((u \ \.the_\) \ \[u, u\<^sub>0, \.chine] \ (\ \ \.chine) \ \.the_\)" using \.\_simps(3) by simp hence "((u \ \.the_\) \ \\.p\<^sub>0) \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0) \ ((\ \ \.chine) \ \\.p\<^sub>0) \ (\.the_\ \ \\.p\<^sub>0) = (u \ \.the_\) \ \[u, u\<^sub>0, \.chine] \ (\ \ \.chine) \ \.the_\ \ \\.p\<^sub>0" using whisker_right by simp also have "... = (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0" using \.\_naturality by simp finally have "((u \ \.the_\) \ \\.p\<^sub>0) \ (\[u, u\<^sub>0, \.chine] \ \\.p\<^sub>0) \ ((\ \ \.chine) \ \\.p\<^sub>0) \ (\.the_\ \ \\.p\<^sub>0) = (\ \ s\<^sub>0) \ \ \ \\.p\<^sub>0" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (?\\<^sub>\ \ (t\<^sub>0 \ inv \\<^sub>\)) \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using comp_assoc by presburger also have "... = ?\\<^sub>\' \ \[t\<^sub>0, \\.p\<^sub>1, chine] \ (inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using \\<^sub>\' \\<^sub>\'_eq by simp also have "... = (u \ the_\) \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ ((t\<^sub>0u\<^sub>1.\ \ chine) \ ((\\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t\<^sub>0, \\.p\<^sub>1, chine]) \ (inv t\<^sub>0u\<^sub>1.\ \ chine)) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using comp_assoc by presburger also have "... = (u \ the_\) \ \[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ ((\ \ \\.p\<^sub>0) \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" proof - have "((t\<^sub>0u\<^sub>1.\ \ chine) \ ((\\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t\<^sub>0, \\.p\<^sub>1, chine]) \ (inv t\<^sub>0u\<^sub>1.\ \ chine)) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine] = \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" proof - have "((t\<^sub>0u\<^sub>1.\ \ chine) \ ((\\<^sup>-\<^sup>1[t\<^sub>0, \\.p\<^sub>1, chine]) \ \[t\<^sub>0, \\.p\<^sub>1, chine]) \ (inv t\<^sub>0u\<^sub>1.\ \ chine)) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine] = ((t\<^sub>0u\<^sub>1.\ \ chine) \ ((t\<^sub>0 \ \\.p\<^sub>1) \ chine) \ (inv t\<^sub>0u\<^sub>1.\ \ chine)) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using comp_inv_arr' \.T0.antipar(1) by auto also have "... = ((t\<^sub>0u\<^sub>1.\ \ chine) \ (inv t\<^sub>0u\<^sub>1.\ \ chine)) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using comp_cod_arr t\<^sub>0u\<^sub>1.\_uniqueness by simp also have "... = (t\<^sub>0u\<^sub>1.\ \ inv t\<^sub>0u\<^sub>1.\ \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using whisker_right t\<^sub>0u\<^sub>1.\_uniqueness by simp also have "... = ((u\<^sub>1 \ \\.p\<^sub>0) \ chine) \ \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using comp_arr_inv' \.T0.antipar(1) t\<^sub>0u\<^sub>1.\_uniqueness by simp also have "... = \\<^sup>-\<^sup>1[u\<^sub>1, \\.p\<^sub>0, chine]" using comp_cod_arr \.T0.antipar(1) by simp finally show ?thesis by simp qed thus ?thesis using comp_assoc by simp qed also have "... = (u \ the_\) \ (\[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine) \ \\<^sup>-\<^sup>1[u \ u\<^sub>0, \\.p\<^sub>0, chine]) \ (\ \ ?w\<^sub>\)" using assoc'_naturality [of \ \\.p\<^sub>0 chine] comp_assoc by auto also have "... = ((u \ the_\) \ (u \ \\<^sup>-\<^sup>1[u\<^sub>0, \\.p\<^sub>0, chine])) \ \[u, u\<^sub>0, ?w\<^sub>\] \ (\ \ ?w\<^sub>\)" using uw\ pentagon comp_assoc invert_opposite_sides_of_square [of "u \ \[u\<^sub>0, \\.p\<^sub>0, chine]" "\[u, u\<^sub>0 \ \\.p\<^sub>0, chine] \ (\[u, u\<^sub>0, \\.p\<^sub>0] \ chine)" "\[u, u\<^sub>0, ?w\<^sub>\]" "\[u \ u\<^sub>0, \\.p\<^sub>0, chine]"] \.base_simps(2) \.ide_base \.ide_leg0 \.leg0_simps(2) assoc'_eq_inv_assoc ide_hcomp hcomp_simps(1) t\<^sub>0u\<^sub>1.ide_u by force also have "... = (u \ the_\ \ \\<^sup>-\<^sup>1[u\<^sub>0, \\.p\<^sub>0, chine]) \ \[u, u\<^sub>0, ?w\<^sub>\] \ (\ \ ?w\<^sub>\)" using whisker_left comp_assoc by simp finally show ?thesis by simp qed show "\!\. \\ : ?w\<^sub>\ \ ?w\<^sub>\'\ \ ?\\<^sub>\ = u\<^sub>1 \ \ \ ?\\<^sub>\ = ?\\<^sub>\' \ (u\<^sub>0 \ \)" using w\<^sub>\ w\<^sub>\' \\<^sub>\ \\<^sub>\' \\<^sub>\ eq\<^sub>\ \.T2 [of ?w\<^sub>\ ?w\<^sub>\' ?\\<^sub>\ ?u\<^sub>\ ?\\<^sub>\' ?\\<^sub>\] by fast qed obtain \\<^sub>\ where \\<^sub>\: "\\\<^sub>\ : ?w\<^sub>\ \ ?w\<^sub>\'\ \ ?\\<^sub>\ = u\<^sub>1 \ \\<^sub>\ \ ?\\<^sub>\ = ?\\<^sub>\' \ (u\<^sub>0 \ \\<^sub>\)" using 1 by auto show "?w\<^sub>\ \ ?w\<^sub>\'" using w\<^sub>\ w\<^sub>\' \\<^sub>\ BS3 [of ?w\<^sub>\ ?w\<^sub>\' \\<^sub>\ \\<^sub>\] isomorphic_def by auto qed lemma comp_L: shows "Maps.seq \\t\<^sub>0\\ \\\.chine \ \\.p\<^sub>1\\" and "\\t\<^sub>0\\ \ \\\.chine \ \\.p\<^sub>1\\ = Maps.MkArr (src (\.chine \ \\.p\<^sub>1)) (src t) (Maps.Comp \t\<^sub>0\ \\.chine \ \\.p\<^sub>1\)" proof - show "Maps.seq \\t\<^sub>0\\ \\\.chine \ \\.p\<^sub>1\\" proof - have "is_left_adjoint (\.chine \ \\.p\<^sub>1)" using \.is_map r\<^sub>0s\<^sub>1.leg1_is_map left_adjoints_compose r\<^sub>0s\<^sub>1.p\<^sub>1_simps by auto thus ?thesis using Maps.CLS_in_hom r\<^sub>0s\<^sub>1.leg1_is_map apply (intro Maps.seqI') apply blast using Maps.CLS_in_hom [of t\<^sub>0] \.leg0_is_map \\.leg1_in_hom by auto qed thus "\\t\<^sub>0\\ \ \\\.chine \ \\.p\<^sub>1\\ = Maps.MkArr (src (\.chine \ \\.p\<^sub>1)) (src t) (Maps.Comp \t\<^sub>0\ \\.chine \ \\.p\<^sub>1\)" using Maps.comp_char by auto qed lemma comp_R: shows "Maps.seq \\u\<^sub>1\\ \\\.chine \ \\.p\<^sub>0\\" and "\\u\<^sub>1\\ \ \\\.chine \ \\.p\<^sub>0\\ = Maps.MkArr (src r\<^sub>0s\<^sub>1.p\<^sub>0) (trg u) (Maps.Comp \u\<^sub>1\ \\.chine \ r\<^sub>0s\<^sub>1.p\<^sub>0\)" proof - show "Maps.seq \\u\<^sub>1\\ \\\.chine \ \\.p\<^sub>0\\" proof - have "is_left_adjoint (\.chine \ \\.p\<^sub>0)" using \.is_map r\<^sub>0s\<^sub>1.leg0_is_map left_adjoints_compose [of \.chine \\.p\<^sub>0] by simp thus ?thesis using Maps.CLS_in_hom \.leg1_is_map apply (intro Maps.seqI') apply blast using Maps.CLS_in_hom [of u\<^sub>1] \.leg1_is_map by simp qed thus "\\u\<^sub>1\\ \ \\\.chine \ \\.p\<^sub>0\\ = Maps.MkArr (src r\<^sub>0s\<^sub>1.p\<^sub>0) (trg u) (Maps.Comp \u\<^sub>1\ \\.chine \ r\<^sub>0s\<^sub>1.p\<^sub>0\)" using Maps.comp_char by auto qed lemma comp_L_eq_comp_R: shows "\\t\<^sub>0\\ \ \\\.chine \ \\.p\<^sub>1\\ = \\u\<^sub>1\\ \ \\\.chine \ \\.p\<^sub>0\\" proof (intro Maps.arr_eqI) show "Maps.seq \\t\<^sub>0\\ \\\.chine \ \\.p\<^sub>1\\" using comp_L(1) by simp show "Maps.seq \\u\<^sub>1\\ \\\.chine \ \\.p\<^sub>0\\" using comp_R(1) by simp show "Maps.Dom (\\t\<^sub>0\\ \ \\\.chine \ \\.p\<^sub>1\\) = Maps.Dom (\\u\<^sub>1\\ \ \\\.chine \ \\.p\<^sub>0\\)" by (metis (no_types, lifting) Maps.Dom.simps(1) \.w_simps(2) \.w_simps(3) \.leg1_simps(3) \\.leg1_in_hom(2) comp_L(2) comp_R(2) hcomp_in_vhomE hseqI' r\<^sub>0s\<^sub>1.leg1_simps(3) hcomp_simps(1)) show "Maps.Cod (\\t\<^sub>0\\ \ \\\.chine \ \\.p\<^sub>1\\) = Maps.Cod (\\u\<^sub>1\\ \ \\\.chine \ \\.p\<^sub>0\\)" by (metis Maps.Cod.simps(1) \\.composable comp_L(2) comp_R(2)) have A: "Maps.Map (\\t\<^sub>0\\ \ \\\.chine \ \\.p\<^sub>1\\) = Maps.Comp \t\<^sub>0\ \\.chine \ \\.p\<^sub>1\" using comp_L(1) Maps.comp_char by auto have B: "Maps.Map (\\u\<^sub>1\\ \ \\\.chine \ \\.p\<^sub>0\\) = Maps.Comp \u\<^sub>1\ \\.chine \ \\.p\<^sub>0\" using comp_R(1) Maps.comp_char by auto have C: "Maps.Comp \t\<^sub>0\ \\.chine \ \\.p\<^sub>1\ = Maps.Comp \u\<^sub>1\ \\.chine \ \\.p\<^sub>0\" proof (intro Maps.Comp_eqI) show "t\<^sub>0 \ \.chine \ \\.p\<^sub>1 \ Maps.Comp \t\<^sub>0\ \\.chine \ \\.p\<^sub>1\" proof (intro Maps.in_CompI) show "is_iso_class \\.chine \ \\.p\<^sub>1\" using prj_chine(2) is_iso_classI isomorphic_implies_hpar(2) by blast show "is_iso_class \t\<^sub>0\" using is_iso_classI by auto show "\.chine \ \\.p\<^sub>1 \ \\.chine \ \\.p\<^sub>1\" using ide_in_iso_class prj_chine(2) isomorphic_implies_hpar(2) by blast show "t\<^sub>0 \ \t\<^sub>0\" using ide_in_iso_class by simp show "t\<^sub>0 \ \.chine \ \\.p\<^sub>1 \ t\<^sub>0 \ \.chine \ \\.p\<^sub>1" using isomorphic_reflexive prj_chine(2) isomorphic_implies_hpar(2) by auto qed show "u\<^sub>1 \ \.chine \ \\.p\<^sub>0 \ Maps.Comp \u\<^sub>1\ \\.chine \ \\.p\<^sub>0\" proof (intro Maps.in_CompI) show "is_iso_class \\.chine \ \\.p\<^sub>0\" using is_iso_classI by simp show "is_iso_class \u\<^sub>1\" using is_iso_classI by simp show "\.chine \ \\.p\<^sub>0 \ \\.chine \ \\.p\<^sub>0\" using ide_in_iso_class by simp show "u\<^sub>1 \ iso_class u\<^sub>1" using ide_in_iso_class by simp show "u\<^sub>1 \ \.chine \ \\.p\<^sub>0 \ u\<^sub>1 \ \.chine \ \\.p\<^sub>0" using isomorphic_reflexive isomorphic_implies_hpar(2) by auto qed show "t\<^sub>0 \ \.chine \ \\.p\<^sub>1 \ u\<^sub>1 \ \.chine \ \\.p\<^sub>0" proof - have "t\<^sub>0 \ \.chine \ \\.p\<^sub>1 \ (t\<^sub>0 \ \.chine) \ \\.p\<^sub>1" using assoc'_in_hom [of t\<^sub>0 \.chine \\.p\<^sub>1] iso_assoc' isomorphic_def r\<^sub>0s\<^sub>1.p\<^sub>1_simps by auto also have "... \ r\<^sub>0 \ \\.p\<^sub>1" using \.leg0_uniquely_isomorphic hcomp_isomorphic_ide by (simp add: \.T0.antipar(1)) also have "... \ s\<^sub>1 \ \\.p\<^sub>0" using isomorphic_def r\<^sub>0s\<^sub>1.\_uniqueness(2) by blast also have "... \ (u\<^sub>1 \ \.chine) \ \\.p\<^sub>0" using \.leg1_uniquely_isomorphic hcomp_isomorphic_ide by auto also have "... \ u\<^sub>1 \ \.chine \ \\.p\<^sub>0" using assoc_in_hom [of u\<^sub>1 \.chine \\.p\<^sub>0] iso_assoc isomorphic_def by auto finally show ?thesis by simp qed qed show "Maps.Map (\\t\<^sub>0\\ \ \\\.chine \ \\.p\<^sub>1\\) = Maps.Map (\\u\<^sub>1\\ \ \\\.chine \ \\.p\<^sub>0\\)" using A B C by simp qed lemma csq: shows "Maps.commutative_square \\t\<^sub>0\\ \\u\<^sub>1\\ \\\.chine \ \\.p\<^sub>1\\ \\\.chine \ \\.p\<^sub>0\\" proof show "Maps.cospan \\t\<^sub>0\\ \\u\<^sub>1\\" using comp_L(1) comp_R(1) comp_L_eq_comp_R by (metis (no_types, lifting) Maps.cod_comp Maps.seq_char) show "Maps.span \\\.chine \ \\.p\<^sub>1\\ \\\.chine \ \\.p\<^sub>0\\" using comp_L(1) comp_R(1) comp_L_eq_comp_R by (metis (no_types, lifting) Maps.dom_comp Maps.seq_char) show "Maps.dom \\t\<^sub>0\\ = Maps.cod \\\.chine \ \\.p\<^sub>1\\" using comp_L(1) by auto show "\\t\<^sub>0\\ \ \\\.chine \ \\.p\<^sub>1\\ = \\u\<^sub>1\\ \ \\\.chine \ \\.p\<^sub>0\\" using comp_L_eq_comp_R by simp qed lemma CLS_chine: shows "\\chine\\ = Maps.tuple \\\.chine \ \\.p\<^sub>1\\ \\t\<^sub>0\\ \\u\<^sub>1\\ \\\.chine \ \\.p\<^sub>0\\" proof - let ?T = "Maps.tuple \\\.chine \ \\.p\<^sub>1\\ \\t\<^sub>0\\ \\u\<^sub>1\\ \\\.chine \ \\.p\<^sub>0\\" have "\!l. \\t\<^sub>0u\<^sub>1.p\<^sub>1\\ \ l = \\\.chine \ \\.p\<^sub>1\\ \ \\t\<^sub>0u\<^sub>1.p\<^sub>0\\ \ l = \\\.chine \ \\.p\<^sub>0\\" using csq \\.prj_char Maps.universal [of "\\t\<^sub>0\\" "\\u\<^sub>1\\" "\\\.chine \ \\.p\<^sub>1\\" "\\\.chine \ \\.p\<^sub>0\\"] by simp moreover have "\\\\.p\<^sub>1\\ \ ?T = \\\.chine \ \\.p\<^sub>1\\ \ \\\\.p\<^sub>0\\ \ ?T = \\\.chine \ \\.p\<^sub>0\\" using csq \\.prj_char Maps.prj_tuple [of "\\t\<^sub>0\\" "\\u\<^sub>1\\" "\\\.chine \ \\.p\<^sub>1\\" "\\\.chine \ \\.p\<^sub>0\\"] by simp moreover have "\\t\<^sub>0u\<^sub>1.p\<^sub>1\\ \ \\chine\\ = \\\.chine \ \\.p\<^sub>1\\ \ \\t\<^sub>0u\<^sub>1.p\<^sub>0\\ \ \\chine\\ = \\\.chine \ \\.p\<^sub>0\\" using prj_chine \\.leg0_is_map \\.leg1_is_map is_map t\<^sub>0u\<^sub>1.leg1_is_map t\<^sub>0u\<^sub>1.satisfies_T0 Maps.comp_CLS by blast ultimately show "\\chine\\ = ?T" by auto qed end subsection "Equivalence of B and Span(Maps(B))" subsubsection "The Functor SPN" text \ We now define a function \SPN\ on arrows and will ultimately show that it extends to a biequivalence from the underlying bicategory \B\ to \Span(Maps(B))\. The idea is that \SPN\ takes \\\ : r \ s\\ to the isomorphism class of an induced arrow of spans from the chosen tabulation of \r\ to the chosen tabulation of \s\. To obtain this, we first use isomorphisms \r.tab\<^sub>1 \ r.tab\<^sub>0\<^sup>* \ r\ and \s.tab\<^sub>1 \ s.tab\<^sub>0\<^sup>* \ s\ to transform \\\ to \\\' : r.tab\<^sub>1 \ r.tab\<^sub>0\<^sup>* \ s.tab\<^sub>1 \ s.tab\<^sub>0\<^sup>*\\. We then take the adjoint transpose of \\'\ to obtain \\\ : r.tab\<^sub>1 \ (s.tab\<^sub>1 \ s.tab\<^sub>0\<^sup>*) \ r.tab\<^sub>0\\. The 2-cell \\\ induces a map \w\ which is an arrow of spans from \(r.tab\<^sub>0, r.tab\<^sub>1)\ to \(s.tab\<^sub>0, s.tab\<^sub>1)\. We take the arrow of \Span(Maps(B))\ defined by \w\ as the value of \SPN \\. Ensuring that \SPN\ is functorial is a somewhat delicate point, which requires that all the underlying definitions that have been set up are ``just so'', with no extra choices other than those that are forced, and with the tabulation assigned to each 1-cell \r\ in the proper relationship with the canonical tabulation assigned to its chosen factorization \r = g \ f\<^sup>*\. \ context bicategory_of_spans begin interpretation Maps: maps_category V H \ \ src trg .. interpretation Span: span_bicategory Maps.comp Maps.PRJ\<^sub>0 Maps.PRJ\<^sub>1 .. no_notation Fun.comp (infixl "\" 55) notation Span.vcomp (infixr "\" 55) notation Span.hcomp (infixr "\" 53) notation Maps.comp (infixr "\" 55) notation isomorphic (infix "\" 50) definition spn where "spn \ \ arrow_of_tabulations_in_maps.chine V H \ \ src trg (tab_of_ide (dom \)) (tab\<^sub>0 (dom \)) (cod \) (tab_of_ide (cod \)) (tab\<^sub>0 (cod \)) (tab\<^sub>1 (cod \)) \" lemma is_induced_map_spn: assumes "arr \" shows "arrow_of_tabulations_in_maps.is_induced_map V H \ \ src trg (tab_of_ide (dom \)) (tab\<^sub>0 (dom \)) (cod \) (tab_of_ide (cod \)) (tab\<^sub>0 (cod \)) (tab\<^sub>1 (cod \)) \ (spn \)" proof - interpret \: arrow_in_bicategory_of_spans V H \ \ src trg \dom \\ \cod \\ \ using assms by unfold_locales auto interpret \: arrow_of_tabulations_in_maps V H \ \ src trg \dom \\ \.r.tab \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \cod \\ \.s.tab \tab\<^sub>0 (cod \)\ \tab\<^sub>1 (cod \)\ \ using \.is_arrow_of_tabulations_in_maps by simp show ?thesis unfolding spn_def using \.chine_is_induced_map by blast qed lemma spn_props: assumes "arr \" shows "\spn \ : src (tab\<^sub>0 (dom \)) \ src (tab\<^sub>0 (cod \))\" and "is_left_adjoint (spn \)" and "tab\<^sub>0 (cod \) \ spn \ \ tab\<^sub>0 (dom \)" and "tab\<^sub>1 (cod \) \ spn \ \ tab\<^sub>1 (dom \)" proof - interpret \: arrow_in_bicategory_of_spans V H \ \ src trg \dom \\ \cod \\ \ using assms by unfold_locales auto interpret \: arrow_of_tabulations_in_maps V H \ \ src trg \dom \\ \.r.tab \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \cod \\ \.s.tab \tab\<^sub>0 (cod \)\ \tab\<^sub>1 (cod \)\ \ using \.is_arrow_of_tabulations_in_maps by simp show "\spn \ : src (tab\<^sub>0 (dom \)) \ src (tab\<^sub>0 (cod \))\" using spn_def by simp show "is_left_adjoint (spn \)" using spn_def by (simp add: \.is_map) show "tab\<^sub>0 (cod \) \ spn \ \ tab\<^sub>0 (dom \)" using spn_def isomorphic_def \.leg0_uniquely_isomorphic(1) by auto show "tab\<^sub>1 (cod \) \ spn \ \ tab\<^sub>1 (dom \)" using spn_def isomorphic_def isomorphic_symmetric \.leg1_uniquely_isomorphic(1) by auto qed lemma spn_in_hom [intro]: assumes "arr \" shows "\spn \ : src (tab\<^sub>0 (dom \)) \ src (tab\<^sub>0 (cod \))\" and "\spn \ : spn \ \ spn \\" using assms spn_props left_adjoint_is_ide by auto lemma spn_simps [simp]: assumes "arr \" shows "is_left_adjoint (spn \)" and "ide (spn \)" and "src (spn \) = src (tab\<^sub>0 (dom \))" and "trg (spn \) = src (tab\<^sub>0 (cod \))" using assms spn_props left_adjoint_is_ide by auto text \ We need the next result to show that \SPN\ is functorial; in particular, that it takes \\r : r \ r\\ in the underlying bicategory to a 1-cell in \Span(Maps(B))\. The 1-cells in \Span(Maps(B))\ have objects of \Maps(B)\ as their chines, and objects of \Maps(B)\ are isomorphism classes of objects in the underlying bicategory \B\. So we need the induced map associated with \r\ to be isomorphic to an object. \ lemma spn_ide: assumes "ide r" shows "spn r \ src (tab\<^sub>0 r)" proof - interpret r: identity_in_bicategory_of_spans V H \ \ src trg r using assms by unfold_locales auto interpret r: arrow_of_tabulations_in_maps V H \ \ src trg r r.tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ r r.tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ r using r.is_arrow_of_tabulations_in_maps by simp interpret tab: tabulation V H \ \ src trg r \r.tab\ \tab\<^sub>0 r\ \dom r.tab\ using assms r.tab_is_tabulation by simp interpret tab: tabulation_in_maps V H \ \ src trg r \r.tab\ \tab\<^sub>0 r\ \dom r.tab\ by (unfold_locales, simp_all) have "tab.is_induced_by_cell (spn r) (tab\<^sub>0 r) r.tab" using spn_def comp_ide_arr r.chine_is_induced_map by auto thus ?thesis using tab.induced_map_unique [of "tab\<^sub>0 r" "r.tab" "spn r" "src r.s\<^sub>0"] tab.apex_is_induced_by_cell by (simp add: comp_assoc) qed text \ The other key result we need to show that \SPN\ is functorial is to show that the induced map of a composite is isomorphic to the composite of induced maps. \ lemma spn_hcomp: assumes "seq \ \" and "g \ spn \" and "f \ spn \" shows "spn (\ \ \) \ g \ f" proof - interpret \: arrow_in_bicategory_of_spans V H \ \ src trg \dom \\ \cod \\ \ using assms by unfold_locales auto interpret \: arrow_of_tabulations_in_maps V H \ \ src trg \dom \\ \.r.tab \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \cod \\ \.s.tab \tab\<^sub>0 (cod \)\ \tab\<^sub>1 (cod \)\ \ using \.is_arrow_of_tabulations_in_maps by simp interpret \: arrow_in_bicategory_of_spans V H \ \ src trg \dom \\ \dom \\ \ using assms apply unfold_locales apply auto[1] by (elim seqE, auto) interpret \: arrow_of_tabulations_in_maps V H \ \ src trg \dom \\ \.r.tab \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \dom \\ \.r.tab \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \ using \.is_arrow_of_tabulations_in_maps by simp interpret \\: vertical_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \dom \\ \.r.tab \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \dom \\ \.r.tab \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \cod \\ \.s.tab \tab\<^sub>0 (cod \)\ \tab\<^sub>1 (cod \)\ \ \ .. have "g \ \.chine" using assms(2) spn_def by auto moreover have "f \ \.chine" using assms(1) assms(3) spn_def by auto moreover have "src g = trg f" using calculation(1-2) isomorphic_implies_hpar(3-4) by auto moreover have "src g = trg \.chine" using calculation(1) isomorphic_implies_hpar(3) by auto ultimately have "g \ f \ \.chine \ \.chine" using hcomp_ide_isomorphic hcomp_isomorphic_ide isomorphic_transitive by (meson \.is_ide isomorphic_implies_ide(1)) also have "... \ spn (\ \ \)" using spn_def \\.chine_char isomorphic_symmetric by (metis \\.in_hom in_homE) finally show ?thesis using isomorphic_symmetric by simp qed abbreviation (input) SPN\<^sub>0 where "SPN\<^sub>0 r \ Span.mkIde \\tab\<^sub>0 r\\ \\tab\<^sub>1 r\\" definition SPN where "SPN \ \ if arr \ then \Chn = \\spn \\\, Dom = \Leg0 = \\tab\<^sub>0 (dom \)\\, Leg1 = \\tab\<^sub>1 (dom \)\\\, Cod = \Leg0 = \\tab\<^sub>0 (cod \)\\, Leg1 = \\tab\<^sub>1 (cod \)\\\\ else Span.null" lemma Dom_SPN [simp]: assumes "arr \" shows "Dom (SPN \) = \Leg0 = \\tab\<^sub>0 (dom \)\\, Leg1 = \\tab\<^sub>1 (dom \)\\\" using assms SPN_def by simp lemma Cod_SPN [simp]: assumes "arr \" shows "Cod (SPN \) = \Leg0 = \\tab\<^sub>0 (cod \)\\, Leg1 = \\tab\<^sub>1 (cod \)\\\" using assms SPN_def by simp text \Now we have to show this does the right thing for us.\ lemma SPN_in_hom: assumes "arr \" shows "Span.in_hom (SPN \) (SPN\<^sub>0 (dom \)) (SPN\<^sub>0 (cod \))" proof interpret Dom: span_in_category Maps.comp \Dom (SPN \)\ proof interpret r: identity_in_bicategory_of_spans V H \ \ src trg \dom \\ using assms by unfold_locales auto show "Maps.span (Leg0 (Dom (SPN \))) (Leg1 (Dom (SPN \)))" using assms Maps.CLS_in_hom SPN_def by (metis (no_types, lifting) Maps.in_homE bicategory_of_spans.Dom_SPN bicategory_of_spans_axioms r.leg1_is_map r.leg1_simps(3) r.satisfies_T0 span_data.simps(1) span_data.simps(2)) qed interpret Dom': span_in_category Maps.comp \\Leg0 = \\tab\<^sub>0 (dom \)\\, Leg1 = \\tab\<^sub>1 (dom \)\\\\ using assms Dom.span_in_category_axioms SPN_def by simp interpret Cod: span_in_category Maps.comp \Cod (SPN \)\ proof interpret s: identity_in_bicategory_of_spans V H \ \ src trg \cod \\ using assms by unfold_locales auto show "Maps.span (Leg0 (Cod (SPN \))) (Leg1 (Cod (SPN \)))" using assms Maps.CLS_in_hom SPN_def by (metis (no_types, lifting) bicategory_of_spans.Cod_SPN bicategory_of_spans_axioms ide_dom s.base_simps(2) s.base_simps(3) s.determines_span span_in_category.is_span) qed interpret Cod': span_in_category Maps.comp \\Leg0 = \\tab\<^sub>0 (cod \)\\, Leg1 = \\tab\<^sub>1 (cod \)\\\\ using assms Cod.span_in_category_axioms SPN_def by simp show 1: "Span.arr (SPN \)" proof (unfold Span.arr_char) show "arrow_of_spans Maps.comp (SPN \)" proof (unfold_locales) show "Maps.in_hom (Chn (SPN \)) Dom.apex Cod.apex" unfolding SPN_def Maps.in_hom_char using assms Dom'.apex_def Cod'.apex_def Dom'.is_span Cod'.is_span Maps.arr_char by auto show "Cod.leg0 \ Chn (SPN \) = Dom.leg0" unfolding SPN_def using assms spn_props [of \] Maps.comp_CLS [of "tab\<^sub>0 (cod \)" "spn \"] by simp show "Cod.leg1 \ Chn (SPN \) = Dom.leg1" unfolding SPN_def using assms spn_props [of \] Maps.comp_CLS [of "tab\<^sub>1 (cod \)" "spn \"] by simp qed qed show "Span.dom (SPN \) = SPN\<^sub>0 (dom \)" using assms 1 Span.dom_char Dom'.apex_def SPN_def by simp show "Span.cod (SPN \) = SPN\<^sub>0 (cod \)" using assms 1 Span.cod_char Cod'.apex_def SPN_def by simp qed interpretation SPN: "functor" V Span.vcomp SPN proof show "\\. \ arr \ \ SPN \ = Span.null" unfolding SPN_def by simp show 1: "\\. arr \ \ Span.arr (SPN \)" using SPN_in_hom by auto show "\\. arr \ \ Span.dom (SPN \) = SPN (dom \)" proof - fix \ assume \: "arr \" have 1: "Maps.arr (Maps.MkArr (src (tab\<^sub>0 (dom \))) (src \) \tab\<^sub>0 (dom \)\)" proof - have "src (tab\<^sub>0 (dom \)) \ Collect obj" using \ by simp moreover have "src \ \ Collect obj" using \ by simp moreover have "\tab\<^sub>0 (dom \)\ \ Maps.Hom (src (tab\<^sub>0 (local.dom \))) (src \)" proof - have "\tab\<^sub>0 (dom \) : src (tab\<^sub>0 (dom \)) \ src \\" using \ by simp moreover have "is_left_adjoint (tab\<^sub>0 (dom \))" using \ tab\<^sub>0_simps [of "dom \"] by auto ultimately show ?thesis by auto qed ultimately show ?thesis by simp qed have "\spn (dom \)\ = \src (tab\<^sub>0 (dom \))\" using \ spn_ide iso_class_eqI by auto hence "SPN (dom \) = SPN\<^sub>0 (dom \)" unfolding SPN_def using \ 1 Maps.dom_char by simp thus "Span.dom (SPN \) = SPN (dom \)" using \ SPN_in_hom by auto qed show "\\. arr \ \ Span.cod (SPN \) = SPN (cod \)" proof - fix \ assume \: "arr \" have 1: "Maps.arr (Maps.MkArr (src (tab\<^sub>0 (cod \))) (src \) \tab\<^sub>0 (cod \)\)" proof - have "src (tab\<^sub>0 (cod \)) \ Collect obj" using \ by simp moreover have "src \ \ Collect obj" using \ by simp moreover have "\tab\<^sub>0 (cod \)\ \ Maps.Hom (src (tab\<^sub>0 (cod \))) (src \)" proof - have "\tab\<^sub>0 (cod \) : src (tab\<^sub>0 (cod \)) \ src \\" using \ by simp moreover have "is_left_adjoint (tab\<^sub>0 (cod \))" using \ by simp ultimately show ?thesis by auto qed ultimately show ?thesis by simp qed have "\spn (cod \)\ = \src (tab\<^sub>0 (cod \))\" using \ spn_ide iso_class_eqI by auto hence "SPN (cod \) = SPN\<^sub>0 (cod \)" unfolding SPN_def using \ 1 Maps.dom_char by simp thus "Span.cod (SPN \) = SPN (cod \)" using \ SPN_in_hom by auto qed show "\\ \. seq \ \ \ SPN (\ \ \) = SPN \ \ SPN \" proof - fix \ \ assume seq: "seq \ \" have "Dom (SPN (\ \ \)) = Dom (SPN \ \ SPN \)" using seq 1 Span.vcomp_def Span.arr_char by (elim seqE, simp) moreover have "Cod (SPN (\ \ \)) = Cod (SPN \ \ SPN \)" using seq 1 Span.vcomp_def Span.arr_char by (elim seqE, simp) moreover have "Chn (SPN (\ \ \)) = Chn (SPN \ \ SPN \)" proof - have *: "\spn (\ \ \)\ = Maps.Comp \spn \\ \spn \\" proof show "\spn (\ \ \)\ \ Maps.Comp \spn \\ \spn \\" proof fix h assume h: "h \ \spn (\ \ \)\" show "h \ Maps.Comp \spn \\ \spn \\" proof - have 1: "spn \ \ \spn \\" using seq ide_in_iso_class by auto moreover have 2: "spn \ \ \spn \\" using seq ide_in_iso_class by auto moreover have "spn \ \ spn \ \ h" proof - have "spn \ \ spn \ \ spn (\ \ \)" using seq spn_hcomp 1 2 iso_class_def isomorphic_reflexive isomorphic_symmetric by simp thus ?thesis using h isomorphic_transitive iso_class_def by simp qed ultimately show ?thesis unfolding Maps.Comp_def by (metis (mono_tags, lifting) is_iso_classI spn_simps(2) mem_Collect_eq seq seqE) qed qed show "Maps.Comp \spn \\ \spn \\ \ \spn (\ \ \)\" proof fix h assume h: "h \ Maps.Comp \spn \\ \spn \\" show "h \ \spn (\ \ \)\" proof - obtain f g where 1: "g \ \spn \\ \ f \ \spn \\ \ g \ f \ h" using h Maps.Comp_def [of "iso_class (spn \)" "iso_class (spn \)"] iso_class_def iso_class_elems_isomorphic by blast have fg: "g \ spn \ \ f \ spn \ \ g \ f \ h" proof - have "spn \ \ \spn \\ \ spn \ \ \spn \\" using seq ide_in_iso_class by auto thus ?thesis using 1 iso_class_elems_isomorphic isomorphic_symmetric is_iso_classI by (meson spn_simps(2) seq seqE) qed have "g \ f \ \spn (\ \ \)\" using seq fg 1 spn_hcomp iso_class_def isomorphic_symmetric by simp thus ?thesis using fg isomorphic_transitive iso_class_def by blast qed qed qed have "Chn (SPN \ \ SPN \) = Maps.MkArr (src (tab\<^sub>0 (cod \))) (src (tab\<^sub>0 (cod \))) \spn \\ \ Maps.MkArr (src (tab\<^sub>0 (dom \))) (src (tab\<^sub>0 (cod \))) \spn \\" using 1 seq SPN_def Span.vcomp_def Span.arr_char apply (elim seqE) apply simp by (metis (no_types, lifting) seq vseq_implies_hpar(1) vseq_implies_hpar(2)) also have "... = Maps.MkArr (src (tab\<^sub>0 (dom \))) (src (tab\<^sub>0 (cod \))) (Maps.Comp \spn \\ \spn \\)" proof - have "Maps.seq (Maps.MkArr (src (tab\<^sub>0 (cod \))) (src (tab\<^sub>0 (cod \))) \spn \\) (Maps.MkArr (src (tab\<^sub>0 (dom \))) (src (tab\<^sub>0 (cod \))) \spn \\)" proof show "Maps.in_hom (Maps.MkArr (src (tab\<^sub>0 (local.dom \))) (src (tab\<^sub>0 (cod \))) \spn \\) (Maps.MkIde (src (tab\<^sub>0 (dom \)))) (Maps.MkIde (src (tab\<^sub>0 (cod \))))" proof - have "src (tab\<^sub>0 (dom \)) \ Collect obj" using in_hhom_def seq by auto moreover have "src (tab\<^sub>0 (cod \)) \ Collect obj" using seq by auto moreover have "\spn \\ \ Maps.Hom (src (tab\<^sub>0 (dom \))) (src (tab\<^sub>0 (cod \)))" using spn_props by (metis (mono_tags, lifting) mem_Collect_eq seq seqE) ultimately show ?thesis using Maps.MkArr_in_hom by simp qed show "Maps.in_hom (Maps.MkArr (src (tab\<^sub>0 (cod \))) (src (tab\<^sub>0 (cod \))) \spn \\) (Maps.MkIde (src (tab\<^sub>0 (cod \)))) (Maps.MkIde (src (tab\<^sub>0 (cod \))))" proof - have "src (tab\<^sub>0 (cod \)) \ Collect obj" using in_hhom_def seq by auto moreover have "src (tab\<^sub>0 (cod \)) \ Collect obj" using seq by auto moreover have "\spn \\ \ Maps.Hom (src (tab\<^sub>0 (cod \))) (src (tab\<^sub>0 (cod \)))" using spn_props by (metis (mono_tags, lifting) mem_Collect_eq seq seqE) ultimately show ?thesis using Maps.MkArr_in_hom by simp qed qed thus ?thesis using Maps.comp_char [of "Maps.MkArr (src (tab\<^sub>0 (cod \))) (src (tab\<^sub>0 (cod \))) \spn \\" "Maps.MkArr (src (tab\<^sub>0 (dom \))) (src (tab\<^sub>0 (cod \))) \spn \\"] by simp qed also have "... = Maps.MkArr (src (tab\<^sub>0 (dom \))) (src (tab\<^sub>0 (cod \))) \spn (\ \ \)\" using * by simp also have "... = Chn (SPN (\ \ \))" using seq SPN_def Span.vcomp_def by (elim seqE, simp) finally show ?thesis by simp qed ultimately show "SPN (\ \ \) = SPN \ \ SPN \" by simp qed qed lemma SPN_is_functor: shows "functor V Span.vcomp SPN" .. interpretation SPN: weak_arrow_of_homs V src trg Span.vcomp Span.src Span.trg SPN proof show "\\. arr \ \ Span.isomorphic (SPN (src \)) (Span.src (SPN \))" proof - fix \ assume \: "arr \" let ?src = "Maps.MkIde (src \)" have src: "Maps.ide ?src" using \ by simp interpret src: identity_in_bicategory_of_spans V H \ \ src trg \src \\ using \ by unfold_locales auto interpret src: arrow_of_tabulations_in_maps V H \ \ src trg \src \\ src.tab \tab\<^sub>0 (src \)\ \tab\<^sub>1 (src \)\ \src \\ src.tab \tab\<^sub>0 (src \)\ \tab\<^sub>1 (src \)\ \src \\ using src.is_arrow_of_tabulations_in_maps by simp interpret src: span_in_category Maps.comp \\Leg0 = ?src, Leg1 = ?src\\ using src by (unfold_locales, simp) let ?tab\<^sub>0 = "Maps.MkArr (src (tab\<^sub>0 (src \))) (src \) \tab\<^sub>0 (src \)\" have tab\<^sub>0_src: "\tab\<^sub>0 (src \) : src (tab\<^sub>0 (src \)) \ src \\ \ is_left_adjoint (tab\<^sub>0 (src \)) \ \tab\<^sub>0 (src \)\ = \tab\<^sub>0 (src \)\" using \ by simp have tab\<^sub>0: "Maps.arr ?tab\<^sub>0" using \ Maps.arr_MkArr tab\<^sub>0_src by blast let ?tab\<^sub>1 = "Maps.MkArr (src (tab\<^sub>0 (src \))) (src \) \tab\<^sub>1 (src \)\" have tab\<^sub>1_src: "\tab\<^sub>1 (src \) : src (tab\<^sub>0 (src \)) \ src \\ \ is_left_adjoint (tab\<^sub>1 (src \)) \ \tab\<^sub>1 (src \)\ = \tab\<^sub>1 (src \)\" using \ by simp have tab\<^sub>1: "Maps.arr ?tab\<^sub>1" using \ Maps.arr_MkArr tab\<^sub>1_src by blast interpret tab: span_in_category Maps.comp \\Leg0 = ?tab\<^sub>0, Leg1 = ?tab\<^sub>1\\ using tab\<^sub>0 tab\<^sub>1 Maps.dom_char Maps.cod_char by (unfold_locales, simp) have "src \ \ tab\<^sub>0 (src \) \ tab\<^sub>0 (src \)" using \ iso_lunit isomorphic_def by (metis lunit_in_hom(2) src.ide_u src.u_simps(3) src_src) hence "src \ \ tab\<^sub>0 (src \) \ tab\<^sub>1 (src \)" using \ src.obj_has_symmetric_tab isomorphic_transitive by blast have "\tab\<^sub>0 (src \)\ \ Maps.Hom (src (tab\<^sub>0 (src \))) (src \)" using \ tab\<^sub>0_src by blast have "\src \\ \ Maps.Hom (src \) (src \)" proof - have "\src \ : src \ \ src \\ \ is_left_adjoint (src \) \ \src \\ = \src \\" using \ obj_is_self_adjoint by simp thus ?thesis by auto qed interpret SPN_src: arrow_of_spans Maps.comp \SPN (src \)\ using \ SPN.preserves_reflects_arr Span.arr_char by blast have SPN_src: "SPN (src \) = \Chn = Maps.MkArr (src (tab\<^sub>0 (src \))) (src (tab\<^sub>0 (src \))) \spn (src \)\, Dom = \Leg0 = ?tab\<^sub>0, Leg1 = ?tab\<^sub>1\, Cod = \Leg0 = ?tab\<^sub>0, Leg1 = ?tab\<^sub>1\\" unfolding SPN_def using \ by simp interpret src_SPN: arrow_of_spans Maps.comp \Span.src (SPN \)\ using \ SPN.preserves_reflects_arr Span.arr_char by blast have src_SPN: "Span.src (SPN \) = \Chn = ?src, Dom = \Leg0 = ?src, Leg1 = ?src\, Cod = \Leg0 = ?src, Leg1 = ?src\\" proof - let ?tab\<^sub>0_dom = "Maps.MkArr (src (tab\<^sub>0 (dom \))) (src \) \tab\<^sub>0 (dom \)\" have "Maps.arr ?tab\<^sub>0_dom" proof - have "\tab\<^sub>0 (dom \) : src (tab\<^sub>0 (dom \)) \ src \\ \ is_left_adjoint (tab\<^sub>0 (dom \)) \ \tab\<^sub>0 (dom \)\ = \tab\<^sub>0 (dom \)\" using \ by simp thus ?thesis using \ Maps.arr_MkArr by blast qed thus ?thesis using \ Maps.cod_char Span.src_def by simp qed text \ The idea of the proof is that @{term "iso_class (tab\<^sub>0 (src \))"} is invertible in \Maps(B)\ and determines an invertible arrow of spans from @{term "SPN (src \)"} to @{term "Span.src (SPN \)"}. \ let ?\ = "\Chn = ?tab\<^sub>0, Dom = Dom (SPN (src \)), Cod = Cod (Span.src (SPN \))\" interpret \: arrow_of_spans Maps.comp ?\ apply (unfold_locales, simp_all) proof - show "Maps.in_hom ?tab\<^sub>0 SPN_src.dom.apex src_SPN.cod.apex" using \ tab\<^sub>0 Maps.dom_char Maps.cod_char SPN_src src_SPN tab.apex_def src_SPN.cod.apex_def apply (intro Maps.in_homI) by simp_all show "src_SPN.cod.leg0 \ ?tab\<^sub>0 = SPN_src.dom.leg0" proof - have "Maps.seq src_SPN.cod.leg0 ?tab\<^sub>0" using \ src_SPN tab\<^sub>0 Maps.dom_char Maps.cod_char by (intro Maps.seqI, auto) moreover have "Maps.Comp \src \\ \tab\<^sub>0 (src \)\ = \tab\<^sub>0 (src \)\" proof - have "tab\<^sub>0 (src \) \ Maps.Comp \src \\ \tab\<^sub>0 (src \)\" using \ is_iso_classI ide_in_iso_class [of "src \"] ide_in_iso_class [of "tab\<^sub>0 (src \)"] \src \ \ tab\<^sub>0 (src \) \ tab\<^sub>0 (src \)\ by auto thus ?thesis using Maps.Comp_eq_iso_class_memb \\tab\<^sub>0 (src \)\ \ Maps.Hom (src (tab\<^sub>0 (src \))) (src \)\ \\src \\ \ Maps.Hom (src \) (src \)\ by meson qed ultimately show ?thesis using \ Maps.comp_char [of src_SPN.cod.leg0 ?tab\<^sub>0] src_SPN by simp qed show "src_SPN.cod.leg1 \ ?tab\<^sub>0 = SPN_src.dom.leg1" proof - have "Maps.seq src_SPN.cod.leg1 ?tab\<^sub>0" using \ src_SPN tab\<^sub>0 Maps.dom_char Maps.cod_char by (intro Maps.seqI, auto) moreover have "Maps.Comp \src \\ \tab\<^sub>0 (src \)\ = \tab\<^sub>1 (src \)\" proof - have "tab\<^sub>1 (src \) \ Maps.Comp \src \\ \tab\<^sub>0 (src \)\" using \ is_iso_classI ide_in_iso_class [of "src \"] ide_in_iso_class [of "tab\<^sub>0 (src \)"] \isomorphic (src \ \ tab\<^sub>0 (src \)) (tab\<^sub>1 (src \))\ by auto thus ?thesis using Maps.Comp_eq_iso_class_memb \\tab\<^sub>0 (src \)\ \ Maps.Hom (src (tab\<^sub>0 (src \))) (src \)\ \\src \\ \ Maps.Hom (src \) (src \)\ by meson qed ultimately show ?thesis using \ Maps.comp_char [of src_SPN.cod.leg1 ?tab\<^sub>0] src_SPN by simp qed qed have "Span.in_hom ?\ (SPN (src \)) (Span.src (SPN \))" using \ tab\<^sub>0 spn_ide [of "src \"] iso_class_eqI Span.arr_char Span.dom_char Span.cod_char \.arrow_of_spans_axioms SPN_src src_SPN src.apex_def tab.apex_def Maps.dom_char apply (intro Span.in_homI) by auto (* The preceding cannot be written "by (intro Span.in_homI, auto)", why? *) moreover have "Maps.iso ?tab\<^sub>0" using \ tab\<^sub>0 ide_in_iso_class src.is_map_iff_tab\<^sub>0_is_equivalence obj_is_self_adjoint Maps.iso_char' [of ?tab\<^sub>0] by auto ultimately show "Span.isomorphic (SPN (src \)) (Span.src (SPN \))" using Span.isomorphic_def Span.iso_char by auto qed show "\\. arr \ \ Span.isomorphic (SPN (trg \)) (Span.trg (SPN \))" proof - fix \ assume \: "arr \" let ?trg = "Maps.MkIde (trg \)" have trg: "Maps.ide ?trg" using \ by simp interpret trg: identity_in_bicategory_of_spans V H \ \ src trg \trg \\ using \ by unfold_locales auto interpret trg: span_in_category Maps.comp \\Leg0 = ?trg, Leg1 = ?trg\\ using trg by (unfold_locales, simp) let ?tab\<^sub>0 = "Maps.MkArr (src (tab\<^sub>0 (trg \))) (trg \) \tab\<^sub>0 (trg \)\" have tab\<^sub>0_trg: "\tab\<^sub>0 (trg \) : src (tab\<^sub>0 (trg \)) \ trg \\ \ is_left_adjoint (tab\<^sub>0 (trg \)) \ \tab\<^sub>0 (trg \)\ = \tab\<^sub>0 (trg \)\" using \ by simp have tab\<^sub>0: "Maps.arr ?tab\<^sub>0" using \ Maps.arr_MkArr tab\<^sub>0_trg by blast let ?tab\<^sub>1 = "Maps.MkArr (src (tab\<^sub>0 (trg \))) (trg \) \tab\<^sub>1 (trg \)\" have tab\<^sub>1_trg: "\tab\<^sub>1 (trg \) : src (tab\<^sub>0 (trg \)) \ trg \\ \ is_left_adjoint (tab\<^sub>1 (trg \)) \ \tab\<^sub>1 (trg \)\ = \tab\<^sub>1 (trg \)\" using \ by simp have tab\<^sub>1: "Maps.arr ?tab\<^sub>1" using \ Maps.arr_MkArr tab\<^sub>1_trg by blast interpret tab: span_in_category Maps.comp \\Leg0 = ?tab\<^sub>0, Leg1 = ?tab\<^sub>1\\ using tab\<^sub>0 tab\<^sub>1 Maps.dom_char Maps.cod_char by (unfold_locales, simp) have "trg \ \ tab\<^sub>1 (trg \) \ tab\<^sub>0 (trg \)" proof - have "\\[tab\<^sub>1 (trg \)] : trg \ \ tab\<^sub>1 (trg \) \ tab\<^sub>1 (trg \)\" using \ by simp moreover have "iso \[tab\<^sub>1 (trg \)]" using \ iso_lunit by simp ultimately have "trg \ \ tab\<^sub>1 (trg \) \ tab\<^sub>1 (trg \)" using isomorphic_def by auto also have "tab\<^sub>1 (trg \) \ tab\<^sub>0 (trg \)" using \ trg.obj_has_symmetric_tab isomorphic_symmetric by auto finally show ?thesis by blast qed hence "trg \ \ tab\<^sub>1 (trg \) \ tab\<^sub>1 (trg \)" using \ trg.obj_has_symmetric_tab isomorphic_transitive by blast have "\tab\<^sub>1 (trg \)\ \ Maps.Hom (src (tab\<^sub>0 (trg \))) (trg \)" proof - have "\tab\<^sub>1 (trg \) : src (tab\<^sub>0 (trg \)) \ trg \\ \ is_left_adjoint (tab\<^sub>0 (trg \)) \ \tab\<^sub>0 (trg \)\ = \tab\<^sub>0 (trg \)\" using \ by simp thus ?thesis by auto qed have "\trg \\ \ Maps.Hom (trg \) (trg \)" proof - have "\trg \ : trg \ \ trg \\ \ is_left_adjoint (trg \) \ \trg \\ = \trg \\" using \ obj_is_self_adjoint by simp thus ?thesis by auto qed interpret SPN_trg: arrow_of_spans Maps.comp \SPN (trg \)\ using \ SPN.preserves_reflects_arr Span.arr_char by blast have SPN_trg: "SPN (trg \) = \Chn = Maps.MkArr (src (tab\<^sub>1 (trg \))) (src (tab\<^sub>1 (trg \))) \spn (trg \)\, Dom = \Leg0 = ?tab\<^sub>0, Leg1 = ?tab\<^sub>1\, Cod = \Leg0 = ?tab\<^sub>0, Leg1 = ?tab\<^sub>1\\" unfolding SPN_def using \ by simp interpret trg_SPN: arrow_of_spans Maps.comp \Span.trg (SPN \)\ using \ SPN.preserves_reflects_arr Span.arr_char by blast have trg_SPN: "Span.trg (SPN \) = \Chn = ?trg, Dom = \Leg0 = ?trg, Leg1 = ?trg\, Cod = \Leg0 = ?trg, Leg1 = ?trg\\" proof - let ?tab\<^sub>1_dom = "Maps.MkArr (src (tab\<^sub>1 (dom \))) (trg \) \tab\<^sub>1 (dom \)\" have "Maps.arr ?tab\<^sub>1_dom" proof - have "\tab\<^sub>1 (dom \) : src (tab\<^sub>1 (dom \)) \ trg \\ \ is_left_adjoint (tab\<^sub>1 (dom \)) \ \tab\<^sub>1 (dom \)\ = \tab\<^sub>1 (dom \)\" using \ by simp thus ?thesis using \ Maps.arr_MkArr by blast qed thus ?thesis using \ Maps.cod_char Span.trg_def by simp qed let ?\ = "\Chn = ?tab\<^sub>1, Dom = Dom (SPN (trg \)), Cod = Cod (Span.trg (SPN \))\" interpret \: arrow_of_spans Maps.comp ?\ apply (unfold_locales, simp_all) proof - show "Maps.in_hom ?tab\<^sub>1 SPN_trg.dom.apex trg_SPN.cod.apex" using \ tab\<^sub>0 tab\<^sub>1 Maps.dom_char Maps.cod_char SPN_trg trg_SPN tab.apex_def trg_SPN.cod.apex_def apply (intro Maps.in_homI) by simp_all (* The preceding cannot be written "by (intro Maps.in_homI, simp_all)", why? *) show "Maps.comp trg_SPN.cod.leg0 ?tab\<^sub>1 = SPN_trg.dom.leg0" proof - have "Maps.seq trg_SPN.cod.leg0 ?tab\<^sub>1" using \ trg_SPN tab\<^sub>1 Maps.dom_char Maps.cod_char by (intro Maps.seqI, auto) moreover have "Maps.Comp \trg \\ \tab\<^sub>1 (trg \)\ = \tab\<^sub>1 (trg \)\" proof - have "tab\<^sub>1 (trg \) \ Maps.Comp \trg \\ \tab\<^sub>1 (trg \)\" using \ is_iso_classI ide_in_iso_class [of "trg \"] ide_in_iso_class [of "tab\<^sub>1 (trg \)"] \trg \ \ tab\<^sub>1 (trg \) \ tab\<^sub>1 (trg \)\ by auto thus ?thesis using Maps.Comp_eq_iso_class_memb \iso_class (tab\<^sub>1 (trg \)) \ Maps.Hom (src (tab\<^sub>0 (trg \))) (trg \)\ \iso_class (trg \) \ Maps.Hom (trg \) (trg \)\ by meson qed moreover have "\tab\<^sub>1 (trg \)\ = \tab\<^sub>0 (trg \)\" using \ iso_class_eqI trg.obj_has_symmetric_tab by auto ultimately show ?thesis using \ Maps.comp_char [of trg_SPN.cod.leg0 ?tab\<^sub>1] trg_SPN by simp qed show "trg_SPN.cod.leg1 \ ?tab\<^sub>1 = SPN_trg.dom.leg1" proof - have "Maps.seq trg_SPN.cod.leg1 ?tab\<^sub>1" using \ trg_SPN tab\<^sub>1 Maps.dom_char Maps.cod_char by (intro Maps.seqI, auto) moreover have "Maps.Comp \trg \\ \tab\<^sub>1 (trg \)\ = \tab\<^sub>1 (trg \)\" proof - have "tab\<^sub>1 (trg \) \ Maps.Comp \trg \\ \tab\<^sub>1 (trg \)\" using \ is_iso_classI ide_in_iso_class [of "trg \"] ide_in_iso_class [of "tab\<^sub>1 (trg \)"] \trg \ \ tab\<^sub>1 (trg \) \ tab\<^sub>1 (trg \)\ by auto thus ?thesis using Maps.Comp_eq_iso_class_memb \\tab\<^sub>1 (trg \)\ \ Maps.Hom (src (tab\<^sub>0 (trg \))) (trg \)\ \\trg \\ \ Maps.Hom (trg \) (trg \)\ by meson qed ultimately show ?thesis using \ Maps.comp_char [of trg_SPN.cod.leg1 ?tab\<^sub>1] trg_SPN by simp qed qed have \: "Span.in_hom ?\ (SPN (trg \)) (Span.trg (SPN \))" using \ tab\<^sub>0 spn_ide [of "trg \"] iso_class_eqI Span.arr_char Span.dom_char Span.cod_char \.arrow_of_spans_axioms SPN_trg trg_SPN trg.apex_def tab.apex_def Maps.dom_char apply (intro Span.in_homI) by auto have "Maps.iso ?tab\<^sub>1" proof - have "Maps.iso ?tab\<^sub>0" using \ tab\<^sub>0 ide_in_iso_class trg.is_map_iff_tab\<^sub>0_is_equivalence obj_is_self_adjoint Maps.iso_char' [of ?tab\<^sub>0] by auto moreover have "?tab\<^sub>0 = ?tab\<^sub>1" proof - have "\tab\<^sub>0 (trg \)\ = \tab\<^sub>1 (trg \)\" using \ iso_class_eqI trg.obj_has_symmetric_tab by auto thus ?thesis by simp qed ultimately show ?thesis by simp qed thus "Span.isomorphic (SPN (trg \)) (Span.trg (SPN \))" using \ Span.isomorphic_def Span.iso_char by auto qed qed lemma SPN_is_weak_arrow_of_homs: shows "weak_arrow_of_homs V src trg Span.vcomp Span.src Span.trg SPN" .. end subsubsection "Compositors" text \ To complete the proof that \SPN\ is a pseudofunctor, we need to obtain a natural isomorphism \\\, whose component at \(r, s)\ is an isomorphism \\ (r, s)\ from the horizontal composite \SPN r \ SPN s\ to \SPN (r \ s)\ in \Span(Maps(B))\, and we need to prove that the coherence conditions are satisfied. We have shown that the tabulations of \r\ and \s\ compose to yield a tabulation of \r \ s\. Since tabulations of the same arrow are equivalent, this tabulation must be equivalent to the chosen tabulation of \r \ s\. We therefore obtain an equivalence map from the apex of \SPN r \ SPN s\ to the apex of \SPN (r \ s)\ which commutes with the legs of these spans up to isomorphism. This equivalence map determines an invertible arrow in \Span(Maps(B))\. Moreover, by property \T2\, any two such equivalence maps are connected by a unique 2-cell, which is consequently an isomorphism. This shows that the arrow in \Span(Maps(B))\ is uniquely determined, which fact we can exploit to establish the required coherence conditions. \ locale two_composable_identities_in_bicategory_of_spans = bicategory_of_spans V H \ \ src trg + r: identity_in_bicategory_of_spans V H \ \ src trg r + s: identity_in_bicategory_of_spans V H \ \ src trg s for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and r :: 'a and s :: 'a + assumes composable: "src r = trg s" begin notation isomorphic (infix "\" 50) interpretation r: arrow_in_bicategory_of_spans V H \ \ src trg r r r by unfold_locales auto interpretation r: arrow_of_tabulations_in_maps V H \ \ src trg r r.tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ r r.tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ r using r.is_arrow_of_tabulations_in_maps by simp interpretation s: arrow_in_bicategory_of_spans V H \ \ src trg s s s by unfold_locales auto interpretation s: arrow_of_tabulations_in_maps V H \ \ src trg s s.tab \tab\<^sub>0 s\ \tab\<^sub>1 s\ s s.tab \tab\<^sub>0 s\ \tab\<^sub>1 s\ s using s.is_arrow_of_tabulations_in_maps by simp sublocale identity_in_bicategory_of_spans V H \ \ src trg \r \ s\ apply unfold_locales by (simp add: composable) sublocale horizontal_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg r r.tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ s s.tab \tab\<^sub>0 s\ \tab\<^sub>1 s\ r r.tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ s s.tab \tab\<^sub>0 s\ \tab\<^sub>1 s\ r s using composable by unfold_locales auto abbreviation p\<^sub>0 where "p\<^sub>0 \ \\.p\<^sub>0" abbreviation p\<^sub>1 where "p\<^sub>1 \ \\.p\<^sub>1" text \ We will take as the composition isomorphism from \SPN r \ SPN s\ to \SPN (r \ s)\ the arrow of tabulations, induced by the identity \r \ s\, from the composite of the chosen tabulations of \r\ and \s\ to the chosen tabulation of \r \ s\. As this arrow of tabulations is induced by an identity, it is an equivalence map. \ interpretation cmp: identity_arrow_of_tabulations_in_maps V H \ \ src trg \r \ s\ \\.tab \tab\<^sub>0 s \ \\.p\<^sub>0\ \tab\<^sub>1 r \ \\.p\<^sub>1\ \r \ s\ tab \tab\<^sub>0 (r \ s)\ \tab\<^sub>1 (r \ s)\ \r \ s\ using composable by unfold_locales auto lemma cmp_interpretation: shows "identity_arrow_of_tabulations_in_maps V H \ \ src trg (r \ s) \\.tab (tab\<^sub>0 s \ \\.p\<^sub>0) (tab\<^sub>1 r \ \\.p\<^sub>1) (r \ s) tab (tab\<^sub>0 (r \ s)) (tab\<^sub>1 (r \ s)) (r \ s)" .. definition cmp where "cmp = cmp.chine" lemma cmp_props: shows "\cmp : src \\.tab \ src tab\" and "\cmp : cmp \ cmp\" and "equivalence_map cmp" and "tab\<^sub>0 (r \ s) \ cmp \ tab\<^sub>0 s \ \\.p\<^sub>0" and "tab\<^sub>1 (r \ s) \ cmp \ tab\<^sub>1 r \ \\.p\<^sub>1" using cmp_def cmp.leg0_uniquely_isomorphic(1) cmp.leg1_uniquely_isomorphic(1) isomorphic_symmetric cmp.chine_is_equivalence by auto lemma cmp_in_hom [intro]: shows "\cmp : src \\.tab \ src tab\" and "\cmp : cmp \ cmp\" using cmp_props by auto lemma cmp_simps [simp]: shows "arr cmp" and "ide cmp" and "src cmp = src \\.tab" and "trg cmp = src tab" and "dom cmp = cmp" and "cod cmp = cmp" using cmp_props equivalence_map_is_ide by auto text \ Now we have to use the above properties of the underlying bicategory to exhibit the composition isomorphisms as actual arrows in \Span(Maps(B))\ and to prove the required naturality and coherence conditions. \ interpretation Maps: maps_category V H \ \ src trg .. interpretation Span: span_bicategory Maps.comp Maps.PRJ\<^sub>0 Maps.PRJ\<^sub>1 .. no_notation Fun.comp (infixl "\" 55) notation Span.vcomp (infixr "\" 55) notation Span.hcomp (infixr "\" 53) notation Maps.comp (infixr "\" 55) interpretation SPN: "functor" V Span.vcomp SPN using SPN_is_functor by simp interpretation SPN: weak_arrow_of_homs V src trg Span.vcomp Span.src Span.trg SPN using SPN_is_weak_arrow_of_homs by simp interpretation SPN_r_SPN_s: arrow_of_spans Maps.comp \SPN r \ SPN s\ using composable Span.ide_char [of "SPN r \ SPN s"] by simp interpretation SPN_r_SPN_s: identity_arrow_of_spans Maps.comp \SPN r \ SPN s\ using composable Span.ide_char [of "SPN r \ SPN s"] by (unfold_locales, simp) interpretation SPN_rs: arrow_of_spans Maps.comp \SPN (r \ s)\ using composable Span.arr_char r.base_simps(2) s.base_simps(2) by blast interpretation SPN_rs: identity_arrow_of_spans Maps.comp \SPN (r \ s)\ using composable Span.ide_char SPN.preserves_ide r.is_ide s.is_ide by (unfold_locales, simp) text \ The following are the legs (as arrows of \Maps\) of the spans \SPN r\ and \SPN s\. \ definition R\<^sub>0 where "R\<^sub>0 = \\tab\<^sub>0 r\\" definition R\<^sub>1 where "R\<^sub>1 = \\tab\<^sub>1 r\\" definition S\<^sub>0 where "S\<^sub>0 = \\tab\<^sub>0 s\\" definition S\<^sub>1 where "S\<^sub>1 = \\tab\<^sub>1 s\\" lemma span_legs_eq: shows "Leg0 (Dom (SPN r)) = R\<^sub>0" and "Leg1 (Dom (SPN r)) = R\<^sub>1" and "Leg0 (Dom (SPN s)) = S\<^sub>0" and "Leg1 (Dom (SPN s)) = S\<^sub>1" using SPN_def R\<^sub>0_def R\<^sub>1_def S\<^sub>0_def S\<^sub>1_def composable by auto lemma R\<^sub>0_in_hom [intro]: shows "Maps.in_hom R\<^sub>0 (Maps.MkIde (src r.s\<^sub>0)) (Maps.MkIde (src r))" by (simp add: Maps.MkArr_in_hom' R\<^sub>0_def) lemma R\<^sub>1_in_hom [intro]: shows "Maps.in_hom R\<^sub>1 (Maps.MkIde (src r.s\<^sub>0)) (Maps.MkIde (trg r))" by (simp add: Maps.MkArr_in_hom' R\<^sub>1_def) lemma S\<^sub>0_in_hom [intro]: shows "Maps.in_hom S\<^sub>0 (Maps.MkIde (src s.s\<^sub>0)) (Maps.MkIde (src s))" by (simp add: Maps.MkArr_in_hom' S\<^sub>0_def) lemma S\<^sub>1_in_hom [intro]: shows "Maps.in_hom S\<^sub>1 (Maps.MkIde (src s.s\<^sub>0)) (Maps.MkIde (trg s))" by (simp add: Maps.MkArr_in_hom' S\<^sub>1_def) lemma RS_simps [simp]: shows "Maps.arr R\<^sub>0" and "Maps.dom R\<^sub>0 = Maps.MkIde (src r.s\<^sub>0)" and "Maps.cod R\<^sub>0 = Maps.MkIde (src r)" and "Maps.Dom R\<^sub>0 = src r.s\<^sub>0" and "Maps.Cod R\<^sub>0 = src r" and "Maps.arr R\<^sub>1" and "Maps.dom R\<^sub>1 = Maps.MkIde (src r.s\<^sub>0)" and "Maps.cod R\<^sub>1 = Maps.MkIde (trg r)" and "Maps.Dom R\<^sub>1 = src r.s\<^sub>0" and "Maps.Cod R\<^sub>1 = trg r" and "Maps.arr S\<^sub>0" and "Maps.dom S\<^sub>0 = Maps.MkIde (src s.s\<^sub>0)" and "Maps.cod S\<^sub>0 = Maps.MkIde (src s)" and "Maps.Dom S\<^sub>0 = src s.s\<^sub>0" and "Maps.Cod S\<^sub>0 = src s" and "Maps.arr S\<^sub>1" and "Maps.dom S\<^sub>1 = Maps.MkIde (src s.s\<^sub>0)" and "Maps.cod S\<^sub>1 = Maps.MkIde (trg s)" and "Maps.Dom S\<^sub>1 = src s.s\<^sub>0" and "Maps.Cod S\<^sub>1 = trg s" using R\<^sub>0_in_hom R\<^sub>1_in_hom S\<^sub>0_in_hom S\<^sub>1_in_hom composable by (auto simp add: R\<^sub>0_def R\<^sub>1_def S\<^sub>0_def S\<^sub>1_def) text \ The apex of the composite span @{term "SPN r \ SPN s"} (defined in terms of pullback) coincides with the apex of the composite tabulation \\\\ (defined using the chosen tabulation of \(tab\<^sub>0 r)\<^sup>* \ tab\<^sub>1 s)\). We need this to be true in order to define the compositor of a pseudofunctor from the underlying bicategory \B\ to \Span(Maps(B))\. It is only true if we have carefully chosen pullbacks in \Maps(B)\ in order to ensure the relationship with the chosen tabulations. \ lemma SPN_r_SPN_s_apex_eq: shows "SPN_r_SPN_s.apex = Maps.MkIde (src \\.tab)" proof - have "obj (Maps.Cod SPN_r_SPN_s.leg0)" using Maps.arr_char [of "SPN_r_SPN_s.leg0"] by simp moreover have "obj (Maps.Dom SPN_r_SPN_s.leg0)" using Maps.arr_char [of "SPN_r_SPN_s.leg0"] by simp moreover have "SPN_r_SPN_s.leg0 \ Maps.Null" using Maps.arr_char [of "SPN_r_SPN_s.leg0"] by simp moreover have "Maps.Dom SPN_r_SPN_s.leg0 = src \\.tab" proof - interpret REP_S\<^sub>1: map_in_bicategory V H \ \ src trg \Maps.REP S\<^sub>1\ using Maps.REP_in_Map Maps.arr_char Maps.in_HomD S\<^sub>1_def apply unfold_locales by (meson Maps.REP_in_hhom(2) S\<^sub>1_in_hom) interpret REP_R\<^sub>0: map_in_bicategory V H \ \ src trg \Maps.REP R\<^sub>0\ using Maps.REP_in_Map Maps.arr_char Maps.in_HomD R\<^sub>0_def apply unfold_locales by (meson Maps.REP_in_hhom(2) R\<^sub>0_in_hom) have "Maps.Dom SPN_r_SPN_s.leg0 = Maps.Dom (S\<^sub>0 \ Maps.PRJ\<^sub>0 R\<^sub>0 S\<^sub>1)" using composable Span.hcomp_def S\<^sub>0_def R\<^sub>0_def S\<^sub>1_def by simp also have "... = Maps.Dom \\tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1)\\" proof - have "is_left_adjoint (tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1))" proof - have "ide ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1)" proof - have "src (Maps.REP R\<^sub>0)\<^sup>* = trg (Maps.REP S\<^sub>1)" using REP_R\<^sub>0.is_map REP_S\<^sub>1.is_map left_adjoint_is_ide R\<^sub>0_def S\<^sub>1_def by (metis (no_types, lifting) Maps.REP_CLS REP_R\<^sub>0.antipar(2) isomorphic_implies_hpar(4) composable r.leg0_simps(3) r.satisfies_T0 s.leg1_is_map s.leg1_simps(3) s.leg1_simps(4)) thus ?thesis by simp qed thus ?thesis by simp qed moreover have "Maps.Dom (S\<^sub>0 \ \\tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1)\\) = src (tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1))" proof - have "Maps.arr (\\prj\<^sub>0 (Maps.REP S\<^sub>1) (Maps.REP R\<^sub>0)\\)" using Maps.CLS_in_hom Maps.prj0_simps(1) Maps.PRJ\<^sub>0_def composable by fastforce moreover have "Maps.Dom S\<^sub>0 = Maps.Cod \\prj\<^sub>0 (Maps.REP S\<^sub>1) (Maps.REP R\<^sub>0)\\" proof - have "Maps.Cod \\prj\<^sub>0 (Maps.REP S\<^sub>1) (Maps.REP R\<^sub>0)\\ = trg (prj\<^sub>0 (Maps.REP S\<^sub>1) (Maps.REP R\<^sub>0))" by simp also have "... = src (Maps.REP S\<^sub>1)" proof - have "ide (Maps.REP S\<^sub>1)" by simp moreover have "is_left_adjoint (Maps.REP R\<^sub>0)" by auto moreover have "trg (Maps.REP S\<^sub>1) = trg (Maps.REP R\<^sub>0)" by (simp add: composable) ultimately show ?thesis using S\<^sub>1_def Maps.REP_CLS r.leg0_is_map s.leg1_is_map by simp qed also have "... = src (tab\<^sub>0 s)" using tab\<^sub>0_in_hom(1) by simp also have "... = Maps.Dom S\<^sub>0" using S\<^sub>0_def by simp finally show ?thesis by simp qed ultimately have "Maps.Dom (S\<^sub>0 \ \\tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1)\\) = Maps.Dom \\tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1)\\" using Maps.CLS_in_hom by simp thus ?thesis by simp qed ultimately show ?thesis using Maps.PRJ\<^sub>0_def composable Maps.Dom.simps(1) RS_simps(1) RS_simps(16) RS_simps(18) RS_simps(3) by presburger qed also have "... = src (tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1))" by simp finally have "Maps.Dom SPN_r_SPN_s.leg0 = src (tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1))" by simp also have "... = src (tab\<^sub>0 (r.s\<^sub>0\<^sup>* \ s.s\<^sub>1))" proof - interpret r\<^sub>0's\<^sub>1: identity_in_bicategory_of_spans V H \ \ src trg \r.s\<^sub>0\<^sup>* \ s.s\<^sub>1\ using composable by (unfold_locales, simp) have "(Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1 \ r.s\<^sub>0\<^sup>* \ s.s\<^sub>1" proof - have "(Maps.REP R\<^sub>0)\<^sup>* \ r.s\<^sub>0\<^sup>*" proof - have 1: "adjoint_pair (Maps.REP R\<^sub>0) (Maps.REP R\<^sub>0)\<^sup>*" using REP_R\<^sub>0.is_map left_adjoint_extends_to_adjoint_pair by blast moreover have "adjoint_pair r.s\<^sub>0 (Maps.REP R\<^sub>0)\<^sup>*" proof - have "Maps.REP R\<^sub>0 \ r.s\<^sub>0" unfolding R\<^sub>0_def using Maps.REP_CLS r.leg0_is_map composable by force thus ?thesis using 1 adjoint_pair_preserved_by_iso isomorphic_def REP_R\<^sub>0.triangle_in_hom(4) REP_R\<^sub>0.triangle_right' by auto qed ultimately show ?thesis using r.leg0_is_map left_adjoint_determines_right_up_to_iso left_adjoint_extends_to_adjoint_pair by auto qed moreover have "Maps.REP S\<^sub>1 \ s.s\<^sub>1" unfolding S\<^sub>1_def using Maps.REP_CLS s.leg1_is_map composable by force moreover have "\a. a \ (tab\<^sub>0 r)\<^sup>* \ tab\<^sub>1 s \ (Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1 \ a" using calculation composable isomorphic_implies_hpar(3) hcomp_ide_isomorphic hcomp_isomorphic_ide [of "(Maps.REP R\<^sub>0)\<^sup>*" "r.s\<^sub>0\<^sup>*" s.s\<^sub>1] by auto ultimately show ?thesis using isomorphic_transitive by blast qed thus ?thesis using r\<^sub>0's\<^sub>1.isomorphic_implies_same_tab isomorphic_symmetric by metis qed also have "... = src \\.tab" using VV.ide_char VV.arr_char composable Span.hcomp_def \\.tab_simps(2) by auto finally show ?thesis by simp qed ultimately show ?thesis using composable Maps.arr_char Maps.dom_char SPN_r_SPN_s.dom.apex_def apply auto by (metis (no_types, lifting) Maps.not_arr_null SPN_r_SPN_s.chine_eq_apex SPN_r_SPN_s.chine_simps(1)) qed text \ We will be taking the arrow @{term "CLS cmp"} of \Maps\ as the composition isomorphism from @{term "SPN r \ SPN s"} to @{term "SPN (r \ s)"}. The following result shows that it has the right domain and codomain for that purpose. \ lemma iso_class_cmp_in_hom: shows "Maps.in_hom (Maps.MkArr (src \\.tab) (src tab) \cmp\) SPN_r_SPN_s.apex SPN_rs.apex" and "Maps.in_hom \\cmp\\ SPN_r_SPN_s.apex SPN_rs.apex" proof - show "Maps.in_hom (Maps.MkArr (src \\.tab) (src tab) \cmp\) SPN_r_SPN_s.apex SPN_rs.apex" proof - have "obj (src \\.tab)" using obj_src \\.tab_in_hom by blast moreover have "obj (src tab)" using obj_src by simp moreover have "\cmp\ \ Maps.Hom (src \\.tab) (src tab)" by (metis (mono_tags, lifting) cmp.is_map cmp_def cmp_props(1) mem_Collect_eq) moreover have "SPN_r_SPN_s.apex = Maps.MkIde (src \\.tab)" using SPN_r_SPN_s_apex_eq by simp moreover have "SPN_rs.apex = Maps.MkIde (src tab)" using SPN_def composable SPN_rs.cod.apex_def Maps.arr_char Maps.dom_char SPN_rs.dom.leg_simps(1) by fastforce ultimately show ?thesis using Maps.MkArr_in_hom by simp qed thus "Maps.in_hom \\cmp\\ SPN_r_SPN_s.apex SPN_rs.apex" by simp qed interpretation r\<^sub>0's\<^sub>1: two_composable_identities_in_bicategory_of_spans V H \ \ src trg \(Maps.REP R\<^sub>0)\<^sup>*\ \Maps.REP S\<^sub>1\ proof show "ide (Maps.REP S\<^sub>1)" using Maps.REP_in_Map Maps.arr_char left_adjoint_is_ide by (meson Maps.REP_in_hhom(2) S\<^sub>1_in_hom) show "ide (Maps.REP R\<^sub>0)\<^sup>*" using Maps.REP_in_Map Maps.arr_char left_adjoint_is_ide Maps.REP_in_hhom(2) R\<^sub>0_in_hom by auto show "src (Maps.REP R\<^sub>0)\<^sup>* = trg (Maps.REP S\<^sub>1)" using Maps.REP_in_hhom(2) R\<^sub>0_in_hom composable by auto qed interpretation R\<^sub>0'S\<^sub>1: identity_in_bicategory_of_spans V H \ \ src trg \(tab\<^sub>0 r)\<^sup>* \ tab\<^sub>1 s\ by (unfold_locales, simp add: composable) lemma prj_tab_agreement: shows "(tab\<^sub>0 r)\<^sup>* \ tab\<^sub>1 s \ (Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1" and "\\.p\<^sub>0 \ prj\<^sub>0 (Maps.REP S\<^sub>1) (Maps.REP R\<^sub>0)" and "\\.p\<^sub>1 \ prj\<^sub>1 (Maps.REP S\<^sub>1) (Maps.REP R\<^sub>0)" proof - show 1: "(tab\<^sub>0 r)\<^sup>* \ tab\<^sub>1 s \ (Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1" proof - have "(tab\<^sub>0 r)\<^sup>* \ (Maps.REP R\<^sub>0)\<^sup>*" using Maps.REP_CLS isomorphic_symmetric R\<^sub>0_def composable r.satisfies_T0 isomorphic_to_left_adjoint_implies_isomorphic_right_adjoint by fastforce moreover have "tab\<^sub>1 s \ Maps.REP S\<^sub>1" by (metis Maps.REP_CLS isomorphic_symmetric S\<^sub>1_def s.leg1_is_map s.leg1_simps(3-4)) moreover have "src (Maps.REP R\<^sub>0)\<^sup>* = trg (tab\<^sub>1 s)" using composable r.T0.antipar right_adjoint_simps(2) by fastforce ultimately show ?thesis using hcomp_isomorphic_ide [of "(tab\<^sub>0 r)\<^sup>*" "(Maps.REP R\<^sub>0)\<^sup>*" "tab\<^sub>1 s"] hcomp_ide_isomorphic isomorphic_transitive composable by auto qed show "\\.p\<^sub>0 \ tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1)" using 1 R\<^sub>0'S\<^sub>1.isomorphic_implies_same_tab isomorphic_reflexive by auto show "\\.p\<^sub>1 \ tab\<^sub>1 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1)" using 1 R\<^sub>0'S\<^sub>1.isomorphic_implies_same_tab isomorphic_reflexive by auto qed lemma chine_hcomp_SPN_SPN: shows "Span.chine_hcomp (SPN r) (SPN s) = Maps.MkIde (src \\.p\<^sub>0)" proof - have "Span.chine_hcomp (SPN r) (SPN s) = Maps.MkIde (src (tab\<^sub>0 ((Maps.REP R\<^sub>0)\<^sup>* \ Maps.REP S\<^sub>1)))" using Span.chine_hcomp_ide_ide [of "SPN r" "SPN s"] composable Maps.pbdom_def Maps.PRJ\<^sub>0_def Maps.CLS_in_hom Maps.dom_char R\<^sub>0_def S\<^sub>1_def apply simp using Maps.prj0_simps(1) RS_simps(1) RS_simps(16) RS_simps(18) RS_simps(3) by presburger also have "... = Maps.MkIde (src \\.p\<^sub>0)" using prj_tab_agreement isomorphic_implies_hpar(3) by force finally show ?thesis by simp qed end text \ The development above focused on two specific composable 1-cells in bicategory \B\. Here we reformulate those results as statements about the entire bicategory. \ context bicategory_of_spans begin interpretation Maps: maps_category V H \ \ src trg .. interpretation Span: span_bicategory Maps.comp Maps.PRJ\<^sub>0 Maps.PRJ\<^sub>1 .. no_notation Fun.comp (infixl "\" 55) notation Span.vcomp (infixr "\" 55) notation Span.hcomp (infixr "\" 53) notation Maps.comp (infixr "\" 55) notation isomorphic (infix "\" 50) interpretation SPN: "functor" V Span.vcomp SPN using SPN_is_functor by simp interpretation SPN: weak_arrow_of_homs V src trg Span.vcomp Span.src Span.trg SPN using SPN_is_weak_arrow_of_homs by simp interpretation HoSPN_SPN: composite_functor VV.comp Span.VV.comp Span.vcomp SPN.FF \\\\. fst \\ \ snd \\\ .. interpretation SPNoH: composite_functor VV.comp V Span.vcomp \\\\. fst \\ \ snd \\\ SPN .. text \ Given arbitrary composable 1-cells \r\ and \s\, obtain an arrow of spans in \Maps\ having the isomorphism class of \rs.cmp\ as its chine. \ definition CMP where "CMP r s \ \Chn = \\two_composable_identities_in_bicategory_of_spans.cmp V H \ \ src trg r s\\, Dom = Dom (SPN r \ SPN s), Cod = Dom (SPN (r \ s))\" lemma compositor_in_hom [intro]: assumes "ide r" and "ide s" and "src r = trg s" shows "Span.in_hhom (CMP r s) (SPN.map\<^sub>0 (src s)) (SPN.map\<^sub>0 (trg r))" and "Span.in_hom (CMP r s) (HoSPN_SPN.map (r, s)) (SPNoH.map (r, s))" proof - have rs: "VV.ide (r, s)" using assms VV.ide_char VV.arr_char by simp interpret rs: two_composable_identities_in_bicategory_of_spans V H \ \ src trg r s using rs VV.ide_char VV.arr_char by unfold_locales auto interpret cmp: arrow_of_tabulations_in_maps V H \ \ src trg \r \ s\ rs.\\.tab \tab\<^sub>0 s \ rs.\\.p\<^sub>0\ \tab\<^sub>1 r \ rs.\\.p\<^sub>1\ \r \ s\ rs.tab \tab\<^sub>0 (r \ s)\ \tab\<^sub>1 (r \ s)\ \r \ s\ by unfold_locales auto have "rs.cmp = cmp.chine" using rs.cmp_def by simp interpret SPN_r_SPN_s: arrow_of_spans Maps.comp \SPN r \ SPN s\ using rs.composable Span.ide_char [of "SPN r \ SPN s"] by simp interpret SPN_r_SPN_s: identity_arrow_of_spans Maps.comp \SPN r \ SPN s\ using rs.composable Span.ide_char [of "SPN r \ SPN s"] by (unfold_locales, simp) interpret SPN_rs: arrow_of_spans Maps.comp \SPN (r \ s)\ using Span.arr_char rs.is_ide SPN.preserves_arr by blast interpret SPN_rs: identity_arrow_of_spans Maps.comp \SPN (r \ s)\ using Span.ide_char rs.is_ide SPN.preserves_ide by (unfold_locales, simp) interpret Dom: span_in_category Maps.comp \Dom (CMP r s)\ by (unfold_locales, simp add: CMP_def) interpret Cod: span_in_category Maps.comp \Cod (CMP r s)\ proof - (* TODO: I don't understand what makes this so difficult. *) have "\tab\<^sub>0 (r \ s) : src (tab\<^sub>0 (r \ s)) \ src s\ \ is_left_adjoint (tab\<^sub>0 (r \ s)) \ \tab\<^sub>0 (r \ s)\ = \tab\<^sub>0 (r \ s)\" by simp hence "\f. \f : src (tab\<^sub>0 (r \ s)) \ src s\ \ is_left_adjoint f \ \tab\<^sub>0 (r \ s)\ = \f\" by blast moreover have "\f. \f : src (tab\<^sub>0 (r \ s)) \ trg r\ \ is_left_adjoint f \ \tab\<^sub>1 (r \ s)\ = \f\" by (metis rs.base_simps(2) rs.leg1_in_hom(1) rs.leg1_is_map trg_hcomp) ultimately show "span_in_category Maps.comp (Cod (CMP r s))" using assms Maps.arr_char Maps.dom_char CMP_def by unfold_locales auto qed interpret r\<^sub>0's\<^sub>1: two_composable_identities_in_bicategory_of_spans V H \ \ src trg \(Maps.REP rs.R\<^sub>0)\<^sup>*\ \Maps.REP rs.S\<^sub>1\ proof show "ide (Maps.REP rs.S\<^sub>1)" using Maps.REP_in_Map Maps.arr_char left_adjoint_is_ide by (meson Maps.REP_in_hhom(2) rs.S\<^sub>1_in_hom) show "ide (Maps.REP rs.R\<^sub>0)\<^sup>*" using Maps.REP_in_Map Maps.arr_char left_adjoint_is_ide Maps.REP_in_hhom(2) rs.R\<^sub>0_in_hom by auto show "src (Maps.REP rs.R\<^sub>0)\<^sup>* = trg (Maps.REP rs.S\<^sub>1)" using Maps.REP_in_hhom(2) rs.R\<^sub>0_in_hom rs.composable by auto qed interpret R\<^sub>0'S\<^sub>1: identity_in_bicategory_of_spans V H \ \ src trg \(tab\<^sub>0 r)\<^sup>* \ tab\<^sub>1 s\ by (unfold_locales, simp add: rs.composable) text \ Here we obtain explicit formulas for the legs and apex of \SPN_r_SPN_s\ and \SPN_rs\. \ have SPN_r_SPN_s_leg0_eq: "SPN_r_SPN_s.leg0 = Maps.comp rs.S\<^sub>0 (Maps.PRJ\<^sub>0 rs.R\<^sub>0 rs.S\<^sub>1)" using rs.composable Span.hcomp_def rs.S\<^sub>0_def rs.R\<^sub>0_def rs.S\<^sub>1_def by simp have SPN_r_SPN_s_leg1_eq: "SPN_r_SPN_s.leg1 = Maps.comp rs.R\<^sub>1 (Maps.PRJ\<^sub>1 rs.R\<^sub>0 rs.S\<^sub>1)" using rs.composable Span.hcomp_def rs.R\<^sub>1_def rs.R\<^sub>0_def rs.S\<^sub>1_def by simp have "SPN_r_SPN_s.apex = Maps.MkIde (src rs.\\.tab)" using rs.SPN_r_SPN_s_apex_eq by auto have SPN_rs_leg0_eq: "SPN_rs.leg0 = \\tab\<^sub>0 (r \ s)\\" unfolding SPN_def using rs by simp have SPN_rs_leg1_eq: "SPN_rs.leg1 = \\tab\<^sub>1 (r \ s)\\" unfolding SPN_def using rs by simp have "SPN_rs.apex = Maps.MkIde (src (tab_of_ide (r \ s)))" using SPN_rs.dom.apex_def Maps.dom_char SPN_rs_leg0_eq SPN_rs.dom.leg_simps(1) by simp text \ The composition isomorphism @{term "CMP r s"} is an arrow of spans in \Maps(B)\. \ interpret arrow_of_spans Maps.comp \CMP r s\ proof show 1: "Maps.in_hom (Chn (CMP r s)) Dom.apex Cod.apex" using rs.iso_class_cmp_in_hom rs.composable CMP_def by simp show "Cod.leg0 \ Chn (CMP r s) = Dom.leg0" proof (intro Maps.arr_eqI) show 2: "Maps.seq Cod.leg0 (Chn (CMP r s))" using 1 Maps.dom_char Maps.cod_char by blast show 3: "Maps.arr Dom.leg0" by simp show "Maps.Dom (Cod.leg0 \ Chn (CMP r s)) = Maps.Dom Dom.leg0" using 1 2 Maps.dom_char Maps.cod_char Maps.comp_char Dom.leg_in_hom Maps.in_hom_char Maps.seq_char by auto show "Maps.Cod (Cod.leg0 \ Chn (CMP r s)) = Maps.Cod Dom.leg0" using 2 3 Maps.comp_char [of Cod.leg0 "Chn (CMP r s)"] Dom.leg_simps Dom.apex_def Maps.dom_char SPN_r_SPN_s_leg0_eq Maps.comp_char [of rs.S\<^sub>0 "Maps.PRJ\<^sub>0 rs.R\<^sub>0 rs.S\<^sub>1"] CMP_def by simp show "Maps.Map (Cod.leg0 \ Chn (CMP r s)) = Maps.Map Dom.leg0" proof - have "Maps.Map (Cod.leg0 \ Chn (CMP r s)) = Maps.Comp \tab\<^sub>0 (r \ s)\ \rs.cmp\" using 1 2 Maps.dom_char Maps.cod_char Maps.comp_char [of Cod.leg0 "Chn (CMP r s)"] CMP_def by simp also have "... = Maps.Comp \tab\<^sub>0 s\ \rs.\\.p\<^sub>0\" proof - have "Maps.Comp \tab\<^sub>0 (r \ s)\ \rs.cmp\ = \tab\<^sub>0 (r \ s) \ rs.cmp\" using Maps.Comp_eq_iso_class_memb Maps.CLS_hcomp cmp.is_map rs.cmp_def by auto also have "... = Maps.Comp \tab\<^sub>0 s\ \rs.\\.p\<^sub>0\" using Maps.Comp_eq_iso_class_memb Maps.CLS_hcomp iso_class_eqI rs.cmp_props(4) by auto finally show ?thesis by simp qed also have "... = Maps.Map Dom.leg0" proof - have "Maps.seq rs.S\<^sub>0 (Maps.PRJ\<^sub>0 rs.R\<^sub>0 rs.S\<^sub>1)" by (intro Maps.seqI, simp_all add: rs.composable) moreover have "\prj\<^sub>0 (Maps.REP rs.S\<^sub>1) (Maps.REP rs.R\<^sub>0)\ = \rs.\\.p\<^sub>0\" using "rs.prj_tab_agreement" iso_class_eqI by auto moreover have "Maps.Dom (Maps.PRJ\<^sub>0 rs.R\<^sub>0 rs.S\<^sub>1) = src rs.\\.p\<^sub>0" using rs.prj_tab_agreement Maps.PRJ\<^sub>0_def rs.composable isomorphic_implies_hpar(3) by auto ultimately show ?thesis using SPN_r_SPN_s_leg0_eq Maps.comp_char [of rs.S\<^sub>0 "Maps.PRJ\<^sub>0 rs.R\<^sub>0 rs.S\<^sub>1"] rs.S\<^sub>0_def Maps.PRJ\<^sub>0_def rs.composable CMP_def by simp qed finally show ?thesis by simp qed qed show "Cod.leg1 \ Chn (CMP r s) = Dom.leg1" proof (intro Maps.arr_eqI) show 2: "Maps.seq Cod.leg1 (Chn (CMP r s))" using 1 Maps.dom_char Maps.cod_char by blast show 3: "Maps.arr Dom.leg1" by simp show "Maps.Dom (Cod.leg1 \ Chn (CMP r s)) = Maps.Dom Dom.leg1" using 1 2 Maps.dom_char Maps.cod_char Maps.comp_char Dom.leg_in_hom Maps.in_hom_char Maps.seq_char by auto show "Maps.Cod (Cod.leg1 \ Chn (CMP r s)) = Maps.Cod Dom.leg1" using 2 3 Maps.comp_char [of Cod.leg1 "Chn (CMP r s)"] Dom.apex_def Maps.dom_char SPN_r_SPN_s_leg1_eq Maps.comp_char [of rs.R\<^sub>1 "Maps.PRJ\<^sub>1 rs.R\<^sub>0 rs.S\<^sub>1"] CMP_def by simp show "Maps.Map (Cod.leg1 \ Chn (CMP r s)) = Maps.Map Dom.leg1" proof - have "Maps.Map (Cod.leg1 \ Chn (CMP r s)) = Maps.Comp \tab\<^sub>1 (r \ s)\ \rs.cmp\" using 1 2 Maps.dom_char Maps.cod_char Maps.comp_char [of Cod.leg1 "Chn (CMP r s)"] CMP_def by simp also have "... = Maps.Comp \tab\<^sub>1 r\ \rs.\\.p\<^sub>1\" proof - have "Maps.Comp \tab\<^sub>1 (r \ s)\ \rs.cmp\ = \tab\<^sub>1 (r \ s) \ rs.cmp\" using Maps.Comp_eq_iso_class_memb Maps.CLS_hcomp cmp.is_map rs.cmp_def by auto also have "... = Maps.Comp \tab\<^sub>1 r\ \rs.\\.p\<^sub>1\" using Maps.Comp_eq_iso_class_memb Maps.CLS_hcomp [of "tab\<^sub>1 r" rs.\\.p\<^sub>1] iso_class_eqI rs.cmp_props(5) by auto finally show ?thesis by simp qed also have "... = Maps.Map Dom.leg1" proof - have "Maps.seq rs.R\<^sub>1 (Maps.PRJ\<^sub>1 rs.R\<^sub>0 rs.S\<^sub>1)" by (intro Maps.seqI, simp_all add: rs.composable) moreover have "\prj\<^sub>1 (Maps.REP rs.S\<^sub>1) (Maps.REP rs.R\<^sub>0)\ = \rs.\\.p\<^sub>1\" using rs.prj_tab_agreement iso_class_eqI by auto moreover have "Maps.Dom (Maps.PRJ\<^sub>1 rs.R\<^sub>0 rs.S\<^sub>1) = src rs.\\.p\<^sub>1" using rs.prj_tab_agreement Maps.PRJ\<^sub>1_def rs.composable isomorphic_implies_hpar(3) by auto ultimately show ?thesis using SPN_r_SPN_s_leg1_eq Maps.comp_char [of rs.R\<^sub>1 "Maps.PRJ\<^sub>1 rs.R\<^sub>0 rs.S\<^sub>1"] rs.R\<^sub>1_def Maps.PRJ\<^sub>1_def rs.composable CMP_def by simp qed finally show ?thesis by simp (* * Very simple, right? Yeah, once you sort through the notational morass and * figure out what equals what. *) qed qed qed show "Span.in_hom (CMP r s) (HoSPN_SPN.map (r, s)) (SPNoH.map (r, s))" using Span.arr_char arrow_of_spans_axioms Span.dom_char Span.cod_char CMP_def SPN.FF_def VV.arr_char rs.composable by auto thus "Span.in_hhom (CMP r s) (SPN.map\<^sub>0 (src s)) (SPN.map\<^sub>0 (trg r))" using assms VV.ide_char VV.arr_char VV.in_hom_char SPN.FF_def apply (intro Span.in_hhomI) apply auto using Span.src_dom [of "CMP r s"] Span.trg_dom [of "CMP r s"] apply (elim Span.in_homE) apply auto using Span.src_dom [of "CMP r s"] Span.trg_dom [of "CMP r s"] apply (elim Span.in_homE) by auto qed lemma compositor_simps [simp]: assumes "ide r" and "ide s" and "src r = trg s" shows "Span.arr (CMP r s)" and "Span.src (CMP r s) = SPN.map\<^sub>0 (src s)" and "Span.trg (CMP r s) = SPN.map\<^sub>0 (trg r)" and "Span.dom (CMP r s) = HoSPN_SPN.map (r, s)" and "Span.cod (CMP r s) = SPNoH.map (r, s)" using assms compositor_in_hom [of r s] by auto lemma compositor_is_iso: assumes "ide r" and "ide s" and "src r = trg s" shows "Span.iso (CMP r s)" proof - interpret rs: two_composable_identities_in_bicategory_of_spans V H \ \ src trg r s using assms by unfold_locales auto have "Span.arr (CMP r s)" using assms compositor_in_hom by blast moreover have "Maps.iso \\rs.cmp\\" using assms Maps.iso_char' by (metis (mono_tags, lifting) Maps.CLS_in_hom Maps.Map.simps(1) Maps.in_homE equivalence_is_left_adjoint ide_in_iso_class rs.cmp_props(3) rs.cmp_simps(2)) ultimately show ?thesis unfolding CMP_def using assms Span.iso_char by simp qed interpretation \: transformation_by_components VV.comp Span.vcomp HoSPN_SPN.map SPNoH.map \\rs. CMP (fst rs) (snd rs)\ proof fix rs assume rs: "VV.ide rs" let ?r = "fst rs" let ?s = "snd rs" show "Span.in_hom (CMP ?r ?s) (HoSPN_SPN.map rs) (SPNoH.map rs)" using rs compositor_in_hom [of ?r ?s] VV.ide_char VV.arr_char by simp next fix \\ assume \\: "VV.arr \\" let ?\ = "fst \\" let ?\ = "snd \\" show "CMP (fst (VV.cod \\)) (snd (VV.cod \\)) \ HoSPN_SPN.map \\ = SPNoH.map \\ \ CMP (fst (VV.dom \\)) (snd (VV.dom \\))" proof - let ?LHS = "CMP (fst (VV.cod \\)) (snd (VV.cod \\)) \ HoSPN_SPN.map \\" let ?RHS = "SPNoH.map \\ \ CMP (fst (VV.dom \\)) (snd (VV.dom \\))" have LHS: "Span.in_hom ?LHS (HoSPN_SPN.map (VV.dom \\)) (SPNoH.map (VV.cod \\))" proof show "Span.in_hom (HoSPN_SPN.map \\) (HoSPN_SPN.map (VV.dom \\)) (HoSPN_SPN.map (VV.cod \\))" using \\ by blast show "Span.in_hom (CMP (fst (VV.cod \\)) (snd (VV.cod \\))) (HoSPN_SPN.map (VV.cod \\)) (SPNoH.map (VV.cod \\))" using \\ VV.cod_simp by (auto simp add: VV.arr_char) qed have RHS: "Span.in_hom ?RHS (HoSPN_SPN.map (VV.dom \\)) (SPNoH.map (VV.cod \\))" using \\ VV.dom_simp VV.cod_simp by (auto simp add: VV.arr_char) show "?LHS = ?RHS" proof (intro Span.arr_eqI) show "Span.par ?LHS ?RHS" apply (intro conjI) using LHS RHS apply auto[2] proof - show "Span.dom ?LHS = Span.dom ?RHS" proof - have "Span.dom ?LHS = HoSPN_SPN.map (VV.dom \\)" using LHS by auto also have "... = Span.dom ?RHS" using RHS by auto finally show ?thesis by simp qed show "Span.cod ?LHS = Span.cod ?RHS" proof - have "Span.cod ?LHS = SPNoH.map (VV.cod \\)" using LHS by auto also have "... = Span.cod ?RHS" using RHS by auto finally show ?thesis by simp qed qed show "Chn ?LHS = Chn ?RHS" proof - interpret dom_\_\: two_composable_identities_in_bicategory_of_spans V H \ \ src trg \dom ?\\ \dom ?\\ using \\ VV.ide_char VV.arr_char by unfold_locales auto interpret cod_\_\: two_composable_identities_in_bicategory_of_spans V H \ \ src trg \cod ?\\ \cod ?\\ using \\ VV.ide_char VV.arr_char by unfold_locales auto interpret \_\: horizontal_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \dom ?\\ \tab_of_ide (dom ?\)\ \tab\<^sub>0 (dom ?\)\ \tab\<^sub>1 (dom ?\)\ \dom ?\\ \tab_of_ide (dom ?\)\ \tab\<^sub>0 (dom ?\)\ \tab\<^sub>1 (dom ?\)\ \cod ?\\ \tab_of_ide (cod ?\)\ \tab\<^sub>0 (cod ?\)\ \tab\<^sub>1 (cod ?\)\ \cod ?\\ \tab_of_ide (cod ?\)\ \tab\<^sub>0 (cod ?\)\ \tab\<^sub>1 (cod ?\)\ ?\ ?\ using \\ VV.arr_char by unfold_locales auto let ?\\ = "?\ \ ?\" interpret dom_\\: identity_in_bicategory_of_spans V H \ \ src trg \dom ?\\\ using \\ by (unfold_locales, simp) interpret cod_\\: identity_in_bicategory_of_spans V H \ \ src trg \cod ?\\\ using \\ by (unfold_locales, simp) interpret \\: arrow_of_tabulations_in_maps V H \ \ src trg \dom ?\\\ \tab_of_ide (dom ?\\)\ \tab\<^sub>0 (dom ?\\)\ \tab\<^sub>1 (dom ?\\)\ \cod ?\\\ \tab_of_ide (cod ?\\)\ \tab\<^sub>0 (cod ?\\)\ \tab\<^sub>1 (cod ?\\)\ ?\\ using \\ by unfold_locales auto have Chn_LHS_eq: "Chn ?LHS = \\cod_\_\.cmp\\ \ Span.chine_hcomp (SPN (fst \\)) (SPN (snd \\))" proof - have "Chn ?LHS = Chn (CMP (fst (VV.cod \\)) (snd (VV.cod \\))) \ Chn (HoSPN_SPN.map \\)" using \\ LHS Span.Chn_vcomp by blast also have "... = \\cod_\_\.cmp\\ \ Chn (HoSPN_SPN.map \\)" using \\ VV.arr_char VV.cod_char CMP_def by simp also have "... = \\cod_\_\.cmp\\ \ Span.chine_hcomp (SPN (fst \\)) (SPN (snd \\))" using \\ VV.arr_char SPN.FF_def Span.hcomp_def by simp finally show ?thesis by blast qed have Chn_RHS_eq: "Chn ?RHS = Maps.MkArr (src (tab\<^sub>0 (dom ?\ \ dom ?\))) (src (tab\<^sub>0 (cod ?\ \ cod ?\))) \\\.chine\ \ Maps.MkArr (src dom_\_\.\\.p\<^sub>0) (src (tab_of_ide (dom ?\ \ dom ?\))) \dom_\_\.cmp\" proof - have "Chn ?RHS = Chn (SPN (?\ \ ?\)) \ Maps.MkArr (src dom_\_\.\\.p\<^sub>0) (src (tab_of_ide (dom ?\ \ dom ?\))) \dom_\_\.cmp\" using \\ RHS Span.vcomp_def VV.arr_char CMP_def Span.arr_char Span.not_arr_Null VV.dom_simp by auto moreover have "Chn (SPN (?\ \ ?\)) = Maps.MkArr (src (tab\<^sub>0 (dom ?\ \ dom ?\))) (src (tab\<^sub>0 (cod ?\ \ cod ?\))) \\\.chine\" proof - have "Chn (SPN (?\ \ ?\)) = Maps.MkArr (src (tab\<^sub>0 (dom ?\ \ dom ?\))) (src (tab\<^sub>0 (cod ?\ \ cod ?\))) \spn ?\\\" using \\ SPN_def by simp also have "... = Maps.MkArr (src (tab\<^sub>0 (dom ?\ \ dom ?\))) (src (tab\<^sub>0 (cod ?\ \ cod ?\))) \\\.chine\" using spn_def by simp finally show ?thesis by simp qed ultimately show ?thesis by simp qed let ?Chn_LHS = "Maps.MkArr (src cod_\_\.\\.p\<^sub>0) (src (tab_of_ide (cod ?\ \ cod ?\))) \cod_\_\.cmp\ \ Span.chine_hcomp (SPN ?\) (SPN ?\)" let ?Chn_RHS = "Maps.MkArr (src (tab\<^sub>0 (dom ?\ \ dom ?\))) (src (tab\<^sub>0 (cod ?\ \ cod ?\))) \\\.chine\ \ Maps.MkArr (src dom_\_\.\\.p\<^sub>0) (src (tab_of_ide (dom ?\ \ dom ?\))) \dom_\_\.cmp\" have "?Chn_LHS = ?Chn_RHS" proof (intro Maps.arr_eqI) interpret LHS: arrow_of_spans Maps.comp ?LHS using LHS Span.arr_char by auto interpret RHS: arrow_of_spans Maps.comp ?RHS using RHS Span.arr_char by auto show 1: "Maps.arr ?Chn_LHS" using LHS.chine_in_hom Chn_LHS_eq by auto show 2: "Maps.arr ?Chn_RHS" using RHS.chine_in_hom Chn_RHS_eq by auto text \ Here is where we use \dom_\_\.chine_hcomp_SPN_SPN\, which depends on our having chosen the ``right'' pullbacks for \Maps(B)\. The map \Chn_LHS\ has as its domain the apex of the horizontal composite of the components of @{term "VV.dom \\"}, whereas \Chn_RHS\ has as its domain the apex of the chosen tabulation of \r\<^sub>0\<^sup>* \ s\<^sub>1\. We need these to be equal in order for \Chn_LHS\ and \Chn_RHS\ to be equal. \ show "Maps.Dom ?Chn_LHS = Maps.Dom ?Chn_RHS" proof - have "Maps.Dom ?Chn_LHS = Maps.Dom (Maps.dom ?Chn_LHS)" using \\ 1 Maps.Dom_dom by presburger also have "... = Maps.Dom (Span.chine_hcomp (SPN (dom ?\)) (SPN (dom ?\)))" proof - have "... = Maps.Dom (Maps.dom (Span.chine_hcomp (SPN ?\) (SPN ?\)))" using 1 Maps.seq_char Maps.Dom_comp by auto also have "... = Maps.Dom (Maps.pbdom (Leg0 (Dom (SPN ?\))) (Leg1 (Dom (SPN ?\))))" using \\ VV.arr_char Span.chine_hcomp_in_hom [of "SPN ?\" "SPN ?\"] by auto also have "... = Maps.Dom (Maps.dom (Maps.pbdom (Leg0 (Dom (SPN ?\))) (Leg1 (Dom (SPN ?\)))))" proof - have "Maps.cospan (Leg0 (Dom (SPN (fst \\)))) (Leg1 (Dom (SPN (snd \\))))" using \\ VV.arr_char SPN_in_hom Span.arr_char Span.dom_char SPN_def Maps.CLS_in_hom Maps.arr_char Maps.cod_char dom_\_\.composable dom_\_\.RS_simps(16) dom_\_\.S\<^sub>1_def dom_\_\.RS_simps(1) dom_\_\.R\<^sub>0_def Maps.pbdom_in_hom by simp thus ?thesis using \\ VV.arr_char Maps.pbdom_in_hom by simp qed also have "... = Maps.Dom (Maps.dom (Maps.pbdom (Leg0 (Dom (SPN (dom ?\)))) (Leg1 (Dom (SPN (dom ?\))))))" using \\ SPN_def VV.arr_char by simp also have "... = Maps.Dom (Maps.dom (Span.chine_hcomp (SPN (dom ?\)) (SPN (dom ?\))))" using \\ VV.arr_char ide_dom by (simp add: Span.chine_hcomp_ide_ide) also have "... = Maps.Dom (Span.chine_hcomp (SPN (dom ?\)) (SPN (dom ?\)))" using Maps.Dom_dom Maps.in_homE SPN.preserves_reflects_arr SPN.preserves_src SPN.preserves_trg Span.chine_hcomp_in_hom dom_\_\.composable dom_\_\.r.base_simps(2) dom_\_\.s.base_simps(2) by (metis (no_types, lifting)) finally show ?thesis by simp qed also have "... = src dom_\_\.\\.p\<^sub>0" using "dom_\_\.chine_hcomp_SPN_SPN" by simp also have "... = Maps.Dom ?Chn_RHS" using 2 Maps.seq_char Maps.Dom_comp by auto finally show ?thesis by simp qed show "Maps.Cod ?Chn_LHS = Maps.Cod ?Chn_RHS" proof - have "Maps.Cod ?Chn_LHS = src (tab_of_ide (cod ?\ \ cod ?\))" using \\ 1 VV.arr_char Maps.seq_char by auto also have "... = src (tab\<^sub>0 (cod ?\ \ cod ?\))" using \\ VV.arr_char cod_\\.tab_simps(2) by auto also have "... = Maps.Cod ?Chn_RHS" by (metis (no_types, lifting) "2" Maps.Cod.simps(1) Maps.Cod_comp Maps.seq_char) finally show ?thesis by simp qed show "Maps.Map ?Chn_LHS = Maps.Map ?Chn_RHS" proof - have RHS: "Maps.Map ?Chn_RHS = iso_class (\\.chine \ dom_\_\.cmp)" proof - have "Maps.Map ?Chn_RHS = Maps.Comp \\\.chine\ \dom_\_\.cmp\" using \\ 2 VV.arr_char Maps.Map_comp Maps.comp_char [of "Maps.MkArr (src (tab\<^sub>0 (dom ?\ \ dom ?\))) (src (tab\<^sub>0 (cod ?\ \ cod ?\))) \\\.chine\" "Maps.MkArr (src dom_\_\.\\.p\<^sub>0) (src (tab_of_ide (dom ?\ \ dom ?\))) \dom_\_\.cmp\"] by simp also have "... = \\\.chine \ dom_\_\.cmp\" proof - have "\dom_\_\.cmp\ \ Maps.Hom (src dom_\_\.\\.p\<^sub>0) (src (tab\<^sub>0 (dom ?\ \ dom ?\)))" proof - have "\dom_\_\.cmp\ \ Maps.Hom (src dom_\_\.\\.tab) (src (tab_of_ide (dom ?\ \ dom ?\)))" using \\ VV.arr_char dom_\_\.cmp_props(1-3) by (metis (mono_tags, lifting) equivalence_is_left_adjoint mem_Collect_eq) thus ?thesis using \\ VV.arr_char dom_\\.tab_simps(2) by simp qed moreover have "\\\.chine\ \ Maps.Hom (src (tab\<^sub>0 (dom ?\ \ dom ?\))) (src (tab\<^sub>0 (cod ?\ \ cod ?\)))" using \\ VV.arr_char \\.chine_in_hom \\.is_map by auto moreover have "\\.chine \ dom_\_\.cmp \ Maps.Comp \\\.chine\ \dom_\_\.cmp\" proof show "is_iso_class \dom_\_\.cmp\" using is_iso_classI by simp show "is_iso_class \\\.chine\" using is_iso_classI by simp show "dom_\_\.cmp \ \dom_\_\.cmp\" using ide_in_iso_class [of dom_\_\.cmp] by simp show "\\.chine \ \\\.chine\" using ide_in_iso_class by simp show "\\.chine \ dom_\_\.cmp \ \\.chine \ dom_\_\.cmp" using \\ VV.arr_char \\.chine_simps dom_\_\.cmp_simps dom_\\.tab_simps(2) isomorphic_reflexive by auto qed ultimately show ?thesis using \\ dom_\_\.cmp_props \\.chine_in_hom \\.chine_is_induced_map Maps.Comp_eq_iso_class_memb by blast qed finally show ?thesis by simp qed have LHS: "Maps.Map ?Chn_LHS = \cod_\_\.cmp \ \_\.chine\" proof - have "Maps.Map ?Chn_LHS = Maps.Comp \cod_\_\.cmp\ (Maps.Map (Maps.tuple (Maps.CLS (spn ?\ \ dom_\_\.\\.p\<^sub>1)) (Maps.CLS (tab\<^sub>0 (cod ?\))) (Maps.CLS (tab\<^sub>1 (cod ?\))) (Maps.CLS (spn ?\ \ dom_\_\.\\.p\<^sub>0))))" proof - have "Maps.Map ?Chn_LHS = Maps.Comp \cod_\_\.cmp\ (Maps.Map (Span.chine_hcomp (SPN ?\) (SPN ?\)))" using \\ 1 VV.arr_char Maps.Map_comp cod_\\.tab_simps(2) Maps.comp_char [of "Maps.MkArr (src cod_\_\.\\.p\<^sub>0) (src (tab_of_ide (cod ?\ \ cod ?\))) \cod_\_\.cmp\" "Span.chine_hcomp (SPN ?\) (SPN ?\)"] by simp moreover have "Span.chine_hcomp (SPN ?\) (SPN ?\) = Maps.tuple (Maps.CLS (spn ?\ \ dom_\_\.\\.p\<^sub>1)) (Maps.CLS (tab\<^sub>0 (cod ?\))) (Maps.CLS (tab\<^sub>1 (cod ?\))) (Maps.CLS (spn ?\ \ dom_\_\.\\.p\<^sub>0))" proof - have "Maps.PRJ\<^sub>0 (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>0 (dom ?\)\) (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>1 (dom ?\)\) = \\dom_\_\.\\.p\<^sub>0\\ \ Maps.PRJ\<^sub>1 (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>0 (dom ?\)\) (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>1 (dom ?\)\) = \\dom_\_\.\\.p\<^sub>1\\" proof - interpret X: identity_in_bicategory_of_spans V H \ \ src trg \(tab\<^sub>0 (dom ?\))\<^sup>* \ tab\<^sub>1 (dom ?\)\ using \\ VV.arr_char by (unfold_locales, simp) have "Maps.PRJ\<^sub>0 (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>0 (dom ?\)\) (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>1 (dom ?\)\) = \\tab\<^sub>0 ((Maps.REP (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg (snd \\)) \tab\<^sub>0 (dom ?\)\))\<^sup>* \ Maps.REP (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>1 (dom ?\)\))\\" unfolding Maps.PRJ\<^sub>0_def using \\ VV.arr_char dom_\_\.RS_simps(1) dom_\_\.RS_simps(16) dom_\_\.RS_simps(18) dom_\_\.RS_simps(3) dom_\_\.R\<^sub>0_def dom_\_\.S\<^sub>1_def by auto moreover have "Maps.PRJ\<^sub>1 (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>0 (dom ?\)\) (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>1 (dom ?\)\) = \\tab\<^sub>1 ((Maps.REP (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg (snd \\)) \tab\<^sub>0 (dom ?\)\))\<^sup>* \ Maps.REP (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>1 (dom ?\)\))\\" unfolding Maps.PRJ\<^sub>1_def using \\ VV.arr_char dom_\_\.RS_simps(1) dom_\_\.RS_simps(16) dom_\_\.RS_simps(18) dom_\_\.RS_simps(3) dom_\_\.R\<^sub>0_def dom_\_\.S\<^sub>1_def by auto moreover have "(Maps.REP (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg (snd \\)) \tab\<^sub>0 (dom ?\)\))\<^sup>* \ Maps.REP (Maps.MkArr (src (tab\<^sub>0 (dom ?\))) (trg ?\) \tab\<^sub>1 (dom ?\)\) \ (tab\<^sub>0 (dom ?\))\<^sup>* \ tab\<^sub>1 (dom ?\)" using VV.arr_char \\ dom_\_\.S\<^sub>1_def dom_\_\.s.leg1_simps(3) dom_\_\.s.leg1_simps(4) trg_dom dom_\_\.R\<^sub>0_def dom_\_\.prj_tab_agreement(1) isomorphic_symmetric by simp ultimately show ?thesis using X.isomorphic_implies_same_tab isomorphic_symmetric by metis qed thus ?thesis unfolding Span.chine_hcomp_def using \\ VV.arr_char SPN_def isomorphic_reflexive Maps.comp_CLS [of "spn ?\" dom_\_\.\\.p\<^sub>1 "spn ?\ \ dom_\_\.\\.p\<^sub>1"] Maps.comp_CLS [of "spn ?\" dom_\_\.\\.p\<^sub>0 "spn ?\ \ dom_\_\.\\.p\<^sub>0"] by simp qed moreover have "Maps.Dom (Span.chine_hcomp (SPN ?\) (SPN ?\)) = src dom_\_\.\\.p\<^sub>0" by (metis (no_types, lifting) "1" "2" Maps.Dom.simps(1) Maps.comp_char \Maps.Dom ?Chn_LHS = Maps.Dom ?Chn_RHS\) ultimately show ?thesis by simp qed also have "... = Maps.Comp \cod_\_\.cmp\ \\_\.chine\" proof - let ?tuple = "Maps.tuple \\spn (fst \\) \ dom_\_\.\\.p\<^sub>1\\ \\tab\<^sub>0 (cod ?\)\\ \\tab\<^sub>1 (cod ?\)\\ \\spn (snd \\) \ dom_\_\.\\.p\<^sub>0\\" have "iso_class \_\.chine = Maps.Map ?tuple" using \_\.CLS_chine spn_def Maps.Map.simps(1) by (metis (no_types, lifting)) thus ?thesis by simp qed also have "... = \cod_\_\.cmp \ \_\.chine\" proof - have "\\_\.chine\ \ Maps.Hom (src dom_\_\.\\.p\<^sub>0) (src cod_\_\.\\.p\<^sub>0)" proof - have "\\_\.chine : src dom_\_\.\\.p\<^sub>0 \ src cod_\_\.\\.p\<^sub>0\" using \\ VV.arr_char by simp thus ?thesis using \_\.is_map ide_in_iso_class left_adjoint_is_ide by blast qed moreover have "\cod_\_\.cmp\ \ Maps.Hom (src cod_\_\.\\.p\<^sub>0) (src (tab\<^sub>0 (cod ?\ \ cod ?\)))" proof - have "\cod_\_\.cmp : src cod_\_\.\\.p\<^sub>0 \ src (tab\<^sub>0 (cod ?\ \ cod ?\))\" using \\ VV.arr_char cod_\_\.cmp_in_hom cod_\\.tab_simps(2) by simp thus ?thesis using cod_\_\.cmp_props equivalence_is_left_adjoint left_adjoint_is_ide ide_in_iso_class [of cod_\_\.cmp] by (metis (mono_tags, lifting) mem_Collect_eq) qed moreover have "cod_\_\.cmp \ \_\.chine \ Maps.Comp \cod_\_\.cmp\ \\_\.chine\" proof show "is_iso_class \\_\.chine\" using \_\.w_simps(1) is_iso_classI by blast show "is_iso_class \cod_\_\.cmp\" using cod_\_\.cmp_simps(2) is_iso_classI by blast show "\_\.chine \ \\_\.chine\" using ide_in_iso_class by simp show "cod_\_\.cmp \ \cod_\_\.cmp\" using ide_in_iso_class by simp show "cod_\_\.cmp \ \_\.chine \ cod_\_\.cmp \ \_\.chine" by (simp add: isomorphic_reflexive) qed ultimately show ?thesis using \\ cod_\_\.cmp_props \_\.chine_in_hom \_\.chine_is_induced_map Maps.Comp_eq_iso_class_memb by simp qed finally show ?thesis by simp qed have EQ: "\\\.chine \ dom_\_\.cmp\ = \cod_\_\.cmp \ \_\.chine\" proof (intro iso_class_eqI) show "\\.chine \ dom_\_\.cmp \ cod_\_\.cmp \ \_\.chine" proof - interpret dom_cmp: identity_arrow_of_tabulations_in_maps V H \ \ src trg \dom ?\\\ dom_\_\.\\.tab \tab\<^sub>0 (dom ?\) \ dom_\_\.\\.p\<^sub>0\ \tab\<^sub>1 (dom ?\) \ dom_\_\.\\.p\<^sub>1\ \dom ?\\\ \tab_of_ide (dom ?\ \ dom ?\)\ \tab\<^sub>0 (dom ?\ \ dom ?\)\ \tab\<^sub>1 (dom ?\ \ dom ?\)\ \dom ?\\\ using \\ VV.arr_char dom_\_\.cmp_interpretation by simp interpret cod_cmp: identity_arrow_of_tabulations_in_maps V H \ \ src trg \cod ?\\\ cod_\_\.\\.tab \tab\<^sub>0 (cod ?\) \ cod_\_\.\\.p\<^sub>0\ \tab\<^sub>1 (cod ?\) \ cod_\_\.\\.p\<^sub>1\ \cod ?\\\ \tab_of_ide (cod ?\ \ cod ?\)\ \tab\<^sub>0 (cod ?\ \ cod ?\)\ \tab\<^sub>1 (cod ?\ \ cod ?\)\ \cod ?\\\ using \\ VV.arr_char cod_\_\.cmp_interpretation by simp interpret L: vertical_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \dom ?\\\ \dom_\_\.\\.tab\ \tab\<^sub>0 (dom ?\) \ dom_\_\.\\.p\<^sub>0\ \tab\<^sub>1 (dom ?\) \ dom_\_\.\\.p\<^sub>1\ \dom ?\\\ \tab_of_ide (dom ?\\)\ \tab\<^sub>0 (dom ?\\)\ \tab\<^sub>1 (dom ?\\)\ \cod ?\\\ cod_\\.tab \tab\<^sub>0 (cod ?\\)\ \tab\<^sub>1 (cod ?\\)\ \dom ?\\\ \?\ \ ?\\ using \\ VV.arr_char dom_\_\.cmp_in_hom by unfold_locales auto interpret R: vertical_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \dom ?\\\ \dom_\_\.\\.tab\ \tab\<^sub>0 (dom ?\) \ dom_\_\.\\.p\<^sub>0\ \tab\<^sub>1 (dom ?\) \ dom_\_\.\\.p\<^sub>1\ \cod ?\\\ \cod_\_\.\\.tab\ \tab\<^sub>0 (cod ?\) \ cod_\_\.\\.p\<^sub>0\ \tab\<^sub>1 (cod ?\) \ cod_\_\.\\.p\<^sub>1\ \cod ?\\\ cod_\\.tab \tab\<^sub>0 (cod ?\\)\ \tab\<^sub>1 (cod ?\\)\ \?\ \ ?\\ \cod ?\\\ using \\ VV.arr_char cod_\_\.cmp_in_hom by unfold_locales auto have "\\.chine \ dom_\_\.cmp \ L.chine" using \\ VV.arr_char L.chine_char dom_\_\.cmp_def isomorphic_symmetric by simp also have "... = R.chine" using L.is_ide \\ comp_arr_dom comp_cod_arr isomorphic_reflexive by force also have "... \ cod_\_\.cmp \ \_\.chine" using \\ VV.arr_char R.chine_char cod_\_\.cmp_def by simp finally show ?thesis by simp qed qed show ?thesis using LHS RHS EQ by simp qed qed thus ?thesis using Chn_LHS_eq Chn_RHS_eq by simp qed qed qed qed interpretation \: natural_isomorphism VV.comp Span.vcomp HoSPN_SPN.map SPNoH.map \.map using VV.ide_char VV.arr_char \.map_simp_ide compositor_is_iso by (unfold_locales, simp) lemma compositor_is_natural_transformation: shows "transformation_by_components VV.comp Span.vcomp HoSPN_SPN.map SPNoH.map (\rs. CMP (fst rs) (snd rs))" .. lemma compositor_is_natural_isomorphism: shows "natural_isomorphism VV.comp Span.vcomp HoSPN_SPN.map SPNoH.map \.map" .. end subsubsection "Associativity Coherence" locale three_composable_identities_in_bicategory_of_spans = bicategory_of_spans V H \ \ src trg + f: identity_in_bicategory_of_spans V H \ \ src trg f + g: identity_in_bicategory_of_spans V H \ \ src trg g + h: identity_in_bicategory_of_spans V H \ \ src trg h for V :: "'a comp" (infixr "\" 55) and H :: "'a \ 'a \ 'a" (infixr "\" 53) and \ :: "'a \ 'a \ 'a \ 'a" ("\[_, _, _]") and \ :: "'a \ 'a" ("\[_]") and src :: "'a \ 'a" and trg :: "'a \ 'a" and f :: 'a and g :: 'a and h :: 'a + assumes fg: "src f = trg g" and gh: "src g = trg h" begin interpretation f: arrow_of_tabulations_in_maps V H \ \ src trg f f.tab \tab\<^sub>0 f\ \tab\<^sub>1 f\ f f.tab \tab\<^sub>0 f\ \tab\<^sub>1 f\ f using f.is_arrow_of_tabulations_in_maps by simp interpretation h: arrow_of_tabulations_in_maps V H \ \ src trg h h.tab \tab\<^sub>0 h\ \tab\<^sub>1 h\ h h.tab \tab\<^sub>0 h\ \tab\<^sub>1 h\ h using h.is_arrow_of_tabulations_in_maps by simp interpretation E: self_evaluation_map V H \ \ src trg .. notation E.eval ("\_\") interpretation Maps: maps_category V H \ \ src trg .. interpretation Span: span_bicategory Maps.comp Maps.PRJ\<^sub>0 Maps.PRJ\<^sub>1 .. no_notation Fun.comp (infixl "\" 55) notation Span.vcomp (infixr "\" 55) notation Span.hcomp (infixr "\" 53) notation Maps.comp (infixr "\" 55) notation isomorphic (infix "\" 50) interpretation SPN: "functor" V Span.vcomp SPN using SPN_is_functor by simp interpretation SPN: weak_arrow_of_homs V src trg Span.vcomp Span.src Span.trg SPN using SPN_is_weak_arrow_of_homs by simp interpretation SPN_SPN: "functor" VV.comp Span.VV.comp SPN.FF using SPN.functor_FF by auto interpretation HoSPN_SPN: composite_functor VV.comp Span.VV.comp Span.vcomp SPN.FF \\\\. fst \\ \ snd \\\ .. interpretation SPNoH: composite_functor VV.comp V Span.vcomp \\\\. fst \\ \ snd \\\ SPN .. text \ Here come a lot of interpretations for ``composite things''. We need these in order to have relatively short, systematic names for entities that will appear in the lemmas to follow. The names of the interpretations use a prefix notation, where \H\ refers to horizontal composition of 1-cells and \T\ refers to composite of tabulations. So, for example, \THfgh\ refers to the composite of the tabulation associated with the horizontal composition \f \ g\ with the tabulation associated with \h\. \ interpretation HHfgh: identity_in_bicategory_of_spans V H \ \ src trg \(f \ g) \ h\ using fg gh by unfold_locales auto interpretation HfHgh: identity_in_bicategory_of_spans V H \ \ src trg \f \ g \ h\ using fg gh by unfold_locales auto interpretation Tfg: two_composable_identities_in_bicategory_of_spans V H \ \ src trg f g using fg gh by unfold_locales auto interpretation Tgh: two_composable_identities_in_bicategory_of_spans V H \ \ src trg g h using fg gh by unfold_locales auto interpretation THfgh: two_composable_identities_in_bicategory_of_spans V H \ \ src trg \f \ g\ h using fg gh by unfold_locales auto interpretation THfgh: tabulation V H \ \ src trg \(f \ g) \ h\ THfgh.\\.tab \tab\<^sub>0 h \ THfgh.\\.p\<^sub>0\ \tab\<^sub>1 (f \ g) \ THfgh.\\.p\<^sub>1\ using THfgh.\\.composite_is_tabulation by simp interpretation TfHgh: two_composable_identities_in_bicategory_of_spans V H \ \ src trg f \g \ h\ using fg gh by unfold_locales auto interpretation TfHgh: tabulation V H \ \ src trg \f \ g \ h\ TfHgh.\\.tab \tab\<^sub>0 (g \ h) \ TfHgh.\\.p\<^sub>0\ \tab\<^sub>1 f \ TfHgh.\\.p\<^sub>1\ using TfHgh.\\.composite_is_tabulation by simp interpretation Tfg_Hfg: arrow_of_tabulations_in_maps V H \ \ src trg \f \ g\ Tfg.\\.tab \tab\<^sub>0 g \ Tfg.\\.p\<^sub>0\ \tab\<^sub>1 f \ Tfg.\\.p\<^sub>1\ \f \ g\ \tab_of_ide (f \ g)\ \tab\<^sub>0 (f \ g)\ \tab\<^sub>1 (f \ g)\ \f \ g\ by unfold_locales auto interpretation Tgh_Hgh: arrow_of_tabulations_in_maps V H \ \ src trg \g \ h\ Tgh.\\.tab \tab\<^sub>0 h \ Tgh.\\.p\<^sub>0\ \tab\<^sub>1 g \ Tgh.\\.p\<^sub>1\ \g \ h\ \tab_of_ide (g \ h)\ \tab\<^sub>0 (g \ h)\ \tab\<^sub>1 (g \ h)\ \g \ h\ by unfold_locales auto interpretation THfgh_HHfgh: arrow_of_tabulations_in_maps V H \ \ src trg \(f \ g) \ h\ THfgh.\\.tab \tab\<^sub>0 h \ THfgh.\\.p\<^sub>0\ \tab\<^sub>1 (f \ g) \ THfgh.\\.p\<^sub>1\ \(f \ g) \ h\ \tab_of_ide ((f \ g) \ h)\ \tab\<^sub>0 ((f \ g) \ h)\ \tab\<^sub>1 ((f \ g) \ h)\ \(f \ g) \ h\ using fg gh by unfold_locales auto interpretation TfHgh_HfHgh: arrow_of_tabulations_in_maps V H \ \ src trg \f \ g \ h\ TfHgh.\\.tab \tab\<^sub>0 (g \ h) \ TfHgh.\\.p\<^sub>0\ \tab\<^sub>1 f \ TfHgh.\\.p\<^sub>1\ \f \ g \ h\ \tab_of_ide (f \ g \ h)\ \tab\<^sub>0 (f \ g \ h)\ \tab\<^sub>1 (f \ g \ h)\ \f \ g \ h\ using fg gh by unfold_locales auto interpretation TTfgh: composite_tabulation_in_maps V H \ \ src trg \f \ g\ Tfg.\\.tab \tab\<^sub>0 g \ Tfg.\\.p\<^sub>0\ \tab\<^sub>1 f \ Tfg.\\.p\<^sub>1\ h \tab_of_ide h\ \tab\<^sub>0 h\ \tab\<^sub>1 h\ using fg gh by unfold_locales auto interpretation TTfgh_THfgh: horizontal_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \f \ g\ Tfg.\\.tab \tab\<^sub>0 g \ Tfg.\\.p\<^sub>0\ \tab\<^sub>1 f \ Tfg.\\.p\<^sub>1\ h \tab_of_ide h\ \tab\<^sub>0 h\ \tab\<^sub>1 h\ \f \ g\ \tab_of_ide (f \ g)\ \tab\<^sub>0 (f \ g)\ \tab\<^sub>1 (f \ g)\ h \tab_of_ide h\ \tab\<^sub>0 h\ \tab\<^sub>1 h\ \f \ g\ h .. interpretation TfTgh: composite_tabulation_in_maps V H \ \ src trg f \tab_of_ide f\ \tab\<^sub>0 f\ \tab\<^sub>1 f\ \g \ h\ Tgh.\\.tab \tab\<^sub>0 h \ Tgh.\\.p\<^sub>0\ \tab\<^sub>1 g \ Tgh.\\.p\<^sub>1\ using fg gh by unfold_locales auto interpretation TfTgh_TfHgh: horizontal_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg f \tab_of_ide f\ \tab\<^sub>0 f\ \tab\<^sub>1 f\ \g \ h\ Tgh.\\.tab \tab\<^sub>0 h \ Tgh.\\.p\<^sub>0\ \tab\<^sub>1 g \ Tgh.\\.p\<^sub>1\ f \tab_of_ide f\ \tab\<^sub>0 f\ \tab\<^sub>1 f\ \g \ h\ \tab_of_ide (g \ h)\ \tab\<^sub>0 (g \ h)\ \tab\<^sub>1 (g \ h)\ f \g \ h\ .. interpretation TfTgh_TfTgh: horizontal_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg f \tab_of_ide f\ \tab\<^sub>0 f\ \tab\<^sub>1 f\ \g \ h\ Tgh.\\.tab \tab\<^sub>0 h \ Tgh.\\.p\<^sub>0\ \tab\<^sub>1 g \ Tgh.\\.p\<^sub>1\ f \tab_of_ide f\ \tab\<^sub>0 f\ \tab\<^sub>1 f\ \g \ h\ Tgh.\\.tab \tab\<^sub>0 h \ Tgh.\\.p\<^sub>0\ \tab\<^sub>1 g \ Tgh.\\.p\<^sub>1\ f \g \ h\ .. text \ The following interpretation defines the associativity between the peaks of the two composite tabulations \TTfgh\ (associated to the left) and \TfTgh\ (associated to the right). \ (* TODO: Try to get rid of the .\\ in, e.g., Tfg.\\.p\<^sub>1. *) interpretation TTfgh_TfTgh: arrow_of_tabulations_in_maps V H \ \ src trg \(f \ g) \ h\ TTfgh.tab \tab\<^sub>0 h \ TTfgh.p\<^sub>0\ \(tab\<^sub>1 f \ Tfg.\\.p\<^sub>1) \ TTfgh.p\<^sub>1\ \f \ g \ h\ TfTgh.tab \(tab\<^sub>0 h \ Tgh.\\.p\<^sub>0) \ TfTgh.p\<^sub>0\ \tab\<^sub>1 f \ TfTgh.p\<^sub>1\ \\[f, g, h]\ using fg gh by unfold_locales auto text \ This interpretation defines the map, from the apex of the tabulation associated with the horizontal composite \(f \ g) \ h\ to the apex of the tabulation associated with the horizontal composite \f \ g \ h\, induced by the associativity isomorphism \\[f, g, h]\ from \(f \ g) \ h\ to \f \ g \ h\. \ interpretation HHfgh_HfHgh: arrow_of_tabulations_in_maps V H \ \ src trg \dom (\ (f, g, h))\ \tab_of_ide (dom (\ (f, g, h)))\ \tab\<^sub>0 (dom (\ (f, g, h)))\ \tab\<^sub>1 (dom (\ (f, g, h)))\ \cod (\ (f, g, h))\ \tab_of_ide (cod (\ (f, g, h)))\ \tab\<^sub>0 (cod (\ (f, g, h)))\ \tab\<^sub>1 (cod (\ (f, g, h)))\ \\ (f, g, h)\ proof - have "arrow_of_tabulations_in_maps V H \ \ src trg ((f \ g) \ h) (tab_of_ide ((f \ g) \ h)) (tab\<^sub>0 ((f \ g) \ h)) (tab\<^sub>1 ((f \ g) \ h)) (f \ g \ h) (tab_of_ide (f \ g \ h)) (tab\<^sub>0 (f \ g \ h)) (tab\<^sub>1 (f \ g \ h)) \[f, g, h]" using fg gh by unfold_locales auto thus "arrow_of_tabulations_in_maps V H \ \ src trg (dom (\ (f, g, h))) (tab_of_ide (dom (\ (f, g, h)))) (tab\<^sub>0 (dom (\ (f, g, h)))) (tab\<^sub>1 (dom (\ (f, g, h)))) (cod (\ (f, g, h))) (tab_of_ide (cod (\ (f, g, h)))) (tab\<^sub>0 (cod (\ (f, g, h)))) (tab\<^sub>1 (cod (\ (f, g, h)))) (\ (f, g, h))" using fg gh \_def by auto qed interpretation SPN_f: arrow_of_spans Maps.comp \SPN f\ using SPN_in_hom Span.arr_char [of "SPN f"] by simp interpretation SPN_g: arrow_of_spans Maps.comp \SPN g\ using SPN_in_hom Span.arr_char [of "SPN g"] by simp interpretation SPN_h: arrow_of_spans Maps.comp \SPN h\ using SPN_in_hom Span.arr_char [of "SPN h"] by simp interpretation SPN_fgh: three_composable_identity_arrows_of_spans Maps.comp Maps.PRJ\<^sub>0 Maps.PRJ\<^sub>1 \SPN f\ \SPN g\ \SPN h\ using fg gh Span.arr_char SPN_in_hom SPN.preserves_ide Span.ide_char apply unfold_locales by auto text \ The following relates the projections associated with the composite span \SPN_fgh\ with tabulations in the underlying bicategory. \ lemma prj_char: shows "SPN_fgh.Prj\<^sub>1\<^sub>1 = \\Tfg.\\.p\<^sub>1 \ TTfgh.p\<^sub>1\\" and "SPN_fgh.Prj\<^sub>0\<^sub>1 = \\Tfg.\\.p\<^sub>0 \ TTfgh.p\<^sub>1\\" and "SPN_fgh.Prj\<^sub>0 = \\TTfgh.p\<^sub>0\\" and "SPN_fgh.Prj\<^sub>1 = \\TfTgh.p\<^sub>1\\" and "SPN_fgh.Prj\<^sub>1\<^sub>0 = \\Tgh.\\.p\<^sub>1 \ TfTgh.p\<^sub>0\\" and "SPN_fgh.Prj\<^sub>0\<^sub>0 = \\Tgh.\\.p\<^sub>0 \ TfTgh.p\<^sub>0\\" proof - show "SPN_fgh.Prj\<^sub>1\<^sub>1 = \\Tfg.\\.p\<^sub>1 \ TTfgh.p\<^sub>1\\" proof - have "ide (Tfg.\\.p\<^sub>1 \ TTfgh.p\<^sub>1)" by (metis TTfgh.composable TTfgh.leg1_simps(2) Tfg.\\.T0.antipar(2) Tfg.\\.T0.ide_right Tfg_Hfg.u_simps(3) f.T0.antipar(2) f.T0.ide_right f.u_simps(3) fg g.ide_leg1 g.leg1_simps(4) h.ide_leg1 h.leg1_simps(4) ide_hcomp hseqE hcomp_simps(1) tab\<^sub>1_simps(1)) thus ?thesis using fg gh Tfg.\\.prj_char TTfgh.prj_char isomorphic_reflexive Maps.comp_CLS [of "tab\<^sub>0 g" Tfg.\\.p\<^sub>0 "tab\<^sub>0 g \ Tfg.\\.p\<^sub>0"] Maps.comp_CLS [of Tfg.\\.p\<^sub>1 TTfgh.p\<^sub>1 "Tfg.\\.p\<^sub>1 \ TTfgh.p\<^sub>1"] by (simp add: TTfgh.composable Tfg.\\.T0.antipar(2)) qed show "SPN_fgh.Prj\<^sub>0\<^sub>1 = \\Tfg.\\.p\<^sub>0 \ TTfgh.p\<^sub>1\\" proof - have "ide (Tfg.\\.p\<^sub>0 \ TTfgh.p\<^sub>1)" by (metis TTfgh.leg1_simps(2) bicategory_of_spans.tab\<^sub>0_simps(1) bicategory_of_spans.tab\<^sub>1_simps(1) bicategory_of_spans_axioms Tfg.\\.T0.antipar(2) Tfg.\\.T0.ide_right Tfg.composable f.T0.antipar(2) f.T0.ide_right f.u_simps(3) g.ide_leg1 g.leg1_simps(4) Tfg.u_simps(3) THfgh.composable h.ide_leg1 h.leg1_simps(4) ide_hcomp hseqE hcomp_simps(1) tab\<^sub>1_simps(3)) thus ?thesis using fg gh Tfg.\\.prj_char TTfgh.prj_char isomorphic_reflexive Maps.comp_CLS [of "tab\<^sub>0 g" Tfg.\\.p\<^sub>0 "tab\<^sub>0 g \ Tfg.\\.p\<^sub>0"] Maps.comp_CLS [of Tfg.\\.p\<^sub>0 TTfgh.p\<^sub>1 "Tfg.\\.p\<^sub>0 \ TTfgh.p\<^sub>1"] by (simp add: Tfg.\\.T0.antipar(2) THfgh.composable) qed show "SPN_fgh.Prj\<^sub>0 = \\TTfgh.p\<^sub>0\\" using isomorphic_reflexive TTfgh.prj_char Tfg.\\.prj_char Maps.comp_CLS [of "tab\<^sub>0 g" Tfg.\\.p\<^sub>0 "tab\<^sub>0 g \ Tfg.\\.p\<^sub>0"] by (simp add: Tfg.composable) show "SPN_fgh.Prj\<^sub>1 = \\TfTgh.p\<^sub>1\\" using Tgh.\\.prj_char isomorphic_reflexive Tgh.composable Maps.comp_CLS [of "tab\<^sub>1 g" Tgh.\\.p\<^sub>1 "tab\<^sub>1 g \ Tgh.\\.p\<^sub>1"] TfTgh.prj_char by simp show "SPN_fgh.Prj\<^sub>1\<^sub>0 = \\Tgh.\\.p\<^sub>1 \ TfTgh.p\<^sub>0\\" using fg gh Tgh.\\.prj_char TfTgh.prj_char isomorphic_reflexive Maps.comp_CLS [of "tab\<^sub>1 g" "prj\<^sub>1 (tab\<^sub>1 h) (tab\<^sub>0 g)" "tab\<^sub>1 g \ Tgh.\\.p\<^sub>1"] Maps.comp_CLS [of Tgh.\\.p\<^sub>1 TfTgh.p\<^sub>0 "Tgh.\\.p\<^sub>1 \ TfTgh.p\<^sub>0"] by simp show "SPN_fgh.Prj\<^sub>0\<^sub>0 = \\Tgh.\\.p\<^sub>0 \ TfTgh.p\<^sub>0\\" using fg gh Tgh.\\.prj_char TfTgh.prj_char isomorphic_reflexive Maps.comp_CLS [of "tab\<^sub>1 g" "Tgh.\\.p\<^sub>1" "tab\<^sub>1 g \ Tgh.\\.p\<^sub>1"] Maps.comp_CLS [of Tgh.\\.p\<^sub>0 TfTgh.p\<^sub>0 "Tgh.\\.p\<^sub>0 \ TfTgh.p\<^sub>0"] by simp qed interpretation \: transformation_by_components VV.comp Span.vcomp HoSPN_SPN.map SPNoH.map \\rs. CMP (fst rs) (snd rs)\ using compositor_is_natural_transformation by simp interpretation \: natural_isomorphism VV.comp Span.vcomp HoSPN_SPN.map SPNoH.map \.map using compositor_is_natural_isomorphism by simp (* * TODO: Figure out how this subcategory gets introduced. * The simps in the locale are used in the subsequent proofs. *) interpretation VVV': subcategory VxVxV.comp \\\\\. arr (fst \\\) \ arr (fst (snd \\\)) \ arr (snd (snd \\\)) \ src (fst (snd \\\)) = trg (snd (snd \\\)) \ src (fst \\\) = trg (fst (snd \\\))\ using fg gh VVV.arr_char VV.arr_char VVV.subcategory_axioms by simp text \ We define abbreviations for the left and right-hand sides of the equation for associativity coherence. \ (* * TODO: \ doesn't really belong in this locale. Replace it with CMP and rearrange * material so that this locale comes first and the definition of \ comes later * in bicategory_of_spans. *) abbreviation LHS where "LHS \ SPN \[f, g, h] \ \.map (f \ g, h) \ (\.map (f, g) \ SPN h)" abbreviation RHS where "RHS \ \.map (f, g \ h) \ (SPN f \ \.map (g, h)) \ Span.assoc (SPN f) (SPN g) (SPN h)" lemma arr_LHS: shows "Span.arr LHS" using fg gh VVV.arr_char VVV.ide_char VV.arr_char VV.ide_char Span.hseqI' HoHV_def compositor_in_hom \_def apply (intro Span.seqI) apply simp_all using SPN.FF_def apply simp proof - have "SPN ((f \ g) \ h) = Span.cod (CMP (f \ g) h)" using fg gh compositor_in_hom by simp also have "... = Span.cod (CMP (f \ g) h \ (CMP f g \ SPN h))" proof - have "Span.seq (CMP (f \ g) h) (CMP f g \ SPN h)" proof (intro Span.seqI Span.hseqI) show 1: "Span.in_hhom (SPN h) (SPN.map\<^sub>0 (src h)) (SPN.map\<^sub>0 (trg h))" using SPN.preserves_src SPN.preserves_trg by simp show 2: "Span.in_hhom (CMP f g) (SPN.map\<^sub>0 (trg h)) (SPN.map\<^sub>0 (trg f))" using compositor_in_hom SPN_fgh.\\.composable fg by auto show 3: "Span.arr (CMP (f \ g) h)" using TTfgh.composable Tfg.\\.ide_base compositor_simps(1) h.is_ide by auto show "Span.dom (CMP (f \ g) h) = Span.cod (CMP f g \ SPN h)" using 1 2 3 fg gh compositor_in_hom SPN_fgh.\\.composable SPN_in_hom SPN.FF_def by auto qed thus ?thesis by simp qed finally show "SPN ((f \ g) \ h) = Span.cod (CMP (f \ g) h \ (CMP f g \ SPN h))" by blast qed lemma arr_RHS: shows "Span.arr RHS" using fg gh VV.ide_char VV.arr_char \.map_simp_ide SPN.FF_def Span.hseqI' by (intro Span.seqI, simp_all) lemma par_LHS_RHS: shows "Span.par LHS RHS" proof (intro conjI) show "Span.arr LHS" using arr_LHS by simp show "Span.arr RHS" using arr_RHS by simp show "Span.dom LHS = Span.dom RHS" proof - have "Span.dom LHS = Span.dom (\.map (f, g) \ SPN h)" using arr_LHS by auto also have "... = Span.dom (\.map (f, g)) \ Span.dom (SPN h)" using arr_LHS Span.dom_hcomp [of "SPN h" "\.map (f, g)"] by blast also have "... = (SPN f \ SPN g) \ SPN h" using fg \.map_simp_ide VV.ide_char VV.arr_char SPN.FF_def by simp also have "... = Span.dom (Span.assoc (SPN f) (SPN g) (SPN h))" using fg gh VVV.arr_char VVV.ide_char VV.arr_char VV.ide_char by simp also have "... = Span.dom RHS" using \Span.arr RHS\ by auto finally show ?thesis by blast qed show "Span.cod LHS = Span.cod RHS" proof - have "Span.cod LHS = Span.cod (SPN \[f, g, h])" using arr_LHS by simp also have "... = SPN (f \ g \ h)" unfolding \_def using fg gh VVV.ide_char VVV.arr_char VV.ide_char VV.arr_char HoVH_def by simp also have "... = Span.cod RHS" using arr_RHS fg gh \.map_simp_ide VV.ide_char VV.arr_char SPN.FF_def compositor_in_hom by simp finally show ?thesis by blast qed qed lemma Chn_LHS_eq: shows "Chn LHS = \\HHfgh_HfHgh.chine\\ \ \\THfgh_HHfgh.chine\\ \ \\TTfgh_THfgh.chine\\" proof - have "Chn LHS = \\HHfgh_HfHgh.chine\\ \ \\THfgh_HHfgh.chine\\ \ Span.chine_hcomp (CMP f g) (SPN h)" proof - have "Chn LHS = Chn (SPN \[f, g, h]) \ Chn (CMP (f \ g) h) \ Chn (CMP f g \ SPN h)" using fg gh arr_LHS \.map_simp_ide VV.ide_char VV.arr_char Span.Chn_vcomp by auto moreover have "Chn (SPN \[f, g, h]) = Maps.CLS HHfgh_HfHgh.chine" using fg gh SPN_def VVV.arr_char VV.arr_char spn_def \_def by simp moreover have "Chn (CMP (f \ g) h) = Maps.CLS THfgh_HHfgh.chine" using fg gh CMP_def THfgh.cmp_def by simp moreover have "Chn (CMP f g \ SPN h) = Span.chine_hcomp (CMP f g) (SPN h)" using fg gh Span.hcomp_def by simp ultimately show ?thesis by simp qed moreover have "Span.chine_hcomp (CMP f g) (SPN h) = \\TTfgh_THfgh.chine\\" proof - have "Span.chine_hcomp (CMP f g) (SPN h) = Maps.tuple (\\Tfg.cmp\\ \ Maps.PRJ\<^sub>1 \\tab\<^sub>0 g \ Tfg.\\.p\<^sub>0\\ \\tab\<^sub>1 h\\) \\tab\<^sub>0 (f \ g)\\ \\tab\<^sub>1 h\\ (\\spn h\\ \ Maps.PRJ\<^sub>0 \\tab\<^sub>0 g \ Tfg.\\.p\<^sub>0\\ \\tab\<^sub>1 h\\)" proof - have "\\tab\<^sub>0 g\\ \ \\Tfg.\\.p\<^sub>0\\ = \\tab\<^sub>0 g \ Tfg.\\.p\<^sub>0\\" using fg isomorphic_reflexive Maps.comp_CLS [of "tab\<^sub>0 g" "Tfg.\\.p\<^sub>0" "tab\<^sub>0 g \ Tfg.\\.p\<^sub>0"] by simp moreover have "span_in_category.apex Maps.comp \Leg0 = \\tab\<^sub>0 h\\, Leg1 = \\tab\<^sub>1 h\\\ = \\spn h\\" proof - interpret h: span_in_category Maps.comp \\Leg0 = \\tab\<^sub>0 h\\, Leg1 = \\tab\<^sub>1 h\\\\ using h.determines_span by simp interpret dom_h: identity_arrow_of_tabulations_in_maps V H \ \ src trg \dom h\ \tab_of_ide (dom h)\ \tab\<^sub>0 (dom h)\ \tab\<^sub>1 (dom h)\ \cod h\ \tab_of_ide (cod h)\ \tab\<^sub>0 (cod h)\ \tab\<^sub>1 (cod h)\ h by (simp add: h.is_arrow_of_tabulations_in_maps identity_arrow_of_tabulations_in_maps.intro identity_arrow_of_tabulations_in_maps_axioms.intro) have "Maps.arr h.leg0" using h.leg_simps(1) by simp hence "Maps.dom h.leg0 = \\dom_h.chine\\" using Maps.dom_char Maps.CLS_in_hom apply simp proof - have "h.is_induced_map (src (tab\<^sub>0 h))" using h.is_induced_map_iff dom_h.\_eq_\ h.apex_is_induced_by_cell by force hence "src (tab\<^sub>0 h) \ h.chine" using h.chine_is_induced_map h.induced_map_unique by simp thus "\src (tab\<^sub>0 h)\ = \h.chine\" using iso_class_eqI by simp qed thus ?thesis using h.apex_def spn_def by simp qed ultimately show ?thesis unfolding Span.chine_hcomp_def using fg gh CMP_def Tfg.\\.prj_char Span.hcomp_def by simp qed also have "... = \\TTfgh_THfgh.chine\\" proof - have "\\TTfgh_THfgh.chine\\ = Maps.tuple \\Tfg_Hfg.chine \ TTfgh.p\<^sub>1\\ \\tab\<^sub>0 (f \ g)\\ \\tab\<^sub>1 h\\ \\h.chine \ TTfgh.p\<^sub>0\\" using TTfgh_THfgh.CLS_chine by simp also have "... = Maps.tuple (\\Tfg_Hfg.chine\\ \ \\TTfgh.p\<^sub>1\\) \\tab\<^sub>0 (f \ g)\\ \\tab\<^sub>1 h\\ (\\h.chine\\ \ \\TTfgh.p\<^sub>0\\)" proof - have "\\Tfg_Hfg.chine \ TTfgh.p\<^sub>1\\ = \\Tfg_Hfg.chine\\ \ \\TTfgh.p\<^sub>1\\" proof - have "is_left_adjoint TTfgh.p\<^sub>1" using Tfg.\\.T0.antipar(2) THfgh.composable by simp moreover have "Tfg_Hfg.chine \ TTfgh.p\<^sub>1 \ Tfg_Hfg.chine \ TTfgh.p\<^sub>1" using TTfgh_THfgh.prj_chine(2) isomorphic_reflexive isomorphic_implies_hpar(2) by blast ultimately show ?thesis using Tfg_Hfg.is_map Maps.comp_CLS [of Tfg_Hfg.chine TTfgh.p\<^sub>1 "Tfg_Hfg.chine \ TTfgh.p\<^sub>1"] by simp qed moreover have "\\h.chine \ TTfgh.p\<^sub>0\\ = \\h.chine\\ \ \\TTfgh.p\<^sub>0\\" proof - have "is_left_adjoint TTfgh.p\<^sub>0" by (simp add: Tfg.\\.T0.antipar(2) THfgh.composable) moreover have "h.chine \ TTfgh.p\<^sub>0 \ h.chine \ TTfgh.p\<^sub>0" using TTfgh_THfgh.prj_chine(1) isomorphic_reflexive isomorphic_implies_hpar(2) by blast ultimately show ?thesis using h.is_map Maps.comp_CLS [of h.chine TTfgh.p\<^sub>0 "h.chine \ TTfgh.p\<^sub>0"] by simp qed ultimately show ?thesis by argo qed also have "... = Maps.tuple (\\Tfg.cmp\\ \ Maps.PRJ\<^sub>1 \\tab\<^sub>0 g \ Tfg.\\.p\<^sub>0\\ \\tab\<^sub>1 h\\) \\tab\<^sub>0 (f \ g)\\ \\tab\<^sub>1 h\\ (\\spn h\\ \ Maps.PRJ\<^sub>0 \\tab\<^sub>0 g \ Tfg.\\.p\<^sub>0\\ \\tab\<^sub>1 h\\)" using Tfg.cmp_def spn_def TTfgh.prj_char by simp finally show ?thesis by simp qed finally show ?thesis by blast qed ultimately show ?thesis by simp qed abbreviation tuple_BC where "tuple_BC \ Maps.tuple SPN_fgh.Prj\<^sub>0\<^sub>1 SPN_fgh.\.leg0 SPN_fgh.\.leg1 SPN_fgh.Prj\<^sub>0" abbreviation tuple_ABC where "tuple_ABC \ Maps.tuple SPN_fgh.Prj\<^sub>1\<^sub>1 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) tuple_BC" abbreviation tuple_BC' where "tuple_BC' \ Maps.tuple \\Tfg.\\.p\<^sub>0 \ TTfgh.p\<^sub>1\\ \\tab\<^sub>0 g\\ \\tab\<^sub>1 h\\ \\TTfgh.p\<^sub>0\\" abbreviation tuple_ABC' where "tuple_ABC' \ Maps.tuple \\Tfg.\\.p\<^sub>1 \ TTfgh.p\<^sub>1\\ \\tab\<^sub>0 f\\ \\tab\<^sub>1 g \ Tgh.\\.p\<^sub>1\\ tuple_BC'" lemma csq: shows "Maps.commutative_square SPN_fgh.\.leg0 SPN_fgh.\.leg1 SPN_fgh.Prj\<^sub>0\<^sub>1 SPN_fgh.Prj\<^sub>0" and "Maps.commutative_square SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) SPN_fgh.Prj\<^sub>1\<^sub>1 tuple_BC" proof - show 1: "Maps.commutative_square SPN_fgh.\.leg0 SPN_fgh.\.leg1 SPN_fgh.Prj\<^sub>0\<^sub>1 SPN_fgh.Prj\<^sub>0" proof show "Maps.cospan SPN_fgh.\.leg0 SPN_fgh.\.leg1" using SPN_fgh.\\.legs_form_cospan(1) by simp show "Maps.span SPN_fgh.Prj\<^sub>0\<^sub>1 SPN_fgh.Prj\<^sub>0" using SPN_fgh.prj_simps(2-3,5-6) by presburger show "Maps.dom SPN_fgh.\.leg0 = Maps.cod SPN_fgh.Prj\<^sub>0\<^sub>1" using SPN_fgh.prj_simps(8) SPN_g.dom.is_span SPN_g.dom.leg_simps(2) by auto show "SPN_fgh.\.leg0 \ SPN_fgh.Prj\<^sub>0\<^sub>1 = SPN_fgh.\.leg1 \ SPN_fgh.Prj\<^sub>0" by (metis (no_types, lifting) Maps.cod_comp Maps.comp_assoc Maps.pullback_commutes' SPN_fgh.\\.dom.leg_simps(1) SPN_fgh.\\.leg0_composite SPN_fgh.cospan_\\) qed show "Maps.commutative_square SPN_fgh.\.leg0 (Maps.comp SPN_fgh.\.leg1 SPN_fgh.\\.prj\<^sub>1) SPN_fgh.Prj\<^sub>1\<^sub>1 tuple_BC" proof show "Maps.cospan SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" using fg gh SPN_fgh.prj_simps(10) by blast show "Maps.span SPN_fgh.Prj\<^sub>1\<^sub>1 tuple_BC" using fg gh 1 Maps.tuple_simps(1) Maps.tuple_simps(2) SPN_fgh.prj_simps(1) SPN_fgh.prj_simps(4) SPN_fgh.prj_simps(5) by presburger show "Maps.dom SPN_fgh.\.leg0 = Maps.cod SPN_fgh.Prj\<^sub>1\<^sub>1" using fg gh SPN_f.dom.leg_simps(2) SPN_fgh.prj_simps(7) by auto show "SPN_fgh.\.leg0 \ SPN_fgh.Prj\<^sub>1\<^sub>1 = (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ tuple_BC" using 1 fg gh Maps.comp_assoc Maps.prj_tuple by (metis (no_types, lifting) Maps.pullback_commutes' SPN_fgh.cospan_\\) qed qed lemma tuple_ABC_eq_ABC': shows "tuple_BC = tuple_BC'" and "tuple_ABC = tuple_ABC'" proof - have "SPN_fgh.Prj\<^sub>1\<^sub>1 = \\Tfg.\\.p\<^sub>1 \ TTfgh.p\<^sub>1\\" using prj_char by simp moreover have "SPN_fgh.\.leg0 = \\tab\<^sub>0 f\\" by simp moreover have "SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1 = \\tab\<^sub>1 g \ Tgh.\\.p\<^sub>1\\" using Tgh.\\.prj_char isomorphic_reflexive Tgh.composable Maps.comp_CLS [of "tab\<^sub>1 g" Tgh.\\.p\<^sub>1 "tab\<^sub>1 g \ Tgh.\\.p\<^sub>1"] by (simp add: g.T0.antipar(2)) moreover show "tuple_BC = tuple_BC'" using prj_char Tfg.\\.prj_char by simp ultimately show "tuple_ABC = tuple_ABC'" by argo qed lemma tuple_BC_in_hom: shows "Maps.in_hom tuple_BC (Maps.MkIde (src TTfgh.p\<^sub>0)) (Maps.MkIde (src Tgh.\\.p\<^sub>0))" proof show 1: "Maps.arr tuple_BC" using csq(1) by simp have 2: "Maps.commutative_square \\tab\<^sub>0 g\\ \\tab\<^sub>1 h\\ \\Tfg.\\.p\<^sub>0 \ TTfgh.p\<^sub>1\\ \\TTfgh.p\<^sub>0\\" by (metis Tfg.S\<^sub>0_def Tfg.span_legs_eq(3) Tgh.S\<^sub>1_def Tgh.span_legs_eq(4) csq(1) prj_char(2) prj_char(3)) show "Maps.dom tuple_BC = Maps.MkIde (src TTfgh.p\<^sub>0)" proof - have "Maps.dom tuple_BC' = Maps.dom \\Tfg.\\.p\<^sub>0 \ TTfgh.p\<^sub>1\\" using 2 Maps.tuple_simps by simp also have "... = Chn (Span.hcomp (Span.hcomp (SPN f) (SPN g)) (SPN h))" using Maps.dom_char by (metis SPN_fgh.prj_simps(5) prj_char(2)) also have "... = Maps.MkIde (src TTfgh.p\<^sub>0)" using 1 fg gh Maps.dom_char csq(1) prj_char(3) tuple_ABC_eq_ABC'(1) Maps.Dom.simps(1) Maps.tuple_simps(2) SPN_fgh.prj_simps(3,5-6) by presburger finally have "Maps.dom tuple_BC' = Maps.MkIde (src TTfgh.p\<^sub>0)" by blast thus ?thesis using tuple_ABC_eq_ABC' by simp qed show "Maps.cod tuple_BC = Maps.MkIde (src Tgh.\\.p\<^sub>0)" proof - have "Maps.cod tuple_BC' = Maps.pbdom \\tab\<^sub>0 g\\ \\tab\<^sub>1 h\\" using 1 2 fg gh Maps.tuple_in_hom by blast also have "... = Maps.MkIde (src Tgh.\\.p\<^sub>0)" using 1 2 fg gh Maps.pbdom_def by (metis (no_types, lifting) SPN.preserves_ide SPN_fgh.\\.are_identities(2) SPN_fgh.\\.composable Span.chine_hcomp_ide_ide Tfg.S\<^sub>0_def Tfg.span_legs_eq(3) Tgh.S\<^sub>1_def Tgh.chine_hcomp_SPN_SPN Tgh.span_legs_eq(4) g.is_ide) finally show ?thesis using tuple_ABC_eq_ABC' by simp qed qed lemma tuple_ABC_in_hom: shows "Maps.in_hom tuple_ABC (Maps.MkIde (src TTfgh.p\<^sub>0)) (Maps.MkIde (src TfTgh.p\<^sub>0))" proof show 1: "Maps.arr tuple_ABC" using SPN_fgh.chine_assoc_def SPN_fgh.chine_assoc_in_hom by auto show "Maps.dom tuple_ABC = Maps.MkIde (src TTfgh.p\<^sub>0)" proof - have "Maps.dom tuple_ABC = Maps.dom SPN_fgh.chine_assoc" by (simp add: SPN_fgh.chine_assoc_def) also have "... = Chn ((SPN f \ SPN g) \ SPN h)" using SPN_fgh.chine_assoc_in_hom by blast also have "... = Maps.MkIde (src TTfgh.p\<^sub>0)" by (metis (lifting) Maps.Dom.simps(1) Maps.dom_char SPN_fgh.prj_simps(3) SPN_fgh.prj_simps(6) prj_char(3)) finally show ?thesis by blast qed show "Maps.cod tuple_ABC = Maps.MkIde (src TfTgh.p\<^sub>0)" proof - have "Maps.cod tuple_ABC = Maps.cod SPN_fgh.chine_assoc" by (simp add: SPN_fgh.chine_assoc_def) also have 1: "... = Chn (SPN f \ SPN g \ SPN h)" using SPN_fgh.chine_assoc_in_hom by blast also have "... = Maps.MkIde (src TfTgh.p\<^sub>0)" by (metis (lifting) Maps.Dom.simps(1) Maps.cod_char Maps.seq_char SPN_fgh.prj_chine_assoc(1) SPN_fgh.prj_simps(1) TfTgh.leg1_in_hom(1) TfTgh_TfTgh.u_in_hom 1 in_hhomE prj_char(4) src_hcomp) finally show ?thesis by argo qed qed lemma Chn_RHS_eq: shows "Chn RHS = \\TfHgh_HfHgh.chine\\ \ \\TfTgh_TfHgh.chine\\ \ tuple_ABC'" proof - have "Chn RHS = Chn (\.map (f, g \ h)) \ Chn (SPN f \ \.map (g, h)) \ Chn (Span.assoc (SPN f) (SPN g) (SPN h))" proof - have "Chn RHS = Chn (\.map (f, g \ h)) \ Chn ((SPN f \ \.map (g, h)) \ Span.assoc (SPN f) (SPN g) (SPN h))" using arr_RHS Span.vcomp_eq Span.Chn_vcomp by blast also have "... = Chn (\.map (f, g \ h)) \ Chn (SPN f \ \.map (g, h)) \ Chn (Span.assoc (SPN f) (SPN g) (SPN h))" proof - have "Span.seq (SPN f \ \.map (g, h)) (Span.assoc (SPN f) (SPN g) (SPN h))" using arr_RHS by auto thus ?thesis using fg gh Span.vcomp_eq [of "SPN f \ \.map (g, h)" "Span.assoc (SPN f) (SPN g) (SPN h)"] by simp qed finally show ?thesis by blast qed moreover have "Chn (\.map (f, g \ h)) = \\TfHgh_HfHgh.chine\\" using arr_RHS fg gh \.map_simp_ide VV.ide_char VV.arr_char CMP_def TfHgh.cmp_def by simp moreover have "Chn (SPN f \ \.map (g, h)) = Span.chine_hcomp (SPN f) (CMP g h)" using fg gh Span.hcomp_def \.map_simp_ide VV.ide_char VV.arr_char SPN.FF_def by simp moreover have "Chn (Span.assoc (SPN f) (SPN g) (SPN h)) = tuple_ABC" using fg gh Span.\_ide VVV.ide_char VVV.arr_char VV.ide_char VV.arr_char SPN_fgh.chine_assoc_def Span.\_def by simp moreover have "Span.chine_hcomp (SPN f) (CMP g h) = \\TfTgh_TfHgh.chine\\" proof - have "Span.chine_hcomp (SPN f) (CMP g h) = Maps.tuple (\\f.chine\\ \ \\TfTgh.p\<^sub>1\\) \\tab\<^sub>0 f\\ \\tab\<^sub>1 (g \ h)\\ (\\Tgh_Hgh.chine\\ \ \\TfTgh.p\<^sub>0\\)" proof - interpret f: span_in_category Maps.comp \\Leg0 = Maps.MkArr (src (tab\<^sub>0 f)) (trg g) \tab\<^sub>0 f\, Leg1 = Maps.MkArr (src (tab\<^sub>0 f)) (trg f) \tab\<^sub>1 f\\\ using f.determines_span by (simp add: Tfg.composable) interpret f: arrow_of_tabulations_in_maps V H \ \ src trg f f.tab \tab\<^sub>0 f\ \tab\<^sub>1 f\ f f.tab \tab\<^sub>0 f\ \tab\<^sub>1 f\ f using f.is_arrow_of_tabulations_in_maps by simp have "f.apex = Maps.CLS f.chine" proof (intro Maps.arr_eqI) show "Maps.arr f.apex" by simp show "Maps.arr \\f.chine\\" using Maps.CLS_in_hom f.is_map by blast show "Maps.Dom f.apex = Maps.Dom \\f.chine\\" using f.apex_def Tfg.RS_simps(2) Tfg.R\<^sub>0_def Tfg.composable by auto show "Maps.Cod f.apex = Maps.Cod \\f.chine\\" using f.apex_def Tfg.RS_simps(2) Tfg.R\<^sub>0_def Tfg.composable by auto show "Maps.Map f.apex = Maps.Map \\f.chine\\" proof - have "Maps.Map f.apex = \src (tab\<^sub>0 f)\" using f.apex_def Maps.dom_char Tfg.RS_simps(2) Tfg.R\<^sub>0_def Tfg.composable by auto also have "... = \f.chine\" proof (intro iso_class_eqI) have "f.is_induced_map (src (tab\<^sub>0 f))" using f.apex_is_induced_by_cell comp_cod_arr by auto thus "src (tab\<^sub>0 f) \ f.chine" using f.induced_map_unique f.chine_is_induced_map by simp qed also have "... = Maps.Map \\f.chine\\" by simp finally show ?thesis by simp qed qed thus ?thesis unfolding Span.chine_hcomp_def using fg gh CMP_def Tgh.\\.prj_char Span.hcomp_def isomorphic_reflexive Maps.comp_CLS [of "tab\<^sub>1 g" Tgh.\\.p\<^sub>1 "tab\<^sub>1 g \ Tgh.\\.p\<^sub>1"] Tgh.cmp_def TfTgh.prj_char by simp qed also have "... = Maps.tuple \\f.chine \ TfTgh.p\<^sub>1\\ \\tab\<^sub>0 f\\ \\tab\<^sub>1 (g \ h)\\ \\Tgh_Hgh.chine \ TfTgh.p\<^sub>0\\" using isomorphic_reflexive TfHgh.composable f.is_map TfHgh.composable Tgh_Hgh.is_map Maps.comp_CLS [of f.chine TfTgh.p\<^sub>1 "f.chine \ TfTgh.p\<^sub>1"] Maps.comp_CLS [of Tgh_Hgh.chine TfTgh.p\<^sub>0 "Tgh_Hgh.chine \ TfTgh.p\<^sub>0"] by auto also have "... = \\TfTgh_TfHgh.chine\\" using TfTgh_TfHgh.CLS_chine by simp finally show ?thesis by blast qed ultimately have "Chn RHS =\\TfHgh_HfHgh.chine\\ \ \\TfTgh_TfHgh.chine\\ \ tuple_ABC" by simp also have "... = \\TfHgh_HfHgh.chine\\ \ \\TfTgh_TfHgh.chine\\ \ tuple_ABC'" using tuple_ABC_eq_ABC' by simp finally show ?thesis by simp qed interpretation g\<^sub>0h\<^sub>1: cospan_of_maps_in_bicategory_of_spans V H \ \ src trg \tab\<^sub>1 h\ \tab\<^sub>0 g\ using gh by unfold_locales auto interpretation f\<^sub>0g\<^sub>1: cospan_of_maps_in_bicategory_of_spans V H \ \ src trg \tab\<^sub>1 g\ \tab\<^sub>0 f\ using fg by unfold_locales auto interpretation f\<^sub>0gh\<^sub>1: cospan_of_maps_in_bicategory_of_spans V H \ \ src trg \tab\<^sub>1 g \ Tgh.\\.p\<^sub>1\ \tab\<^sub>0 f\ using fg gh Tgh.\\.leg1_is_map by unfold_locales auto interpretation fg\<^sub>0h\<^sub>1: cospan_of_maps_in_bicategory_of_spans V H \ \ src trg \tab\<^sub>1 h\ \tab\<^sub>0 g \ Tfg.p\<^sub>0\ using TTfgh.r\<^sub>0s\<^sub>1_is_cospan by simp lemma src_tab_eq: shows "(\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ TfTgh.composite_cell TTfgh_TfTgh.chine TTfgh_TfTgh.the_\ \ TTfgh_TfTgh.the_\ = TTfgh.tab" proof - have "TfTgh.composite_cell TTfgh_TfTgh.chine TTfgh_TfTgh.the_\ \ TTfgh_TfTgh.the_\ = (\[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ TTfgh.tab" unfolding TTfgh.tab_def using TTfgh_TfTgh.chine_is_induced_map TTfgh.tab_def TTfgh_TfTgh.\_simps(4) by auto moreover have "iso (\[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0)" by (simp add: fg gh) moreover have "inv (\[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) = \\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0" using fg gh by simp ultimately show ?thesis using TTfgh_TfTgh.\_simps(1) invert_side_of_triangle(1) [of "TfTgh.composite_cell TTfgh_TfTgh.chine TTfgh_TfTgh.the_\ \ TTfgh_TfTgh.the_\" "\[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0" TTfgh.tab] by argo qed text \ We need to show that the associativity isomorphism (defined in terms of tupling) coincides with \TTfgh_TfTgh.chine\ (defined in terms of tabulations). In order to do this, we need to know how the latter commutes with projections. That is the purpose of the following lemma. Unfortunately, it requires some lengthy calculations, which I haven't seen any way to avoid. \ lemma prj_chine: shows "\\TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine\\ = \\Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1\\" and "\\Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\ = \\Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1\\" and "\\Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\ = \\TTfgh.p\<^sub>0\\" proof - have 1: "ide TfTgh.p\<^sub>1" by (simp add: TfTgh.composable) have 2: "ide TTfgh_TfTgh.chine" by simp have 3: "src TfTgh.p\<^sub>1 = trg TTfgh_TfTgh.chine" using TTfgh_TfTgh.chine_in_hom(1) by simp have 4: "src (tab\<^sub>1 f) = trg TfTgh.p\<^sub>1" using TfTgh.leg1_simps(2) by blast text \ The required isomorphisms will each be established via \T2\, using the equation \src_tab_eq\ (associativities omitted from diagram): $$ \begin{array}{l} \xymatrix{ && \xtwocell[dddd]{}\omit{^{\rm the\_}\nu} & \scriptstyle{{\rm TTfgh}.{\rm apex}} \ar[dd]^{{\rm chine}} \ar[dddlll]_{{\rm TfTgh}.p_1} \ar[dddrrr]^{{\rm TfTgh}.p_0} & \xtwocell[dddd]{}\omit{^{\rm the\_}\theta} \\ &&&&& \\ &&& \scriptstyle{{\rm TfTgh.apex}} \ar[ddll]_{{\rm TfTgh}.p_1} \ar[dr]^{{\rm TfTgh}.p_0} && \\ \scriptstyle{f.{\rm apex}} \ar[dd]_{f.{\rm tab}_1} && \dtwocell\omit{^<-7>{f_0gh_1.\phi}} && \scriptstyle{{\rm Tgh.apex}} \ar[dl]_{{\rm Tgh}.p_1} \ar[dr]^{{\rm Tgh}.p_0} \ddtwocell\omit{^{g_0h_1.\phi}} && \scriptstyle{h.{\rm apex}} \ar[dd]^{h.{\rm tab}_0} \\ & \scriptstyle{f.{\rm apex}} \ar[dl]_{f.{\rm tab}_1} \ar[dr]^{f.{\rm tab}_0} \dtwocell\omit{^f.{\rm tab}} && \scriptstyle{g.{\rm apex}} \ar[dl]_{g.{\rm tab}_1} \ar[dr]^{g.{\rm tab}_0} \dtwocell\omit{^g.{\rm tab}} && \scriptstyle{h.{\rm apex}} \ar[dl]_{h.{\rm tab}_1} \ar[dr]^{h.{\rm tab}_0} \dtwocell\omit{^h.{\rm tab}} \\ \scriptstyle{{\rm trg}~f} && \scriptstyle{{\rm src}~f = {\rm trg}~g} \ar[ll]^{f} && \scriptstyle{{\rm src}~g = {\rm trg}~h} \ar[ll]^{g} && \scriptstyle{{\rm src}~h} \ar[ll]^{h} } \\ \\ \hspace{7cm}= \\ \\ \xymatrix{ &&& \scriptstyle{{\rm TTfgh.apex}} \ar[dl]_{{\rm TTfgh}.p_1} \ar[ddrr]^{{\rm TTfgh}.p_0} && \\ && \scriptstyle{{\rm Tfg.apex}} \ar[dl]_{{\rm Tfg}.p_1} \ar[dr]^{{\rm Tfg}.p_0} \ddtwocell\omit{^{f_0g_1.\phi}} & \dtwocell\omit{^<-7>{fg_0h_1.\phi}} &&& \\ & \scriptstyle{f.{\rm apex}} \ar[dl]_{f.{\rm tab}_1} \ar[dr]^{f.{\rm tab}_0} \dtwocell\omit{^f.{\rm tab}} && \scriptstyle{g.{\rm apex}} \ar[dl]_{g.{\rm tab}_1} \ar[dr]^{g.{\rm tab}_0} \dtwocell\omit{^g.{\rm tab}} && \scriptstyle{h.{\rm apex}} \ar[dl]_{h.{\rm tab}_1} \ar[dr]^{h.{\rm tab}_0} \dtwocell\omit{^h.{\rm tab}} \\ \scriptstyle{{\rm trg}~f} && \scriptstyle{{\rm src}~f = {\rm trg}~g} \ar[ll]^{f} && \scriptstyle{{\rm src}~g = {\rm trg}~h} \ar[ll]^{g} && \scriptstyle{{\rm src}~h} \ar[ll]^{h} } \end{array} $$ There is a sequential dependence between the proofs, such as we have already seen for \horizontal_composite_of_arrows_of_tabulations_in_maps.prj_chine\. \ define u\<^sub>f where "u\<^sub>f = g \ h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0" define w\<^sub>f where "w\<^sub>f = Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1" define w\<^sub>f' where "w\<^sub>f' = TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine" define \\<^sub>f where "\\<^sub>f = (g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (g \ h.tab \ TTfgh.p\<^sub>0) \ (g \ fg\<^sub>0h\<^sub>1.\) \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ ((g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ (f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" define \\<^sub>f' where "\\<^sub>f' = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]" define \\<^sub>f where "\\<^sub>f = \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" have w\<^sub>f: "ide w\<^sub>f" using w\<^sub>f_def fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by auto have w\<^sub>f_is_map: "is_left_adjoint w\<^sub>f" using w\<^sub>f_def fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by (simp add: left_adjoints_compose) have w\<^sub>f': "ide w\<^sub>f'" unfolding w\<^sub>f'_def by simp have w\<^sub>f'_is_map: "is_left_adjoint w\<^sub>f'" unfolding w\<^sub>f'_def using 3 TTfgh_TfTgh.is_map f\<^sub>0gh\<^sub>1.leg1_is_map by (simp add: left_adjoints_compose) have \\<^sub>f: "\\\<^sub>f : tab\<^sub>0 f \ w\<^sub>f \ u\<^sub>f\" proof (unfold \\<^sub>f_def w\<^sub>f_def u\<^sub>f_def, intro comp_in_homI) show "\\\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] : tab\<^sub>0 f \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1 \ (tab\<^sub>0 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1\" using f\<^sub>0g\<^sub>1.leg1_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.cospan g\<^sub>0h\<^sub>1.cospan by auto show "\f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1 : (tab\<^sub>0 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1 \ (tab\<^sub>1 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1\" using f\<^sub>0g\<^sub>1.\_in_hom(2) Tfg.\\.T0.antipar(1) by (intro hcomp_in_vhom, auto) show "\(g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1 : (tab\<^sub>1 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1 \ ((g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1\" using Tfg.\\.T0.antipar(1) by (intro hcomp_in_vhom, auto) show "\\[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1 : ((g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1 \ (g \ tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by (intro hcomp_in_vhom, auto) show "\\[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] : (g \ tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1 \ g \ (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by auto show "\g \ fg\<^sub>0h\<^sub>1.\ : g \ (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1 \ g \ tab\<^sub>1 h \ TTfgh.p\<^sub>0\" using fg\<^sub>0h\<^sub>1.\_in_hom fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by (intro hcomp_in_vhom, auto) show "\g \ h.tab \ TTfgh.p\<^sub>0 : g \ tab\<^sub>1 h \ TTfgh.p\<^sub>0 \ g \ (h \ tab\<^sub>0 h) \ TTfgh.p\<^sub>0\" using gh fg\<^sub>0h\<^sub>1.\_in_hom fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by (intro hcomp_in_vhom, auto) show "\g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0] : g \ (h \ tab\<^sub>0 h) \ TTfgh.p\<^sub>0 \ g \ h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0\" using gh fg\<^sub>0h\<^sub>1.\_in_hom fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by (intro hcomp_in_vhom, auto) qed have \\<^sub>f': "\\\<^sub>f' : tab\<^sub>0 f \ w\<^sub>f' \ u\<^sub>f\" proof (unfold \\<^sub>f'_def w\<^sub>f'_def u\<^sub>f_def, intro comp_in_homI) show "\\\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] : tab\<^sub>0 f \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine \ (tab\<^sub>0 f \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine\" using "1" "2" "3" "4" assoc'_in_hom(2) f.ide_u f.leg1_simps(3) by auto show "\f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine : (tab\<^sub>0 f \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine \ ((tab\<^sub>1 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine\" using f\<^sub>0gh\<^sub>1.\_in_hom(2) by (intro hcomp_in_vhom, auto) show "\((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine : ((tab\<^sub>1 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine \ (((g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine\" using f\<^sub>0gh\<^sub>1.cospan g\<^sub>0h\<^sub>1.cospan by (intro hcomp_in_vhom, auto) show "\(\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine : (((g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine \ ((g \ tab\<^sub>0 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine\" using f\<^sub>0gh\<^sub>1.cospan g\<^sub>0h\<^sub>1.cospan by (intro hcomp_in_vhom, auto) show "\((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine : ((g \ tab\<^sub>0 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine \ ((g \ tab\<^sub>1 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine\" using f\<^sub>0gh\<^sub>1.cospan g\<^sub>0h\<^sub>1.cospan g\<^sub>0h\<^sub>1.\_in_hom(2) by (intro hcomp_in_vhom, auto) show "\((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine : ((g \ tab\<^sub>1 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine \ ((g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine\" using f\<^sub>0gh\<^sub>1.cospan g\<^sub>0h\<^sub>1.cospan by (intro hcomp_in_vhom, auto) show "\can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) : ((g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine \ g \ h \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine\" using f\<^sub>0gh\<^sub>1.cospan g\<^sub>0h\<^sub>1.cospan by auto show "\g \ h \ TTfgh_TfTgh.the_\ : g \ h \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine \ g \ h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0\" using f\<^sub>0gh\<^sub>1.cospan g\<^sub>0h\<^sub>1.cospan TTfgh_TfTgh.the_\_in_hom by (intro hcomp_in_vhom, auto) qed have \\<^sub>f: "\\\<^sub>f : tab\<^sub>1 f \ w\<^sub>f \ tab\<^sub>1 f \ w\<^sub>f'\" proof (unfold \\<^sub>f_def w\<^sub>f_def w\<^sub>f'_def, intro comp_in_homI) show "\\\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] : tab\<^sub>1 f \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1 \ (tab\<^sub>1 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1\" using TTfgh.leg1_in_hom(2) assoc'_in_hom by auto show "\TTfgh_TfTgh.the_\ : (tab\<^sub>1 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1 \ (tab\<^sub>1 f \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine\" using TTfgh_TfTgh.the_\_in_hom TTfgh_TfTgh.the_\_props by simp show "\\[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] : (tab\<^sub>1 f \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine \ tab\<^sub>1 f \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine\" using 1 2 3 4 by auto qed have iso_\\<^sub>f: "iso \\<^sub>f" unfolding \\<^sub>f_def using 1 2 3 4 \\<^sub>f \\<^sub>f_def isos_compose apply (intro isos_compose) apply (metis TTfgh.composable TTfgh.leg1_in_hom(2) Tfg.\\.T0.antipar(2) Tfg.\\.T0.ide_right Tfg.\\.leg1_in_hom(2) Tfg_Hfg.u_simps(3) f.T0.antipar(2) f.T0.ide_right f.ide_leg1 f\<^sub>0g\<^sub>1.cospan g.ide_leg1 h.ide_leg1 h.leg1_simps(4) hcomp_in_vhomE ide_hcomp iso_assoc' tab\<^sub>1_simps(1)) using TTfgh_TfTgh.the_\_props(2) f.ide_leg1 iso_assoc by blast+ have u\<^sub>f: "ide u\<^sub>f" using \\<^sub>f ide_cod by blast have w\<^sub>f_in_hhom: "in_hhom w\<^sub>f (src u\<^sub>f) (src (tab\<^sub>0 f))" using u\<^sub>f w\<^sub>f u\<^sub>f_def w\<^sub>f_def by simp have w\<^sub>f'_in_hhom: "in_hhom w\<^sub>f' (src u\<^sub>f) (src (tab\<^sub>0 f))" using u\<^sub>f w\<^sub>f' w\<^sub>f'_def u\<^sub>f_def by simp have 5: "\!\. \\ : w\<^sub>f \ w\<^sub>f'\ \ \\<^sub>f = tab\<^sub>1 f \ \ \ \\<^sub>f = \\<^sub>f' \ (tab\<^sub>0 f \ \)" proof - have eq\<^sub>f: "f.composite_cell w\<^sub>f \\<^sub>f = f.composite_cell w\<^sub>f' \\<^sub>f' \ \\<^sub>f" proof - text \ I don't see any alternative here to just grinding out the calculation. The idea is to bring \f.composite_cell w\<^sub>f \\<^sub>f\ into a form in which \src_tab_eq\ can be applied to eliminate \\\<^sub>f\ in favor of \\\<^sub>f'\. \ have "f.composite_cell w\<^sub>f \\<^sub>f = ((f \ g \ \[h, tab\<^sub>0 h, fg\<^sub>0h\<^sub>1.p\<^sub>0]) \ (f \ g \ h.tab \ fg\<^sub>0h\<^sub>1.p\<^sub>0) \ (f \ g \ fg\<^sub>0h\<^sub>1.\) \ (f \ \[g, tab\<^sub>0 g \ f\<^sub>0g\<^sub>1.p\<^sub>0, fg\<^sub>0h\<^sub>1.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, f\<^sub>0g\<^sub>1.p\<^sub>0] \ fg\<^sub>0h\<^sub>1.p\<^sub>1) \ (f \ (g.tab \ f\<^sub>0g\<^sub>1.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.p\<^sub>1) \ (f \ f\<^sub>0g\<^sub>1.\ \ fg\<^sub>0h\<^sub>1.p\<^sub>1) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, f\<^sub>0g\<^sub>1.p\<^sub>1, fg\<^sub>0h\<^sub>1.p\<^sub>1])) \ \[f, tab\<^sub>0 f, f\<^sub>0g\<^sub>1.p\<^sub>1 \ fg\<^sub>0h\<^sub>1.p\<^sub>1] \ (f.tab \ f\<^sub>0g\<^sub>1.p\<^sub>1 \ fg\<^sub>0h\<^sub>1.p\<^sub>1)" unfolding w\<^sub>f_def \\<^sub>f_def using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps Tgh.composable whisker_left by simp (* 12 sec, 30 sec cpu *) also have "... = (f \ g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (f \ g \ h.tab \ TTfgh.p\<^sub>0) \ (f \ g \ fg\<^sub>0h\<^sub>1.\) \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ (f \ f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" using comp_assoc by simp also have "... = (\[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \\<^sup>-\<^sup>1[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (f \ g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0])) \ (f \ g \ h.tab \ TTfgh.p\<^sub>0) \ (f \ g \ fg\<^sub>0h\<^sub>1.\) \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ (f \ f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" proof - have "(\[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \\<^sup>-\<^sup>1[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0]) \ (f \ g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) = f \ g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_cod_arr comp_assoc_assoc' by simp thus ?thesis using comp_assoc by simp qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (f \ g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0])) \ (f \ g \ h.tab \ TTfgh.p\<^sub>0) \ (f \ g \ fg\<^sub>0h\<^sub>1.\) \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ (f \ f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" using comp_assoc by presburger also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (\\<^sup>-\<^sup>1[f, g, (h \ tab\<^sub>0 h) \ TTfgh.p\<^sub>0] \ (f \ g \ h.tab \ TTfgh.p\<^sub>0)) \ (f \ g \ fg\<^sub>0h\<^sub>1.\) \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ (f \ f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_assoc assoc'_naturality [of f g "\[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]"] by simp also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ (\\<^sup>-\<^sup>1[f, g, tab\<^sub>1 h \ TTfgh.p\<^sub>0] \ (f \ g \ fg\<^sub>0h\<^sub>1.\)) \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ (f \ f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_assoc assoc'_naturality [of f g "h.tab \ TTfgh.p\<^sub>0"] by simp also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ (f \ f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ ((f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1]) \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_assoc assoc'_naturality [of f g fg\<^sub>0h\<^sub>1.\] by simp also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ ((f \ f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \[f, tab\<^sub>0 f \ Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" proof - have "(f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1] = \[f, tab\<^sub>0 f \ Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "(f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1] = \(\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\tab\<^sub>0 f\<^bold>\, \<^bold>\Tfg.p\<^sub>1\<^bold>\, \<^bold>\TTfgh.p\<^sub>1\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\tab\<^sub>0 f\<^bold>\, \<^bold>\Tfg.p\<^sub>1\<^bold>\ \<^bold>\ \<^bold>\TTfgh.p\<^sub>1\<^bold>\\<^bold>]\" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps \'_def \_def by simp also have "... = \\<^bold>\\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\tab\<^sub>0 f\<^bold>\ \<^bold>\ \<^bold>\Tfg.p\<^sub>1\<^bold>\, \<^bold>\TTfgh.p\<^sub>1\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\tab\<^sub>0 f\<^bold>\, \<^bold>\Tfg.p\<^sub>1\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TTfgh.p\<^sub>1\<^bold>\) \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 f\<^bold>\, \<^bold>\Tfg.p\<^sub>1\<^bold>\, \<^bold>\TTfgh.p\<^sub>1\<^bold>\\<^bold>]\" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps by (intro E.eval_eqI, simp_all) also have "... = \[f, tab\<^sub>0 f \ Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps \'_def \_def by simp finally show ?thesis by blast qed thus ?thesis using comp_assoc by presburger qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ ((f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ \[f, tab\<^sub>1 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ ((f \ f\<^sub>0g\<^sub>1.\) \ TTfgh.p\<^sub>1) \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" proof - have "(f \ f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \[f, tab\<^sub>0 f \ Tfg.p\<^sub>1, TTfgh.p\<^sub>1] = \[f, tab\<^sub>1 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((f \ f\<^sub>0g\<^sub>1.\) \ TTfgh.p\<^sub>1)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.\_in_hom assoc_naturality [of f f\<^sub>0g\<^sub>1.\ TTfgh.p\<^sub>1] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1) \ ((f \ f\<^sub>0g\<^sub>1.\) \ TTfgh.p\<^sub>1) \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1)" proof - have "(f \ (g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ \[f, tab\<^sub>1 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] = \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.\_in_hom assoc_naturality [of f "g.tab \ Tfg.p\<^sub>0" TTfgh.p\<^sub>1] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ ((f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ ((f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1) \ ((f \ f\<^sub>0g\<^sub>1.\) \ TTfgh.p\<^sub>1) \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ ((f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps assoc'_naturality [of f.tab Tfg.p\<^sub>1 TTfgh.p\<^sub>1] comp_assoc by simp also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((((f \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ ((f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1)) \ ((f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1)) \ ((f \ f\<^sub>0g\<^sub>1.\) \ TTfgh.p\<^sub>1) \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ ((f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "(((f \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ ((f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1)) \ ((f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1) = (f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_cod_arr whisker_right comp_assoc_assoc' whisker_left [of f "\\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0]" "\[g, tab\<^sub>0 g, Tfg.p\<^sub>0]"] by simp thus ?thesis using comp_assoc by simp qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((f \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ ((f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ ((f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1) \ ((f \ f\<^sub>0g\<^sub>1.\) \ TTfgh.p\<^sub>1) \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ ((f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using comp_assoc by presburger also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((f \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ (((\[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (\\<^sup>-\<^sup>1[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1)) \ ((f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1)) \ ((f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1) \ ((f \ f\<^sub>0g\<^sub>1.\) \ TTfgh.p\<^sub>1) \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ ((f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "((\[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (\\<^sup>-\<^sup>1[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1)) \ ((f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) = (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1" using fg fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_cod_arr comp_assoc_assoc' whisker_right [of TTfgh.p\<^sub>1 "\[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0]" "\\<^sup>-\<^sup>1[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0]"] by simp thus ?thesis using comp_assoc by simp qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((f \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ (\[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ ((\\<^sup>-\<^sup>1[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ ((f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ ((f \ (g.tab \ Tfg.p\<^sub>0)) \ TTfgh.p\<^sub>1) \ ((f \ f\<^sub>0g\<^sub>1.\) \ TTfgh.p\<^sub>1) \ (\[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ TTfgh.p\<^sub>1) \ ((f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1)) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using comp_assoc by presburger also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ (\\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((f \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ (\[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1)) \ (\\<^sup>-\<^sup>1[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ (f \ (g.tab \ Tfg.p\<^sub>0)) \ (f \ f\<^sub>0g\<^sub>1.\) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps whisker_right comp_assoc by simp also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \[f \ g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\\<^sup>-\<^sup>1[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ (f \ (g.tab \ Tfg.p\<^sub>0)) \ (f \ f\<^sub>0g\<^sub>1.\) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "\\<^sup>-\<^sup>1[f, g, (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1] \ (f \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ \[f, (g \ tab\<^sub>0 g) \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ ((f \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ TTfgh.p\<^sub>1) \ (\[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\g\<^bold>\, (\<^bold>\tab\<^sub>0 g\<^bold>\ \<^bold>\ \<^bold>\Tfg.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh.p\<^sub>1\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\tab\<^sub>0 g\<^bold>\ \<^bold>\ \<^bold>\Tfg.p\<^sub>0\<^bold>\, \<^bold>\TTfgh.p\<^sub>1\<^bold>\\<^bold>]) \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\tab\<^sub>0 g\<^bold>\, \<^bold>\Tfg.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TTfgh.p\<^sub>1\<^bold>\) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\f\<^bold>\, (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 g\<^bold>\) \<^bold>\ \<^bold>\Tfg.p\<^sub>0\<^bold>\, \<^bold>\TTfgh.p\<^sub>1\<^bold>\\<^bold>] \<^bold>\ ((\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\tab\<^sub>0 g\<^bold>\, \<^bold>\Tfg.p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\TTfgh.p\<^sub>1\<^bold>\) \<^bold>\ (\<^bold>\\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\g\<^bold>\, \<^bold>\tab\<^sub>0 g\<^bold>\ \<^bold>\ \<^bold>\Tfg.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TTfgh.p\<^sub>1\<^bold>\)\" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps \'_def \_def by simp also have "... = \\<^bold>\\<^bold>[\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\g\<^bold>\, \<^bold>\tab\<^sub>0 g\<^bold>\ \<^bold>\ \<^bold>\Tfg.p\<^sub>0\<^bold>\, \<^bold>\TTfgh.p\<^sub>1\<^bold>\\<^bold>]\" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps by (intro E.eval_eqI, auto) also have "... = \[f \ g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps \'_def \_def by simp finally show ?thesis using comp_assoc by presburger qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((\[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \\<^sup>-\<^sup>1[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0]) \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0])) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \[f \ g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\\<^sup>-\<^sup>1[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ (f \ (g.tab \ Tfg.p\<^sub>0)) \ (f \ f\<^sub>0g\<^sub>1.\) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "(\[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \\<^sup>-\<^sup>1[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0]) \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) = ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0])" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps comp_cod_arr comp_assoc_assoc' by simp thus ?thesis by simp qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ ((f \ g) \ h.tab \ TTfgh.p\<^sub>0) \ ((f \ g) \ fg\<^sub>0h\<^sub>1.\) \ \[f \ g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\\<^sup>-\<^sup>1[f, g, tab\<^sub>0 g \ Tfg.p\<^sub>0] \ (f \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0]) \ (f \ (g.tab \ Tfg.p\<^sub>0)) \ (f \ f\<^sub>0g\<^sub>1.\) \ \[f, tab\<^sub>0 f, Tfg.p\<^sub>1] \ (f.tab \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1)) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using comp_assoc by presburger also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ TTfgh.tab \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using TTfgh.tab_def Tfg.\\.tab_def by simp also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ (f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ (g \ h.tab \ Tgh.p\<^sub>0) \ (g \ g\<^sub>0h\<^sub>1.\) \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine) \ TTfgh_TfTgh.the_\) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using src_tab_eq TfTgh.tab_def Tgh.\\.tab_def comp_assoc by simp text \Now we have to make this look like \f.composite_cell w\<^sub>f' \\<^sub>f' \ \\<^sub>f\.\ also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ (f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ (f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ (f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\)) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine) \ TTfgh_TfTgh.the_\) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ (g \ h.tab \ Tgh.p\<^sub>0) \ (g \ g\<^sub>0h\<^sub>1.\) \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0 = (f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ (f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ (f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ (f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0)" using fg gh whisker_right whisker_left by simp thus ?thesis using comp_assoc by presburger qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ (\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ ((f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine) \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ (f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ (f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ (f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ (f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine = (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ (\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ ((f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine)" (* using fg gh whisker_right [of TTfgh_TfTgh.chine] by auto (* 2 min *) *) proof - have "arr (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ (f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ (f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ (f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ (f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using fg gh by (intro seqI' comp_in_homI) auto moreover have "arr ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ (f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ (f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ (f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ (f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast moreover have "arr ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ (f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ (f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ (f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast moreover have "arr ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ (f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ (f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast moreover have "arr ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ (f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast moreover have "arr ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ (f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast moreover have "arr ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ (f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast moreover have "arr ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ (f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast moreover have "arr ((f \ f\<^sub>0gh\<^sub>1.\) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast moreover have "arr (\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ (f.tab \ TfTgh.p\<^sub>1))" using calculation by blast ultimately show ?thesis using whisker_right [of TTfgh_TfTgh.chine] TTfgh_TfTgh.is_ide by presburger qed thus ?thesis using comp_assoc by presburger qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ (\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ (((f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]) \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "((f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] = (f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps comp_arr_dom comp_assoc_assoc' by simp thus ?thesis by simp qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ (\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ (((f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using comp_assoc by presburger also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ (\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "((f.tab \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps assoc'_naturality [of f.tab TfTgh.p\<^sub>1 TTfgh_TfTgh.chine] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ (\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ ((\\<^sup>-\<^sup>1[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine]) \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine)) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "(\\<^sup>-\<^sup>1[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine]) \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) = f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps comp_cod_arr comp_assoc_assoc' by simp thus ?thesis using comp_assoc by simp qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ ((\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine]) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" using comp_assoc by presburger also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, tab\<^sub>0 f \ TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "(\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[f, tab\<^sub>0 f \ TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine])" proof - have "(\[f, tab\<^sub>0 f, TfTgh.p\<^sub>1] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f \ tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] = \(\<^bold>\\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\tab\<^sub>0 f\<^bold>\, \<^bold>\TfTgh.p\<^sub>1\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 f\<^bold>\, \<^bold>\TfTgh.p\<^sub>1\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\tab\<^sub>0 f\<^bold>\, \<^bold>\TfTgh.p\<^sub>1\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\" using \'_def \_def by simp also have "... = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\tab\<^sub>0 f\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>1\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\tab\<^sub>0 f\<^bold>\, \<^bold>\TfTgh.p\<^sub>1\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>])\" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps by (intro E.eval_eqI, auto) also have "... = \\<^sup>-\<^sup>1[f, tab\<^sub>0 f \ TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine])" using \'_def \_def by simp finally show ?thesis by simp qed thus ?thesis using comp_assoc by presburger qed also have "... = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ h) \ (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (f \ (\\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ ((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine])) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, tab\<^sub>0 f \ TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[f, (g \ h) \ (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (f \ (\\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine)" proof - (* * This one can't be shortcut with a straight coherence-based proof, * due to the presence of f\<^sub>0gh\<^sub>1.\, g\<^sub>0h\<^sub>1.\, h.tab, with associativities that * do not respect their domain and codomain. * * I also tried to avoid distributing the "f \" in advance, in order to * reduce the number of associativity proof steps, but it then becomes * less automatic to prove the necessary "arr" facts to do the proof. * So unfortunately the mindless grind seems to be the path of least * resistance. *) have "((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ f\<^sub>0gh\<^sub>1.\) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, tab\<^sub>0 f \ TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] = ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (tab\<^sub>1 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps assoc'_naturality [of f f\<^sub>0gh\<^sub>1.\ TTfgh_TfTgh.chine] comp_assoc by simp also have "... = ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, ((g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine)" proof - have "((f \ (g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (tab\<^sub>1 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[f, ((g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps assoc'_naturality [of f "(g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0" TTfgh_TfTgh.chine] by simp thus ?thesis using comp_assoc by presburger qed also have "... = ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ tab\<^sub>0 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ (f \ (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine)" proof - have "((f \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, ((g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[f, (g \ tab\<^sub>0 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps assoc'_naturality [of f "\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0" TTfgh_TfTgh.chine] by simp thus ?thesis using comp_assoc by presburger qed also have "... = ((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ tab\<^sub>1 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ (f \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine)" proof - have "((f \ (g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ tab\<^sub>0 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[f, (g \ tab\<^sub>1 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps assoc'_naturality [of f "(g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0" TTfgh_TfTgh.chine] by simp thus ?thesis using comp_assoc by presburger qed also have "... = (((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ (f \ ((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine)" proof - have "((f \ (g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ tab\<^sub>1 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[f, (g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ ((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps assoc'_naturality [of f "(g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0" TTfgh_TfTgh.chine] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[f, (g \ h) \ (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (f \ (\\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine)" proof - (* OK, we can perhaps shortcut the last few steps... *) have "((f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0]) \ TTfgh_TfTgh.chine) \ ((f \ \\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((f \ (g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \((\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ ((\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ ((\<^bold>\f\<^bold>\ \<^bold>\ (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\, \<^bold>\Tgh.p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\, (\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps \'_def \_def by simp also have "... = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\, (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\) \<^bold>\ (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ (\<^bold>\\<^bold>[\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ (\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ ((\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\, \<^bold>\Tgh.p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)\" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps apply (intro E.eval_eqI) by simp_all also have "... = \\<^sup>-\<^sup>1[f, (g \ h) \ (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (f \ (\\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using fg gh fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.p\<^sub>0_simps f\<^sub>0g\<^sub>1.p\<^sub>1_simps \'_def \_def by simp finally show ?thesis using comp_assoc by presburger qed finally show ?thesis using comp_assoc by presburger qed thus ?thesis using comp_assoc by presburger qed also have "... = (\[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\)) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ h) \ (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (f \ (\\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "(f \ ((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ (f \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]) = (f \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine])" using fg gh whisker_left by simp (* 15 sec elapsed, 30 sec cpu *) thus ?thesis using comp_assoc by presburger qed also have "... = (f \ g \ h \ TTfgh_TfTgh.the_\) \ (\[f, g, h \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ \[f \ g, h, ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g, h] \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ h) \ (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (f \ (\\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)) \ (f \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "\[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ \[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) = \[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (\[f \ g, h, tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ (((f \ g) \ h) \ TTfgh_TfTgh.the_\)) \ (\\<^sup>-\<^sup>1[f, g, h] \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" proof - have "(\\<^sup>-\<^sup>1[f, g, h] \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ ((f \ g \ h) \ TTfgh_TfTgh.the_\) = \\<^sup>-\<^sup>1[f, g, h] \ TTfgh_TfTgh.the_\" using fg gh comp_arr_dom comp_cod_arr interchange [of "\\<^sup>-\<^sup>1[f, g, h]" "f \ g \ h" "tab\<^sub>0 h \ TTfgh.p\<^sub>0" TTfgh_TfTgh.the_\] by simp also have "... = (((f \ g) \ h) \ TTfgh_TfTgh.the_\) \ (\\<^sup>-\<^sup>1[f, g, h] \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using fg gh comp_arr_dom comp_cod_arr interchange [of "(f \ g) \ h" "\\<^sup>-\<^sup>1[f, g, h]" TTfgh_TfTgh.the_\ "((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine"] by simp finally show ?thesis using comp_assoc by presburger qed also have "... = (\[f, g, h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0] \ ((f \ g) \ h \ TTfgh_TfTgh.the_\)) \ \[f \ g, h, ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g, h] \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using fg gh assoc_naturality [of "f \ g" h TTfgh_TfTgh.the_\] comp_assoc by simp also have "... = (f \ g \ h \ TTfgh_TfTgh.the_\) \ \[f, g, h \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ \[f \ g, h, ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g, h] \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using fg gh assoc_naturality [of f g "h \ TTfgh_TfTgh.the_\"] comp_assoc by simp finally show ?thesis using comp_assoc by presburger qed also have "... = ((f \ g \ h \ TTfgh_TfTgh.the_\) \ (f \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)) \ (f \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine])) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "\[f, g, h \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ \[f \ g, h, ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g, h] \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ h) \ (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (f \ (\\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) = f \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" proof - have "\[f, g, h \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ \[f \ g, h, ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g, h] \ ((tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \[f \ g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[f, g \ h, (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[f, (g \ h) \ (tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f \ \[g \ h, tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0] \ TTfgh_TfTgh.chine) \ (f \ (\\<^sup>-\<^sup>1[g, h, tab\<^sub>0 h \ Tgh.p\<^sub>0] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f \ ((g \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0]) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) = \\<^bold>\\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\g\<^bold>\, \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^bold>[\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\g\<^bold>\, \<^bold>\h\<^bold>\, ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\g\<^bold>\, \<^bold>\h\<^bold>\\<^bold>] \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ \<^bold>\\<^bold>[\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\, (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\, \<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\, (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\f\<^bold>\, (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\) \<^bold>\ (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ (\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ (\<^bold>\f\<^bold>\ \<^bold>\ ((\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\\<^bold>[\<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\, \<^bold>\Tgh.p\<^sub>0\<^bold>\\<^bold>]) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)\" using \'_def \_def by simp also have "... = can (\<^bold>\f\<^bold>\ \<^bold>\ (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)) (\<^bold>\f\<^bold>\ \<^bold>\ (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\))" using fg gh apply (unfold can_def) apply (intro E.eval_eqI) by simp_all also have "... = f \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" using fg gh whisker_can_left_0 by simp finally show ?thesis by blast qed thus ?thesis using comp_assoc by presburger qed also have "... = (f \ (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]) \ \[f, tab\<^sub>0 f, TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine] \ (f.tab \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>1 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]" proof - have "((f \ g \ h \ TTfgh_TfTgh.the_\) \ (f \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)) \ (f \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine])) = f \ (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine]" proof - have 1: "arr ((g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine])" using fg gh apply (intro seqI' comp_in_homI) by auto moreover have 2: "arr (can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine])" using calculation by blast ultimately show ?thesis using whisker_left f.ide_base by presburger qed thus ?thesis using comp_assoc by presburger qed also have "... = f.composite_cell w\<^sub>f' \\<^sub>f' \ \\<^sub>f" unfolding w\<^sub>f'_def \\<^sub>f'_def \\<^sub>f_def using comp_assoc by presburger finally show ?thesis by blast qed show ?thesis using w\<^sub>f w\<^sub>f' \\<^sub>f \\<^sub>f' \\<^sub>f f.T2 [of w\<^sub>f w\<^sub>f' \\<^sub>f u\<^sub>f \\<^sub>f' \\<^sub>f] eq\<^sub>f by fast qed obtain \\<^sub>f where \\<^sub>f: "\\\<^sub>f : w\<^sub>f \ w\<^sub>f'\ \ \\<^sub>f = tab\<^sub>1 f \ \\<^sub>f \ \\<^sub>f = \\<^sub>f' \ (tab\<^sub>0 f \ \\<^sub>f)" using 5 by auto show "\\TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine\\ = \\Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1\\" proof - have "iso \\<^sub>f" using \\<^sub>f BS3 w\<^sub>f_is_map w\<^sub>f'_is_map by blast hence "isomorphic w\<^sub>f w\<^sub>f'" using \\<^sub>f isomorphic_def isomorphic_symmetric by auto thus ?thesis using w\<^sub>f w\<^sub>f_def w\<^sub>f'_def Maps.CLS_eqI isomorphic_symmetric by auto qed text \ On to the next equation: \[ \\\Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\ = \\Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1\\\. \] We have to make use of the equation \\\<^sub>f = \\<^sub>f' \ (tab\<^sub>0 f \ \\<^sub>f)\ in this part, similarly to how the equation \src_tab_eq\ was used to replace \TTfgh.tab\ in the first part. \ define u\<^sub>g where "u\<^sub>g = h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0" define w\<^sub>g where "w\<^sub>g = Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1" define w\<^sub>g' where "w\<^sub>g' = Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine" define \\<^sub>g where "\\<^sub>g = \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0] \ (h.tab \ TTfgh.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.\ \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" define \\<^sub>g' where "\\<^sub>g' = (h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ ((h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" define \\<^sub>g where "\\<^sub>g = \[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[tab\<^sub>1 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ (tab\<^sub>0 f \ \\<^sub>f) \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" have u\<^sub>g: "ide u\<^sub>g" unfolding u\<^sub>g_def by simp have w\<^sub>g: "ide w\<^sub>g" unfolding w\<^sub>g_def using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by auto have w\<^sub>g_is_map: "is_left_adjoint w\<^sub>g" unfolding w\<^sub>g_def using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps left_adjoints_compose by simp have w\<^sub>g': "ide w\<^sub>g'" unfolding w\<^sub>g'_def by simp have w\<^sub>g'_is_map: "is_left_adjoint w\<^sub>g'" unfolding w\<^sub>g'_def using TTfgh_TfTgh.is_map left_adjoints_compose by simp have \\<^sub>g: "\\\<^sub>g : tab\<^sub>0 g \ w\<^sub>g \ u\<^sub>g\" using w\<^sub>g_def u\<^sub>g_def \\<^sub>g_def fg\<^sub>0h\<^sub>1.p\<^sub>1_simps fg\<^sub>0h\<^sub>1.\_in_hom by auto have \\<^sub>g': "\\\<^sub>g' : tab\<^sub>0 g \ w\<^sub>g' \ u\<^sub>g\" unfolding w\<^sub>g'_def u\<^sub>g_def \\<^sub>g'_def by (intro comp_in_homI) auto have w\<^sub>g_in_hhom: "in_hhom w\<^sub>g (src u\<^sub>g) (src (tab\<^sub>0 g))" unfolding w\<^sub>g_def u\<^sub>g_def by auto have w\<^sub>g'_in_hhom: "in_hhom w\<^sub>g' (src u\<^sub>g) (src (tab\<^sub>0 g))" unfolding w\<^sub>g'_def u\<^sub>g_def by auto have \\<^sub>g: "\\\<^sub>g : tab\<^sub>1 g \ w\<^sub>g \ tab\<^sub>1 g \ w\<^sub>g'\" proof (unfold \\<^sub>g_def w\<^sub>g_def, intro comp_in_homI) (* auto can solve this, but it's too slow *) show "\\\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] : tab\<^sub>1 g \ Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1 \ (tab\<^sub>1 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by auto show "\inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1 : (tab\<^sub>1 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1 \ (tab\<^sub>0 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.\_in_hom f\<^sub>0g\<^sub>1.\_uniqueness(2) by (intro hcomp_in_vhom) auto show "\\[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] : (tab\<^sub>0 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1 \ tab\<^sub>0 f \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps \\<^sub>f w\<^sub>f_def w\<^sub>f'_def by auto show "\tab\<^sub>0 f \ \\<^sub>f : tab\<^sub>0 f \ Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1 \ tab\<^sub>0 f \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps \\<^sub>f w\<^sub>f_def w\<^sub>f'_def by auto show "\\\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] : tab\<^sub>0 f \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine \ (tab\<^sub>0 f \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine\" by auto show "\f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine : (tab\<^sub>0 f \ TfTgh.p\<^sub>1) \ TTfgh_TfTgh.chine \ ((tab\<^sub>1 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine\" using f\<^sub>0gh\<^sub>1.\_in_hom by (intro hcomp_in_vhom) auto show "\\[tab\<^sub>1 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] : ((tab\<^sub>1 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine \ (tab\<^sub>1 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\" by auto show "\\[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] : (tab\<^sub>1 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine \ tab\<^sub>1 g \ w\<^sub>g'\" using w\<^sub>g'_def by auto qed have eq\<^sub>g: "g.composite_cell w\<^sub>g \\<^sub>g = g.composite_cell w\<^sub>g' \\<^sub>g' \ \\<^sub>g" proof - have "g.composite_cell w\<^sub>g \\<^sub>g = (g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0] \ (h.tab \ TTfgh.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.\ \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1] \ (g.tab \ Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1)" unfolding w\<^sub>g_def \\<^sub>g_def by simp also have "... = (g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (g \ h.tab \ TTfgh.p\<^sub>0) \ (g \ fg\<^sub>0h\<^sub>1.\) \ ((g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1]) \ (g.tab \ Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1)" using fg gh f\<^sub>0g\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps whisker_left comp_assoc by simp also have "... = (g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (g \ h.tab \ TTfgh.p\<^sub>0) \ (g \ fg\<^sub>0h\<^sub>1.\) \ (\[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]))) \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1] \ (g.tab \ Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1)" proof - have "(\[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) = g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_cod_arr comp_assoc_assoc' by simp thus ?thesis by (simp add: comp_assoc) qed also have "... = (g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (g \ h.tab \ TTfgh.p\<^sub>0) \ (g \ fg\<^sub>0h\<^sub>1.\) \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ \[g, tab\<^sub>0 g, Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1]) \ (g.tab \ Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1)" using comp_assoc by presburger also have "... = (g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (g \ h.tab \ TTfgh.p\<^sub>0) \ (g \ fg\<^sub>0h\<^sub>1.\) \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ (\\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (g.tab \ Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1))" using fg gh f\<^sub>0g\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>0_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_assoc pentagon' invert_opposite_sides_of_square [of "\\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1" "(\\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ (g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1])" "\\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" "\\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1]"] by simp also have "... = (g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (g \ h.tab \ TTfgh.p\<^sub>0) \ (g \ fg\<^sub>0h\<^sub>1.\) \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ ((g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps assoc'_naturality [of g.tab Tfg.p\<^sub>0 TTfgh.p\<^sub>1] by simp also have "... = (g \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]) \ (g \ h.tab \ TTfgh.p\<^sub>0) \ (g \ fg\<^sub>0h\<^sub>1.\) \ \[g, tab\<^sub>0 g \ Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ (\[g, tab\<^sub>0 g, Tfg.p\<^sub>0] \ TTfgh.p\<^sub>1) \ ((g.tab \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ (f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" proof - have "(f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] = ((f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ (\\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1]) \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1)) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" using comp_assoc by presburger also have "... = ((f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ ((tab\<^sub>0 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1) \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1)) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps whisker_right comp_assoc_assoc' by simp also have "... = ((f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1)) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0g\<^sub>1.\_uniqueness comp_cod_arr by simp also have "... = ((tab\<^sub>1 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" proof - have "(f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) = f\<^sub>0g\<^sub>1.\ \ inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1" using f\<^sub>0g\<^sub>1.\_uniqueness whisker_right by simp also have "... = (tab\<^sub>1 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1" using f\<^sub>0g\<^sub>1.\_uniqueness comp_arr_inv' by simp finally show ?thesis by simp qed also have "... = \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_cod_arr by simp finally have "(f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] = \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" by simp thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sub>f \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" unfolding \\<^sub>f_def using comp_assoc by presburger also have "... = \\<^sub>f' \ (tab\<^sub>0 f \ \\<^sub>f) \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" using \\<^sub>f comp_assoc by simp also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ (tab\<^sub>0 f \ \\<^sub>f) \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" unfolding \\<^sub>f'_def using comp_assoc by presburger also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (\\<^sup>-\<^sup>1[tab\<^sub>1 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \[tab\<^sub>1 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine)) \ \\<^sup>-\<^sup>1[tab\<^sub>0 f, TfTgh.p\<^sub>1, TTfgh_TfTgh.chine] \ (tab\<^sub>0 f \ \\<^sub>f) \ \[tab\<^sub>0 f, Tfg.p\<^sub>1, TTfgh.p\<^sub>1] \ (inv f\<^sub>0g\<^sub>1.\ \ TTfgh.p\<^sub>1) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]" proof - have "(\\<^sup>-\<^sup>1[tab\<^sub>1 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \[tab\<^sub>1 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ (f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine) = f\<^sub>0gh\<^sub>1.\ \ TTfgh_TfTgh.chine" using f\<^sub>0gh\<^sub>1.p\<^sub>0_simps comp_cod_arr comp_arr_dom comp_assoc_assoc' by simp thus ?thesis using comp_assoc by fastforce qed also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \\<^sub>g" unfolding \\<^sub>g_def using comp_assoc by presburger also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \\<^sub>g" proof - have "(((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" using f\<^sub>0gh\<^sub>1.p\<^sub>0_simps assoc'_naturality [of "(g.tab \ Tgh.p\<^sub>1)" TfTgh.p\<^sub>0 TTfgh_TfTgh.chine] by simp thus ?thesis using comp_assoc by presburger qed also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sub>g" proof - have "((g.tab \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>1 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" using g\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps assoc'_naturality [of g.tab Tgh.p\<^sub>1 "TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine"] by simp thus ?thesis using comp_assoc by presburger qed also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ ((\\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)) \ \\<^sub>g" proof - have "(\\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) = g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine" using comp_cod_arr comp_assoc_assoc' by simp thus ?thesis using comp_assoc g\<^sub>0h\<^sub>1.\_in_hom by simp qed also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)) \ \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ ((\\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)) \ \\<^sub>g" proof - have "(\\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) = (\\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((g \ (tab\<^sub>0 g \ Tgh.p\<^sub>1)) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using g\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps comp_assoc comp_assoc_assoc' by simp also have "... = (\\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using g\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps comp_cod_arr comp_assoc_assoc' by simp also have "... = (((g \ (tab\<^sub>0 g \ Tgh.p\<^sub>1)) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine)" using g\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps whisker_right comp_assoc_assoc' by simp also have "... = (\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine" using g\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps comp_cod_arr by simp finally show ?thesis by presburger qed also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ ((((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (\\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)) \ \\<^sub>g" using comp_assoc by presburger also have "... = (g \ h \ TTfgh_TfTgh.the_\) \ (can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ \\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ (g \ (h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (g \ g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (\[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sub>g" proof - have "(((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g \ (h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (g \ g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" proof - have "(((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ (((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ ((((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" using comp_assoc by presburger also have "... = ((((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g \ tab\<^sub>1 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine]) \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" proof - have "(((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[g \ tab\<^sub>1 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" using gh f\<^sub>0gh\<^sub>1.p\<^sub>0_simps assoc'_naturality [of "g \ g\<^sub>0h\<^sub>1.\" TfTgh.p\<^sub>0 TTfgh_TfTgh.chine] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ ((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" proof - have "(((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g \ tab\<^sub>1 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" using gh f\<^sub>0gh\<^sub>1.p\<^sub>0_simps assoc'_naturality [of "g \ h.tab \ Tgh.p\<^sub>0" TfTgh.p\<^sub>0 TTfgh_TfTgh.chine] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ (((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g, tab\<^sub>1 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ (g \ g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" proof - have "((g \ g\<^sub>0h\<^sub>1.\) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[g, tab\<^sub>1 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g \ g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" using gh f\<^sub>0gh\<^sub>1.p\<^sub>0_simps assoc'_naturality [of g g\<^sub>0h\<^sub>1.\ "TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine"] by simp thus ?thesis using comp_assoc by presburger qed also have "... = \\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g \ (h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (g \ g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" proof - have "((g \ h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[g, tab\<^sub>1 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = \\<^sup>-\<^sup>1[g, (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g \ (h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)" using gh f\<^sub>0gh\<^sub>1.p\<^sub>0_simps assoc'_naturality [of g "h.tab \ Tgh.p\<^sub>0" "TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine"] by simp thus ?thesis using comp_assoc by presburger qed finally show ?thesis by simp qed thus ?thesis using comp_assoc by presburger qed also have "... = ((g \ h \ TTfgh_TfTgh.the_\) \ (g \ can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)) \ (g \ (h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (g \ g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine])) \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sub>g" proof - have "can (\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ \\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = g \ can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" proof - have "\\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = can (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) ((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" proof - have "\\<^sup>-\<^sup>1[g \ (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\" using gh f\<^sub>0gh\<^sub>1.p\<^sub>0_simps canI_associator_0 \'_def \_def by simp also have "... = can (((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) ((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" unfolding can_def using gh apply (intro E.eval_eqI) by simp_all finally show ?thesis by blast qed moreover have "\\<^sup>-\<^sup>1[g, (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = can ((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\g\<^bold>\ \<^bold>\ ((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" proof - have "\\<^sup>-\<^sup>1[g, (h \ tab\<^sub>0 h) \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\g\<^bold>\, (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\" using gh f\<^sub>0gh\<^sub>1.p\<^sub>0_simps canI_associator_0 \'_def \_def by simp also have "... = can ((\<^bold>\g\<^bold>\ \<^bold>\ (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\g\<^bold>\ \<^bold>\ ((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" unfolding can_def using gh apply (intro E.eval_eqI) by simp_all finally show ?thesis by blast qed ultimately show ?thesis using gh whisker_can_left_0 by simp qed moreover have "\[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" proof - have "\[g, tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[g \ tab\<^sub>0 g \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ ((\[g, tab\<^sub>0 g, Tgh.p\<^sub>1] \ TfTgh.p\<^sub>0) \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[(g \ tab\<^sub>0 g) \ Tgh.p\<^sub>1, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g \ tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] = \\<^bold>\\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\tab\<^sub>0 g\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>1\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^bold>[\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 g\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>1\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ ((\<^bold>\\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\tab\<^sub>0 g\<^bold>\, \<^bold>\Tgh.p\<^sub>1\<^bold>\\<^bold>] \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[(\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 g\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>1\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 g\<^bold>\, \<^bold>\Tgh.p\<^sub>1\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\g\<^bold>\, \<^bold>\tab\<^sub>0 g\<^bold>\, \<^bold>\Tgh.p\<^sub>1\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\" using gh g\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps \'_def \_def by simp also have "... = \\<^bold>\g\<^bold>\ \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\tab\<^sub>0 g\<^bold>\, \<^bold>\Tgh.p\<^sub>1\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\" apply (intro E.eval_eqI) by simp_all also have "... = g \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" using gh g\<^sub>0h\<^sub>1.p\<^sub>1_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps \'_def \_def by simp finally show ?thesis by simp qed ultimately show ?thesis using comp_assoc by presburger qed also have "... = (g \ (h \ TTfgh_TfTgh.the_\) \ (can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)) \ ((h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \[g, tab\<^sub>0 g, Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g.tab \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sub>g" using gh whisker_left by auto (* 11 sec *) also have "... = g.composite_cell w\<^sub>g' \\<^sub>g' \ \\<^sub>g" unfolding w\<^sub>g'_def \\<^sub>g'_def using comp_assoc by presburger finally show ?thesis by blast qed have 6: "\!\. \\ : w\<^sub>g \ w\<^sub>g'\ \ \\<^sub>g = tab\<^sub>1 g \ \ \ \\<^sub>g = \\<^sub>g' \ (tab\<^sub>0 g \ \)" using w\<^sub>g w\<^sub>g' \\<^sub>g \\<^sub>g' \\<^sub>g eq\<^sub>g g.T2 [of w\<^sub>g w\<^sub>g' \\<^sub>g u\<^sub>g \\<^sub>g' \\<^sub>g] by blast obtain \\<^sub>g where \\<^sub>g: "\\\<^sub>g : w\<^sub>g \ w\<^sub>g'\ \ \\<^sub>g = tab\<^sub>1 g \ \\<^sub>g \ \\<^sub>g = \\<^sub>g' \ (tab\<^sub>0 g \ \\<^sub>g)" using 6 by auto show "\\Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\ = \\Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1\\" proof - have "iso \\<^sub>g" using \\<^sub>g BS3 w\<^sub>g_is_map w\<^sub>g'_is_map by blast hence "isomorphic w\<^sub>g w\<^sub>g'" using \\<^sub>g isomorphic_def isomorphic_symmetric by auto thus ?thesis using w\<^sub>g w\<^sub>g' w\<^sub>g_def w\<^sub>g'_def Maps.CLS_eqI by auto qed text \Now the last equation: similar, but somewhat simpler.\ define u\<^sub>h where "u\<^sub>h = tab\<^sub>0 h \ TTfgh.p\<^sub>0" define w\<^sub>h where "w\<^sub>h = TTfgh.p\<^sub>0" define w\<^sub>h' where "w\<^sub>h' = Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine" define \\<^sub>h where "\\<^sub>h = tab\<^sub>0 h \ TTfgh.p\<^sub>0" define \\<^sub>h' where "\\<^sub>h' = TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" define \\<^sub>h where "\\<^sub>h = \[tab\<^sub>1 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" have u\<^sub>h: "ide u\<^sub>h" unfolding u\<^sub>h_def by simp have w\<^sub>h: "ide w\<^sub>h" unfolding w\<^sub>h_def by simp have w\<^sub>h_is_map: "is_left_adjoint w\<^sub>h" unfolding w\<^sub>h_def by simp have w\<^sub>h': "ide w\<^sub>h'" unfolding w\<^sub>h'_def by simp have w\<^sub>h'_is_map: "is_left_adjoint w\<^sub>h'" unfolding w\<^sub>h'_def using g\<^sub>0h\<^sub>1.p\<^sub>0_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps TTfgh_TfTgh.is_map left_adjoints_compose by simp have \\<^sub>h: "\\\<^sub>h : tab\<^sub>0 h \ w\<^sub>h \ u\<^sub>h\" unfolding \\<^sub>h_def w\<^sub>h_def u\<^sub>h_def by auto have \\<^sub>h': "\\\<^sub>h' : tab\<^sub>0 h \ w\<^sub>h' \ u\<^sub>h\" unfolding \\<^sub>h'_def w\<^sub>h'_def u\<^sub>h_def using g\<^sub>0h\<^sub>1.p\<^sub>0_simps f\<^sub>0gh\<^sub>1.p\<^sub>0_simps by (intro comp_in_homI) auto have \\<^sub>h: "\\\<^sub>h : tab\<^sub>1 h \ w\<^sub>h \ tab\<^sub>1 h \ w\<^sub>h'\" proof (unfold \\<^sub>h_def w\<^sub>h_def w\<^sub>h'_def, intro comp_in_homI) (* auto can solve this, but it's too slow *) show "\inv fg\<^sub>0h\<^sub>1.\ : tab\<^sub>1 h \ TTfgh.p\<^sub>0 \ (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1\" using fg\<^sub>0h\<^sub>1.\_uniqueness by blast show "\\[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] : (tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1 \ tab\<^sub>0 g \ Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by auto show "\tab\<^sub>0 g \ \\<^sub>g : tab\<^sub>0 g \ Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1 \ tab\<^sub>0 g \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\" using \\<^sub>g w\<^sub>g_def w\<^sub>g'_def fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by auto show "\\\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] : tab\<^sub>0 g \ Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine \ (tab\<^sub>0 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by auto show "\g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine : (tab\<^sub>0 g \ Tgh.p\<^sub>1) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine \ (tab\<^sub>1 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by force show "\\[tab\<^sub>1 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] : (tab\<^sub>1 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine \ tab\<^sub>1 h \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps by auto qed have eq\<^sub>h: "h.composite_cell w\<^sub>h \\<^sub>h = h.composite_cell w\<^sub>h' \\<^sub>h' \ \\<^sub>h" proof - text \ Once again, the strategy is to form the subexpression \[ \\[h, tab\<^sub>0 h, TTfgh.p\<^sub>0] \ (h.tab \ TTfgh.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.\ \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]\ \] which is equal to \\\<^sub>g\, so that we can make use of the equation \\\<^sub>g = \\<^sub>g' \ (tab\<^sub>0 g \ \\<^sub>g)\. \ have "h.composite_cell w\<^sub>h \\<^sub>h = (h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0] \ (h.tab \ TTfgh.p\<^sub>0)" unfolding w\<^sub>h_def \\<^sub>h_def by simp also have "... = \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0] \ (h.tab \ TTfgh.p\<^sub>0)" proof - have "(h \ tab\<^sub>0 h \ TTfgh.p\<^sub>0) \ \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0] = \[h, tab\<^sub>0 h, TTfgh.p\<^sub>0]" using comp_cod_arr by simp thus ?thesis using comp_assoc by metis qed also have "... = (\[h, tab\<^sub>0 h, TTfgh.p\<^sub>0] \ (h.tab \ TTfgh.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.\ \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" proof - have "(h.tab \ TTfgh.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.\ \ (\\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ inv fg\<^sub>0h\<^sub>1.\ = (h.tab \ TTfgh.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.\ \ ((tab\<^sub>0 g \ Tfg.p\<^sub>0) \ TTfgh.p\<^sub>1) \ inv fg\<^sub>0h\<^sub>1.\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps comp_assoc_assoc' by simp also have "... = (h.tab \ TTfgh.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.\ \ inv fg\<^sub>0h\<^sub>1.\" using fg\<^sub>0h\<^sub>1.p\<^sub>1_simps fg\<^sub>0h\<^sub>1.\_uniqueness comp_cod_arr by simp also have "... = (h.tab \ TTfgh.p\<^sub>0) \ (tab\<^sub>1 h \ TTfgh.p\<^sub>0)" using comp_arr_inv' fg\<^sub>0h\<^sub>1.\_uniqueness by simp also have "... = h.tab \ TTfgh.p\<^sub>0" using comp_arr_dom fg\<^sub>0h\<^sub>1.p\<^sub>0_simps by simp finally have "(h.tab \ TTfgh.p\<^sub>0) \ fg\<^sub>0h\<^sub>1.\ \ (\\<^sup>-\<^sup>1[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1]) \ inv fg\<^sub>0h\<^sub>1.\ = h.tab \ TTfgh.p\<^sub>0" by simp thus ?thesis using comp_assoc by simp qed also have "... = \\<^sub>g \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" unfolding \\<^sub>g_def by simp also have "... = (\\<^sub>g' \ (tab\<^sub>0 g \ \\<^sub>g)) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" using \\<^sub>g by simp also have "... = (h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ ((h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" unfolding \\<^sub>g'_def using comp_assoc by presburger also have "... = (h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ ((\\<^sup>-\<^sup>1[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ ((h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)) \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" proof - have "(\\<^sup>-\<^sup>1[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ ((h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) = (h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine" using comp_cod_arr comp_assoc_assoc' by simp thus ?thesis using comp_assoc by simp qed also have "... = (h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ \\<^sup>-\<^sup>1[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (\[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ ((h.tab \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)) \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" using comp_assoc by presburger also have "... = (h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ \\<^sup>-\<^sup>1[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (h.tab \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" using assoc_naturality [of h.tab Tgh.p\<^sub>0 "TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine"] comp_assoc by simp also have "... = (h \ TTfgh_TfTgh.the_\) \ can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ \\<^sup>-\<^sup>1[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ ((\\<^sup>-\<^sup>1[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ (h.tab \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine)) \ \[tab\<^sub>1 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" proof - have "(\\<^sup>-\<^sup>1[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ (h.tab \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) = h.tab \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine" using comp_cod_arr comp_assoc_assoc' by simp thus ?thesis using comp_assoc by simp qed also have "... = (h \ TTfgh_TfTgh.the_\) \ (can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (\\<^sup>-\<^sup>1[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine])) \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (h.tab \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" using comp_assoc by presburger also have "... = ((h \ TTfgh_TfTgh.the_\) \ (h \ can (((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\))) \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (h.tab \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" proof - have "can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (\\<^sup>-\<^sup>1[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) = can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\, \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\, \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\" using \'_def \_def by simp also have "... = can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ can (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" proof - have "\\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\, \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\h\<^bold>\, \<^bold>\tab\<^sub>0 h\<^bold>\, \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\ = can (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" unfolding can_def apply (intro E.eval_eqI) by simp_all thus ?thesis by simp qed also have "... = can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" by simp also have "... = h \ can (((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" using whisker_can_left_0 by simp finally have "can (\<^bold>\h\<^bold>\ \<^bold>\ ((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (((\<^bold>\h\<^bold>\ \<^bold>\ \<^bold>\tab\<^sub>0 h\<^bold>\) \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) \ (\\<^sup>-\<^sup>1[h \ tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) = h \ can (((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)" by simp thus ?thesis using comp_assoc by presburger qed also have "... = (h \ TTfgh_TfTgh.the_\ \ can (((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\)) \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (h.tab \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" using whisker_left [of h] comp_assoc by simp also have "... = (h \ TTfgh_TfTgh.the_\ \ \\<^sup>-\<^sup>1[tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]) \ \[h, tab\<^sub>0 h, Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (h.tab \ Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \[tab\<^sub>1 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (g\<^sub>0h\<^sub>1.\ \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine) \ \\<^sup>-\<^sup>1[tab\<^sub>0 g, Tgh.p\<^sub>1, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine] \ (tab\<^sub>0 g \ \\<^sub>g) \ \[tab\<^sub>0 g, Tfg.p\<^sub>0, TTfgh.p\<^sub>1] \ inv fg\<^sub>0h\<^sub>1.\" proof - have "can (((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) = \\<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\, \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>] \<^bold>\ \<^bold>\\<^sup>-\<^sup>1\<^bold>[\<^bold>\tab\<^sub>0 h\<^bold>\, \<^bold>\Tgh.p\<^sub>0\<^bold>\, \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\\<^bold>]\" unfolding can_def apply (intro E.eval_eqI) by auto also have "... = \\<^sup>-\<^sup>1[tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" using \'_def \_def by simp finally have "can (((\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\) \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) (\<^bold>\tab\<^sub>0 h\<^bold>\ \<^bold>\ \<^bold>\Tgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TfTgh.p\<^sub>0\<^bold>\ \<^bold>\ \<^bold>\TTfgh_TfTgh.chine\<^bold>\) = \\<^sup>-\<^sup>1[tab\<^sub>0 h \ Tgh.p\<^sub>0, TfTgh.p\<^sub>0, TTfgh_TfTgh.chine] \ \\<^sup>-\<^sup>1[tab\<^sub>0 h, Tgh.p\<^sub>0, TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine]" by simp thus ?thesis by simp qed also have "... = h.composite_cell w\<^sub>h' \\<^sub>h' \ \\<^sub>h" unfolding w\<^sub>h'_def \\<^sub>h'_def \\<^sub>h_def using comp_assoc by presburger finally show ?thesis by simp qed have 7: "\!\. \\ : w\<^sub>h \ w\<^sub>h'\ \ \\<^sub>h = tab\<^sub>1 h \ \ \ \\<^sub>h = \\<^sub>h' \ (tab\<^sub>0 h \ \)" using w\<^sub>h w\<^sub>h' \\<^sub>h \\<^sub>h' \\<^sub>h eq\<^sub>h h.T2 [of w\<^sub>h w\<^sub>h' \\<^sub>h u\<^sub>h \\<^sub>h' \\<^sub>h] by blast obtain \\<^sub>h where \\<^sub>h: "\\\<^sub>h : w\<^sub>h \ w\<^sub>h'\ \ \\<^sub>h = tab\<^sub>1 h \ \\<^sub>h \ \\<^sub>h = \\<^sub>h' \ (tab\<^sub>0 h \ \\<^sub>h)" using 7 by auto show "\\Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\ = \\TTfgh.p\<^sub>0\\" proof - have "iso \\<^sub>h" using \\<^sub>h BS3 w\<^sub>h_is_map w\<^sub>h'_is_map by blast hence "isomorphic w\<^sub>h w\<^sub>h'" using \\<^sub>h isomorphic_def isomorphic_symmetric by auto thus ?thesis using w\<^sub>h w\<^sub>h' w\<^sub>h_def w\<^sub>h'_def Maps.CLS_eqI [of w\<^sub>h w\<^sub>h'] by simp qed qed text \ Finally, we can show that @{term TTfgh_TfTgh.chine} is given by tupling. \ lemma CLS_chine: shows "\\TTfgh_TfTgh.chine\\ = tuple_ABC" proof - have "tuple_ABC = SPN_fgh.chine_assoc" using SPN_fgh.chine_assoc_def by simp also have "... = \\TTfgh_TfTgh.chine\\" proof (intro Maps.arr_eqI) show "Maps.arr SPN_fgh.chine_assoc" using SPN_fgh.chine_assoc_in_hom by auto show "Maps.arr \\TTfgh_TfTgh.chine\\" using Maps.CLS_in_hom TTfgh_TfTgh.is_map by blast show "Maps.Dom SPN_fgh.chine_assoc = Maps.Dom \\TTfgh_TfTgh.chine\\" using SPN_fgh.chine_assoc_def Maps.dom_char tuple_ABC_in_hom TTfgh_TfTgh.chine_in_hom by fastforce show "Maps.Cod SPN_fgh.chine_assoc = Maps.Cod \\TTfgh_TfTgh.chine\\" proof - have "Maps.Cod SPN_fgh.chine_assoc = Maps.Cod tuple_ABC" using SPN_fgh.chine_assoc_def by simp also have "... = src (prj\<^sub>0 (tab\<^sub>1 g \ prj\<^sub>1 (tab\<^sub>1 h) (tab\<^sub>0 g)) (tab\<^sub>0 f))" by (metis (lifting) Maps.Dom.simps(1) Maps.seq_char SPN_fgh.prj_chine_assoc(1) SPN_fgh.prj_simps(1) calculation f\<^sub>0gh\<^sub>1.leg1_simps(3) prj_char(4)) also have "... = Maps.Cod \\TTfgh_TfTgh.chine\\" using Maps.cod_char TTfgh_TfTgh.chine_in_hom by simp finally show ?thesis by blast qed show "Maps.Map SPN_fgh.chine_assoc = Maps.Map \\TTfgh_TfTgh.chine\\" proof - have 0: "Chn (Span.hcomp (SPN f) (Span.hcomp (SPN g) (SPN h))) = Maps.MkIde (src TfTgh.p\<^sub>0)" using fg gh by (metis (mono_tags, lifting) Maps.in_homE Maps.seqE SPN_fgh.prj_chine_assoc(1) SPN_fgh.prj_simps(1) SPN_fgh.prj_simps(13) calculation tuple_ABC_in_hom) have "tuple_ABC = \\TTfgh_TfTgh.chine\\" proof (intro Maps.prj_joint_monic [of SPN_fgh.\.leg0 "SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1" tuple_ABC "\\TTfgh_TfTgh.chine\\"]) show "Maps.cospan SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" using SPN_fgh.\\.dom.is_span SPN_fgh.\\.leg1_composite SPN_fgh.cospan_\\ by auto show "Maps.seq SPN_fgh.Prj\<^sub>1 tuple_ABC" using 0 tuple_ABC_in_hom SPN_fgh.prj_in_hom(4) by auto show "Maps.seq SPN_fgh.Prj\<^sub>1 \\TTfgh_TfTgh.chine\\" proof show "Maps.in_hom \\TTfgh_TfTgh.chine\\ \\src TTfgh_TfTgh.chine\\ \\trg TTfgh_TfTgh.chine\\" using fg gh TTfgh_TfTgh.chine_in_hom Maps.CLS_in_hom TTfgh_TfTgh.is_map by blast show "Maps.in_hom SPN_fgh.Prj\<^sub>1 \\trg TTfgh_TfTgh.chine\\ SPN_fgh.\.apex" proof show "Maps.cospan SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" using SPN_fgh.prj_in_hom(4) by blast show "\\trg TTfgh_TfTgh.chine\\ = Maps.pbdom SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" proof - have "\\trg TTfgh_TfTgh.chine\\ = Maps.MkIde (src TfTgh.p\<^sub>0)" by simp also have "... = Maps.pbdom SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" using 0 Maps.pbdom_def SPN_fgh.chine_composite(2) by presburger finally show ?thesis by blast qed show "SPN_fgh.\.apex = Maps.dom SPN_fgh.\.leg0" using SPN_f.dom.apex_def by blast qed qed have 2: "Maps.commutative_square SPN_fgh.\.leg0 SPN_fgh.\.leg1 SPN_fgh.Prj\<^sub>0\<^sub>1 SPN_fgh.Prj\<^sub>0" proof show "Maps.cospan SPN_fgh.\.leg0 SPN_fgh.\.leg1" using SPN_fgh.\\.legs_form_cospan(1) by simp show "Maps.span SPN_fgh.Prj\<^sub>0\<^sub>1 SPN_fgh.Prj\<^sub>0" using SPN_fgh.prj_simps(2-3,5-6) by presburger show "Maps.dom SPN_fgh.\.leg0 = Maps.cod SPN_fgh.Prj\<^sub>0\<^sub>1" using SPN_fgh.prj_simps(8) SPN_g.dom.is_span SPN_g.dom.leg_simps(2) by auto show "SPN_fgh.\.leg0 \ SPN_fgh.Prj\<^sub>0\<^sub>1 = SPN_fgh.\.leg1 \ SPN_fgh.Prj\<^sub>0" by (metis (no_types, lifting) Maps.cod_comp Maps.comp_assoc Maps.pullback_commutes' SPN_fgh.\\.dom.leg_simps(1) SPN_fgh.\\.leg0_composite SPN_fgh.cospan_\\) qed have 1: "Maps.commutative_square SPN_fgh.\.leg0 (Maps.comp SPN_fgh.\.leg1 SPN_fgh.\\.prj\<^sub>1) SPN_fgh.Prj\<^sub>1\<^sub>1 tuple_BC" proof show "Maps.cospan SPN_fgh.\.leg0 (Maps.comp SPN_fgh.\.leg1 SPN_fgh.\\.prj\<^sub>1)" using fg gh SPN_fgh.prj_simps(10) by blast show "Maps.span SPN_fgh.Prj\<^sub>1\<^sub>1 tuple_BC" using fg gh csq(2) by blast show "Maps.dom SPN_fgh.\.leg0 = Maps.cod SPN_fgh.Prj\<^sub>1\<^sub>1" using fg gh SPN_f.dom.leg_simps(2) SPN_fgh.prj_simps(7) by auto show "SPN_fgh.\.leg0 \ SPN_fgh.Prj\<^sub>1\<^sub>1 = (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ tuple_BC" using 2 fg gh Maps.comp_assoc csq(2) Maps.prj_tuple [of SPN_fgh.\.leg0 SPN_fgh.\.leg1 SPN_fgh.Prj\<^sub>0\<^sub>1 SPN_fgh.Prj\<^sub>0] by blast qed show "SPN_fgh.Prj\<^sub>1 \ tuple_ABC = SPN_fgh.Prj\<^sub>1 \ Maps.CLS TTfgh_TfTgh.chine" proof - have "SPN_fgh.Prj\<^sub>1 \ tuple_ABC = SPN_fgh.Prj\<^sub>1\<^sub>1" using csq(2) by simp also have "... = \\Tfg.p\<^sub>1 \ TTfgh.p\<^sub>1\\" using prj_char by simp also have "... = \\TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine\\" using prj_chine(1) by simp also have "... = \\TfTgh.p\<^sub>1\\ \ \\TTfgh_TfTgh.chine\\" proof - have "is_left_adjoint TfTgh.p\<^sub>1" by (simp add: fg) moreover have "is_left_adjoint TTfgh_TfTgh.chine" using TTfgh_TfTgh.is_map by simp moreover have "TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine \ TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine" using fg gh isomorphic_reflexive by simp ultimately show ?thesis using Maps.comp_CLS [of TfTgh.p\<^sub>1 TTfgh_TfTgh.chine "TfTgh.p\<^sub>1 \ TTfgh_TfTgh.chine"] by simp qed also have "... = SPN_fgh.Prj\<^sub>1 \ Maps.CLS TTfgh_TfTgh.chine" using prj_char by simp finally show ?thesis by blast qed show "Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ tuple_ABC = Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\" proof - have "Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ tuple_ABC = tuple_BC" using csq(2) Maps.prj_tuple [of SPN_fgh.\.leg0 "SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1" SPN_fgh.Prj\<^sub>1\<^sub>1 tuple_BC] by simp also have "... = Maps.comp (Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (Maps.comp SPN_fgh.\.leg1 SPN_fgh.\\.prj\<^sub>1)) \\TTfgh_TfTgh.chine\\" proof (intro Maps.prj_joint_monic [of SPN_fgh.\.leg0 SPN_fgh.\.leg1 tuple_BC "Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\"]) show "Maps.cospan SPN_fgh.\.leg0 SPN_fgh.\.leg1" using SPN_fgh.\\.legs_form_cospan(1) by simp show "Maps.seq SPN_fgh.\\.prj\<^sub>1 tuple_BC" proof show "Maps.in_hom tuple_BC (Maps.MkIde (src TTfgh.p\<^sub>0)) (Maps.MkIde (src Tgh.p\<^sub>0))" using tuple_BC_in_hom by simp show "Maps.in_hom SPN_fgh.\\.prj\<^sub>1 (Maps.MkIde (src Tgh.p\<^sub>0)) SPN_fgh.\.apex" proof - have "Maps.pbdom SPN_fgh.\.leg0 SPN_fgh.\.leg1 = Maps.MkIde (src Tgh.p\<^sub>0)" using fg gh Maps.pbdom_def by (metis (no_types, lifting) SPN.preserves_ide SPN_fgh.\\.are_identities(2) SPN_fgh.\\.composable Span.chine_hcomp_ide_ide Tgh.chine_hcomp_SPN_SPN g.is_ide) thus ?thesis using SPN_fgh.\\.prj_in_hom(1) by simp qed qed show "Maps.seq SPN_fgh.\\.prj\<^sub>1 (Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\)" proof show "Maps.in_hom SPN_fgh.\\.prj\<^sub>1 (Maps.pbdom SPN_fgh.\.leg0 SPN_fgh.\.leg1) SPN_fgh.\.apex" using SPN_fgh.\\.prj_in_hom(1) by simp show "Maps.in_hom (Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\) \\src TTfgh_TfTgh.chine\\ (Maps.pbdom SPN_fgh.\.leg0 SPN_fgh.\.leg1)" proof show "Maps.in_hom \\TTfgh_TfTgh.chine\\ \\src TTfgh_TfTgh.chine\\ \\trg TTfgh_TfTgh.chine\\" using fg gh TTfgh_TfTgh.chine_in_hom Maps.CLS_in_hom TTfgh_TfTgh.is_map by blast show "Maps.in_hom (Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)) \\trg TTfgh_TfTgh.chine\\ (Maps.pbdom SPN_fgh.\.leg0 SPN_fgh.\.leg1)" proof show "Maps.cospan SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" using SPN_fgh.prj_in_hom(4) by blast show "\\trg TTfgh_TfTgh.chine\\ = Maps.pbdom SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" proof - have "\\trg TTfgh_TfTgh.chine\\ = Maps.MkIde (src TfTgh.p\<^sub>0)" by simp also have "... = Maps.pbdom SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" using 0 Maps.pbdom_def SPN_fgh.chine_composite(2) by presburger finally show ?thesis by blast qed show "Maps.pbdom SPN_fgh.\.leg0 SPN_fgh.\.leg1 = Maps.dom (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1)" using fg gh Maps.pbdom_def SPN_fgh.\\.apex_composite SPN_fgh.\\.dom.apex_def SPN_fgh.\\.dom.is_span SPN_fgh.\\.leg1_composite by presburger qed qed qed show "SPN_fgh.\\.prj\<^sub>0 \ tuple_BC = SPN_fgh.\\.prj\<^sub>0 \ Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\" proof - have "SPN_fgh.\\.prj\<^sub>0 \ tuple_BC = SPN_fgh.Prj\<^sub>0" using csq(1) by simp also have "... = SPN_fgh.\\.prj\<^sub>0 \ Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\" proof - have "SPN_fgh.\\.prj\<^sub>0 \ Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\ = \\Tgh.p\<^sub>0\\ \ \\TfTgh.p\<^sub>0\\ \ \\TTfgh_TfTgh.chine\\" using fg gh Tgh.\\.prj_char TfTgh.prj_char(1) isomorphic_reflexive Maps.comp_CLS [of "tab\<^sub>1 g" "prj\<^sub>1 (tab\<^sub>1 h) (tab\<^sub>0 g)" "tab\<^sub>1 g \ Tgh.p\<^sub>1"] by simp also have "... = \\Tgh.p\<^sub>0\\ \ \\TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\" using fg gh TTfgh_TfTgh.is_map isomorphic_reflexive Maps.comp_CLS [of TfTgh.p\<^sub>0 TTfgh_TfTgh.chine "TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine"] by simp also have "... = \\Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\" using fg gh TTfgh_TfTgh.is_map left_adjoints_compose isomorphic_reflexive Maps.comp_CLS [of Tgh.p\<^sub>0 "TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine" "Tgh.p\<^sub>0 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine"] by simp also have "... = \\TTfgh.p\<^sub>0\\" using prj_chine(3) by simp also have "... = SPN_fgh.Prj\<^sub>0" using prj_char by simp finally show ?thesis by argo qed finally show ?thesis by blast qed show "SPN_fgh.\\.prj\<^sub>1 \ tuple_BC = SPN_fgh.\\.prj\<^sub>1 \ Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\" proof - have "SPN_fgh.\\.prj\<^sub>1 \ tuple_BC = SPN_fgh.Prj\<^sub>0\<^sub>1" using csq(1) by simp also have "... = SPN_fgh.\\.prj\<^sub>1 \ Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\" proof - have "SPN_fgh.\\.prj\<^sub>1 \ Maps.PRJ\<^sub>0 SPN_fgh.\.leg0 (SPN_fgh.\.leg1 \ SPN_fgh.\\.prj\<^sub>1) \ \\TTfgh_TfTgh.chine\\ = \\Tgh.p\<^sub>1\\ \ \\TfTgh.p\<^sub>0\\ \ \\TTfgh_TfTgh.chine\\" using fg gh Tgh.\\.prj_char TfTgh.prj_char(1) isomorphic_reflexive Maps.comp_CLS [of "tab\<^sub>1 g" "prj\<^sub>1 (tab\<^sub>1 h) (tab\<^sub>0 g)" "tab\<^sub>1 g \ Tgh.p\<^sub>1"] by simp also have "... = \\Tgh.p\<^sub>1\\ \ \\TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\" using fg gh TTfgh_TfTgh.is_map isomorphic_reflexive Maps.comp_CLS [of TfTgh.p\<^sub>0 TTfgh_TfTgh.chine "TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine"] by simp also have "... = \\Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine\\" using fg gh TTfgh_TfTgh.is_map left_adjoints_compose isomorphic_reflexive Maps.comp_CLS [of Tgh.p\<^sub>1 "TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine" "Tgh.p\<^sub>1 \ TfTgh.p\<^sub>0 \ TTfgh_TfTgh.chine"] by simp also have "... = \\Tfg.p\<^sub>0 \ TTfgh.p\<^sub>1\\" using prj_chine(2) by simp also have "... = SPN_fgh.Prj\<^sub>0\<^sub>1" using prj_char by simp finally show ?thesis by argo qed finally show ?thesis by blast qed qed finally show ?thesis by simp qed qed thus ?thesis using SPN_fgh.chine_assoc_def by simp qed qed finally show ?thesis by simp qed text \ At long last, we can show associativity coherence for \SPN\. \ lemma assoc_coherence: shows "LHS = RHS" proof (intro Span.arr_eqI) show "Span.par LHS RHS" using par_LHS_RHS by blast show "Chn LHS = Chn RHS" proof - have "Chn LHS = \\HHfgh_HfHgh.chine\\ \ \\THfgh_HHfgh.chine\\ \ \\TTfgh_THfgh.chine\\" using Chn_LHS_eq by simp also have "... = \\HHfgh_HfHgh.chine \ THfgh_HHfgh.chine \ TTfgh_THfgh.chine\\" proof - have "\\THfgh_HHfgh.chine\\ \ \\TTfgh_THfgh.chine\\ = \\THfgh_HHfgh.chine \ TTfgh_THfgh.chine\\" using fg gh isomorphic_reflexive HHfgh_HfHgh.is_map THfgh_HHfgh.is_map TTfgh_THfgh.is_map left_adjoints_compose Maps.comp_CLS [of THfgh_HHfgh.chine TTfgh_THfgh.chine "THfgh_HHfgh.chine \ TTfgh_THfgh.chine"] by simp moreover have "\\HHfgh_HfHgh.chine\\ \ \\THfgh_HHfgh.chine \ TTfgh_THfgh.chine\\ = \\HHfgh_HfHgh.chine \ THfgh_HHfgh.chine \ TTfgh_THfgh.chine\\" proof - have "ide (HHfgh_HfHgh.chine \ THfgh_HHfgh.chine \ TTfgh_THfgh.chine)" proof - have "ide (THfgh_HHfgh.chine \ TTfgh_THfgh.chine)" using fg gh HHfgh_HfHgh.is_map THfgh_HHfgh.is_map TTfgh_THfgh.is_map left_adjoint_is_ide left_adjoints_compose by auto moreover have "src HHfgh_HfHgh.chine = trg (THfgh_HHfgh.chine \ TTfgh_THfgh.chine)" using fg gh HHfgh_HfHgh.chine_in_hom \_def by auto ultimately show ?thesis by simp qed thus ?thesis using fg gh isomorphic_reflexive HHfgh_HfHgh.is_map THfgh_HHfgh.is_map TTfgh_THfgh.is_map left_adjoints_compose Maps.comp_CLS [of HHfgh_HfHgh.chine "THfgh_HHfgh.chine \ TTfgh_THfgh.chine" "HHfgh_HfHgh.chine \ THfgh_HHfgh.chine \ TTfgh_THfgh.chine"] by auto qed ultimately show ?thesis by argo qed also have "... = \\TfHgh_HfHgh.chine \ TfTgh_TfHgh.chine \ TTfgh_TfTgh.chine\\" proof - interpret A: vertical_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \(f \ g) \ h\ TTfgh.tab \tab\<^sub>0 h \ TTfgh.p\<^sub>0\ \(tab\<^sub>1 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1\ \f \ g \ h\ TfTgh.tab \(tab\<^sub>0 h \ Tgh.p\<^sub>0) \ TfTgh.p\<^sub>0\ \tab\<^sub>1 f \ TfTgh.p\<^sub>1\ \f \ g \ h\ TfHgh.\\.tab \tab\<^sub>0 (g \ h) \ TfHgh.\\.p\<^sub>0\ \tab\<^sub>1 f \ TfHgh.\\.p\<^sub>1\ \\[f, g, h]\ \f \ g \ h\ .. interpret B: vertical_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \(f \ g) \ h\ TTfgh.tab \tab\<^sub>0 h \ TTfgh.p\<^sub>0\ \(tab\<^sub>1 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1\ \f \ g \ h\ TfHgh.\\.tab \tab\<^sub>0 (g \ h) \ TfHgh.\\.p\<^sub>0\ \tab\<^sub>1 f \ TfHgh.\\.p\<^sub>1\ \f \ g \ h\ HfHgh.tab \tab\<^sub>0 (f \ g \ h)\ \tab\<^sub>1 (f \ g \ h)\ \\[f, g, h]\ \f \ g \ h\ using fg gh by unfold_locales auto interpret C: vertical_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \(f \ g) \ h\ THfgh.\\.tab \tab\<^sub>0 h \ THfgh.\\.p\<^sub>0\ \tab\<^sub>1 (f \ g) \ THfgh.\\.p\<^sub>1\ \(f \ g) \ h\ HHfgh.tab \tab\<^sub>0 ((f \ g) \ h)\ \tab\<^sub>1 ((f \ g) \ h)\ \f \ g \ h\ HfHgh.tab \tab\<^sub>0 (f \ g \ h)\ \tab\<^sub>1 (f \ g \ h)\ \(f \ g) \ h\ \\[f, g, h]\ using fg gh by unfold_locales auto interpret D: vertical_composite_of_arrows_of_tabulations_in_maps V H \ \ src trg \(f \ g) \ h\ TTfgh.tab \tab\<^sub>0 h \ TTfgh.p\<^sub>0\ \(tab\<^sub>1 f \ Tfg.p\<^sub>1) \ TTfgh.p\<^sub>1\ \(f \ g) \ h\ THfgh.\\.tab \tab\<^sub>0 h \ THfgh.\\.p\<^sub>0\ \tab\<^sub>1 (f \ g) \ THfgh.\\.p\<^sub>1\ \f \ g \ h\ HfHgh.tab \tab\<^sub>0 (f \ g \ h)\ \tab\<^sub>1 (f \ g \ h)\ \(f \ g) \ h\ \\[f, g, h]\ using fg gh by unfold_locales auto have "HHfgh_HfHgh.chine \ THfgh_HHfgh.chine \ TTfgh_THfgh.chine \ D.chine" proof - have "D.chine \ D.\.chine \ TTfgh_THfgh.chine" using D.chine_char by simp also have "... \ C.chine \ TTfgh_THfgh.chine" using fg gh comp_arr_dom isomorphic_reflexive by simp also have "... \ (C.\.chine \ THfgh_HHfgh.chine) \ TTfgh_THfgh.chine" using C.chine_char hcomp_isomorphic_ide by simp also have "... \ (HHfgh_HfHgh.chine \ THfgh_HHfgh.chine) \ TTfgh_THfgh.chine" proof - have "C.\.chine = HHfgh_HfHgh.chine" using fg gh comp_arr_dom comp_cod_arr \_def by simp hence "isomorphic C.\.chine HHfgh_HfHgh.chine" using isomorphic_reflexive by simp thus ?thesis using hcomp_isomorphic_ide by simp qed also have "... \ HHfgh_HfHgh.chine \ THfgh_HHfgh.chine \ TTfgh_THfgh.chine" proof - have "ide HHfgh_HfHgh.chine \ ide THfgh_HHfgh.chine \ ide TTfgh_THfgh.chine" by simp moreover have "src HHfgh_HfHgh.chine = trg THfgh_HHfgh.chine \ src THfgh_HHfgh.chine = trg TTfgh_THfgh.chine" using fg gh HHfgh_HfHgh.chine_in_hom THfgh_HHfgh.chine_in_hom TTfgh_THfgh.chine_in_hom \_def by auto ultimately show ?thesis using fg gh iso_assoc isomorphic_def assoc_in_hom [of HHfgh_HfHgh.chine THfgh_HHfgh.chine TTfgh_THfgh.chine] by auto qed finally show ?thesis using isomorphic_symmetric by blast qed also have "... \ B.chine" proof - have "D.chine = B.chine" using fg gh comp_arr_dom comp_cod_arr by simp thus ?thesis using isomorphic_reflexive by simp qed also have "... \ TfHgh_HfHgh.chine \ TfTgh_TfHgh.chine \ TTfgh_TfTgh.chine" proof - have "B.chine \ TfHgh_HfHgh.chine \ B.\.chine" using B.chine_char by simp also have "... \ TfHgh_HfHgh.chine \ A.chine" using fg gh comp_cod_arr isomorphic_reflexive by simp also have "... \ TfHgh_HfHgh.chine \ TfTgh_TfHgh.chine \ TTfgh_TfTgh.chine" using A.chine_char hcomp_ide_isomorphic by simp finally show ?thesis by blast qed finally have "HHfgh_HfHgh.chine \ THfgh_HHfgh.chine \ TTfgh_THfgh.chine \ TfHgh_HfHgh.chine \ TfTgh_TfHgh.chine \ TTfgh_TfTgh.chine" by blast thus ?thesis using fg gh Maps.CLS_eqI isomorphic_implies_hpar(1) by blast qed also have "... = \\TfHgh_HfHgh.chine\\ \ \\TfTgh_TfHgh.chine\\ \ \\TTfgh_TfTgh.chine\\" using fg gh isomorphic_reflexive TfTgh_TfHgh.is_map TfHgh_HfHgh.is_map TTfgh_TfTgh.is_map left_adjoints_compose Maps.comp_CLS [of TfTgh_TfHgh.chine TTfgh_TfTgh.chine "TfTgh_TfHgh.chine \ TTfgh_TfTgh.chine"] Maps.comp_CLS [of TfHgh_HfHgh.chine "TfTgh_TfHgh.chine \ TTfgh_TfTgh.chine" "TfHgh_HfHgh.chine \ TfTgh_TfHgh.chine \ TTfgh_TfTgh.chine"] by simp also have "... = Chn RHS" using Chn_RHS_eq CLS_chine tuple_ABC_eq_ABC'(2) by simp finally show ?thesis by blast qed qed end subsubsection "SPN is an Equivalence Pseudofunctor" context bicategory_of_spans begin interpretation Maps: maps_category V H \ \ src trg .. interpretation Span: span_bicategory Maps.comp Maps.PRJ\<^sub>0 Maps.PRJ\<^sub>1 .. no_notation Fun.comp (infixl "\" 55) notation Span.vcomp (infixr "\" 55) notation Span.hcomp (infixr "\" 53) notation Maps.comp (infixr "\" 55) notation isomorphic (infix "\" 50) interpretation SPN: "functor" V Span.vcomp SPN using SPN_is_functor by simp interpretation SPN: weak_arrow_of_homs V src trg Span.vcomp Span.src Span.trg SPN using SPN_is_weak_arrow_of_homs by simp interpretation HoSPN_SPN: composite_functor VV.comp Span.VV.comp Span.vcomp SPN.FF \\\\. Span.hcomp (fst \\) (snd \\)\ .. interpretation SPNoH: composite_functor VV.comp V Span.vcomp \\\\. fst \\ \ snd \\\ SPN .. interpretation \: transformation_by_components VV.comp Span.vcomp HoSPN_SPN.map SPNoH.map \\rs. CMP (fst rs) (snd rs)\ using compositor_is_natural_transformation by simp interpretation \: natural_isomorphism VV.comp Span.vcomp HoSPN_SPN.map SPNoH.map \.map using compositor_is_natural_isomorphism by simp abbreviation \ where "\ \ \.map" interpretation SPN: pseudofunctor V H \ \ src trg Span.vcomp Span.hcomp Span.assoc Span.unit Span.src Span.trg SPN \ proof show "\f g h. \ ide f; ide g; ide h; src f = trg g; src g = trg h \ \ SPN \[f, g, h] \ \ (f \ g, h) \ (\ (f, g) \ SPN h) = \ (f, g \ h) \ (SPN f \ \ (g, h)) \ Span.assoc (SPN f) (SPN g) (SPN h)" proof - fix f g h assume f: "ide f" and g: "ide g" and h: "ide h" assume fg: "src f = trg g" and gh: "src g = trg h" interpret fgh: three_composable_identities_in_bicategory_of_spans V H \ \ src trg f g h using f g h fg gh by (unfold_locales, simp) show "fgh.LHS = fgh.RHS" using fgh.assoc_coherence by simp qed qed lemma SPN_is_pseudofunctor: shows "pseudofunctor V H \ \ src trg Span.vcomp Span.hcomp Span.assoc Span.unit Span.src Span.trg SPN \" .. interpretation SPN: equivalence_pseudofunctor V H \ \ src trg Span.vcomp Span.hcomp Span.assoc Span.unit Span.src Span.trg SPN \ proof show "\\ \'. \par \ \'; SPN \ = SPN \'\ \ \ = \'" proof - fix \ \' assume par: "par \ \'" assume eq: "SPN \ = SPN \'" interpret dom_\: identity_in_bicategory_of_spans V H \ \ src trg \dom \\ using par apply unfold_locales by auto interpret cod_\: identity_in_bicategory_of_spans V H \ \ src trg \cod \\ using par apply unfold_locales by auto interpret \: arrow_of_tabulations_in_maps V H \ \ src trg \dom \\ \tab_of_ide (dom \)\ \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \cod \\ \tab_of_ide (cod \)\ \tab\<^sub>0 (cod \)\ \tab\<^sub>1 (cod \)\ \ using par apply unfold_locales by auto interpret \: arrow_in_bicategory_of_spans V H \ \ src trg \dom \\ \cod \\ \ using par apply unfold_locales by auto interpret \': arrow_of_tabulations_in_maps V H \ \ src trg \dom \\ \tab_of_ide (dom \)\ \tab\<^sub>0 (dom \)\ \tab\<^sub>1 (dom \)\ \cod \\ \tab_of_ide (cod \)\ \tab\<^sub>0 (cod \)\ \tab\<^sub>1 (cod \)\ \' using par apply unfold_locales by auto interpret \': arrow_in_bicategory_of_spans V H \ \ src trg \dom \\ \cod \\ \' using par apply unfold_locales by auto have "\.chine \ \'.chine" using par eq SPN_def spn_def Maps.CLS_eqI \.is_ide by auto hence "\.\ = \'.\" using \.\_naturality \'.\_naturality by (metis \.\_simps(4) \'.\_simps(4) \.chine_is_induced_map \'.chine_is_induced_map \.induced_map_preserved_by_iso) thus "\ = \'" using par \.\_in_terms_of_\ \'.\_in_terms_of_\ by metis qed show "\a'. Span.obj a' \ \a. obj a \ Span.equivalent_objects (SPN.map\<^sub>0 a) a'" proof - fix a' assume a': "Span.obj a'" let ?a = "Maps.Dom (Chn a')" have a: "obj ?a" using a' Span.obj_char Span.ide_char Maps.ide_char by blast moreover have "Span.equivalent_objects (SPN.map\<^sub>0 ?a) a'" proof - have "SPN.map\<^sub>0 ?a = a'" proof (intro Span.arr_eqI) have "Chn (SPN.map\<^sub>0 ?a) = Chn (Span.src (SPN ?a))" using a a' by auto also have "... = Maps.MkIde (Maps.Dom (Chn a'))" proof - have "Maps.arr \\tab\<^sub>0 (dom (Maps.Dom (Chn a')))\\" proof - have "is_left_adjoint (tab\<^sub>0 (dom (Maps.Dom (Chn a'))))" using a by auto thus ?thesis using Maps.CLS_in_hom by auto qed moreover have "arr (Maps.Dom (Chn a'))" using a by auto moreover have "Span.arr (SPN (Maps.Dom (Chn a')))" using a a' SPN_in_hom by auto ultimately show ?thesis using a a' SPN_def Span.src_def Maps.cod_char obj_simps(2) by simp qed also have "... = Chn a'" using a' Maps.MkIde_Dom Span.obj_char Span.ide_char by simp finally show "Chn (SPN.map\<^sub>0 ?a) = Chn a'" by simp show "Span.par (SPN.map\<^sub>0 (Maps.Dom (Chn a'))) a'" using a a' Span.obj_char apply (intro conjI) using SPN.map\<^sub>0_simps(1) Span.obj_def apply blast apply simp apply (metis (no_types, lifting) SPN.map\<^sub>0_def SPN.preserves_arr Span.obj_src \Chn (SPN.map\<^sub>0 (Maps.Dom (Chn a'))) = Chn a'\ obj_def) by (metis (no_types, lifting) SPN.map\<^sub>0_def SPN.preserves_arr Span.obj_src \Chn (SPN.map\<^sub>0 (Maps.Dom (Chn a'))) = Chn a'\ obj_def) qed thus ?thesis using Span.equivalent_objects_reflexive by (simp add: a') qed ultimately show "\a. obj a \ Span.equivalent_objects (SPN.map\<^sub>0 a) a'" by auto qed show "\a b g. \obj a; obj b; Span.in_hhom g (SPN.map\<^sub>0 a) (SPN.map\<^sub>0 b); Span.ide g\ \ \f. \f : a \ b\ \ ide f \ Span.isomorphic (SPN f) g" proof - fix a b g assume a: "obj a" and b: "obj b" and g_in_hhom: "Span.in_hhom g (SPN.map\<^sub>0 a) (SPN.map\<^sub>0 b)" and ide_g: "Span.ide g" have arr_a: "arr a" using a by auto have arr_b: "arr b" using b by auto show "\f. \f : a \ b\ \ ide f \ Span.isomorphic (SPN f) g" proof - interpret g: arrow_of_spans Maps.comp g using ide_g Span.ide_char by blast interpret g: identity_arrow_of_spans Maps.comp g using ide_g Span.ide_char by unfold_locales auto interpret REP_leg0: map_in_bicategory V H \ \ src trg \Maps.REP g.leg0\ using Maps.REP_in_Map [of g.leg0] by unfold_locales auto have 0: "\Maps.REP g.leg0 : src (Maps.REP g.apex) \ Maps.Cod g.leg0\" using g.dom.leg_in_hom Maps.REP_in_hhom by (metis (no_types, lifting) Maps.Dom_cod Maps.REP_simps(2) Maps.arr_cod g.dom.leg_simps(1)) have 1: "\Maps.REP g.leg1 : src (Maps.REP g.apex) \ Maps.Cod g.leg1\" using g.dom.leg_in_hom Maps.REP_in_hhom by (metis (no_types, lifting) Maps.Dom_cod Maps.REP_simps(2) Maps.arr_cod g.dom.leg_simps(3)) let ?f = "Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*" have f_in_hhom: "\?f : a \ b\" proof show "\Maps.REP g.leg1 : src (Maps.REP g.apex) \ b\" proof - have "\Maps.REP g.leg1 : src (Maps.REP g.apex) \ Maps.Cod g.leg1\" using 1 by simp moreover have "Maps.Cod g.leg1 = b" proof - have "src (Maps.REP g.dtrg) = src (Maps.REP (Leg0 (Dom (SPN.map\<^sub>0 b))))" using g_in_hhom Span.trg_def [of g] by auto also have "... = src (Maps.REP (Maps.cod \\tab\<^sub>0 b\\))" using b arr_b SPN.map\<^sub>0_def Span.src_def SPN_in_hom by auto also have "... = src (Maps.REP \\trg (tab\<^sub>0 b)\\)" using b Maps.CLS_in_hom [of "tab\<^sub>0 b"] by force also have "... = src (Maps.REP \\b\\)" using b by fastforce also have "... = b" using b obj_simps by auto finally show ?thesis by simp qed ultimately show ?thesis by argo qed show "\(Maps.REP g.leg0)\<^sup>* : a \ src (Maps.REP g.apex)\" proof - have "\Maps.REP g.leg0 : src (Maps.REP g.apex) \ a\" proof - have "src (Maps.REP g.dsrc) = src (Maps.REP (Leg0 (Dom (SPN.map\<^sub>0 a))))" using g_in_hhom Span.src_def [of g] by auto also have "... = src (Maps.REP (Maps.cod \\tab\<^sub>0 a\\))" using a arr_a SPN.map\<^sub>0_def Span.src_def SPN_in_hom by auto also have "... = src (Maps.REP \\trg (tab\<^sub>0 a)\\)" using a Maps.CLS_in_hom [of "tab\<^sub>0 a"] by force also have "... = src (Maps.REP \\a\\)" using a by fastforce also have "... = a" using a obj_simps by auto finally show ?thesis by fast qed thus ?thesis using REP_leg0.antipar REP_leg0.ide_right apply (intro in_hhomI) by auto qed qed moreover have ide_f: "ide ?f" using REP_leg0.antipar f_in_hhom by fastforce moreover have "Span.isomorphic (SPN ?f) g" proof - have SPN_f_eq: "SPN ?f = \Chn = \\spn ?f\\, Dom = \Leg0 = \\tab\<^sub>0 ?f\\, Leg1 = \\tab\<^sub>1 ?f\\\, Cod = \Leg0 = \\tab\<^sub>0 ?f\\, Leg1 = \\tab\<^sub>1 ?f\\\\" using calculation(1) SPN_def [of ?f] REP_leg0.antipar by auto text \ We need an invertible arrow of spans from \SPN f\ to \g\. There exists a tabulation \(REP g.leg0, \, REP g.leg1)\ of \f\. There is also a tabulation \(tab\<^sub>0 f, \', tab\<^sub>1 f) of f\. As these are tabulations of the same arrow, they are equivalent. This yields an equivalence map which is an arrow of spans from \(tab\<^sub>0 f, tab\<^sub>1 f)\ to \(REP g.leg0, \, REP g.leg1)\. Its isomorphism class is an invertible arrow of spans in maps from \(CLS (tab\<^sub>0 f), CLS (tab\<^sub>1 f))\ to \(g.leg0, g.leg1)\. \ interpret f: identity_in_bicategory_of_spans V H \ \ src trg ?f using ide_f apply unfold_locales by auto interpret f: arrow_of_tabulations_in_maps V H \ \ src trg ?f f.tab \tab\<^sub>0 ?f\ \tab\<^sub>1 ?f\ ?f f.tab \tab\<^sub>0 ?f\ \tab\<^sub>1 ?f\ ?f using f.is_arrow_of_tabulations_in_maps by simp interpret g: span_of_maps V H \ \ src trg \Maps.REP g.leg0\ \Maps.REP g.leg1\ using Span.arr_char by (unfold_locales, blast+) have 2: "src (Maps.REP g.leg0) = src (Maps.REP g.leg1)" using 0 1 by fastforce hence "\\. tabulation (\) (\) \ \ src trg ?f \ (Maps.REP g.leg0) (Maps.REP g.leg1)" using BS2' [of "Maps.REP g.leg0" "Maps.REP g.leg1" ?f] isomorphic_reflexive Span.arr_char by auto hence "tabulation V H \ \ src trg ?f (REP_leg0.trnr\<^sub>\ (Maps.REP g.leg1) ?f) (Maps.REP g.leg0) (Maps.REP g.leg1)" using 2 REP_leg0.canonical_tabulation [of "Maps.REP g.leg1"] by auto hence 3: "\w w' \ \ \ \ \' \'. equivalence_in_bicategory (\) (\) \ \ src trg w' w \ \ \ \w : src (tab\<^sub>0 ?f) \ src (Maps.REP g.leg0)\ \ \w' : src (Maps.REP g.leg0) \ src (tab\<^sub>0 ?f)\ \ \\ : Maps.REP g.leg0 \ w \ tab\<^sub>0 ?f\ \ \\ : tab\<^sub>1 ?f \ Maps.REP g.leg1 \ w\ \ iso \ \ f.tab = (?f \ \) \ \[?f, Maps.REP g.leg0, w] \ (REP_leg0.trnr\<^sub>\ (Maps.REP g.leg1) ?f \ w) \ \ \ \\' : tab\<^sub>0 ?f \ w' \ Maps.REP g.leg0\ \ \\' : Maps.REP g.leg1 \ tab\<^sub>1 ?f \ w'\ \ iso \' \ REP_leg0.trnr\<^sub>\ (Maps.REP g.leg1) ?f = (?f \ \') \ \[?f, tab\<^sub>0 ?f, w'] \ (f.tab \ w') \ \'" using f.apex_unique_up_to_equivalence [of "REP_leg0.trnr\<^sub>\ (Maps.REP g.leg1) ?f" "Maps.REP g.leg0" "Maps.REP g.leg1"] by simp obtain w w' \ \ \ \ \' \' where 4: "equivalence_in_bicategory (\) (\) \ \ src trg w' w \ \ \ \w : src (tab\<^sub>0 ?f) \ src (Maps.REP g.leg0)\ \ \w' : src (Maps.REP g.leg0) \ src (tab\<^sub>0 ?f)\ \ \\ : Maps.REP g.leg0 \ w \ tab\<^sub>0 ?f\ \ \\ : tab\<^sub>1 ?f \ Maps.REP g.leg1 \ w\ \ iso \ \ f.tab = (?f \ \) \ \[?f, Maps.REP g.leg0, w] \ (REP_leg0.trnr\<^sub>\ (Maps.REP g.leg1) ?f \ w) \ \ \ \\' : tab\<^sub>0 ?f \ w' \ Maps.REP g.leg0\ \ \\' : Maps.REP g.leg1 \ tab\<^sub>1 ?f \ w'\ \ iso \' \ REP_leg0.trnr\<^sub>\ (Maps.REP g.leg1) ?f = (?f \ \') \ \[?f, tab\<^sub>0 ?f, w'] \ (f.tab \ w') \ \'" using 3 by meson hence w\\: "equivalence_map w \ \w : src (tab\<^sub>0 ?f) \ src (Maps.REP g.leg0)\ \ \\ : Maps.REP g.leg0 \ w \ tab\<^sub>0 ?f\ \ \\ : tab\<^sub>1 ?f \ Maps.REP g.leg1 \ w\ \ iso \" using equivalence_map_def quasi_inverses_def quasi_inverses_symmetric by meson let ?W = "\Chn = \\w\\, Dom = Dom (SPN ?f), Cod = Dom g\" have W_in_hom: "Span.in_hom ?W (SPN ?f) g" proof have "arrow_of_spans Maps.comp ?W" proof interpret Dom_W: span_in_category Maps.comp \Dom ?W\ proof (unfold_locales, intro conjI) show "Maps.arr (Leg0 (Dom ?W))" apply (intro Maps.arrI) apply auto by (metis f.base_simps(2) f.satisfies_T0 f.u_in_hom src_hcomp) show "Maps.arr (Leg1 (Dom ?W))" using 1 apply (intro Maps.arrI) apply auto proof - let ?f = "tab\<^sub>1 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)" assume 1: "\Maps.REP g.leg1 : Maps.Dom g.apex \ Maps.Cod g.leg1\" have "\?f : src (tab\<^sub>0 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)) \ Maps.Cod g.leg1\ \ is_left_adjoint ?f \ \tab\<^sub>1 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)\ = \?f\" using 1 by simp thus "\f. \f : src (tab\<^sub>0 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)) \ Maps.Cod g.leg1\ \ is_left_adjoint f \ \tab\<^sub>1 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)\ = \f\" by blast qed show "Maps.dom (Leg0 (Dom ?W)) = Maps.dom (Leg1 (Dom ?W))" proof - have "Maps.dom (Leg0 (Dom ?W)) = Maps.MkIde (src (tab\<^sub>0 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)))" using Maps.dom_char apply simp by (metis (no_types, lifting) Maps.CLS_in_hom Maps.in_homE f.base_simps(2) f.satisfies_T0 f.u_simps(3) hcomp_simps(1)) also have "... = Maps.dom (Leg1 (Dom ?W))" using Maps.dom_char Maps.CLS_in_hom f.leg1_is_map f_in_hhom apply simp by (metis (no_types, lifting) Maps.in_homE Maps.REP_simps(3) f.base_simps(2) f.leg1_is_map f.leg1_simps(3) f.leg1_simps(4) g.dom.leg_simps(3) trg_hcomp) finally show ?thesis by blast qed qed show "Maps.span (Leg0 (Dom ?W)) (Leg1 (Dom ?W))" using Dom_W.span_in_category_axioms Dom_W.is_span by blast interpret Cod_W: span_in_category Maps.comp \Cod ?W\ apply unfold_locales by fastforce show "Maps.span (Leg0 (Cod ?W)) (Leg1 (Cod ?W))" by fastforce show "Maps.in_hom (Chn ?W) Dom_W.apex Cod_W.apex" proof show 1: "Maps.arr (Chn ?W)" using w\\ Maps.CLS_in_hom [of w] equivalence_is_adjoint by auto show "Maps.dom (Chn ?W) = Dom_W.apex" proof - have "Maps.dom (Chn ?W) = Maps.MkIde (src w)" using 1 w\\ Maps.dom_char by simp also have "... = Dom_W.apex" proof - have "src w = src (tab\<^sub>0 ?f)" using w\\ by blast thus ?thesis using Dom_W.apex_def Maps.arr_char Maps.dom_char apply simp by (metis (no_types, lifting) f.base_simps(2) f.satisfies_T0 f.u_in_hom hcomp_simps(1)) qed finally show ?thesis by fastforce qed show "Maps.cod (Chn ?W) = Cod_W.apex" proof - have "Maps.cod (Chn ?W) = Maps.MkIde (trg w)" using 1 w\\ Maps.cod_char by simp also have "... = Cod_W.apex" proof - have "trg w = src (Maps.REP g.leg0)" using w\\ by blast thus ?thesis using Cod_W.apex_def Maps.arr_char Maps.cod_char apply simp using g.dom.apex_def Maps.dom_char Maps.REP_simps(2) g.dom.is_span by presburger qed finally show ?thesis by fastforce qed qed show "Cod_W.leg0 \ Chn ?W = Dom_W.leg0" proof - have "Cod_W.leg0 \ Chn ?W = g.leg0 \ \\w\\" by simp also have "... = \\Maps.REP g.leg0\\ \ \\w\\" using g.dom.leg_simps(1) Maps.CLS_REP [of g.leg0] by simp also have "... = \\Maps.REP g.leg0 \ w\\" proof - have "is_left_adjoint (Maps.REP g.leg0)" by fast moreover have "is_left_adjoint w" using w\\ equivalence_is_adjoint by simp moreover have "Maps.REP g.leg0 \ w \ Maps.REP g.leg0 \ w" using w\\ isomorphic_reflexive Maps.REP_in_hhom by (metis (no_types, lifting) REP_leg0.ide_left adjoint_pair_antipar(1) calculation(2) ide_hcomp in_hhomE) ultimately show ?thesis using w\\ Maps.comp_CLS isomorphic_reflexive equivalence_is_adjoint by blast qed also have "... = \\tab\<^sub>0 ?f\\" proof - have "iso \" proof - have "is_left_adjoint (Maps.REP g.leg0 \ w)" using w\\ equivalence_is_adjoint Maps.REP_in_hhom by (simp add: g.leg0_is_map in_hhom_def left_adjoints_compose) moreover have "is_left_adjoint (tab\<^sub>0 ?f)" by simp ultimately show ?thesis using w\\ BS3 by blast qed thus ?thesis using w\\ Maps.CLS_eqI equivalence_is_adjoint by (meson isomorphic_def isomorphic_implies_hpar(1)) qed finally show ?thesis by fastforce qed show "Cod_W.leg1 \ Chn ?W = Dom_W.leg1" proof - have "Cod_W.leg1 \ Chn ?W = g.leg1 \ \\w\\" by simp also have "... = \\Maps.REP g.leg1\\ \ \\w\\" using g.dom.leg_simps(3) Maps.CLS_REP by presburger also have "... = \\Maps.REP g.leg1 \ w\\" proof - have "is_left_adjoint (Maps.REP g.leg1)" by fast moreover have "is_left_adjoint w" using w\\ equivalence_is_adjoint by simp moreover have "Maps.REP g.leg1 \ w \ Maps.REP g.leg1 \ w" using w\\ isomorphic_reflexive Maps.REP_in_hhom by (metis (no_types, lifting) "2" calculation(2) g.dom.is_span hcomp_ide_isomorphic Maps.ide_REP in_hhomE right_adjoint_determines_left_up_to_iso) ultimately show ?thesis using w\\ Maps.comp_CLS isomorphic_reflexive equivalence_is_adjoint by blast qed also have "... = \\tab\<^sub>1 ?f\\" proof - have "ide (Maps.REP g.leg1 \ w)" using 2 w\\ equivalence_map_is_ide by auto moreover have "Maps.REP g.leg1 \ w \ tab\<^sub>1 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)" using w\\ equivalence_is_adjoint f.leg1_is_map right_adjoint_determines_left_up_to_iso adjoint_pair_preserved_by_iso by (meson adjoint_pair_antipar(2) ide_in_hom(2) ide_is_iso) ultimately show ?thesis using Maps.CLS_eqI by blast qed finally show ?thesis by fastforce qed qed thus W: "Span.arr ?W" using Span.arr_char by blast interpret Dom_W: span_in_category Maps.comp \\Leg0 = Maps.MkArr (src (tab\<^sub>0 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*))) (src (Maps.REP g.leg0)\<^sup>*) (iso_class (tab\<^sub>0 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*))), Leg1 = Maps.MkArr (src (tab\<^sub>0 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*))) (Maps.Cod g.leg1) (iso_class (tab\<^sub>1 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)))\\ using W Span.arr_char by (simp add: arrow_of_spans_def) interpret Cod_W: span_in_category Maps.comp \Cod ?W\ using W Span.arr_char by (simp add: arrow_of_spans_def) show "Span.dom ?W = SPN ?f" proof - have "Span.dom ?W = \Chn = Dom_W.apex, Dom = \Leg0 = \\tab\<^sub>0 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)\\, Leg1 = \\tab\<^sub>1 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)\\\, Cod = \Leg0 = \\tab\<^sub>0 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)\\, Leg1 = \\tab\<^sub>1 (Maps.REP g.leg1 \ (Maps.REP g.leg0)\<^sup>*)\\\\" using 0 W Span.dom_char by simp also have "... = SPN ?f" using SPN_def Dom_W.apex_def Maps.dom_char Dom_W.is_span iso_class_eqI spn_ide apply simp using ide_f by blast finally show ?thesis by blast qed show "Span.cod ?W = g" using 0 W Span.cod_char Cod_W.apex_def by simp qed moreover have "Span.iso ?W" proof - have "Maps.iso \\w\\" proof - have "Maps.arr \\w\\ \ w \ Maps.Map \\w\\ \ equivalence_map w" proof (intro conjI) show 1: "Maps.arr \\w\\" using w\\ Maps.CLS_in_hom equivalence_is_adjoint by blast show "equivalence_map w" using w\\ by blast show "w \ Maps.Map \\w\\" using 1 w\\ equivalence_is_adjoint Maps.arr_char by (simp add: equivalence_map_is_ide ide_in_iso_class) qed thus ?thesis using Maps.iso_char' by blast qed thus ?thesis using w\\ W_in_hom Span.iso_char by auto qed ultimately show ?thesis using Span.isomorphic_def by blast qed ultimately show ?thesis by blast qed qed show "\r s \. \ide r; ide s; src r = src s; trg r = trg s; Span.in_hom \ (SPN r) (SPN s)\ \ \\. \\ : r \ s\ \ SPN \ = \" proof - fix r s \ assume r: "ide r" and s: "ide s" assume src_eq: "src r = src s" and trg_eq: "trg r = trg s" assume \: "Span.in_hom \ (SPN r) (SPN s)" interpret \: arrow_of_spans Maps.comp \ using \ Span.arr_char by auto interpret r: identity_in_bicategory_of_spans V H \ \ src trg r using r by unfold_locales auto interpret s: identity_in_bicategory_of_spans V H \ \ src trg s using s by unfold_locales auto interpret s: arrow_of_tabulations_in_maps V H \ \ src trg s s.tab \tab\<^sub>0 s\ \tab\<^sub>1 s\ s s.tab \tab\<^sub>0 s\ \tab\<^sub>1 s\ s using s.is_arrow_of_tabulations_in_maps by simp have \_dom_leg0_eq: "\.dom.leg0 = \\tab\<^sub>0 r\\" using \ Span.dom_char SPN_def [of r] by auto have \_dom_leg1_eq: "\.dom.leg1 = \\tab\<^sub>1 r\\" using \ Span.dom_char SPN_def [of r] by auto have \_cod_leg0_eq: "\.cod.leg0 = \\tab\<^sub>0 s\\" using \ Span.cod_char SPN_def [of s] by auto have \_cod_leg1_eq: "\.cod.leg1 = \\tab\<^sub>1 s\\" using \ Span.cod_char SPN_def [of s] by auto have 1: "tab\<^sub>0 s \ Maps.REP \.chine \ tab\<^sub>0 r" proof - have "tab\<^sub>0 s \ Maps.REP \.chine \ Maps.REP \.cod.leg0 \ Maps.REP \.chine" proof - have "Maps.REP \.cod.leg0 \ tab\<^sub>0 s" using \_cod_leg0_eq Maps.CLS_REP Maps.CLS_eqI Maps.REP_CLS s.satisfies_T0 by presburger moreover have "src (tab\<^sub>0 s) = trg (Maps.REP \.chine)" using Maps.seq_char [of "\\tab\<^sub>0 s\\" \.chine] \.cod.leg_simps(1) \.leg0_commutes \_cod_leg0_eq by auto ultimately show ?thesis using hcomp_isomorphic_ide [of "tab\<^sub>0 s" "Maps.REP \.cod.leg0" "Maps.REP \.chine"] isomorphic_symmetric by fastforce qed also have "... \ Maps.REP \.dom.leg0" proof - have "\\Maps.REP \.cod.leg0\\ \ \\Maps.REP \.chine\\ = \\Maps.REP \.dom.leg0\\" using \.leg0_commutes Maps.CLS_REP \.chine_simps(1) \.cod.leg_simps(1) \.dom.leg_simps(1) by presburger hence "\\Maps.REP \.cod.leg0 \ Maps.REP \.chine\\ = \\Maps.REP \.dom.leg0\\" using Maps.comp_CLS [of "Maps.REP \.cod.leg0" "Maps.REP \.chine" "Maps.REP \.cod.leg0 \ Maps.REP \.chine"] isomorphic_reflexive by (metis (no_types, lifting) Maps.seq_char Maps.REP_in_hhom(2) Maps.REP_simps(2-3) \.chine_in_hom \.cod.leg_in_hom(1) \.dom.leg_simps(1) \.leg0_commutes ide_hcomp Maps.ide_REP) thus ?thesis using Maps.CLS_eqI Maps.seq_char Maps.ide_REP by (meson calculation isomorphic_implies_ide(2)) qed also have "... \ tab\<^sub>0 r" using \_dom_leg0_eq Maps.CLS_REP Maps.CLS_eqI Maps.REP_CLS r.satisfies_T0 by presburger finally show ?thesis by blast qed obtain \ where \: "\\ : tab\<^sub>0 s \ Maps.REP \.chine \ tab\<^sub>0 r\ \ iso \" using 1 by blast have 2: "tab\<^sub>1 s \ Maps.REP \.chine \ tab\<^sub>1 r" proof - have "tab\<^sub>1 s \ Maps.REP \.chine \ Maps.REP \.cod.leg1 \ Maps.REP \.chine" proof - have "Maps.REP \.cod.leg1 \ tab\<^sub>1 s" using \_cod_leg1_eq Maps.CLS_REP Maps.CLS_eqI Maps.REP_CLS s.leg1_is_map by presburger moreover have "src (Maps.REP \.cod.leg1) = trg (Maps.REP \.chine)" using Maps.seq_char by auto ultimately show ?thesis using hcomp_isomorphic_ide [of "Maps.REP \.cod.leg1" "tab\<^sub>1 s" "Maps.REP \.chine"] isomorphic_symmetric by fastforce qed also have "... \ Maps.REP \.dom.leg1" proof - have "\\Maps.REP \.cod.leg1\\ \ \\Maps.REP \.chine\\ = \\Maps.REP \.dom.leg1\\" using \.leg1_commutes Maps.CLS_REP \.chine_simps(1) \.cod.leg_simps(3) \.dom.leg_simps(3) by presburger hence "\\Maps.REP \.cod.leg1 \ Maps.REP \.chine\\ = \\Maps.REP \.dom.leg1\\" using Maps.comp_CLS [of "Maps.REP \.cod.leg1" "Maps.REP \.chine" "Maps.REP \.cod.leg1 \ Maps.REP \.chine"] isomorphic_reflexive by (metis (no_types, lifting) Maps.seq_char Maps.REP_in_hhom(2) Maps.REP_simps(2) Maps.REP_simps(3) \.chine_in_hom \.cod.leg_in_hom(2) \.dom.leg_simps(3) \.leg1_commutes ide_hcomp Maps.ide_REP) thus ?thesis using Maps.CLS_eqI Maps.seq_char Maps.ide_REP by (meson calculation isomorphic_implies_ide(2)) qed also have "... \ tab\<^sub>1 r" using \_dom_leg1_eq Maps.CLS_REP Maps.CLS_eqI Maps.REP_CLS r.leg1_is_map by presburger finally show ?thesis by blast qed obtain \ where \: "\\ : tab\<^sub>1 r \ tab\<^sub>1 s \ Maps.REP \.chine\ \ iso \" using 2 isomorphic_symmetric by blast define \ where "\ \ (s \ \) \ \[s, tab\<^sub>0 s, Maps.REP \.chine] \ (s.tab \ Maps.REP \.chine) \ \" have \: "\\ : tab\<^sub>1 r \ s \ tab\<^sub>0 r\" proof (unfold \_def, intro comp_in_homI) show "\\ : tab\<^sub>1 r \ tab\<^sub>1 s \ Maps.REP \.chine\" using \ by simp show 3: "\s.tab \ Maps.REP \.chine : tab\<^sub>1 s \ Maps.REP \.chine \ (s \ tab\<^sub>0 s) \ Maps.REP \.chine\" apply (intro hcomp_in_vhom) apply auto using "1" by fastforce show "\\[s, tab\<^sub>0 s, Maps.REP \.chine] : (s \ tab\<^sub>0 s) \ Maps.REP \.chine \ s \ tab\<^sub>0 s \ Maps.REP \.chine\" using s assoc_in_hom [of s "tab\<^sub>0 s" "Maps.REP \.chine"] by (metis (no_types, lifting) Maps.ide_REP 3 \.chine_simps(1) hcomp_in_vhomE ideD(2) ideD(3) s.ide_u s.tab_simps(2) s.u_simps(3)) show "\s \ \ : s \ tab\<^sub>0 s \ Maps.REP \.chine \ s \ tab\<^sub>0 r\" using 1 s \ isomorphic_implies_hpar(4) src_eq by auto qed define \ where "\ \ r.T0.trnr\<^sub>\ s \ \ inv (r.T0.trnr\<^sub>\ r r.tab)" have \: "\\ : r \ s\" proof (unfold \_def, intro comp_in_homI) show "\inv (r.T0.trnr\<^sub>\ r r.tab) : r \ tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*\" using r.yields_isomorphic_representation by fastforce show "\r.T0.trnr\<^sub>\ s \ : tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>* \ s\" using s \ src_eq r.T0.adjoint_transpose_right(2) [of s "tab\<^sub>1 r"] by auto qed interpret \: arrow_in_bicategory_of_spans V H \ \ src trg r s \ using \ by unfold_locales auto interpret \: arrow_of_tabulations_in_maps V H \ \ src trg r r.tab \tab\<^sub>0 r\ \tab\<^sub>1 r\ s s.tab \tab\<^sub>0 s\ \tab\<^sub>1 s\ \ using \.is_arrow_of_tabulations_in_maps by simp have \_eq: "\ = \.\" proof - have "r.T0.trnr\<^sub>\ s \ \ inv (r.T0.trnr\<^sub>\ r r.tab) = r.T0.trnr\<^sub>\ s \.\ \ inv (r.T0.trnr\<^sub>\ r r.tab)" using \ \_def \.\_in_terms_of_\ by auto hence "r.T0.trnr\<^sub>\ s \ = r.T0.trnr\<^sub>\ s \.\" using r s \ r.T0.adjoint_transpose_right(2) r.yields_isomorphic_representation iso_inv_iso iso_is_retraction retraction_is_epi epiE by (metis \.in_hom \_def arrI) thus ?thesis using \ \.\_in_hom(2) src_eq r.T0.adjoint_transpose_right(6) bij_betw_imp_inj_on [of "r.T0.trnr\<^sub>\ s" "hom (tab\<^sub>1 r) (s \ tab\<^sub>0 r)" "hom (tab\<^sub>1 r \ (tab\<^sub>0 r)\<^sup>*) s"] inj_on_def [of "r.T0.trnr\<^sub>\ s" "hom (tab\<^sub>1 r) (s \ tab\<^sub>0 r)"] by simp qed have "\.is_induced_map (Maps.REP \.chine)" using \ \ \_eq \_def \.is_induced_map_iff \.chine_simps(1) Maps.ide_REP by blast hence 3: "Maps.REP \.chine \ \.chine" using \.chine_is_induced_map \.induced_map_unique by simp have "SPN \ = \" proof (intro Span.arr_eqI) show "Span.par (SPN \) \" using \ \ SPN_in_hom by (metis (no_types, lifting) SPN.preserves_cod SPN.preserves_dom Span.in_homE in_homE) show "Chn (SPN \) = \.chine" proof - have "Chn (SPN \) = \\spn \\\" using \ SPN_def spn_def by auto also have "... = \\\.chine\\" using \ spn_def by fastforce also have "... = \\Maps.REP \.chine\\" using 3 isomorphic_symmetric Maps.CLS_eqI iso_class_eqI isomorphic_implies_hpar(3) isomorphic_implies_hpar(4) by auto also have "... = \.chine" using Maps.CLS_REP \.chine_simps(1) by blast finally show ?thesis by blast qed qed thus "\\. \\ : r \ s\ \ SPN \ = \" using \ by auto qed qed theorem SPN_is_equivalence_pseudofunctor: shows "equivalence_pseudofunctor V H \ \ src trg Span.vcomp Span.hcomp Span.assoc Span.unit Span.src Span.trg SPN \" .. text \ We have completed the proof of the second half of the main result (CKS Theorem 4): \B\ is biequivalent (via \SPN\) to \Span(Maps(B))\. \ corollary shows "equivalent_bicategories V H \ \ src trg Span.vcomp Span.hcomp Span.assoc Span.unit Span.src Span.trg" using SPN_is_equivalence_pseudofunctor equivalent_bicategories_def by blast end end

\<^sub>1[?R, ?w1]" let ?\ = "\?R \r0, r0\ ?R\" have P: "?P = ru.apex" using ru.apex_composite by auto have Chn_\: "\?\ : ?V \\<^sub>C ?P\" using P Chn_in_hom \ by force have p0\: "\?p0 \ ?\ : ?V \\<^sub>C ?U\" using Chn_\ ru.legs_form_cospan by auto have w1: "\?w1 : ?V \\<^sub>C ?R\" using Chn_\ ru.legs_form_cospan r.dom.apex_def by blast have r1w1: "r1 \ ?w1 = ?v1" by (metis C.comp_assoc T.base_simps(3) \ \.leg1_commutes arrow_of_spans_data.select_convs(3) cod_char dom_char ideD(1) ideD(2) in_homE ru.composite_in_hom ru.leg1_composite u v) have w: "ide w" unfolding w_def using P \ w1 by (intro ide_mkIde, auto) interpret w: identity_arrow_of_spans C w using w_def w ide_char' by auto have hseq_fw: "hseq f w" using w_def ide_f w src_def trg_def w1 by auto interpret fw: two_composable_arrows_of_spans C prj0 prj1 f w using w_def hseq_fw hseq_char by unfold_locales auto interpret fw: two_composable_identity_arrows_of_spans C prj0 prj1 f w .. have hseq_gw: "hseq g w" using w_def ide_g w src_def trg_def w1 by auto interpret gw: two_composable_arrows_of_spans C prj0 prj1 g w using hseq_gw hseq_char by unfold_locales auto interpret gw: two_composable_identity_arrows_of_spans C prj0 prj1 g w .. interpret rfw: three_composable_arrows_of_spans C prj0 prj1 r f w .. interpret rfw: three_composable_identity_arrows_of_spans C prj0 prj1 r f w .. have arfw: "\\[r, f, w] : (r \ f) \ w \ r \ f \ w\" using fw.composable ide_f ide_r w rf.composable by auto have fw_apex_eq: "fw.apex = ?R \\ ?w1" using w_def fw.dom.apex_def hcomp_def hseq_fw hseq_char \ C.arr_dom_iff_arr C.pbdom_def fw.chine_eq_apex fw.chine_simps(1) by auto have gw_apex_eq: "gw.apex = ?R \\ ?w1" using w_def \ w1 gw.dom.apex_def hcomp_def hseq_gw hseq_char by auto text \ Well, CKS say take \\ = p\<^sub>0\\, but taking this literally and trying to define \\\ so that \Chn \ = ?p\<^sub>0 \ ?\\, does not yield the required \dom \ = ?R \\ ?w1\. We need \\Chn \ : ?R \\ ?w1 \\<^sub>C ?U\\, so we have to compose with a projection, which leads to: \Chn \ = ?p0 \ ?\ \ \