diff --git a/thys/CZH_Elementary_Categories/czh_ecategories/CZH_ECAT_NTCF.thy b/thys/CZH_Elementary_Categories/czh_ecategories/CZH_ECAT_NTCF.thy --- a/thys/CZH_Elementary_Categories/czh_ecategories/CZH_ECAT_NTCF.thy +++ b/thys/CZH_Elementary_Categories/czh_ecategories/CZH_ECAT_NTCF.thy @@ -1,2514 +1,2511 @@ (* Copyright 2021 (C) Mihails Milehins *) section\Natural transformation\ theory CZH_ECAT_NTCF imports CZH_Foundations.CZH_SMC_NTSMCF CZH_ECAT_Functor begin subsection\Background\ named_theorems ntcf_cs_simps named_theorems ntcf_cs_intros lemmas [cat_cs_simps] = dg_shared_cs_simps lemmas [cat_cs_intros] = dg_shared_cs_intros subsubsection\Slicing\ definition ntcf_ntsmcf :: "V \ V" where "ntcf_ntsmcf \ = [ \\NTMap\, cf_smcf (\\NTDom\), cf_smcf (\\NTCod\), cat_smc (\\NTDGDom\), cat_smc (\\NTDGCod\) ]\<^sub>\" text\Components.\ lemma ntcf_ntsmcf_components: shows [slicing_simps]: "ntcf_ntsmcf \\NTMap\ = \\NTMap\" and [slicing_commute]: "ntcf_ntsmcf \\NTDom\ = cf_smcf (\\NTDom\)" and [slicing_commute]: "ntcf_ntsmcf \\NTCod\ = cf_smcf (\\NTCod\)" and [slicing_commute]: "ntcf_ntsmcf \\NTDGDom\ = cat_smc (\\NTDGDom\)" and [slicing_commute]: "ntcf_ntsmcf \\NTDGCod\ = cat_smc (\\NTDGCod\)" unfolding ntcf_ntsmcf_def nt_field_simps by (auto simp: nat_omega_simps) subsection\Definition and elementary properties\ text\ The definition of a natural transformation that is used in this work is is similar to the definition that can be found in Chapter I-4 in \cite{mac_lane_categories_2010}. \ locale is_ntcf = \ \ + vfsequence \ + NTDom: is_functor \ \ \ \ + NTCod: is_functor \ \ \ \ for \ \ \ \ \ \ + assumes ntcf_length[cat_cs_simps]: "vcard \ = 5\<^sub>\" and ntcf_is_ntsmcf[slicing_intros]: "ntcf_ntsmcf \ : cf_smcf \ \\<^sub>S\<^sub>M\<^sub>C\<^sub>F cf_smcf \ : cat_smc \ \\\<^sub>S\<^sub>M\<^sub>C\<^bsub>\\<^esub> cat_smc \" and ntcf_NTDom[cat_cs_simps]: "\\NTDom\ = \" and ntcf_NTCod[cat_cs_simps]: "\\NTCod\ = \" and ntcf_NTDGDom[cat_cs_simps]: "\\NTDGDom\ = \" and ntcf_NTDGCod[cat_cs_simps]: "\\NTDGCod\ = \" syntax "_is_ntcf" :: "V \ V \ V \ V \ V \ V \ bool" (\(_ :/ _ \\<^sub>C\<^sub>F _ :/ _ \\\<^sub>C\ _)\ [51, 51, 51, 51, 51] 51) translations "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" \ "CONST is_ntcf \ \ \ \ \ \" abbreviation all_ntcfs :: "V \ V" where "all_ntcfs \ \ set {\. \\ \ \ \. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \}" abbreviation ntcfs :: "V \ V \ V \ V" where "ntcfs \ \ \ \ set {\. \\ \. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \}" abbreviation these_ntcfs :: "V \ V \ V \ V \ V \ V" where "these_ntcfs \ \ \ \ \ \ set {\. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \}" lemmas [cat_cs_simps] = is_ntcf.ntcf_length is_ntcf.ntcf_NTDom is_ntcf.ntcf_NTCod is_ntcf.ntcf_NTDGDom is_ntcf.ntcf_NTDGCod lemma (in is_ntcf) ntcf_is_ntsmcf': assumes "\' = cf_smcf \" and "\' = cf_smcf \" and "\' = cat_smc \" and "\' = cat_smc \" shows "ntcf_ntsmcf \ : \' \\<^sub>S\<^sub>M\<^sub>C\<^sub>F \' : \' \\\<^sub>S\<^sub>M\<^sub>C\<^bsub>\\<^esub> \'" unfolding assms(1-4) by (rule ntcf_is_ntsmcf) lemmas [slicing_intros] = is_ntcf.ntcf_is_ntsmcf' text\Rules.\ lemma (in is_ntcf) is_ntcf_axioms'[cat_cs_intros]: assumes "\' = \" and "\' = \" and "\' = \" and "\' = \" and "\' = \" shows "\ : \' \\<^sub>C\<^sub>F \' : \' \\\<^sub>C\<^bsub>\'\<^esub> \'" unfolding assms by (rule is_ntcf_axioms) mk_ide rf is_ntcf_def[unfolded is_ntcf_axioms_def] |intro is_ntcfI| |dest is_ntcfD[dest]| |elim is_ntcfE[elim]| lemmas [cat_cs_intros] = is_ntcfD(3,4) lemma is_ntcfI': assumes "\ \" and "vfsequence \" and "vcard \ = 5\<^sub>\" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\\NTDom\ = \" and "\\NTCod\ = \" and "\\NTDGDom\ = \" and "\\NTDGCod\ = \" and "vsv (\\NTMap\)" and "\\<^sub>\ (\\NTMap\) = \\Obj\" and "\a. a \\<^sub>\ \\Obj\ \ \\NTMap\\a\ : \\ObjMap\\a\ \\<^bsub>\\<^esub> \\ObjMap\\a\" and "\a b f. f : a \\<^bsub>\\<^esub> b \ \\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ = \\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\" shows "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (intro is_ntcfI is_ntsmcfI', unfold ntcf_ntsmcf_components slicing_simps) ( simp_all add: assms nat_omega_simps ntcf_ntsmcf_def is_functorD(6)[OF assms(4)] is_functorD(6)[OF assms(5)] ) lemma is_ntcfD': assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \" and "vfsequence \" and "vcard \ = 5\<^sub>\" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\\NTDom\ = \" and "\\NTCod\ = \" and "\\NTDGDom\ = \" and "\\NTDGCod\ = \" and "vsv (\\NTMap\)" and "\\<^sub>\ (\\NTMap\) = \\Obj\" and "\a. a \\<^sub>\ \\Obj\ \ \\NTMap\\a\ : \\ObjMap\\a\ \\<^bsub>\\<^esub> \\ObjMap\\a\" and "\a b f. f : a \\<^bsub>\\<^esub> b \ \\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ = \\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\" by ( simp_all add: is_ntcfD(2-10)[OF assms] is_ntsmcfD'[OF is_ntcfD(6)[OF assms], unfolded slicing_simps] ) lemma is_ntcfE': assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" obtains "\ \" and "vfsequence \" and "vcard \ = 5\<^sub>\" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\\NTDom\ = \" and "\\NTCod\ = \" and "\\NTDGDom\ = \" and "\\NTDGCod\ = \" and "vsv (\\NTMap\)" and "\\<^sub>\ (\\NTMap\) = \\Obj\" and "\a. a \\<^sub>\ \\Obj\ \ \\NTMap\\a\ : \\ObjMap\\a\ \\<^bsub>\\<^esub> \\ObjMap\\a\" and "\a b f. f : a \\<^bsub>\\<^esub> b \ \\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ = \\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\" using assms by (simp add: is_ntcfD') text\Slicing.\ context is_ntcf begin interpretation ntsmcf: is_ntsmcf \ \cat_smc \\ \cat_smc \\ \cf_smcf \\ \cf_smcf \\ \ntcf_ntsmcf \\ by (rule ntcf_is_ntsmcf) lemmas_with [unfolded slicing_simps]: ntcf_NTMap_vsv(*not cat_cs_intros: clash*) = ntsmcf.ntsmcf_NTMap_vsv and ntcf_NTMap_vdomain[cat_cs_simps] = ntsmcf.ntsmcf_NTMap_vdomain and ntcf_NTMap_is_arr = ntsmcf.ntsmcf_NTMap_is_arr and ntcf_NTMap_is_arr'[cat_cs_intros] = ntsmcf.ntsmcf_NTMap_is_arr' sublocale NTMap: vsv \\\NTMap\\ rewrites "\\<^sub>\ (\\NTMap\) = \\Obj\" by (rule ntcf_NTMap_vsv) (simp add: cat_cs_simps) lemmas_with [unfolded slicing_simps]: ntcf_NTMap_app_in_Arr[cat_cs_intros] = ntsmcf.ntsmcf_NTMap_app_in_Arr and ntcf_NTMap_vrange_vifunion = ntsmcf.ntsmcf_NTMap_vrange_vifunion and ntcf_NTMap_vrange = ntsmcf.ntsmcf_NTMap_vrange and ntcf_NTMap_vsubset_Vset = ntsmcf.ntsmcf_NTMap_vsubset_Vset and ntcf_NTMap_in_Vset = ntsmcf.ntsmcf_NTMap_in_Vset and ntcf_is_ntsmcf_if_ge_Limit = ntsmcf.ntsmcf_is_ntsmcf_if_ge_Limit lemmas_with [unfolded slicing_simps]: ntcf_Comp_commute[cat_cs_intros] = ntsmcf.ntsmcf_Comp_commute and ntcf_Comp_commute' = ntsmcf.ntsmcf_Comp_commute' and ntcf_Comp_commute'' = ntsmcf.ntsmcf_Comp_commute'' end lemmas [cat_cs_simps] = is_ntcf.ntcf_NTMap_vdomain lemmas [cat_cs_intros] = is_ntcf.ntcf_NTMap_vsv is_ntcf.ntcf_NTMap_is_arr' ntsmcf_hcomp_NTMap_vsv text\Elementary properties.\ lemma ntcf_eqI: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' : \' \\<^sub>C\<^sub>F \' : \' \\\<^sub>C\<^bsub>\\<^esub> \'" and "\\NTMap\ = \'\NTMap\" and "\ = \'" and "\ = \'" and "\ = \'" and "\ = \'" shows "\ = \'" proof- interpret L: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret R: is_ntcf \ \' \' \' \' \' by (rule assms(2)) show ?thesis proof(rule vsv_eqI) have dom: "\\<^sub>\ \ = 5\<^sub>\" by (cs_concl cs_shallow cs_simp: cat_cs_simps V_cs_simps) show "\\<^sub>\ \ = \\<^sub>\ \'" by (cs_concl cs_shallow cs_simp: cat_cs_simps V_cs_simps) from assms(4-7) have sup: "\\NTDom\ = \'\NTDom\" "\\NTCod\ = \'\NTCod\" "\\NTDGDom\ = \'\NTDGDom\" "\\NTDGCod\ = \'\NTDGCod\" by (simp_all add: cat_cs_simps) show "a \\<^sub>\ \\<^sub>\ \ \ \\a\ = \'\a\" for a by (unfold dom, elim_in_numeral, insert assms(3) sup) (auto simp: nt_field_simps) qed auto qed lemma ntcf_ntsmcf_eqI: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' : \' \\<^sub>C\<^sub>F \' : \' \\\<^sub>C\<^bsub>\\<^esub> \'" and "\ = \'" and "\ = \'" and "\ = \'" and "\ = \'" and "ntcf_ntsmcf \ = ntcf_ntsmcf \'" shows "\ = \'" proof(rule ntcf_eqI[of \]) from assms(7) have "ntcf_ntsmcf \\NTMap\ = ntcf_ntsmcf \'\NTMap\" by simp then show "\\NTMap\ = \'\NTMap\" unfolding slicing_simps by simp_all from assms(3-6) show "\ = \'" "\ = \'" "\ = \'" "\ = \'" by simp_all qed (auto simp: assms(1,2)) lemma (in is_ntcf) ntcf_def: "\ = [\\NTMap\, \\NTDom\, \\NTCod\, \\NTDGDom\, \\NTDGCod\]\<^sub>\" proof(rule vsv_eqI) have dom_lhs: "\\<^sub>\ \ = 5\<^sub>\" by (cs_concl cs_shallow cs_simp: cat_cs_simps V_cs_simps) have dom_rhs: "\\<^sub>\ [\\NTMap\, \\NTDGDom\, \\NTDGCod\, \\NTDom\, \\NTCod\]\<^sub>\ = 5\<^sub>\" by (simp add: nat_omega_simps) then show "\\<^sub>\ \ = \\<^sub>\ [\\NTMap\, \\NTDom\, \\NTCod\, \\NTDGDom\, \\NTDGCod\]\<^sub>\" unfolding dom_lhs dom_rhs by (simp add: nat_omega_simps) show "a \\<^sub>\ \\<^sub>\ \ \ \\a\ = [\\NTMap\, \\NTDom\, \\NTCod\, \\NTDGDom\, \\NTDGCod\]\<^sub>\\a\" for a by (unfold dom_lhs, elim_in_numeral, unfold nt_field_simps) (simp_all add: nat_omega_simps) qed (auto simp: vsv_axioms) lemma (in is_ntcf) ntcf_in_Vset: assumes "\ \" and "\ \\<^sub>\ \" shows "\ \\<^sub>\ Vset \" proof- interpret \: \ \ by (rule assms(1)) note [cat_cs_intros] = ntcf_NTMap_in_Vset NTDom.cf_in_Vset NTCod.cf_in_Vset NTDom.HomDom.cat_in_Vset NTDom.HomCod.cat_in_Vset from assms(2) show ?thesis by (subst ntcf_def) ( cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros V_cs_intros ) qed lemma (in is_ntcf) ntcf_is_ntcf_if_ge_Limit: assumes "\ \" and "\ \\<^sub>\ \" shows "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(intro is_ntcfI) show "ntcf_ntsmcf \ : cf_smcf \ \\<^sub>S\<^sub>M\<^sub>C\<^sub>F cf_smcf \ : cat_smc \ \\\<^sub>S\<^sub>M\<^sub>C\<^bsub>\\<^esub> cat_smc \" by (rule is_ntsmcf.ntsmcf_is_ntsmcf_if_ge_Limit[OF ntcf_is_ntsmcf assms]) qed ( cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: V_cs_intros assms NTDom.cf_is_functor_if_ge_Limit NTCod.cf_is_functor_if_ge_Limit )+ lemma small_all_ntcfs[simp]: "small {\. \\ \ \ \. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \}" proof(cases \\ \\) case True from is_ntcf.ntcf_in_Vset show ?thesis by (intro down[of _ \Vset (\ + \)\]) (auto simp: True \.\_Limit_\\ \.\_\_\\ \.intro \.\_\_\\) next case False then have "{\. \\ \ \ \. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \} = {}" by auto then show ?thesis by simp qed lemma small_ntcfs[simp]: "small {\. \\ \. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \}" by (rule down[of _ \set {\. \\ \ \ \. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \}\]) auto lemma small_these_ntcfs[simp]: "small {\. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \}" by (rule down[of _ \set {\. \\ \ \ \. \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \}\]) auto text\Further elementary results.\ lemma these_ntcfs_iff: (*not simp*) "\ \\<^sub>\ these_ntcfs \ \ \ \ \ \ \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by auto subsection\Opposite natural transformation\ text\See section 1.5 in \cite{bodo_categories_1970}.\ definition op_ntcf :: "V \ V" where "op_ntcf \ = [ \\NTMap\, op_cf (\\NTCod\), op_cf (\\NTDom\), op_cat (\\NTDGDom\), op_cat (\\NTDGCod\) ]\<^sub>\" text\Components.\ lemma op_ntcf_components[cat_op_simps]: shows "op_ntcf \\NTMap\ = \\NTMap\" and "op_ntcf \\NTDom\ = op_cf (\\NTCod\)" and "op_ntcf \\NTCod\ = op_cf (\\NTDom\)" and "op_ntcf \\NTDGDom\ = op_cat (\\NTDGDom\)" and "op_ntcf \\NTDGCod\ = op_cat (\\NTDGCod\)" unfolding op_ntcf_def nt_field_simps by (auto simp: nat_omega_simps) text\Slicing.\ lemma ntcf_ntsmcf_op_ntcf[slicing_commute]: "op_ntsmcf (ntcf_ntsmcf \) = ntcf_ntsmcf (op_ntcf \)" proof(rule vsv_eqI) have dom_lhs: "\\<^sub>\ (op_ntsmcf (ntcf_ntsmcf \)) = 5\<^sub>\" unfolding op_ntsmcf_def by (auto simp: nat_omega_simps) have dom_rhs: "\\<^sub>\ (ntcf_ntsmcf (op_ntcf \)) = 5\<^sub>\" unfolding ntcf_ntsmcf_def by (auto simp: nat_omega_simps) show "\\<^sub>\ (op_ntsmcf (ntcf_ntsmcf \)) = \\<^sub>\ (ntcf_ntsmcf (op_ntcf \))" unfolding dom_lhs dom_rhs by simp show "a \\<^sub>\ \\<^sub>\ (op_ntsmcf (ntcf_ntsmcf \)) \ op_ntsmcf (ntcf_ntsmcf \)\a\ = ntcf_ntsmcf (op_ntcf \)\a\" for a by ( unfold dom_lhs, elim_in_numeral, unfold nt_field_simps ntcf_ntsmcf_def op_ntcf_def op_ntsmcf_def ) (auto simp: nat_omega_simps slicing_commute[symmetric]) qed (auto simp: ntcf_ntsmcf_def op_ntsmcf_def) text\Elementary properties.\ lemma op_ntcf_vsv[cat_op_intros]: "vsv (op_ntcf \)" unfolding op_ntcf_def by auto subsubsection\Further properties\ lemma (in is_ntcf) is_ntcf_op: "op_ntcf \ : op_cf \ \\<^sub>C\<^sub>F op_cf \ : op_cat \ \\\<^sub>C\<^bsub>\\<^esub> op_cat \" proof(rule is_ntcfI, unfold cat_op_simps) show "vfsequence (op_ntcf \)" by (simp add: op_ntcf_def) show "vcard (op_ntcf \) = 5\<^sub>\" by (simp add: op_ntcf_def nat_omega_simps) qed ( use is_ntcf_axioms in \ cs_concl cs_shallow cs_simp: cat_cs_simps slicing_commute[symmetric] cs_intro: cat_cs_intros cat_op_intros smc_op_intros slicing_intros \ )+ lemma (in is_ntcf) is_ntcf_op'[cat_op_intros]: assumes "\' = op_cf \" and "\' = op_cf \" and "\' = op_cat \" and "\' = op_cat \" shows "op_ntcf \ : \' \\<^sub>C\<^sub>F \' : \' \\\<^sub>C\<^bsub>\\<^esub> \'" unfolding assms by (rule is_ntcf_op) lemmas [cat_op_intros] = is_ntcf.is_ntcf_op' lemma (in is_ntcf) ntcf_op_ntcf_op_ntcf[cat_op_simps]: "op_ntcf (op_ntcf \) = \" proof(rule ntcf_eqI[of \ \ \ \ \ _ \ \ \ \], unfold cat_op_simps) interpret op: is_ntcf \ \op_cat \\ \op_cat \\ \op_cf \\ \op_cf \\ \op_ntcf \\ by (rule is_ntcf_op) from op.is_ntcf_op show "op_ntcf (op_ntcf \) : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (simp add: cat_op_simps) qed (auto simp: cat_cs_intros) lemmas ntcf_op_ntcf_op_ntcf[cat_op_simps] = is_ntcf.ntcf_op_ntcf_op_ntcf lemma eq_op_ntcf_iff[cat_op_simps]: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' : \' \\<^sub>C\<^sub>F \' : \' \\\<^sub>C\<^bsub>\\<^esub> \'" shows "op_ntcf \ = op_ntcf \' \ \ = \'" proof interpret L: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret R: is_ntcf \ \' \' \' \' \' by (rule assms(2)) assume prems: "op_ntcf \ = op_ntcf \'" show "\ = \'" proof(rule ntcf_eqI[OF assms]) from prems L.ntcf_op_ntcf_op_ntcf R.ntcf_op_ntcf_op_ntcf show "\\NTMap\ = \'\NTMap\" by metis+ from prems L.ntcf_op_ntcf_op_ntcf R.ntcf_op_ntcf_op_ntcf have "\\NTDom\ = \'\NTDom\" and "\\NTCod\ = \'\NTCod\" and "\\NTDGDom\ = \'\NTDGDom\" and "\\NTDGCod\ = \'\NTDGCod\" by metis+ then show "\ = \'" "\ = \'" "\ = \'" "\ = \'" by (auto simp: cat_cs_simps) qed qed auto subsection\Vertical composition of natural transformations\ subsubsection\Definition and elementary properties\ text\See Chapter II-4 in \cite{mac_lane_categories_2010}.\ abbreviation (input) ntcf_vcomp :: "V \ V \ V" (infixl \\\<^sub>N\<^sub>T\<^sub>C\<^sub>F\ 55) where "ntcf_vcomp \ ntsmcf_vcomp" lemmas [cat_cs_simps] = ntsmcf_vcomp_components(2-5) text\Slicing.\ lemma ntcf_ntsmcf_ntcf_vcomp[slicing_commute]: "ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \ = ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" unfolding ntsmcf_vcomp_def ntcf_ntsmcf_def cat_smc_def nt_field_simps dg_field_simps by (simp add: nat_omega_simps) subsubsection\Natural transformation map\ lemma ntcf_vcomp_NTMap_vdomain[cat_cs_simps]: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\) = \\Obj\" proof- interpret \: is_ntcf \ \ \ \ \ \ using assms by auto show ?thesis by ( rule ntsmcf_vcomp_NTMap_vdomain [ OF \.ntcf_is_ntsmcf, of \ntcf_ntsmcf \\, unfolded slicing_commute slicing_simps ] ) qed lemma ntcf_vcomp_NTMap_app[cat_cs_simps]: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "a \\<^sub>\ \\Obj\" shows "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\a\ = \\NTMap\\a\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\" proof- interpret \: is_ntcf \ \ \ \ \ \ using assms by clarsimp interpret \: is_ntcf \ \ \ \ \ \ using assms by clarsimp show ?thesis by ( rule ntsmcf_vcomp_NTMap_app [ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_commute slicing_simps, OF assms(3) ] ) qed lemma ntcf_vcomp_NTMap_vrange: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\) \\<^sub>\ \\Arr\" proof- interpret \: is_ntcf \ \ \ \ \ \ using assms by auto interpret \: is_ntcf \ \ \ \ \ \ using assms by auto show ?thesis by ( rule ntsmcf_vcomp_NTMap_vrange[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps slicing_commute ] ) qed subsubsection\Further properties\ lemma ntcf_vcomp_composable_commute[cat_cs_simps]: \\See Chapter II-4 in \cite{mac_lane_categories_2010}.\ assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and [intro]: "f : a \\<^bsub>\\<^esub> b" shows "(\\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\b\) \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ = \\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> (\\NTMap\\a\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\)" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis by ( rule ntsmcf_vcomp_composable_commute[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps, OF assms(3) ] ) qed lemma ntcf_vcomp_is_ntcf[cat_cs_intros]: \\see Chapter II-4 in \cite{mac_lane_categories_2010}.\ assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis proof(intro is_ntcfI) show "vfsequence (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" by (simp add: ntsmcf_vcomp_def) show "vcard (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = 5\<^sub>\" unfolding ntsmcf_vcomp_def by (simp add: nat_omega_simps) show "ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) : cf_smcf \ \\<^sub>S\<^sub>M\<^sub>C\<^sub>F cf_smcf \ : cat_smc \ \\\<^sub>S\<^sub>M\<^sub>C\<^bsub>\\<^esub> cat_smc \" by ( rule ntsmcf_vcomp_is_ntsmcf[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps slicing_commute ] ) qed (auto simp: ntsmcf_vcomp_components(1) cat_cs_simps cat_cs_intros) qed lemma ntcf_vcomp_assoc[cat_cs_simps]: \\See Chapter II-4 in \cite{mac_lane_categories_2010}.\ assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(3)) - find_theorems "vsv (\\NTMap\) " - - thm vsvI show ?thesis proof(rule ntcf_eqI[of \]) from ntsmcf_vcomp_assoc[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps slicing_commute ] have "ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\ = ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))\NTMap\" by simp then show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\ = (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))\NTMap\" unfolding slicing_simps . qed (auto intro: cat_cs_intros) qed subsubsection\ The opposite of the vertical composition of natural transformations \ lemma op_ntcf_ntcf_vcomp[cat_op_simps]: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "op_ntcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = op_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F op_ntcf \" proof- interpret \: is_ntcf \ \ \ \ \ \ using assms(1) by auto interpret \: is_ntcf \ \ \ \ \ \ using assms(2) by auto show ?thesis proof(rule sym, rule ntcf_eqI[of \]) from op_ntsmcf_ntsmcf_vcomp [ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps slicing_commute ] have "ntcf_ntsmcf (op_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F op_ntcf \)\NTMap\ = ntcf_ntsmcf (op_ntcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))\NTMap\" by simp then show "(op_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F op_ntcf \)\NTMap\ = op_ntcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\" unfolding slicing_simps . qed (auto intro: cat_cs_intros cat_op_intros) qed subsection\Horizontal composition of natural transformations\ subsubsection\Definition and elementary properties\ text\See Chapter II-5 in \cite{mac_lane_categories_2010}.\ abbreviation (input) ntcf_hcomp :: "V \ V \ V" (infixl \\\<^sub>N\<^sub>T\<^sub>C\<^sub>F\ 55) where "ntcf_hcomp \ ntsmcf_hcomp" lemmas [cat_cs_simps] = ntsmcf_hcomp_components(2-5) text\Slicing.\ lemma ntcf_ntsmcf_ntcf_hcomp[slicing_commute]: "ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \ = ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" proof(rule vsv_eqI) show "vsv (ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \)" unfolding ntsmcf_hcomp_def by auto show "vsv (ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))" unfolding ntcf_ntsmcf_def by auto have dom_lhs: "\\<^sub>\ (ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \) = 5\<^sub>\" unfolding ntsmcf_hcomp_def by (simp add: nat_omega_simps) have dom_rhs: "\\<^sub>\ (ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)) = 5\<^sub>\" unfolding ntcf_ntsmcf_def by (simp add: nat_omega_simps) show "\\<^sub>\ (ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \) = \\<^sub>\ (ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))" unfolding dom_lhs dom_rhs .. fix a assume "a \\<^sub>\ \\<^sub>\ (ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \)" then show "(ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \)\a\ = ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\a\" unfolding dom_lhs by (elim_in_numeral; fold nt_field_simps) (simp_all add: ntsmcf_hcomp_components slicing_simps slicing_commute) qed subsubsection\Natural transformation map\ lemma ntcf_hcomp_NTMap_vdomain[cat_cs_simps]: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\) = \\Obj\" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) show ?thesis unfolding ntsmcf_hcomp_components by (simp add: cat_cs_simps) qed lemma ntcf_hcomp_NTMap_app[cat_cs_simps]: assumes "\ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "a \\<^sub>\ \\Obj\" shows "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\a\ = \'\ArrMap\\\\NTMap\\a\\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\\\ObjMap\\a\\" proof- interpret \: is_ntcf \ \ \ \' \' \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) from assms(3) show ?thesis unfolding ntsmcf_hcomp_components by (simp add: cat_cs_simps) qed lemma ntcf_hcomp_NTMap_vrange: assumes "\ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\) \\<^sub>\ \\Arr\" proof- interpret \: is_ntcf \ \ \ \' \' \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis by ( rule ntsmcf_hcomp_NTMap_vrange[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps slicing_commute ] ) qed subsubsection\Further properties\ lemma ntcf_hcomp_composable_commute: \\See Chapter II-5 in \cite{mac_lane_categories_2010}.\ assumes "\ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "f : a \\<^bsub>\\<^esub> b" shows "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> (\' \\<^sub>C\<^sub>F \)\ArrMap\\f\ = (\' \\<^sub>C\<^sub>F \)\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\a\" (is \?\\b \\<^sub>A\<^bsub>\\<^esub> ?\'\f = ?\'\f \\<^sub>A\<^bsub>\\<^esub> ?\\a\) proof- interpret \: is_ntcf \ \ \ \' \' \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis by ( rule ntsmcf_hcomp_composable_commute[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps slicing_commute, OF assms(3) ] ) qed lemma ntcf_hcomp_is_ntcf: \\See Chapter II-5 in \cite{mac_lane_categories_2010}.\ assumes "\ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \' \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \' \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof- interpret \: is_ntcf \ \ \ \' \' \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis proof(intro is_ntcfI) show "vfsequence (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" unfolding ntsmcf_hcomp_def by (simp add: nat_omega_simps) show "vcard (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = 5\<^sub>\" unfolding ntsmcf_hcomp_def by (simp add: nat_omega_simps) show "ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) : cf_smcf (\' \\<^sub>S\<^sub>M\<^sub>C\<^sub>F \) \\<^sub>S\<^sub>M\<^sub>C\<^sub>F cf_smcf (\' \\<^sub>C\<^sub>F \) : cat_smc \ \\\<^sub>S\<^sub>M\<^sub>C\<^bsub>\\<^esub> cat_smc \" by ( rule ntsmcf_hcomp_is_ntsmcf[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps slicing_commute ] ) qed (auto simp: ntsmcf_hcomp_components(1) cat_cs_simps intro: cat_cs_intros) qed lemma ntcf_hcomp_is_ntcf'[cat_cs_intros]: assumes "\ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ = \' \\<^sub>C\<^sub>F \" and "\' = \' \\<^sub>C\<^sub>F \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" using assms(1,2) unfolding assms(3,4) by (rule ntcf_hcomp_is_ntcf) lemma ntcf_hcomp_associativ[cat_cs_simps]: assumes "\ : \'' \\<^sub>C\<^sub>F \'' : \ \\\<^sub>C\<^bsub>\\<^esub> \
" and "\ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" proof- interpret \: is_ntcf \ \ \
\'' \'' \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \' \' \ by (rule assms(2)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(3)) show ?thesis proof(rule ntcf_eqI[of \]) show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) : \'' \\<^sub>C\<^sub>F \' \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \'' \\<^sub>C\<^sub>F \' \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \
" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) from ntsmcf_hcomp_assoc[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_commute ] have "ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\ = ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))\NTMap\" by simp then show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\ = (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))\NTMap\" unfolding slicing_simps . qed (auto intro: cat_cs_intros) qed subsubsection\ The opposite of the horizontal composition of natural transformations \ lemma op_ntcf_ntcf_hcomp[cat_op_simps]: assumes "\ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "op_ntcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = op_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F op_ntcf \" proof- interpret \: is_ntcf \ \ \ \' \' \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis proof(rule sym, rule ntcf_eqI[of \]) from op_ntsmcf_ntsmcf_hcomp[ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf, unfolded slicing_simps slicing_commute ] have "ntcf_ntsmcf (op_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F op_ntcf \)\NTMap\ = ntcf_ntsmcf (op_ntcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))\NTMap\" by simp then show "(op_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F op_ntcf \)\NTMap\ = op_ntcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\" unfolding slicing_simps . have "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \' \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \' \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (rule ntcf_hcomp_is_ntcf[OF assms]) from is_ntcf.is_ntcf_op[OF this] show "op_ntcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) : op_cf \' \\<^sub>C\<^sub>F op_cf \ \\<^sub>C\<^sub>F op_cf \' \\<^sub>C\<^sub>F op_cf \ : op_cat \ \\\<^sub>C\<^bsub>\\<^esub> op_cat \" unfolding cat_op_simps . qed (auto intro: cat_op_intros cat_cs_intros) qed subsection\Interchange law\ lemma ntcf_comp_interchange_law: \\See Chapter II-5 in \cite{mac_lane_categories_2010}.\ assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "((\' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \') \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)) = (\' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) interpret \': is_ntcf \ \ \ \' \' \' by (rule assms(3)) interpret \': is_ntcf \ \ \ \' \' \' by (rule assms(4)) show ?thesis proof(rule ntcf_eqI) from ntsmcf_comp_interchange_law [ OF \.ntcf_is_ntsmcf \.ntcf_is_ntsmcf \'.ntcf_is_ntsmcf \'.ntcf_is_ntsmcf ] have "( (ntcf_ntsmcf \' \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \') \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F (ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \) )\NTMap\ = ( (ntcf_ntsmcf \' \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (ntcf_ntsmcf \' \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \) )\NTMap\" by simp then show "(\' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))\NTMap\ = (\' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))\NTMap\" unfolding slicing_simps slicing_commute . qed (auto intro: cat_cs_intros) qed subsection\Identity natural transformation\ subsubsection\Definition and elementary properties\ text\See Chapter II-4 in \cite{mac_lane_categories_2010}.\ definition ntcf_id :: "V \ V" where "ntcf_id \ = [\\HomCod\\CId\ \\<^sub>\ \\ObjMap\, \, \, \\HomDom\, \\HomCod\]\<^sub>\" text\Components.\ lemma ntcf_id_components: shows "ntcf_id \\NTMap\ = \\HomCod\\CId\ \\<^sub>\ \\ObjMap\" and [dg_shared_cs_simps, cat_cs_simps]: "ntcf_id \\NTDom\ = \" and [dg_shared_cs_simps, cat_cs_simps]: "ntcf_id \\NTCod\ = \" and [dg_shared_cs_simps, cat_cs_simps]: "ntcf_id \\NTDGDom\ = \\HomDom\" and [dg_shared_cs_simps, cat_cs_simps]: "ntcf_id \\NTDGCod\ = \\HomCod\" unfolding ntcf_id_def nt_field_simps by (simp_all add: nat_omega_simps) lemma (in is_functor) is_functor_ntcf_id_components: shows "ntcf_id \\NTMap\ = \\CId\ \\<^sub>\ \\ObjMap\" and "ntcf_id \\NTDom\ = \" and "ntcf_id \\NTCod\ = \" and "ntcf_id \\NTDGDom\ = \" and "ntcf_id \\NTDGCod\ = \" unfolding ntcf_id_components by (simp_all add: cat_cs_simps) subsubsection\Natural transformation map\ lemma (in is_functor) ntcf_id_NTMap_vdomain[cat_cs_simps]: "\\<^sub>\ (ntcf_id \\NTMap\) = \\Obj\" using cf_ObjMap_vrange unfolding is_functor_ntcf_id_components by (auto simp: cat_cs_simps) lemmas [cat_cs_simps] = is_functor.ntcf_id_NTMap_vdomain lemma (in is_functor) ntcf_id_NTMap_app_vdomain[cat_cs_simps]: assumes [simp]: "a \\<^sub>\ \\Obj\" shows "ntcf_id \\NTMap\\a\ = \\CId\\\\ObjMap\\a\\" unfolding is_functor_ntcf_id_components by (rule vsv_vcomp_at) (auto simp: cf_ObjMap_vrange cat_cs_simps cat_cs_intros) lemmas [cat_cs_simps] = is_functor.ntcf_id_NTMap_app_vdomain lemma (in is_functor) ntcf_id_NTMap_vsv[cat_cs_intros]: "vsv (ntcf_id \\NTMap\)" unfolding is_functor_ntcf_id_components by (auto intro: vsv_vcomp) lemmas [cat_cs_intros] = is_functor.ntcf_id_NTMap_vsv lemma (in is_functor) ntcf_id_NTMap_vrange: "\\<^sub>\ (ntcf_id \\NTMap\) \\<^sub>\ \\Arr\" proof(rule vsubsetI) interpret vsv \ntcf_id \\NTMap\\ by (rule ntcf_id_NTMap_vsv) fix f assume "f \\<^sub>\ \\<^sub>\ (ntcf_id \\NTMap\)" then obtain a where f_def: "f = ntcf_id \\NTMap\\a\" and a: "a \\<^sub>\ \\<^sub>\ (ntcf_id \\NTMap\)" using vrange_atD by metis then have "a \\<^sub>\ \\Obj\" and "f = \\CId\\\\ObjMap\\a\\" by (auto simp: cat_cs_simps) then show "f \\<^sub>\ \\Arr\" by (auto dest: cf_ObjMap_app_in_HomCod_Obj HomCod.cat_CId_is_arr) qed subsubsection\Further properties\ lemma (in is_functor) cf_ntcf_id_is_ntcf[cat_cs_intros]: "ntcf_id \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(rule is_ntcfI, unfold is_functor_ntcf_id_components(2,3,4,5)) show "ntcf_ntsmcf (ntcf_id \) : cf_smcf \ \\<^sub>S\<^sub>M\<^sub>C\<^sub>F cf_smcf \ : cat_smc \ \\\<^sub>S\<^sub>M\<^sub>C\<^bsub>\\<^esub> cat_smc \" proof ( rule is_ntsmcfI, unfold slicing_simps slicing_commute is_functor_ntcf_id_components(2,3,4,5) ) show "ntsmcf_tdghm (ntcf_ntsmcf (ntcf_id \)) : smcf_dghm (cf_smcf \) \\<^sub>D\<^sub>G\<^sub>H\<^sub>M smcf_dghm (cf_smcf \) : smc_dg (cat_smc \) \\\<^sub>D\<^sub>G\<^bsub>\\<^esub> smc_dg (cat_smc \)" by ( rule is_tdghmI, unfold slicing_simps slicing_commute is_functor_ntcf_id_components(2,3,4,5) ) ( auto simp: cat_cs_simps cat_cs_intros nat_omega_simps ntsmcf_tdghm_def cf_is_semifunctor intro: slicing_intros ) fix f a b assume "f : a \\<^bsub>\\<^esub> b" with is_functor_axioms show "ntcf_id \\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ = \\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> ntcf_id \\NTMap\\a\" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (auto simp: ntcf_ntsmcf_def nat_omega_simps intro: slicing_intros) qed (auto simp: ntcf_id_def nat_omega_simps intro: cat_cs_intros) lemma (in is_functor) cf_ntcf_id_is_ntcf': assumes "\' = \" and "\' = \" shows "ntcf_id \ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" unfolding assms by (rule cf_ntcf_id_is_ntcf) lemmas [cat_cs_intros] = is_functor.cf_ntcf_id_is_ntcf' lemma (in is_ntcf) ntcf_ntcf_vcomp_ntcf_id_left_left[cat_cs_simps]: \\See Chapter II-4 in \cite{mac_lane_categories_2010}.\ "ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = \" proof(rule ntcf_eqI[of \]) interpret id: is_ntcf \ \ \ \ \ \ntcf_id \\ by (rule NTCod.cf_ntcf_id_is_ntcf) show "(ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\ = \\NTMap\" proof(rule vsv_eqI) show [simp]: "\\<^sub>\ ((ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\) = \\<^sub>\ (\\NTMap\)" unfolding ntsmcf_vcomp_components by (simp add: cat_cs_simps) fix a assume "a \\<^sub>\ \\<^sub>\ ((ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\)" then have "a \\<^sub>\ \\Obj\" by (simp add: cat_cs_simps) then show "(ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\a\ = \\NTMap\\a\" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (auto simp: ntsmcf_vcomp_components) qed (auto intro: cat_cs_intros) lemmas [cat_cs_simps] = is_ntcf.ntcf_ntcf_vcomp_ntcf_id_left_left lemma (in is_ntcf) ntcf_ntcf_vcomp_ntcf_id_right_left[cat_cs_simps]: \\See Chapter II-4 in \cite{mac_lane_categories_2010}.\ "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \ = \" proof(rule ntcf_eqI[of \]) interpret id: is_ntcf \ \ \ \ \ \ntcf_id \\ by (rule NTDom.cf_ntcf_id_is_ntcf) show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\ = \\NTMap\" proof(rule vsv_eqI) show [simp]: "\\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\) = \\<^sub>\ (\\NTMap\)" unfolding ntsmcf_vcomp_components by (simp add: cat_cs_simps) fix a assume "a \\<^sub>\ \\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\)" then have "a \\<^sub>\ \\Obj\" by (simp add: cat_cs_simps) then show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\\a\ = \\NTMap\\a\" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (auto simp: ntsmcf_vcomp_components) qed (auto intro: cat_cs_intros) lemmas [cat_cs_simps] = is_ntcf.ntcf_ntcf_vcomp_ntcf_id_right_left lemma (in is_ntcf) ntcf_ntcf_hcomp_ntcf_id_left_left[cat_cs_simps]: \\See Chapter II-5 in \cite{mac_lane_categories_2010}.\ "ntcf_id (cf_id \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = \" proof(rule ntcf_eqI) interpret id: is_ntcf \ \ \ \cf_id \\ \cf_id \\ \ntcf_id (cf_id \)\ by ( simp add: NTDom.HomCod.cat_cf_id_is_functor is_functor.cf_ntcf_id_is_ntcf ) show "ntcf_id (cf_id \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : cf_id \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F cf_id \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: cat_cs_intros) show "(ntcf_id (cf_id \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\ = \\NTMap\" proof(rule vsv_eqI) fix a assume "a \\<^sub>\ \\<^sub>\ ((ntcf_id (cf_id \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\)" then have a: "a \\<^sub>\ \\Obj\" unfolding ntcf_hcomp_NTMap_vdomain[OF is_ntcf_axioms] by simp with is_ntcf_axioms show "(ntcf_id (cf_id \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\a\ = \\NTMap\\a\" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (auto simp: ntsmcf_hcomp_components(1) cat_cs_simps) qed (auto simp: cat_cs_simps intro: cat_cs_intros) lemmas [cat_cs_simps] = is_ntcf.ntcf_ntcf_hcomp_ntcf_id_left_left lemma (in is_ntcf) ntcf_ntcf_hcomp_ntcf_id_right_left[cat_cs_simps]: \\See Chapter II-5 in \cite{mac_lane_categories_2010}.\ "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id (cf_id \) = \" proof(rule ntcf_eqI[of \]) interpret id: is_ntcf \ \ \ \cf_id \\ \cf_id \\ \ntcf_id (cf_id \)\ by ( simp add: NTDom.HomDom.cat_cf_id_is_functor is_functor.cf_ntcf_id_is_ntcf ) show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id (cf_id \) : \ \\<^sub>C\<^sub>F cf_id \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F cf_id \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: cat_cs_intros) show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id (cf_id \))\NTMap\ = \\NTMap\" proof(rule vsv_eqI) fix a assume "a \\<^sub>\ \\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id (cf_id \))\NTMap\)" then have a: "a \\<^sub>\ \\Obj\" unfolding ntcf_hcomp_NTMap_vdomain[OF id.is_ntcf_axioms] by simp with is_ntcf_axioms show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id (cf_id \))\NTMap\\a\ = \\NTMap\\a\" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (auto simp: ntsmcf_hcomp_components(1) cat_cs_simps) qed (auto simp: cat_cs_simps cat_cs_intros) lemmas [cat_cs_simps] = is_ntcf.ntcf_ntcf_hcomp_ntcf_id_right_left subsubsection\The opposite identity natural transformation\ lemma (in is_functor) cf_ntcf_id_op_cf: "ntcf_id (op_cf \) = op_ntcf (ntcf_id \)" proof(rule ntcf_eqI) show ntcfid_op: "ntcf_id (op_cf \) : op_cf \ \\<^sub>C\<^sub>F op_cf \ : op_cat \ \\\<^sub>C\<^bsub>\\<^esub> op_cat \" by (simp add: is_functor.cf_ntcf_id_is_ntcf local.is_functor_op) show "ntcf_id (op_cf \)\NTMap\ = op_ntcf (ntcf_id \)\NTMap\" by (rule vsv_eqI, unfold cat_op_simps) ( auto simp: cat_op_simps cat_cs_simps ntcf_id_components(1) intro: vsv_vcomp ) qed (auto intro: cat_op_intros cat_cs_intros) subsubsection\Identity natural transformation of a composition of functors\ lemma ntcf_id_cf_comp: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "ntcf_id (\ \\<^sub>C\<^sub>F \) = ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \" proof(rule ntcf_eqI) from assms show \\: "ntcf_id (\ \\<^sub>C\<^sub>F \) : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) interpret \\: is_ntcf \ \ \ \\ \\<^sub>C\<^sub>F \\ \\ \\<^sub>C\<^sub>F \\ \ntcf_id (\ \\<^sub>C\<^sub>F \)\ by (rule \\) from assms show \_\: "ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \ : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) interpret \_\: is_ntcf \ \ \ \\ \\<^sub>C\<^sub>F \\ \\ \\<^sub>C\<^sub>F \\ \ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \\ by (rule \_\) show "ntcf_id (\ \\<^sub>C\<^sub>F \)\NTMap\ = (ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\" proof(rule vsv_eqI, unfold \\.ntcf_NTMap_vdomain \_\.ntcf_NTMap_vdomain) fix a assume "a \\<^sub>\ \\Obj\" with assms show "ntcf_id (\ \\<^sub>C\<^sub>F \)\NTMap\\a\ = (ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\\a\" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed auto qed auto lemmas [cat_cs_simps] = ntcf_id_cf_comp[symmetric] subsection\Composition of a natural transformation and a functor\ subsubsection\Definition and elementary properties\ abbreviation (input) ntcf_cf_comp :: "V \ V \ V" (infixl "\\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F" 55) where "ntcf_cf_comp \ tdghm_dghm_comp" text\Slicing.\ lemma ntsmcf_tdghm_ntsmcf_smcf_comp[slicing_commute]: "ntcf_ntsmcf \ \\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F\<^sub>-\<^sub>S\<^sub>M\<^sub>C\<^sub>F cf_smcf \ = ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)" unfolding ntcf_ntsmcf_def cf_smcf_def cat_smc_def tdghm_dghm_comp_def dghm_comp_def ntsmcf_tdghm_def smcf_dghm_def smc_dg_def dg_field_simps dghm_field_simps nt_field_simps by (simp add: nat_omega_simps) (*slow*) subsubsection\Natural transformation map\ mk_VLambda (in is_functor) tdghm_dghm_comp_components(1)[where \=\, unfolded cf_HomDom] |vdomain ntcf_cf_comp_NTMap_vdomain[cat_cs_simps]| |app ntcf_cf_comp_NTMap_app[cat_cs_simps]| lemmas [cat_cs_simps] = is_functor.ntcf_cf_comp_NTMap_vdomain is_functor.ntcf_cf_comp_NTMap_app lemma ntcf_cf_comp_NTMap_vrange: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)\NTMap\) \\<^sub>\ \\Arr\" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_functor \ \ \ \ by (rule assms(2)) show ?thesis unfolding tdghm_dghm_comp_components by (auto simp: cat_cs_simps intro: cat_cs_intros) qed subsubsection\ Opposite of the composition of a natural transformation and a functor \ lemma op_ntcf_ntcf_cf_comp[cat_op_simps]: "op_ntcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) = op_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F op_cf \" unfolding tdghm_dghm_comp_def dghm_comp_def op_ntcf_def op_cf_def op_cat_def dg_field_simps dghm_field_simps nt_field_simps by (simp add: nat_omega_simps) (*slow*) subsubsection\ Composition of a natural transformation and a functor is a natural transformation \ lemma ntcf_cf_comp_is_ntcf: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_functor \ \ \ \ by (rule assms(2)) show ?thesis proof(rule is_ntcfI) show "vfsequence (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)" unfolding tdghm_dghm_comp_def by (simp add: nat_omega_simps) from assms show "\ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros) from assms show "\ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros) show "vcard (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) = 5\<^sub>\" unfolding tdghm_dghm_comp_def by (simp add: nat_omega_simps) from assms show "ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) : cf_smcf (\ \\<^sub>C\<^sub>F \) \\<^sub>S\<^sub>M\<^sub>C\<^sub>F cf_smcf (\ \\<^sub>C\<^sub>F \) : cat_smc \ \\\<^sub>S\<^sub>M\<^sub>C\<^bsub>\\<^esub> cat_smc \" by ( cs_concl cs_simp: slicing_commute[symmetric] cs_intro: slicing_intros smc_cs_intros cat_cs_intros ) qed (auto simp: tdghm_dghm_comp_components(1) cat_cs_simps) qed lemma ntcf_cf_comp_is_ntcf'[cat_cs_intros]: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' = \ \\<^sub>C\<^sub>F \" and "\' = \ \\<^sub>C\<^sub>F \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" using assms(1,2) unfolding assms(3,4) by (simp add: ntcf_cf_comp_is_ntcf) subsubsection\Further properties\ lemma ntcf_cf_comp_ntcf_cf_comp_assoc: assumes "\ : \ \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \
" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ = \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F (\ \\<^sub>C\<^sub>F \)" proof- interpret \: is_ntcf \ \ \
\ \' \ by (rule assms(1)) interpret \: is_functor \ \ \ \ by (rule assms(2)) interpret \: is_functor \ \ \ \ by (rule assms(3)) show ?thesis proof(rule ntcf_ntsmcf_eqI) from assms show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \' \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \
" by (cs_concl cs_shallow cs_intro: cat_cs_intros) show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F (\ \\<^sub>C\<^sub>F \) : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \' \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \
" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) from assms show "ntcf_ntsmcf ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) = ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F (\ \\<^sub>C\<^sub>F \))" by ( cs_concl cs_simp: slicing_commute[symmetric] cs_intro: slicing_intros ntsmcf_smcf_comp_ntsmcf_smcf_comp_assoc ) qed simp_all qed lemma (in is_ntcf) ntcf_ntcf_cf_comp_cf_id[cat_cs_simps]: "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F cf_id \ = \" proof(rule ntcf_ntsmcf_eqI) show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F cf_id \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) show "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: cat_cs_intros) show "ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F cf_id \) = ntcf_ntsmcf \" by ( cs_concl cs_shallow cs_simp: slicing_commute[symmetric] cs_intro: cat_cs_intros slicing_intros smc_cs_simps ) qed simp_all lemmas [cat_cs_simps] = is_ntcf.ntcf_ntcf_cf_comp_cf_id lemma ntcf_vcomp_ntcf_cf_comp[cat_cs_simps]: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) = (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \" proof(rule ntcf_ntsmcf_eqI) from assms show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \) : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: cat_cs_intros) from assms show "ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)) = ntcf_ntsmcf (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)" unfolding slicing_commute[symmetric] by (intro ntsmcf_vcomp_ntsmcf_smcf_comp) (cs_concl cs_intro: slicing_intros) qed (use assms in \cs_concl cs_shallow cs_intro: cat_cs_intros\)+ subsection\Composition of a functor and a natural transformation\ subsubsection\Definition and elementary properties\ abbreviation (input) cf_ntcf_comp :: "V \ V \ V" (infixl "\\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F" 55) where "cf_ntcf_comp \ dghm_tdghm_comp" text\Slicing.\ lemma ntcf_ntsmcf_cf_ntcf_comp[slicing_commute]: "cf_smcf \ \\<^sub>S\<^sub>M\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F ntcf_ntsmcf \ = ntcf_ntsmcf (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" unfolding ntcf_ntsmcf_def cf_smcf_def cat_smc_def dghm_tdghm_comp_def dghm_comp_def ntsmcf_tdghm_def smcf_dghm_def smc_dg_def dg_field_simps dghm_field_simps nt_field_simps by (simp add: nat_omega_simps) (*slow*) subsubsection\Natural transformation map\ mk_VLambda (in is_ntcf) dghm_tdghm_comp_components(1)[where \=\, unfolded ntcf_NTDGDom] |vdomain cf_ntcf_comp_NTMap_vdomain| |app cf_ntcf_comp_NTMap_app| lemmas [cat_cs_simps] = is_ntcf.cf_ntcf_comp_NTMap_vdomain is_ntcf.cf_ntcf_comp_NTMap_app lemma cf_ntcf_comp_NTMap_vrange: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\\<^sub>\ ((\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\) \\<^sub>\ \\Arr\" proof- interpret \: is_functor \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis unfolding dghm_tdghm_comp_components by (auto simp: cat_cs_simps intro: cat_cs_intros) qed subsubsection\ Opposite of the composition of a functor and a natural transformation \ lemma op_ntcf_cf_ntcf_comp[cat_op_simps]: "op_ntcf (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = op_cf \ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F op_ntcf \" unfolding dghm_tdghm_comp_def dghm_comp_def op_ntcf_def op_cf_def op_cat_def dg_field_simps dghm_field_simps nt_field_simps by (simp add: nat_omega_simps) (*slow*) subsubsection\ Composition of a functor and a natural transformation is a natural transformation \ lemma cf_ntcf_comp_is_ntcf: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof- interpret \: is_functor \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis proof(rule is_ntcfI) show "vfsequence (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" unfolding dghm_tdghm_comp_def by simp from assms show "\ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros) from assms show "\ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros) show "vcard (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = 5\<^sub>\" unfolding dghm_tdghm_comp_def by (simp add: nat_omega_simps) from assms show "ntcf_ntsmcf (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) : cf_smcf (\ \\<^sub>C\<^sub>F \) \\<^sub>S\<^sub>M\<^sub>C\<^sub>F cf_smcf (\ \\<^sub>C\<^sub>F \) : cat_smc \ \\\<^sub>S\<^sub>M\<^sub>C\<^bsub>\\<^esub> cat_smc \" by ( cs_concl cs_simp: slicing_commute[symmetric] cs_intro: slicing_intros smc_cs_intros ) qed (auto simp: dghm_tdghm_comp_components(1) cat_cs_simps) qed lemma cf_ntcf_comp_is_functor'[cat_cs_intros]: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' = \ \\<^sub>C\<^sub>F \" and "\' = \ \\<^sub>C\<^sub>F \" shows "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \' \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" using assms(1,2) unfolding assms(3,4) by (simp add: cf_ntcf_comp_is_ntcf) subsubsection\Further properties\ lemma cf_comp_cf_ntcf_comp_assoc: assumes "\ : \ \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \
" shows "(\ \\<^sub>C\<^sub>F \) \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = \ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" proof(rule ntcf_ntsmcf_eqI) interpret \: is_ntcf \ \ \ \ \' \ by (rule assms(1)) interpret \: is_functor \ \ \ \ by (rule assms(2)) interpret \: is_functor \ \ \
\ by (rule assms(3)) from assms show "(\ \\<^sub>C\<^sub>F \) \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \
" by (cs_concl cs_intro: cat_cs_intros) from assms show "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \' : \ \\\<^sub>C\<^bsub>\\<^esub> \
" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) from assms show "ntcf_ntsmcf (\ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = ntcf_ntsmcf (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \))" by ( cs_concl cs_simp: slicing_commute[symmetric] cs_intro: slicing_intros smcf_comp_smcf_ntsmcf_comp_assoc ) qed simp_all lemma (in is_ntcf) ntcf_cf_ntcf_comp_cf_id[cat_cs_simps]: "cf_id \ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = \" proof(rule ntcf_ntsmcf_eqI) show "cf_id \ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) show "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: cat_cs_intros) show "ntcf_ntsmcf (smcf_id \ \\<^sub>S\<^sub>M\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>S\<^sub>M\<^sub>C\<^sub>F \) = ntcf_ntsmcf \" by ( cs_concl cs_shallow cs_simp: slicing_commute[symmetric] cs_intro: cat_cs_intros slicing_intros smc_cs_simps ) qed simp_all lemmas [cat_cs_simps] = is_ntcf.ntcf_cf_ntcf_comp_cf_id lemma cf_ntcf_comp_ntcf_cf_comp_assoc: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \
" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "(\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ = \ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_functor \ \ \
\ by (rule assms(2)) interpret \: is_functor \ \ \ \ by (rule assms(3)) show ?thesis by (rule ntcf_ntsmcf_eqI) ( use assms in \ cs_concl cs_simp: cat_cs_simps slicing_commute[symmetric] cs_intro: cat_cs_intros slicing_intros smcf_ntsmcf_comp_ntsmcf_smcf_comp_assoc \ )+ qed lemma ntcf_cf_comp_ntcf_id[cat_cs_simps]: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ = ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \" proof(rule ntcf_eqI) from assms have dom_lhs: "\\<^sub>\ ((ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)\NTMap\) = \\Obj\" by (cs_concl cs_shallow cs_simp: cat_cs_simps) from assms have dom_rhs: "\\<^sub>\ ((ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\) = \\Obj\" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) show "(ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)\NTMap\ = (ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\" proof(rule vsv_eqI, unfold dom_lhs dom_rhs) fix a assume "a \\<^sub>\ \\Obj\" with assms show "(ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)\NTMap\\a\ = (ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\\a\" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (auto intro: cat_cs_intros) qed (use assms in \cs_concl cs_shallow cs_intro: cat_cs_intros\)+ lemma cf_ntcf_comp_ntcf_vcomp: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" proof- interpret \: is_functor \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(3)) show "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = \ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)" by (rule ntcf_ntsmcf_eqI) ( use assms in \ cs_concl cs_simp: smc_cs_simps slicing_commute[symmetric] cs_intro: cat_cs_intros slicing_intros smcf_ntsmcf_comp_ntsmcf_vcomp \ )+ qed subsection\Constant natural transformation\ subsubsection\Definition and elementary properties\ text\See Chapter III in \cite{mac_lane_categories_2010}.\ definition ntcf_const :: "V \ V \ V \ V" where "ntcf_const \ \ f = [ vconst_on (\\Obj\) f, cf_const \ \ (\\Dom\\f\), cf_const \ \ (\\Cod\\f\), \, \ ]\<^sub>\" text\Components.\ lemma ntcf_const_components: shows "ntcf_const \ \ f\NTMap\ = vconst_on (\\Obj\) f" and "ntcf_const \ \ f\NTDom\ = cf_const \ \ (\\Dom\\f\)" and "ntcf_const \ \ f\NTCod\ = cf_const \ \ (\\Cod\\f\)" and "ntcf_const \ \ f\NTDGDom\ = \" and "ntcf_const \ \ f\NTDGCod\ = \" unfolding ntcf_const_def nt_field_simps by (auto simp: nat_omega_simps) subsubsection\Natural transformation map\ mk_VLambda ntcf_const_components(1)[folded VLambda_vconst_on] |vsv ntcf_const_ObjMap_vsv[cat_cs_intros]| |vdomain ntcf_const_ObjMap_vdomain[cat_cs_simps]| |app ntcf_const_ObjMap_app[cat_cs_simps]| lemma ntcf_const_NTMap_ne_vrange: assumes "\\Obj\ \ 0" shows "\\<^sub>\ (ntcf_const \ \ f\NTMap\) = set {f}" using assms unfolding ntcf_const_components by simp lemma ntcf_const_NTMap_vempty_vrange: assumes "\\Obj\ = 0" shows "\\<^sub>\ (ntcf_const \ \ f\NTMap\) = 0" using assms unfolding ntcf_const_components by simp subsubsection\Constant natural transformation is a natural transformation\ lemma ntcf_const_is_ntcf: assumes "category \ \" and "category \ \" and "f : a \\<^bsub>\\<^esub> b" shows "ntcf_const \ \ f : cf_const \ \ a \\<^sub>C\<^sub>F cf_const \ \ b : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof- interpret \: category \ \ by (rule assms(1)) interpret \: category \ \ by (rule assms(2)) show ?thesis proof(intro is_ntcfI') show "vfsequence (ntcf_const \ \ f)" unfolding ntcf_const_def by auto show "cf_const \ \ a : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(rule cf_const_is_functor) from assms(3) show "a \\<^sub>\ \\Obj\" by (simp add: cat_cs_intros) qed (auto simp: cat_cs_intros) from assms(3) show const_b_is_functor: "cf_const \ \ b : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (auto intro: cf_const_is_functor cat_cs_intros) show "vcard (ntcf_const \ \ f) = 5\<^sub>\" unfolding ntcf_const_def by (simp add: nat_omega_simps) show "ntcf_const \ \ f\NTMap\\a'\ : cf_const \ \ a\ObjMap\\a'\ \\<^bsub>\\<^esub> cf_const \ \ b\ObjMap\\a'\" if "a' \\<^sub>\ \\Obj\" for a' by (simp add: that assms(3) ntcf_const_components(1) dghm_const_ObjMap_app) from assms(3) show "ntcf_const \ \ f\NTMap\\b'\ \\<^sub>A\<^bsub>\\<^esub> cf_const \ \ a\ArrMap\\f'\ = cf_const \ \ b \ArrMap\\f'\ \\<^sub>A\<^bsub>\\<^esub> ntcf_const \ \ f\NTMap\\a'\" if "f' : a' \\<^bsub>\\<^esub> b'" for f' a' b' using that dghm_const_ArrMap_app by (auto simp: ntcf_const_components cat_cs_intros cat_cs_simps) qed (use assms(3) in \auto simp: ntcf_const_components\) qed lemma ntcf_const_is_ntcf'[cat_cs_intros]: assumes "category \ \" and "category \ \" and "f : a \\<^bsub>\\<^esub> b" and "\ = cf_const \ \ a" and "\ = cf_const \ \ b" and "\' = \" and "\' = \" shows "ntcf_const \ \ f : \ \\<^sub>C\<^sub>F \ : \' \\\<^sub>C\<^bsub>\\<^esub> \'" using assms(1-3) unfolding assms(4-7) by (rule ntcf_const_is_ntcf) subsubsection\Opposite constant natural transformation\ lemma op_ntcf_ntcf_const[cat_op_simps]: "op_ntcf (ntcf_const \ \ f) = ntcf_const (op_cat \) (op_cat \) f" unfolding nt_field_simps dghm_field_simps dg_field_simps dghm_const_def ntcf_const_def op_cat_def op_cf_def op_ntcf_def by (simp_all add: nat_omega_simps) subsubsection\Further properties\ lemma ntcf_const_ntcf_vcomp[cat_cs_simps]: assumes "category \ \" and "category \ \" and "g : b \\<^bsub>\\<^esub> c" and "f : a \\<^bsub>\\<^esub> b" shows "ntcf_const \ \ g \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \ \ f = ntcf_const \ \ (g \\<^sub>A\<^bsub>\\<^esub> f)" proof- interpret \: category \ \ by (rule assms(1)) interpret \: category \ \ by (rule assms(2)) from assms(3,4) have gf: "g \\<^sub>A\<^bsub>\\<^esub> f : a \\<^bsub>\\<^esub> c" by (simp add: cat_cs_intros) note \\g = ntcf_const_is_ntcf[OF assms(1,2,3)] and \\f = ntcf_const_is_ntcf[OF assms(1,2,4)] show ?thesis proof(rule ntcf_eqI) from ntcf_const_is_ntcf[OF assms(1,2,3)] ntcf_const_is_ntcf[OF assms(1,2,4)] show "ntcf_const \ \ g \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \ \ f : cf_const \ \ a \\<^sub>C\<^sub>F cf_const \ \ c : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (rule ntcf_vcomp_is_ntcf) show "ntcf_const \ \ (g \\<^sub>A\<^bsub>\\<^esub> f) : cf_const \ \ a \\<^sub>C\<^sub>F cf_const \ \ c : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (rule ntcf_const_is_ntcf[OF assms(1,2) gf]) show "(ntcf_const \ \ g \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \ \ f)\NTMap\ = ntcf_const \ \ (g \\<^sub>A\<^bsub>\\<^esub> f)\NTMap\" unfolding ntcf_const_components proof(rule vsv_eqI, unfold ntcf_vcomp_NTMap_vdomain[OF \\f]) fix a assume prems: "a \\<^sub>\ \\Obj\" then show "(ntcf_const \ \ g \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \ \ f)\NTMap\\a\ = vconst_on (\\Obj\) (g \\<^sub>A\<^bsub>\\<^esub> f)\a\" unfolding ntcf_vcomp_NTMap_app[OF \\g \\f prems] by (simp add: ntcf_const_components) qed (simp_all add: ntsmcf_vcomp_components) qed auto qed lemma ntcf_id_cf_const[cat_cs_simps]: assumes "category \ \" and "category \ \" and "c \\<^sub>\ \\Obj\" shows "ntcf_id (cf_const \ \ c) = ntcf_const \ \ (\\CId\\c\)" proof(rule ntcf_eqI) interpret \: category \ \ by (rule assms(1)) interpret \: category \ \ by (rule assms(2)) from assms show "ntcf_const \ \ (\\CId\\c\) : cf_const \ \ c \\<^sub>C\<^sub>F cf_const \ \ c : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (auto intro: ntcf_const_is_ntcf) interpret const_c: is_functor \ \ \ \cf_const \ \ c\ by (rule cf_const_is_functor) (auto simp: assms(3) cat_cs_intros) show "ntcf_id (cf_const \ \ c) : cf_const \ \ c \\<^sub>C\<^sub>F cf_const \ \ c : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (rule const_c.cf_ntcf_id_is_ntcf) show "ntcf_id (cf_const \ \ c)\NTMap\ = ntcf_const \ \ (\\CId\\c\)\NTMap\" proof(rule vsv_eqI, unfold ntcf_const_components) show "vsv (ntcf_id (cf_const \ \ c)\NTMap\)" unfolding ntcf_id_components by (auto simp: cat_cs_simps intro: vsv_vcomp) qed (auto simp: cat_cs_simps) qed simp_all lemma ntcf_cf_comp_cf_const_right[cat_cs_simps]: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "category \ \" and "b \\<^sub>\ \\Obj\" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F cf_const \ \ b = ntcf_const \ \ (\\NTMap\\b\)" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: category \ \ by (rule assms(2)) show ?thesis proof(rule ntcf_eqI) from assms(3) show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F cf_const \ \ b : cf_const \ \ (\\ObjMap\\b\) \\<^sub>C\<^sub>F cf_const \ \ (\\ObjMap\\b\) : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) from assms(3) show "ntcf_const \ \ (\\NTMap\\b\) : cf_const \ \ (\\ObjMap\\b\) \\<^sub>C\<^sub>F cf_const \ \ (\\ObjMap\\b\) : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) from assms(3) have dom_lhs: "\\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F cf_const \ \ b)\NTMap\) = \\Obj\" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) from assms(3) have dom_rhs: "\\<^sub>\ (ntcf_const \ \ (\\NTMap\\b\)\NTMap\) = \\Obj\" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F cf_const \ \ b)\NTMap\ = ntcf_const \ \ (\\NTMap\\b\)\NTMap\" proof(rule vsv_eqI, unfold dom_lhs dom_rhs) fix a assume "a \\<^sub>\ \\Obj\" with assms(3) show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F cf_const \ \ b)\NTMap\\a\ = ntcf_const \ \ (\\NTMap\\b\)\NTMap\\a\" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (auto intro: cat_cs_intros) qed simp_all qed lemma cf_ntcf_comp_ntcf_id[cat_cs_simps]: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \ = ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \" proof- interpret \: is_functor \ \ \ \ by (rule assms(1)) interpret \: is_functor \ \ \ \ by (rule assms(2)) show ?thesis proof(rule ntcf_eqI) show "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \ : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: cat_cs_intros) show "ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \ : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: cat_cs_intros) have dom_lhs: "\\<^sub>\ ((\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\) = \\Obj\" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) have dom_rhs: "\\<^sub>\ ((ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\) = \\Obj\" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) show "(\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\ = (ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\" proof(rule vsv_eqI, unfold dom_lhs dom_rhs) fix a assume "a \\<^sub>\ \\Obj\" then show "(\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\\a\ = (ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \)\NTMap\\a\" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (cs_concl cs_intro: cat_cs_intros) qed simp_all qed lemma (in is_functor) cf_ntcf_cf_comp_ntcf_const[cat_cs_simps]: assumes "category \ \" and "f : a \\<^bsub>\\<^esub> b" shows "ntcf_const \ \ f \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ = ntcf_const \ \ f" proof(rule ntcf_eqI) interpret \: category \ \ by (rule assms(1)) from assms(2) show "ntcf_const \ \ f \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ : cf_const \ \ a \\<^sub>C\<^sub>F cf_const \ \ b : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) then have dom_lhs: "\\<^sub>\ ((ntcf_const \ \ f \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)\NTMap\) = \\Obj\" by (cs_concl cs_shallow cs_simp: cat_cs_simps) from assms(2) show "ntcf_const \ \ f : cf_const \ \ a \\<^sub>C\<^sub>F cf_const \ \ b : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) then have dom_rhs: "\\<^sub>\ (ntcf_const \ \ f\NTMap\) = \\Obj\" by (cs_concl cs_shallow cs_simp: cat_cs_simps) show "(ntcf_const \ \ f \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)\NTMap\ = ntcf_const \ \ f\NTMap\" proof(rule vsv_eqI, unfold dom_lhs dom_rhs) fix a assume "a \\<^sub>\ \\Obj\" then show "(ntcf_const \ \ f \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)\NTMap\\a\ = ntcf_const \ \ f\NTMap\\a\" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) qed simp_all lemmas [cat_cs_simps] = is_functor.cf_ntcf_cf_comp_ntcf_const lemma (in is_functor) cf_ntcf_comp_cf_ntcf_const[cat_cs_simps]: assumes "category \ \" and "f : r' \\<^bsub>\\<^esub> r" shows "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \ \ f = ntcf_const \ \ (\\ArrMap\\f\)" proof(rule ntcf_eqI) interpret \: category \ \ by (rule assms(1)) from assms(2) have r': "r' \\<^sub>\ \\Obj\" and r: "r \\<^sub>\ \\Obj\" by auto from assms(2) show "\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \ \ f : cf_const \ \ (\\ObjMap\\r'\) \\<^sub>C\<^sub>F cf_const \ \ (\\ObjMap\\r\) : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros) with assms(2) have dom_lhs: "\\<^sub>\ ((\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \ \ f)\NTMap\) = \\Obj\" by (cs_concl cs_simp: cat_cs_simps) from assms(2) show "ntcf_const \ \ (\\ArrMap\\f\) : cf_const \ \ (\\ObjMap\\r'\) \\<^sub>C\<^sub>F cf_const \ \ (\\ObjMap\\r\) : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros) with assms(2) have dom_rhs: "\\<^sub>\ (ntcf_const \ \ (\\ArrMap\\f\)\NTMap\) = \\Obj\" by (cs_concl cs_shallow cs_simp: cat_cs_simps) show "(\ \\<^sub>C\<^sub>F\<^sub>-\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_const \ \ f)\NTMap\ = ntcf_const \ \ (\\ArrMap\\f\)\NTMap\" by (rule vsv_eqI, unfold dom_lhs dom_rhs) ( use assms(2) in \cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros\ )+ qed simp_all lemmas [cat_cs_simps] = is_functor.cf_ntcf_comp_cf_ntcf_const subsection\Natural isomorphism\ text\See Chapter I-4 in \cite{mac_lane_categories_2010}.\ locale is_iso_ntcf = is_ntcf + assumes iso_ntcf_is_iso_arr[cat_arrow_cs_intros]: "a \\<^sub>\ \\Obj\ \ \\NTMap\\a\ : \\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\a\" syntax "_is_iso_ntcf" :: "V \ V \ V \ V \ V \ V \ bool" (\(_ : _ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o _ : _ \\\<^sub>C\ _)\ [51, 51, 51, 51, 51] 51) translations "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" \ "CONST is_iso_ntcf \ \ \ \ \ \" lemma (in is_iso_ntcf) iso_ntcf_is_iso_arr': assumes "a \\<^sub>\ \\Obj\" and "A = \\ObjMap\\a\" and "B = \\ObjMap\\a\" shows "\\NTMap\\a\ : A \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> B" using assms by (auto intro: cat_arrow_cs_intros) lemmas [cat_arrow_cs_intros] = is_iso_ntcf.iso_ntcf_is_iso_arr' lemma (in is_iso_ntcf) iso_ntcf_is_iso_arr'': assumes "a \\<^sub>\ \\Obj\" and "A = \\ObjMap\\a\" and "B = \\ObjMap\\a\" and "F = \\NTMap\\a\" and "\' = \" shows "F : A \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\'\<^esub> B" using assms by (auto intro: cat_arrow_cs_intros) text\Rules.\ lemma (in is_iso_ntcf) is_iso_ntcf_axioms'[cat_cs_intros]: assumes "\' = \" and "\' = \" and "\' = \" and "\' = \" and "\' = \" shows "\ : \' \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \' : \' \\\<^sub>C\<^bsub>\'\<^esub> \'" unfolding assms by (rule is_iso_ntcf_axioms) mk_ide rf is_iso_ntcf_def[unfolded is_iso_ntcf_axioms_def] |intro is_iso_ntcfI| |dest is_iso_ntcfD[dest]| |elim is_iso_ntcfE[elim]| lemmas [ntcf_cs_intros] = is_iso_ntcfD(1) subsection\Inverse natural transformation\ subsubsection\Definition and elementary properties\ definition inv_ntcf :: "V \ V" where "inv_ntcf \ = [ (\a\\<^sub>\\\NTDGDom\\Obj\. SOME g. is_inverse (\\NTDGCod\) g (\\NTMap\\a\)), \\NTCod\, \\NTDom\, \\NTDGDom\, \\NTDGCod\ ]\<^sub>\" text\Slicing.\ lemma inv_ntcf_components: shows "inv_ntcf \\NTMap\ = (\a\\<^sub>\\\NTDGDom\\Obj\. SOME g. is_inverse (\\NTDGCod\) g (\\NTMap\\a\))" and [cat_cs_simps]: "inv_ntcf \\NTDom\ = \\NTCod\" and [cat_cs_simps]: "inv_ntcf \\NTCod\ = \\NTDom\" and [cat_cs_simps]: "inv_ntcf \\NTDGDom\ = \\NTDGDom\" and [cat_cs_simps]: "inv_ntcf \\NTDGCod\ = \\NTDGCod\" unfolding inv_ntcf_def nt_field_simps by (simp_all add: nat_omega_simps) text\Components.\ lemma (in is_iso_ntcf) is_iso_ntcf_inv_ntcf_components[cat_cs_simps]: "inv_ntcf \\NTDom\ = \" "inv_ntcf \\NTCod\ = \" "inv_ntcf \\NTDGDom\ = \" "inv_ntcf \\NTDGCod\ = \" unfolding inv_ntcf_components by (simp_all add: cat_cs_simps) subsubsection\Natural transformation map\ lemma inv_ntcf_NTMap_vsv[cat_cs_intros]: "vsv (inv_ntcf \\NTMap\)" unfolding inv_ntcf_components by auto lemma (in is_iso_ntcf) iso_ntcf_inv_ntcf_NTMap_app_is_inverse[cat_cs_intros]: assumes "a \\<^sub>\ \\Obj\" shows "is_inverse \ (inv_ntcf \\NTMap\\a\) (\\NTMap\\a\)" proof- from assms is_iso_ntcf_axioms have "\g. is_inverse \ g (\\NTMap\\a\)" by auto from assms someI2_ex[OF this] show "is_inverse \ (inv_ntcf \\NTMap\\a\) (\\NTMap\\a\)" unfolding inv_ntcf_components by (simp add: cat_cs_simps) qed lemma (in is_iso_ntcf) iso_ntcf_inv_ntcf_NTMap_app_is_the_inverse[cat_cs_intros]: assumes "a \\<^sub>\ \\Obj\" shows "inv_ntcf \\NTMap\\a\ = (\\NTMap\\a\)\\<^sub>C\<^bsub>\\<^esub>" proof- have "is_inverse \ (inv_ntcf \\NTMap\\a\) (\\NTMap\\a\)" by (rule iso_ntcf_inv_ntcf_NTMap_app_is_inverse[OF assms]) from NTDom.HomCod.cat_is_inverse_eq_the_inverse[OF this] show ?thesis . qed lemmas [cat_cs_simps] = is_iso_ntcf.iso_ntcf_inv_ntcf_NTMap_app_is_the_inverse lemma (in is_ntcf) inv_ntcf_NTMap_vdomain[cat_cs_simps]: "\\<^sub>\ (inv_ntcf \\NTMap\) = \\Obj\" unfolding inv_ntcf_components by (simp add: cat_cs_simps) lemmas [cat_cs_simps] = is_ntcf.inv_ntcf_NTMap_vdomain lemma (in is_iso_ntcf) inv_ntcf_NTMap_vrange: "\\<^sub>\ (inv_ntcf \\NTMap\) \\<^sub>\ \\Arr\" proof(rule vsubsetI) interpret inv_\: vsv \inv_ntcf \\NTMap\\ by (rule inv_ntcf_NTMap_vsv) fix f assume "f \\<^sub>\ \\<^sub>\ (inv_ntcf \\NTMap\)" then obtain a where f_def: "f = inv_ntcf \\NTMap\\a\" and "a \\<^sub>\ \\<^sub>\ (inv_ntcf \\NTMap\)" by (blast elim: inv_\.vrange_atE) then have "a \\<^sub>\ \\Obj\" by (simp add: cat_cs_simps) then have "is_inverse \ f (\\NTMap\\a\)" unfolding f_def by (intro iso_ntcf_inv_ntcf_NTMap_app_is_inverse) then show "f \\<^sub>\ \\Arr\" by auto qed subsubsection\Opposite natural isomorphism\ lemma (in is_iso_ntcf) is_iso_ntcf_op: "op_ntcf \ : op_cf \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o op_cf \ : op_cat \ \\\<^sub>C\<^bsub>\\<^esub> op_cat \" proof- from is_iso_ntcf_axioms have "op_ntcf \ : op_cf \ \\<^sub>C\<^sub>F op_cf \ : op_cat \ \\\<^sub>C\<^bsub>\\<^esub> op_cat \" by (cs_concl cs_shallow cs_intro: cat_cs_intros cat_op_intros) then show ?thesis by (intro is_iso_ntcfI) (auto simp: cat_op_simps cat_arrow_cs_intros) qed lemma (in is_iso_ntcf) is_iso_ntcf_op'[cat_op_intros]: assumes "\' = op_cf \" and "\' = op_cf \" and "\' = op_cat \" and "\' = op_cat \" shows "op_ntcf \ : \' \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \' : \' \\\<^sub>C\<^bsub>\\<^esub> \'" unfolding assms by (rule is_iso_ntcf_op) lemmas is_iso_ntcf_op[cat_op_intros] = is_iso_ntcf.is_iso_ntcf_op subsection\A natural isomorphism is an isomorphism in the category \Funct\\ text\ The results that are presented in this subsection can be found in nLab (see \cite{noauthor_nlab_nodate}\footnote{\url{ https://ncatlab.org/nlab/show/natural+isomorphism }}). \ lemma is_iso_arr_is_iso_ntcf: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = ntcf_id \" and "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = ntcf_id \" shows "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show ?thesis proof(rule is_iso_ntcfI) fix a assume prems: "a \\<^sub>\ \\Obj\" show "\\NTMap\\a\ : \\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\a\" proof(rule is_iso_arrI) show "is_inverse \ (\\NTMap\\a\) (\\NTMap\\a\)" proof(rule is_inverseI) from prems have "\\NTMap\\a\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\ = (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\a\" by (simp add: ntcf_vcomp_NTMap_app[OF assms(2,1) prems]) also have "\ = ntcf_id \\NTMap\\a\" unfolding assms(4) by simp also from prems \.NTDom.ntcf_id_NTMap_app_vdomain have "\ = \\CId\\\\ObjMap\\a\\" unfolding ntcf_id_components by auto finally show "\\NTMap\\a\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\ = \\CId\\\\ObjMap\\a\\". from prems have "\\NTMap\\a\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\ = (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\a\" by (simp add: ntcf_vcomp_NTMap_app[OF assms(1,2) prems]) also have "\ = ntcf_id \\NTMap\\a\" unfolding assms(3) by simp also from prems \.NTCod.ntcf_id_NTMap_app_vdomain have "\ = \\CId\\\\ObjMap\\a\\" unfolding ntcf_id_components by auto finally show "\\NTMap\\a\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\ = \\CId\\\\ObjMap\\a\\". qed (auto simp: prems cat_cs_intros) qed (auto simp: prems cat_cs_intros) qed (auto simp: cat_cs_intros) qed lemma iso_ntcf_is_iso_arr: assumes "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows [ntcf_cs_intros]: "inv_ntcf \ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \ = ntcf_id \" and "inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = ntcf_id \" proof- interpret is_iso_ntcf \ \ \ \ \ \ by (rule assms(1)) define m where "m a = inv_ntcf \\NTMap\\a\" for a have is_inverse[intro]: "a \\<^sub>\ \\Obj\ \ is_inverse \ (m a) (\\NTMap\\a\)" for a unfolding m_def by (cs_concl cs_shallow cs_intro: cat_cs_intros) have [dest, intro, simp]: "a \\<^sub>\ \\Obj\ \ m a : \\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\a\" for a proof- assume prems: "a \\<^sub>\ \\Obj\" from prems have "\\NTMap\\a\ : \\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\a\" by (auto intro: cat_cs_intros cat_arrow_cs_intros) with is_inverse[OF prems] show "m a : \\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\a\" by ( meson NTDom.HomCod.cat_is_inverse_is_iso_arr is_iso_arrD ) qed have [intro]: "f : a \\<^bsub>\\<^esub> b \ m b \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ = \\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> m a" for f a b proof- assume prems: "f : a \\<^bsub>\\<^esub> b" then have ma: "m a : \\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\a\" and mb: "m b : \\ObjMap\\b\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\b\" and \f: "\\ArrMap\\f\ : \\ObjMap\\a\ \\<^bsub>\\<^esub> \\ObjMap\\b\" and \a: "\\NTMap\\a\ : \\ObjMap\\a\ \\<^bsub>\\<^esub> \\ObjMap\\a\" and \f: "\\ArrMap\\f\ : \\ObjMap\\a\ \\<^bsub>\\<^esub> \\ObjMap\\b\" and \b: "\\NTMap\\b\ : \\ObjMap\\b\ \\<^bsub>\\<^esub> \\ObjMap\\b\" by (auto intro: cat_cs_intros) then have \b\f: "\\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ : \\ObjMap\\a\ \\<^bsub>\\<^esub> \\ObjMap\\b\" by (auto intro: cat_cs_intros) from prems have inv_ma: "is_inverse \ (m a) (\\NTMap\\a\)" and inv_mb: "is_inverse \ (\\NTMap\\b\) (m b)" by (auto simp: is_inverse_sym) from mb have mb_\b: "m b \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\b\ = \\CId\\\\ObjMap\\b\\" by (auto intro: is_inverse_Comp_CId_right[OF inv_mb]) from prems have \a_ma: "\\NTMap\\a\ \\<^sub>A\<^bsub>\\<^esub> m a = \\CId\\\\ObjMap\\a\\" using \a inv_ma ma by (meson is_inverse_Comp_CId_right) from \f have "m b \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ = m b \\<^sub>A\<^bsub>\\<^esub> (\\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> (\\NTMap\\a\ \\<^sub>A\<^bsub>\\<^esub> m a))" unfolding \a_ma by (cs_concl cs_shallow cs_simp: cat_cs_simps) also have "\ = m b \\<^sub>A\<^bsub>\\<^esub> ((\\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\a\) \\<^sub>A\<^bsub>\\<^esub> m a)" by ( metis ma \f \a NTDom.HomCod.cat_Comp_assoc is_iso_arrD(1) ) also from prems have "\ = m b \\<^sub>A\<^bsub>\\<^esub> ((\\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\) \\<^sub>A\<^bsub>\\<^esub> m a)" by (metis ntcf_Comp_commute) also have "\ = (m b \\<^sub>A\<^bsub>\\<^esub> (\\NTMap\\b\ \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\)) \\<^sub>A\<^bsub>\\<^esub> m a" by ( metis \b\f ma mb NTDom.HomCod.cat_Comp_assoc is_iso_arrD(1) ) also from \f \b mb NTDom.HomCod.cat_Comp_assoc have "\ = ((m b \\<^sub>A\<^bsub>\\<^esub> \\NTMap\\b\) \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\) \\<^sub>A\<^bsub>\\<^esub> m a" by (metis is_iso_arrD(1)) also from \f have "\ = \\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> m a" unfolding mb_\b by (simp add: cat_cs_simps) finally show "m b \\<^sub>A\<^bsub>\\<^esub> \\ArrMap\\f\ = \\ArrMap\\f\ \\<^sub>A\<^bsub>\\<^esub> m a" by simp qed show \: "inv_ntcf \ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(intro is_iso_ntcfI is_ntcfI', unfold m_def[symmetric]) show "vfsequence (inv_ntcf \)" unfolding inv_ntcf_def by simp show "vcard (inv_ntcf \) = 5\<^sub>\" unfolding inv_ntcf_def by (simp add: nat_omega_simps) qed (auto simp: cat_cs_simps intro: cat_cs_intros) interpret \: is_iso_ntcf \ \ \ \ \ \inv_ntcf \\ by (rule \) show \\: "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \ = ntcf_id \" proof(rule ntcf_eqI) from NTCod.cf_ntcf_id_is_ntcf show "ntcf_id \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by auto show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \)\NTMap\ = ntcf_id \\NTMap\" proof(rule vsv_eqI) fix a assume "a \\<^sub>\ \\<^sub>\ ((\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \)\NTMap\)" then have "a \\<^sub>\ \\Obj\" unfolding ntcf_vcomp_NTMap_vdomain[OF \.is_ntcf_axioms] by simp then show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \)\NTMap\\a\ = ntcf_id \\NTMap\\a\" by ( cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros cat_arrow_cs_intros ) qed ( auto simp: ntsmcf_vcomp_components(1) cat_cs_simps intro: cat_cs_intros ) qed (auto intro: cat_cs_intros) show \\: "inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ = ntcf_id \" proof(rule ntcf_eqI) show "(inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\ = ntcf_id \\NTMap\" proof(rule vsv_eqI) show "\\<^sub>\ ((inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\) = \\<^sub>\ (ntcf_id \\NTMap\)" by (simp add: ntsmcf_vcomp_components(1) cat_cs_simps) fix a assume "a \\<^sub>\ \\<^sub>\ ((inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\)" then have "a \\<^sub>\ \\Obj\" unfolding ntsmcf_vcomp_components by (simp add: cat_cs_simps) then show "(inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \)\NTMap\\a\ = ntcf_id \\NTMap\\a\" by ( cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros cat_arrow_cs_intros ) qed ( auto simp: ntsmcf_vcomp_components(1) ntcf_id_components(1) cat_cs_simps intro: vsv_vcomp ) qed (auto intro: cat_cs_intros) qed subsubsection\ The operation of taking the inverse natural transformation is an involution \ lemma (in is_iso_ntcf) iso_ntcf_inv_ntcf_inv_ntcf[ntcf_cs_simps]: "inv_ntcf (inv_ntcf \) = \" proof(rule ntcf_eqI) show "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros) show "inv_ntcf (inv_ntcf \) : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: ntcf_cs_intros cat_cs_intros) then have dom_lhs: "\\<^sub>\ (inv_ntcf (inv_ntcf \)\NTMap\) = \\Obj\" by (cs_concl cs_simp: cat_cs_simps) show "inv_ntcf (inv_ntcf \)\NTMap\ = \\NTMap\" proof(rule vsv_eqI, unfold cat_cs_simps dom_lhs) fix a assume prems: "a \\<^sub>\ \\Obj\" then show "inv_ntcf (inv_ntcf \)\NTMap\\a\ = \\NTMap\\a\" by ( cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_arrow_cs_intros ntcf_cs_intros cat_cs_intros ) qed (auto intro: cat_cs_intros) qed simp_all lemmas [ntcf_cs_simps] = is_iso_ntcf.iso_ntcf_inv_ntcf_inv_ntcf subsubsection\Natural isomorphisms from natural transformations\ lemma iso_ntcf_if_is_inverse: assumes "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\a. a \\<^sub>\ \\Obj\ \ is_inverse \ (\\NTMap\\a\) (\\NTMap\\a\)" shows "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ = inv_ntcf \" and "\ = inv_ntcf \" proof- interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(1)) interpret \: is_ntcf \ \ \ \ \ \ by (rule assms(2)) show \: "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(intro is_iso_ntcfI assms(1)) fix a assume prems: "a \\<^sub>\ \\Obj\" show "\\NTMap\\a\ : \\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\a\" by ( rule is_iso_arrI[ OF \.ntcf_NTMap_is_arr[OF prems] assms(3)[OF prems] ] ) qed show \: "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(intro is_iso_ntcfI assms(2)) fix a assume prems: "a \\<^sub>\ \\Obj\" show "\\NTMap\\a\ : \\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> \\ObjMap\\a\" by ( rule is_iso_arrI [ OF \.ntcf_NTMap_is_arr[OF prems] is_inverse_sym[THEN iffD1, OF assms(3)[OF prems]] ] ) qed have \_NTMap_unique: "g = \\NTMap\\a\" if "a \\<^sub>\ \\Obj\" and "is_inverse \ g (\\NTMap\\a\)" for g a by (rule \.NTDom.HomCod.cat_is_inverse_eq[OF that(2) assms(3)[OF that(1)]]) show "\ = inv_ntcf \" proof(rule ntcf_eqI, rule assms(2)) from \ show "inv_ntcf \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: ntcf_cs_intros) show "\\NTMap\ = inv_ntcf \\NTMap\" proof(rule vsv_eqI, unfold cat_cs_simps) fix a assume prems: "a \\<^sub>\ \\Obj\" show "\\NTMap\\a\ = inv_ntcf \\NTMap\\a\" proof(intro \_NTMap_unique[symmetric] prems) from prems assms(3)[OF prems] show "is_inverse \ (inv_ntcf \\NTMap\\a\) (\\NTMap\\a\)" unfolding inv_ntcf_components cat_cs_simps by ( cs_concl cs_shallow cs_intro: V_cs_intros cs_simp: some_eq_ex V_cs_simps ) qed qed (auto simp: inv_ntcf_components) qed simp_all then have "inv_ntcf (inv_ntcf \) = inv_ntcf \" by simp from this \ \ show "\ = inv_ntcf \" by (cs_prems cs_shallow cs_simp: ntcf_cs_simps) qed subsubsection\Vertical composition of natural isomorphisms\ lemma ntcf_vcomp_is_iso_ntcf[cat_cs_intros]: assumes "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(intro is_iso_arr_is_iso_ntcf) note inv_ntcf_\ = iso_ntcf_is_iso_arr[OF assms(1)] and inv_ntcf_\ = iso_ntcf_is_iso_arr[OF assms(2)] note [cat_cs_simps] = inv_ntcf_\(2,3) inv_ntcf_\(2,3) from assms show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros ntcf_cs_intros) from inv_ntcf_\(1) inv_ntcf_\(1) show "inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros ntcf_cs_intros) from assms inv_ntcf_\(1) inv_ntcf_\(1) have "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \) = \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \" by ( cs_concl cs_simp: ntcf_vcomp_assoc cs_intro: cat_cs_intros ntcf_cs_intros ) also from assms have "\ = ntcf_id \" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: ntcf_cs_intros) finally show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \) = ntcf_id \" by simp from assms inv_ntcf_\(1) inv_ntcf_\(1) have "inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \" by ( cs_concl cs_simp: ntcf_vcomp_assoc cs_intro: cat_cs_intros ntcf_cs_intros ) also from assms have "\ = ntcf_id \" by (cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: ntcf_cs_intros) finally show "inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = ntcf_id \" by simp qed subsubsection\Horizontal composition of natural isomorphisms\ lemma ntcf_hcomp_is_iso_ntcf: assumes "\ : \' \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \' \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \' \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(intro is_iso_arr_is_iso_ntcf) note inv_ntcf_\ = iso_ntcf_is_iso_arr[OF assms(1)] and inv_ntcf_\ = iso_ntcf_is_iso_arr[OF assms(2)] note [cat_cs_simps] = inv_ntcf_\(2,3) inv_ntcf_\(2,3) from assms show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \' \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \' \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros ntcf_cs_intros) from inv_ntcf_\(1) inv_ntcf_\(1) show "inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \ : \' \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F \' \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_intro: cat_cs_intros ntcf_cs_intros) from assms inv_ntcf_\(1) inv_ntcf_\(1) have "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \) = ntcf_id \' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \" by ( cs_concl cs_simp: ntcf_comp_interchange_law[symmetric] cat_cs_simps cs_intro: ntcf_cs_intros ) also from assms have "\ = ntcf_id (\' \\<^sub>C\<^sub>F \)" by ( cs_concl cs_shallow cs_simp: cat_cs_simps cs_intro: cat_cs_intros ntcf_cs_intros ) finally show "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \) = ntcf_id (\' \\<^sub>C\<^sub>F \)" by simp from assms inv_ntcf_\(1) inv_ntcf_\(1) have "inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = ntcf_id \' \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \" by ( cs_concl cs_simp: ntcf_comp_interchange_law[symmetric] cat_cs_simps cs_intro: ntcf_cs_intros ) also from assms have "\ = ntcf_id (\' \\<^sub>C\<^sub>F \)" by (cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros ntcf_cs_intros) finally show "inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F inv_ntcf \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F (\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \) = ntcf_id (\' \\<^sub>C\<^sub>F \)" by simp qed lemma ntcf_hcomp_is_iso_ntcf'[ntcf_cs_intros]: assumes "\ : \' \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' = \' \\<^sub>C\<^sub>F \" and "\'' = \' \\<^sub>C\<^sub>F \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F \ : \' \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \'' : \ \\\<^sub>C\<^bsub>\\<^esub> \" using assms(1,2) unfolding assms(3,4) by (rule ntcf_hcomp_is_iso_ntcf) subsubsection\Composition of a natural isomorphism and a functor\ lemma ntcf_cf_comp_is_iso_ntcf: assumes "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ : \ \\<^sub>C\<^sub>F \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof(intro is_iso_ntcfI ntcf_cf_comp_is_ntcf) interpret \: is_iso_ntcf \ \ \ \ \ \ by (rule assms(1)) show "\ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (rule \.is_ntcf_axioms) fix a assume "a \\<^sub>\ \\Obj\" with assms(2) show "(\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \)\NTMap\\a\ : (\ \\<^sub>C\<^sub>F \)\ObjMap\\a\ \\<^sub>i\<^sub>s\<^sub>o\<^bsub>\\<^esub> (\ \\<^sub>C\<^sub>F \)\ObjMap\\a\" by ( cs_concl cs_simp: cat_cs_simps cs_intro: cat_cs_intros cat_arrow_cs_intros ) qed (rule assms(2)) lemma ntcf_cf_comp_is_iso_ntcf'[cat_cs_intros]: assumes "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" and "\' = \ \\<^sub>C\<^sub>F \" and "\' = \ \\<^sub>C\<^sub>F \" shows "\ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F\<^sub>-\<^sub>C\<^sub>F \ : \' \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" using assms(1,2) unfolding assms(3,4) by (rule ntcf_cf_comp_is_iso_ntcf) subsubsection\An identity natural transformation is a natural isomorphism\ lemma (in is_functor) cf_ntcf_id_is_iso_ntcf: "ntcf_id \ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" proof- have "ntcf_id \ : \ \\<^sub>C\<^sub>F \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (auto intro: cat_cs_intros) moreover then have "ntcf_id \ \\<^sub>N\<^sub>T\<^sub>C\<^sub>F ntcf_id \ = ntcf_id \" by (cs_concl cs_shallow cs_simp: cat_cs_simps) ultimately show ?thesis by (auto intro: is_iso_arr_is_iso_ntcf) qed lemma (in is_functor) cf_ntcf_id_is_iso_ntcf'[ntcf_cs_intros]: assumes "\' = \" and "\' = \" shows "ntcf_id \ : \' \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \' : \ \\\<^sub>C\<^bsub>\\<^esub> \" unfolding assms by (rule cf_ntcf_id_is_iso_ntcf) lemmas [ntcf_cs_intros] = is_functor.cf_ntcf_id_is_iso_ntcf' subsection\Functor isomorphism\ subsubsection\Definition and elementary properties\ text\See subsection 1.5 in \cite{bodo_categories_1970}.\ locale iso_functor = fixes \ \ \ assumes iso_cf_is_iso_ntcf: "\\ \ \. \ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" notation iso_functor (infixl "\\<^sub>C\<^sub>F\" 50) text\Rules.\ lemma iso_functorI: assumes "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" using assms unfolding iso_functor_def by auto lemma iso_functorD[dest]: assumes "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" shows "\\ \ \. \ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" using assms unfolding iso_functor_def by auto lemma iso_functorE[elim]: assumes "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" obtains \ \ \ where "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" using assms unfolding iso_functor_def by auto subsubsection\A functor isomorphism is an equivalence relation\ lemma iso_functor_refl: assumes "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" shows "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" proof(rule iso_functorI) from assms show "ntcf_id \ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by (cs_concl cs_shallow cs_intro: ntcf_cs_intros) qed lemma iso_functor_sym[sym]: assumes "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" shows "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" proof- from assms obtain \ \ \ where \: "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by auto from iso_ntcf_is_iso_arr(1)[OF \] show "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" by (auto simp: iso_functorI) qed lemma iso_functor_trans[trans, intro]: assumes "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" and "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" shows "\ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> \" proof- from assms(1) obtain \ \ \ where \: "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by auto moreover from assms(2) obtain \' \' \ where \: "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \' \\\<^sub>C\<^bsub>\\<^esub> \'" by auto ultimately have "\ : \' \\\<^sub>C\<^bsub>\\<^esub> \'" and "\ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by blast+ then have eq: "\' = \" "\' = \" by auto from \ have \: "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" unfolding eq . from ntcf_vcomp_is_iso_ntcf[OF \ \] show ?thesis by (rule iso_functorI) qed subsubsection\Opposite functor isomorphism\ lemma (in iso_functor) iso_functor_op: "op_cf \ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> op_cf \" proof- from iso_functor_axioms obtain \ \ \ where "\ : \ \\<^sub>C\<^sub>F\<^sub>.\<^sub>i\<^sub>s\<^sub>o \ : \ \\\<^sub>C\<^bsub>\\<^esub> \" by auto from is_iso_ntcf_op[OF this] have "op_cf \ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> op_cf \" by (auto simp: iso_functorI) then show "op_cf \ \\<^sub>C\<^sub>F\<^bsub>\\<^esub> op_cf \" by (rule iso_functor_sym) qed lemmas iso_functor_op[cat_op_intros] = iso_functor.iso_functor_op text\\newpage\ end \ No newline at end of file