Theory CanonicalIsos
section "Canonical Isomorphisms"
text βΉ
In this section we develop some technology for working with canonical isomorphisms in a bicategory,
which permits them to be specified simply by giving syntactic terms that evaluate to the
domain and codomain, rather than often-cumbersome formulas expressed in terms of unitors and
associators.
βΊ
theory CanonicalIsos
imports Coherence
begin
context bicategory
begin
interpretation bicategorical_language ..
interpretation E: self_evaluation_map V H πΊ π src trg ..
notation E.eval ("β¦_β¦")
text βΉ
The next definition defines βΉcan u tβΊ, which denotes the unique canonical isomorphism
from βΉβ¦tβ¦βΊ to βΉβ¦uβ¦βΊ. The ordering of the arguments of βΉcanβΊ has been chosen to be the
opposite of what was used for βΉhomβΊ. Having the arguments to βΉcanβΊ this way makes it easier
to see at a glance when canonical isomorphisms are composable. It could probably be argued
that βΉhomβΊ should have been defined this way as well, but that choice is somewhat
well-entrenched by now and the argument for βΉcanβΊ is stronger, as it denotes an arrow and
therefore appears in expressions composed with other arrows, rather than just as a hypothesis
or conclusion.
βΊ
definition can
where "can u t β‘ β¦Inv (uββ) ββ
tβββ¦"
subsection "Basic Properties"
text βΉ
The following develop basic properties of βΉcanβΊ.
βΊ
lemma can_in_hom [intro]:
assumes "Ide t" and "Ide u" and "ββtββ = ββuββ"
shows "Β«can u t : β¦tβ¦ β β¦uβ¦Β»"
proof -
let ?v = "Inv (uββ) ββ
tββ"
have 1: "Can ?v β§ Dom ?v = t β§ Cod ?v = u"
using assms red_in_Hom Can_red Inv_in_Hom Can_Inv(1) by simp
show "Β«can u t : β¦tβ¦ β β¦uβ¦Β»"
unfolding can_def using 1 E.eval_in_hom Can_implies_Arr
by (metis (no_types, lifting))
qed
lemma can_simps [simp]:
assumes "Ide t" and "Ide u" and "ββtββ = ββuββ"
shows "arr (can u t)" and "dom (can u t) = β¦tβ¦" and "cod (can u t) = β¦uβ¦"
using assms can_in_hom by auto
lemma inverse_arrows_can:
assumes "Ide t" and "Ide u" and "ββtββ = ββuββ"
shows "iso (can u t)" and "inverse_arrows (can u t) (can t u)"
proof -
let ?v = "Inv (uββ) ββ
tββ"
have 1: "Can ?v β§ Dom ?v = t β§ Cod ?v = u"
using assms red_in_Hom Can_red Inv_in_Hom Can_Inv(1) by simp
show "iso (can u t)"
unfolding can_def using 1 E.iso_eval_Can by blast
show "inverse_arrows (can u t) (can t u)"
proof (unfold can_def)
show "inverse_arrows β¦Inv (uββ) ββ
tβββ¦ β¦Inv (tββ) ββ
uβββ¦"
proof
show "ide (β¦Inv (uββ) ββ
tβββ¦ β
β¦Inv (tββ) ββ
uβββ¦)"
proof -
have "β¦Inv (uββ) ββ
tβββ¦ β
β¦Inv (tββ) ββ
uβββ¦ = β¦(Inv (uββ) ββ
tββ) ββ
(Inv (tββ) ββ
uββ)β¦"
by simp
also have "... = β¦uβ¦"
proof (intro E.eval_eqI)
show 2: "VPar ((Inv (uββ) ββ
tββ) ββ
Inv (tββ) ββ
uββ) u"
using assms 1 red_in_Hom Inv_in_Hom Ide_implies_Can Can_Inv Can_implies_Arr
Can_red(1)
by (simp add: Dom_Ide Cod_Ide)
show "ββ(Inv (uββ) ββ
tββ) ββ
Inv (tββ) ββ
uββββ = ββuββ"
proof -
have 3: "Can (Inv (tββ) ββ
uββ)"
using Arr.simps(4) Can.simps(4) Can_Inv(1) Can_red(1) 2 assms(1) assms(2)
by presburger
have "VSeq (Inv (uββ) ββ
tββ) (Inv (tββ) ββ
uββ)"
using 2 Arr.simps(4) by blast
hence "Can (Inv (uββ) ββ
tββ) β§ Can (Inv (tββ) ββ
uββ) β§
Dom (Inv (uββ) ββ
tββ) = Cod (Inv (tββ) ββ
uββ)"
using 3 1 by metis
thus ?thesis
by (metis (no_types) 2 Can.simps(4) Nmlize_Dom Dom_Ide Ide_Nmlize_Can
assms(2))
qed
qed
finally have "β¦Inv (uββ) ββ
tβββ¦ β
β¦Inv (tββ) ββ
uβββ¦ = β¦uβ¦"
by blast
moreover have "ide β¦uβ¦"
using assms E.ide_eval_Ide by simp
ultimately show ?thesis by simp
qed
show "ide (β¦Inv (tββ) ββ
uβββ¦ β
β¦Inv (uββ) ββ
tβββ¦)"
proof -
have "β¦Inv (tββ) ββ
uβββ¦ β
β¦Inv (uββ) ββ
tβββ¦ = β¦(Inv (tββ) ββ
uββ) ββ
(Inv (uββ) ββ
tββ)β¦"
by simp
also have "... = β¦tβ¦"
proof (intro E.eval_eqI)
show 2: "VPar ((Inv (tββ) ββ
uββ) ββ
Inv (uββ) ββ
tββ) t"
using assms 1 red_in_Hom Inv_in_Hom Ide_implies_Can Can_Inv Can_implies_Arr
Can_red(1)
by (simp add: Dom_Ide Cod_Ide)
show "ββ(Inv (tββ) ββ
uββ) ββ
Inv (uββ) ββ
tββββ = ββtββ"
using assms 1 2
by (metis (full_types) Arr.simps(4) Can.simps(4) Can_Inv(1) Can_red(1)
Nml_Nmlize(4) Dom_Ide Ide_Nmlize_Can)
qed
finally have "β¦Inv (tββ) ββ
uβββ¦ β
β¦Inv (uββ) ββ
tβββ¦ = β¦tβ¦"
by blast
moreover have "ide β¦tβ¦"
using assms E.ide_eval_Ide by simp
ultimately show ?thesis by simp
qed
qed
qed
qed
lemma inv_can [simp]:
assumes "Ide t" and "Ide u" and "ββtββ = ββuββ"
shows "inv (can u t) = can t u"
using assms inverse_arrows_can by (simp add: inverse_unique)
lemma vcomp_can [simp]:
assumes "Ide t" and "Ide u" and "Ide v" and "ββtββ = ββuββ" and "ββuββ = ββvββ"
shows "can v u β
can u t = can v t"
proof (unfold can_def)
have "β¦Inv (vββ) ββ
uβββ¦ β
β¦Inv (uββ) ββ
tβββ¦ = β¦(Inv (vββ) ββ
uββ) ββ
(Inv (uββ) ββ
tββ)β¦"
using assms by simp
also have "... = β¦Inv (vββ) ββ
tβββ¦"
proof (intro E.eval_eqI)
show "VPar ((Inv (vββ) ββ
uββ) ββ
Inv (uββ) ββ
tββ) (Inv (vββ) ββ
tββ)"
using assms red_in_Hom Inv_in_Hom Ide_implies_Can
by (simp add: Can_red(1))
show "ββ(Inv (vββ) ββ
uββ) ββ
Inv (uββ) ββ
tββββ = ββInv (vββ) ββ
tββββ"
using assms Can_red(1) Nml_Nmlize(1) Nmlize_Inv Ide_Nmlize_Can
Ide_implies_Can βΉVPar ((Inv (vββ) ββ
uββ) ββ
Inv (uββ) ββ
tββ) (Inv (vββ) ββ
tββ)βΊ
apply simp
by (metis red_simps(4) Nmlize_red Dom_Cod VcompNml_Nml_Dom)
qed
finally show "β¦Inv (vββ) ββ
uβββ¦ β
β¦Inv (uββ) ββ
tβββ¦ = β¦Inv (vββ) ββ
tβββ¦"
by blast
qed
lemma hcomp_can [simp]:
assumes "Ide t" and "Ide u" and "Ide v" and "Ide w" and "ββtββ = ββuββ" and "ββvββ = ββwββ"
and "Src t = Trg v" and "Src u = Trg w"
shows "can u t β can w v = can (u ββ w) (t ββ v)"
proof (unfold can_def)
have "β¦Inv (uββ) ββ
tβββ¦ β β¦Inv (wββ) ββ
vβββ¦ = β¦(Inv (uββ) ββ
tββ) ββ (Inv (wββ) ββ
vββ)β¦"
using assms by simp
also have "... = β¦Inv ((u ββ w)ββ) ββ
(t ββ v)βββ¦"
proof (intro E.eval_eqI)
show "VPar (Inv (uββ) ββ
tββ ββ Inv (wββ) ββ
vββ) (Inv ((u ββ w)ββ) ββ
(t ββ v)ββ)"
proof -
have "Arr (Inv ((u ββ w)ββ) ββ
(t ββ v)ββ)"
proof -
have "Ide (u ββ w)"
using assms by simp
hence "Can ((u ββ w)ββ)"
using assms Can_red by blast
thus ?thesis
using assms Can.simps(4) Can_Inv(1) Dom_Inv Can_implies_Arr Can_red(1)
red_simps(4) Nmlize.simps(3) Ide.simps(3)
by presburger
qed
moreover have "Arr (Inv (uββ) ββ
tββ ββ Inv (wββ) ββ
vββ)"
using assms red_in_Hom Inv_in_Hom Ide_implies_Can
by (simp add: Can_red(1))
moreover have "Dom (Inv (uββ) ββ
tββ ββ Inv (wββ) ββ
vββ) =
Dom (Inv ((u ββ w)ββ) ββ
(t ββ v)ββ)"
using assms red_in_Hom Inv_in_Hom Ide_implies_Can
by (metis (no_types, lifting) Nml_HcompD(3-4) Dom.simps(3-4) red.simps(3)
red_Nml)
moreover have "Cod (Inv (uββ) ββ
tββ ββ Inv (wββ) ββ
vββ) =
Cod (Inv ((u ββ w)ββ) ββ
(t ββ v)ββ)"
using assms red_in_Hom Inv_in_Hom Ide_implies_Can red_Nml
by (simp add: Can_red(1) Cod_Ide)
ultimately show ?thesis by simp
qed
show "ββInv (uββ) ββ
tββ ββ Inv (wββ) ββ
vββββ = ββInv ((u ββ w)ββ) ββ
(t ββ v)ββββ"
using assms Inv_in_Hom Ide_implies_Can Nmlize_Inv Ide_Nmlize_Can Can_red
red2_Nml
apply auto
using VcompNml_HcompNml [of u w u w]
apply (metis red_simps(4) Nml_HcompD(3-4) Nmlize_Nml red_simps(3) red_Nml)
apply (metis Nml_HcompD(3-4) Nmlize.simps(3) Nmlize_Nml
red_simps(3) Ide.simps(3) VcompNml_Nml_Dom red_Nml)
apply (metis Can_red2(1) red_simps(4) Nml_HcompD(3-4) Nmlize.simps(3)
Nmlize_Nml VcompNml_Cod_Nml red_Nml)
using red2_Nml Nmlize_red2 Can_red2(1) Nmlize_Hcomp Dom_Ide Ide_implies_Arr
VcompNml_Nml_Dom Nml_Nmlize(1) Nml_Nmlize(2) Nml_Nmlize(3)
Nmlize.simps(3)
by metis
qed
finally show "β¦Inv (uββ) ββ
tβββ¦ β β¦Inv (wββ) ββ
vβββ¦ = β¦Inv ((u ββ w)ββ) ββ
(t ββ v)βββ¦"
by blast
qed
subsection "Introduction Rules"
text βΉ
To make the βΉcanβΊ notation useful, we need a way to introduce it.
This is a bit tedious, because in general there can multiple βΉcanβΊ
notations for the same isomorphism, and we have to use the right ones in the
right contexts, otherwise we won't be able to compose them properly.
Thankfully, we don't need the inverse versions of the theorems below,
as they are easily provable from the non-inverse versions using βΉinv_canβΊ.
βΊ
lemma canI_unitor_0:
assumes "ide f"
shows "π
[f] = can ββ¨fββ© (ββ¨trg fββ©β©0 ββ ββ¨fββ©)"
and "π[f] = can ββ¨fββ© (ββ¨fββ© ββ ββ¨src fββ©β©0)"
proof -
have "can ββ¨fββ© (ββ¨trg fββ©β©0 ββ ββ¨fββ©) = β¦βπ
β[ββ¨fββ©β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus 1: "π
[f] = can ββ¨fββ© (ββ¨trg fββ©β©0 ββ ββ¨fββ©)"
using assms by (simp add: π©_ide_simp)
have "can ββ¨fββ© (ββ¨fββ© ββ ββ¨src fββ©β©0) = β¦βπβ[ββ¨fββ©β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus "π[f] = can ββ¨fββ© (ββ¨fββ© ββ ββ¨src fββ©β©0)"
using assms by (simp add: π―_ide_simp)
qed
lemma canI_unitor_1:
assumes "obj a"
shows "π
[a] = can ββ¨aββ©β©0 (ββ¨aββ©β©0 ββ ββ¨aββ©β©0)"
and "π[a] = can ββ¨aββ©β©0 (ββ¨aββ©β©0 ββ ββ¨aββ©β©0)"
proof -
have "can ββ¨aββ©β©0 (ββ¨aββ©β©0 ββ ββ¨aββ©β©0) = β¦βπ
β[ββ¨aββ©β©0β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus 1: "π
[a] = can ββ¨aββ©β©0 (ββ¨aββ©β©0 ββ ββ¨aββ©β©0)"
using assms by (auto simp add: π©_ide_simp)
have "can ββ¨aββ©β©0 (ββ¨aββ©β©0 ββ ββ¨aββ©β©0) = β¦βπβ[ββ¨aββ©β©0β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus "π[a] = can ββ¨aββ©β©0 (ββ¨aββ©β©0 ββ ββ¨aββ©β©0)"
using assms by (auto simp add: π―_ide_simp)
qed
lemma canI_associator_0:
assumes "ide f" and "ide g" and "ide h" and "src f = trg g" and "src g = trg h"
shows "πΊ[f, g, h] = can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨hββ©) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ©)"
proof -
have "can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨hββ©) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ©) = β¦βπΊβ[ββ¨fββ©, ββ¨gββ©, ββ¨hββ©β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus "πΊ[f, g, h] = can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨hββ©) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ©)"
using assms by (simp add: Ξ±_def)
qed
lemma canI_associator_1:
assumes "ide f" and "ide g" and "src f = trg g"
shows "πΊ[trg f, f, g] = can (ββ¨trg fββ©β©0 ββ ββ¨fββ© ββ ββ¨gββ©) ((ββ¨trg fββ©β©0 ββ ββ¨fββ©) ββ ββ¨gββ©)"
and "πΊ[f, src f, g] = can (ββ¨fββ© ββ ββ¨src fββ©β©0 ββ ββ¨gββ©) ((ββ¨fββ© ββ ββ¨src fββ©β©0) ββ ββ¨gββ©)"
and "πΊ[f, g, src g] = can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨src gββ©β©0) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨src gββ©β©0)"
proof -
show "πΊ[trg f, f, g] = can (ββ¨trg fββ©β©0 ββ ββ¨fββ© ββ ββ¨gββ©) ((ββ¨trg fββ©β©0 ββ ββ¨fββ©) ββ ββ¨gββ©)"
proof -
have "can (ββ¨trg fββ©β©0 ββ ββ¨fββ© ββ ββ¨gββ©) ((ββ¨trg fββ©β©0 ββ ββ¨fββ©) ββ ββ¨gββ©) = β¦βπΊβ[ββ¨trg fββ©β©0, ββ¨fββ©, ββ¨gββ©β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus ?thesis
using assms Ξ±_def by simp
qed
show "πΊ[f, src f, g] = can (ββ¨fββ© ββ ββ¨src fββ©β©0 ββ ββ¨gββ©) ((ββ¨fββ© ββ ββ¨src fββ©β©0) ββ ββ¨gββ©)"
proof -
have "can (ββ¨fββ© ββ ββ¨src fββ©β©0 ββ ββ¨gββ©) ((ββ¨fββ© ββ ββ¨src fββ©β©0) ββ ββ¨gββ©) = β¦βπΊβ[ββ¨fββ©, ββ¨src fββ©β©0, ββ¨gββ©β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus ?thesis
using assms Ξ±_def by simp
qed
show "πΊ[f, g, src g] = can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨src gββ©β©0) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨src gββ©β©0)"
proof -
have "can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨src gββ©β©0) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨src gββ©β©0) = β¦βπΊβ[ββ¨fββ©, ββ¨gββ©, ββ¨src gββ©β©0β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus ?thesis
using assms Ξ±_def by simp
qed
qed
lemma canI_associator_2:
assumes "ide f"
shows "πΊ[trg f, trg f, f] = can (ββ¨trg fββ©β©0 ββ ββ¨trg fββ©β©0 ββ ββ¨fββ©) ((ββ¨trg fββ©β©0 ββ ββ¨trg fββ©β©0) ββ ββ¨fββ©)"
and "πΊ[trg f, f, src f] = can (ββ¨trg fββ©β©0 ββ ββ¨fββ© ββ ββ¨src fββ©β©0) ((ββ¨trg fββ©β©0 ββ ββ¨fββ©) ββ ββ¨src fββ©β©0)"
and "πΊ[f, src f, src f] = can (ββ¨fββ© ββ ββ¨src fββ©β©0 ββ ββ¨src fββ©β©0) ((ββ¨fββ© ββ ββ¨src fββ©β©0) ββ ββ¨src fββ©β©0)"
proof -
show "πΊ[trg f, trg f, f] = can (ββ¨trg fββ©β©0 ββ ββ¨trg fββ©β©0 ββ ββ¨fββ©) ((ββ¨trg fββ©β©0 ββ ββ¨trg fββ©β©0) ββ ββ¨fββ©)"
proof -
have "can (ββ¨trg fββ©β©0 ββ ββ¨trg fββ©β©0 ββ ββ¨fββ©) ((ββ¨trg fββ©β©0 ββ ββ¨trg fββ©β©0) ββ ββ¨fββ©) = β¦βπΊβ[ββ¨trg fββ©β©0, ββ¨trg fββ©β©0, ββ¨fββ©β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus ?thesis
using assms Ξ±_def by simp
qed
show "πΊ[trg f, f, src f] = can (ββ¨trg fββ©β©0 ββ ββ¨fββ© ββ ββ¨src fββ©β©0) ((ββ¨trg fββ©β©0 ββ ββ¨fββ©) ββ ββ¨src fββ©β©0)"
proof -
have "can (ββ¨trg fββ©β©0 ββ ββ¨fββ© ββ ββ¨src fββ©β©0) ((ββ¨trg fββ©β©0 ββ ββ¨fββ©) ββ ββ¨src fββ©β©0) = β¦βπΊβ[ββ¨trg fββ©β©0, ββ¨fββ©, ββ¨src fββ©β©0β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus ?thesis
using assms Ξ±_def by simp
qed
show "πΊ[f, src f, src f] = can (ββ¨fββ© ββ ββ¨src fββ©β©0 ββ ββ¨src fββ©β©0) ((ββ¨fββ© ββ ββ¨src fββ©β©0) ββ ββ¨src fββ©β©0)"
proof -
have "can (ββ¨fββ© ββ ββ¨src fββ©β©0 ββ ββ¨src fββ©β©0) ((ββ¨fββ© ββ ββ¨src fββ©β©0) ββ ββ¨src fββ©β©0) =
β¦βπΊβ[ββ¨fββ©, ββ¨src fββ©β©0, ββ¨src fββ©β©0β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus ?thesis
using assms Ξ±_def by simp
qed
qed
lemma canI_associator_3:
assumes "obj a"
shows "πΊ[a, a, a] = can (ββ¨aββ©β©0 ββ ββ¨aββ©β©0 ββ ββ¨aββ©β©0) ((ββ¨aββ©β©0 ββ ββ¨aββ©β©0) ββ ββ¨aββ©β©0)"
proof -
have "can (ββ¨aββ©β©0 ββ ββ¨aββ©β©0 ββ ββ¨aββ©β©0) ((ββ¨aββ©β©0 ββ ββ¨aββ©β©0) ββ ββ¨aββ©β©0) = β¦βπΊβ[ββ¨aββ©β©0, ββ¨aββ©β©0, ββ¨aββ©β©0β]β¦"
unfolding can_def using assms by (intro E.eval_eqI, simp_all)
thus ?thesis
using assms Ξ±_def by auto
qed
lemma canI_associator_hcomp:
assumes "ide f" and "ide g" and "ide h" and "ide k"
and "src f = trg g" and "src g = trg h" and "src h = trg k"
shows "πΊ[f β g, h, k] = can ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ© ββ ββ¨kββ©) (((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ©) ββ ββ¨kββ©)"
and "πΊ[f, g β h, k] = can (ββ¨fββ© ββ (ββ¨gββ© ββ ββ¨hββ©) ββ ββ¨kββ©) ((ββ¨fββ© ββ (ββ¨gββ© ββ ββ¨hββ©)) ββ ββ¨kββ©)"
and "πΊ[f, g, h β k] = can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨hββ© ββ ββ¨kββ©) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ© ββ ββ¨kββ©)"
proof -
show "πΊ[f β g, h, k] = can ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ© ββ ββ¨kββ©) (((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ©) ββ ββ¨kββ©)"
proof -
have "can ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ© ββ ββ¨kββ©) (((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ©) ββ ββ¨kββ©) =
(((f β g) β h β k) β
(πΊβ§-β§1[f, g, h β k] β
(f β g β h β k)) β
(f β g β h β k)) β
((f β g β h β k) β
(f β (g β h β k) β
(g β h β k) β
πΊ[g, h, k]) β
πΊ[f, g β h, k]) β
(((f β g β h) β
(f β g β h) β
πΊ[f, g, h]) β
((f β g) β h) β k)"
unfolding can_def using assms Ξ±_def πΊ'_def Ξ±'.map_ide_simp by simp
also have "... = πΊβ§-β§1[f, g, h β k] β
(f β πΊ[g, h, k]) β
πΊ[f, g β h, k] β
(πΊ[f, g, h] β k)"
using assms comp_arr_dom comp_cod_arr comp_assoc by simp
also have "... = πΊ[f β g, h, k]"
using assms pentagon [of f g h k] invert_side_of_triangle(1) Ξ±_def Ξ±'.map_ide_simp
assoc_simps(1,4-5) ideD(1) iso_assoc preserves_ide seqI
by simp
finally show ?thesis by simp
qed
show "πΊ[f, g β h, k] = can (ββ¨fββ© ββ (ββ¨gββ© ββ ββ¨hββ©) ββ ββ¨kββ©) ((ββ¨fββ© ββ (ββ¨gββ© ββ ββ¨hββ©)) ββ ββ¨kββ©)"
proof -
have "can (ββ¨fββ© ββ (ββ¨gββ© ββ ββ¨hββ©) ββ ββ¨kββ©) ((ββ¨fββ© ββ (ββ¨gββ© ββ ββ¨hββ©)) ββ ββ¨kββ©) =
((f β ((g β h) β k) β
(πΊβ§-β§1[g, h, k] β
(g β h β k)) β
(g β h β k)) β
(f β g β h β k)) β
((f β g β h β k) β
(f β (g β h β k) β
(g β h β k) β
πΊ[g, h, k]) β
πΊ[f, g β h, k]) β
((f β g β h) β k)"
unfolding can_def using assms Ξ±_def Ξ±'.map_ide_simp πΊ'_def by simp
also have "... = ((f β πΊβ§-β§1[g, h, k]) β
(f β πΊ[g, h, k])) β
πΊ[f, g β h, k]"
using assms comp_arr_dom comp_cod_arr comp_assoc by simp
also have "... = πΊ[f, g β h, k]"
using assms comp_cod_arr whisker_left [of f "πΊβ§-β§1[g, h, k]" "πΊ[g, h, k]"]
comp_assoc_assoc'
by simp
finally show ?thesis by simp
qed
show "πΊ[f, g, h β k] = can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨hββ© ββ ββ¨kββ©) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ© ββ ββ¨kββ©)"
proof -
have "can (ββ¨fββ© ββ ββ¨gββ© ββ ββ¨hββ© ββ ββ¨kββ©) ((ββ¨fββ© ββ ββ¨gββ©) ββ ββ¨hββ© ββ ββ¨kββ©) =
(f β g β h β k) β
((f β g β h β k) β
(f β g β h β k) β
πΊ[f, g, h β k]) β
((f β g) β h β k)"
unfolding can_def using assms Ξ±_def Ξ±'.map_ide_simp by simp
also have "... = πΊ[f, g, h β k]"
using assms comp_arr_dom comp_cod_arr by simp
finally show ?thesis by simp
qed
qed
subsection "Rules for Eliminating `can'"
text βΉ
The following rules are used for replacing βΉcanβΊ in an expression by terms expressed
using unit and associativity isomorphisms. They are not really expressed in the form
of elimination rules, so the names are perhaps a bit misleading. They are typically
applied as simplifications.
βΊ
lemma canE_unitor:
assumes "Ide f"
shows "can f (f ββ Src f) = π[β¦fβ¦]"
and "can f (Trg f ββ f) = π
[β¦fβ¦]"
and "can (f ββ Src f) f = πβ§-β§1[β¦fβ¦]"
and "can (Trg f ββ f) f = π
β§-β§1[β¦fβ¦]"
proof -
show 1: "can f (f ββ Src f) = π[β¦fβ¦]"
proof -
have f: "Β¬Nml (f ββ Src f)"
using assms Nml_HcompD(5) is_Prim0_Src by blast
have "can f (f ββ Src f) = β¦Inv (fββ) ββ
(ββfββ ββ ββSrc fββ) ββ
(fββ ββ Src fββ)β¦"
using assms f can_def by simp
also have "... = β¦βπβ[fβ]β¦"
proof (intro E.eval_eqI)
show "VPar (Inv (fββ) ββ
(ββfββ ββ ββSrc fββ) ββ
(fββ ββ Src fββ)) βπβ[fβ]"
using assms Nmlize_in_Hom red_in_Hom red2_in_Hom Inv_in_Hom Can_red Can_implies_Arr
Nml_Nmlize(1) Ide_implies_Can Nml_Src Nml_implies_Arr
HcompNml_Nml_Src Ide_Cod Obj_implies_Ide
apply (simp add: Dom_Ide Cod_Ide)
apply (intro conjI)
proof -
assume f: "Ide f"
have 1: "Nml (Src f)"
proof -
have "Ide (Src f)"
using f Obj_implies_Ide by simp
thus ?thesis
using f Obj_Src Nml_Nmlize(1) Nmlize_Src(2) Ide_implies_Arr
by metis
qed
show "Arr (ββfββ ββ ββSrc fββ)"
using f 1 Can_red2 Ide_Nmlize_Ide Nml_Nmlize Obj_implies_Ide by simp
show "Dom (ββfββ ββ ββSrc fββ) = ββfββ ββ ββSrc fββ"
using f 1 Nml_Nmlize red2_in_Hom Ide_Nmlize_Ide Obj_implies_Ide by auto
show "ββfββ = Cod (ββfββ ββ ββSrc fββ)"
proof -
have "Src ββfββ = Trg ββSrc fββ"
using f Nml_Nmlize Obj_implies_Ide by simp
moreover have "ββββfββ ββ ββSrc fββββ = ββfββ"
using f 1 Nml_Nmlize Nmlize_Src HcompNml_Nml_Src Nml_Src
by (auto simp add: HcompNml_Nml_Obj)
thus ?thesis
using f 1 Obj_Src red2_in_Hom [of "ββfββ" "ββSrc fββ"] HcompNml_Nml_Src
Nml_Nmlize Ide_Nmlize_Ide Obj_implies_Ide
by auto
qed
qed
show "ββInv (fββ) ββ
(ββfββ ββ ββSrc fββ) ββ
(fββ ββ Src fββ)ββ = βββπβ[fβ]ββ"
using assms f HcompNml_Nml_Src Nml_Nmlize Can_red Nmlize_Hcomp
Nmlize_Inv Nmlize_Src(1) Nmlize_red Nmlize_red2
Ide_Nmlize_Can VcompNml_Nml_Ide red_Src
apply (simp add: HcompNml_Nml_Obj)
proof -
assume f: "Ide f"
have "ββββfββ ββ Src fββ = ββfββ"
proof -
have "Obj (Src f)"
using f Obj_Src by simp
thus ?thesis
using f apply (cases "Src f")
by (simp_all add: Nml_Nmlize(1) Nml_Nmlize(2) Ide_Nmlize_Ide)
qed
thus "ββfββ ββββ
ββ ββββfββ ββ Src fββ ββββ
ββ ββfββ = ββfββ"
by (metis Cod_Inv Can_red(1) Cod.simps(4) Nmlize.simps(4)
Nmlize.simps(7) Nmlize_Vcomp_Cod_Arr red_simps(3)
βΉVPar (Inv (fββ) ββ
(ββfββ ββ ββSrc fββ) ββ
(fββ ββ Src fββ)) βπβ[fβ]βΊ f)
qed
qed
also have "... = π[β¦fβ¦]"
using assms E.eval_Runit_Ide by blast
finally show ?thesis by simp
qed
show 2: "can f (Trg f ββ f) = π
[β¦fβ¦]"
proof -
have f: "Β¬Nml (Trg f ββ f)"
using assms by (metis Nml.simps(4) Nml_HcompD(6))
have "can f (Trg f ββ f) = β¦Inv (fββ) ββ
(ββTrg fββ ββ ββfββ) ββ
(Trg fββ ββ fββ)β¦"
using assms f can_def by simp
also have "... = β¦βπ
β[fβ]β¦"
proof (intro E.eval_eqI)
show "VPar (Inv (fββ) ββ
(ββTrg fββ ββ ββfββ) ββ
(Trg fββ ββ fββ)) βπ
β[fβ]"
using assms Nmlize_in_Hom red_in_Hom red2_in_Hom Inv_in_Hom Can_red Can_implies_Arr
Nml_Nmlize(1) Ide_implies_Can Nml_Trg Nml_implies_Arr
HcompNml_Trg_Nml Ide_Cod Nmlize_Trg(1) Obj_implies_Ide
apply (simp add: Dom_Ide Cod_Ide)
apply (intro conjI)
proof -
assume f: "Ide f"
have 1: "Nml (Trg f)"
proof -
have "Ide (Trg f)"
using f Obj_implies_Ide by simp
thus ?thesis
using f Obj_Trg Nml_Nmlize(1) Nmlize_Trg(2) Ide_implies_Arr
by metis
qed
show "Arr (Trg f ββ ββfββ)"
using f 1 Can_red2 Ide_Nmlize_Ide Nml_Nmlize(1,3) Obj_implies_Ide by simp
show "Dom (Trg f ββ ββfββ) = Trg f ββ ββfββ"
using f Obj_Trg 1 Nml_Nmlize(1,3) red2_in_Hom Ide_Nmlize_Ide Obj_implies_Ide by auto
show "ββfββ = Cod (Trg f ββ ββfββ)"
proof -
have "Src (Trg f) = Trg ββfββ"
using f Nml_Nmlize(3) by simp
thus ?thesis
using f 1 Obj_Trg HcompNml_Trg_Nml Nml_Nmlize(1) Ide_Nmlize_Ide Obj_implies_Ide
by auto
qed
qed
show "ββInv (fββ) ββ
(ββTrg fββ ββ ββfββ) ββ
(Trg fββ ββ fββ)ββ = βββπ
β[fβ]ββ"
using assms f HcompNml_Nml_Src Nml_Nmlize Can_red Nmlize_Hcomp
Nmlize_Inv Nmlize_Trg(1) Nmlize_red Nmlize_red2
Ide_Nmlize_Can VcompNml_Nml_Ide red_Trg
apply (simp add: HcompNml_Obj_Nml)
proof -
assume f: "Ide f"
have "ββTrg f ββ ββfββββ = ββfββ"
proof -
have "Obj (Trg f)"
using f Obj_Trg by simp
thus ?thesis
using f apply (cases "Trg f")
by (simp_all add: Nml_Nmlize(1) Nml_Nmlize(2) Ide_Nmlize_Ide)
qed
thus "ββfββ ββββ
ββ ββTrg f ββ ββfββββ ββββ
ββ ββfββ = ββfββ"
by (metis Cod_Inv Can_red(1) Cod.simps(4) Nmlize.simps(4)
Nmlize.simps(5) Nmlize_Vcomp_Cod_Arr red_simps(3)
βΉVPar (Inv (fββ) ββ
(ββTrg fββ ββ ββfββ) ββ
(Trg fββ ββ fββ)) βπ
β[fβ]βΊ f)
qed
qed
also have "... = π
[β¦fβ¦]"
using assms E.eval_Lunit_Ide by blast
finally show ?thesis by simp
qed
show "can (f ββ Src f) f = πβ§-β§1[β¦fβ¦]"
using assms 1 inv_can inv_inv
by (metis (no_types, lifting) Nml_Nmlize(1) Nmlize.simps(3)
Nmlize_Src(1) HcompNml_Nml_Src Ide.simps(3) Ide_implies_Arr
Obj_Src Obj_implies_Ide Trg_Src)
show "can (Trg f ββ f) f = π
β§-β§1[β¦fβ¦]"
using assms 2 inv_can inv_inv
by (metis (no_types, lifting) Nml_Nmlize(1) Nmlize.simps(3)
Nmlize_Trg(1) HcompNml_Trg_Nml Ide.simps(3) Ide_implies_Arr
Obj_Trg Obj_implies_Ide Src_Trg)
qed
lemma canE_associator:
assumes "Ide f" and "Ide g" and "Ide h" and "Src f = Trg g" and "Src g = Trg h"
shows "can (f ββ g ββ h) ((f ββ g) ββ h) = πΊ[β¦fβ¦, β¦gβ¦, β¦hβ¦]"
and "can ((f ββ g) ββ h) (f ββ g ββ h) = πΊβ§-β§1[β¦fβ¦, β¦gβ¦, β¦hβ¦]"
proof -
show "can (f ββ g ββ h) ((f ββ g) ββ h) = πΊ[β¦fβ¦, β¦gβ¦, β¦hβ¦]"
proof -
have "can (f ββ g ββ h) ((f ββ g) ββ h) = β¦Inv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)βββ¦"
using can_def by simp
also have "... = β¦βπΊβ[f, g, hβ]β¦"
proof (intro E.eval_eqI)
have 1: "Inv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)ββ β VHom ((f ββ g) ββ h) (f ββ g ββ h)"
using assms Inv_in_Hom [of "(f ββ g ββ h)ββ"] Can_red [of "f ββ g ββ h"]
red_in_Hom [of "f ββ g ββ h"] red_in_Hom [of "(f ββ g) ββ h"]
Nmlize_Hcomp_Hcomp Nmlize_Hcomp_Hcomp'
Ide_implies_Arr Nml_HcompNml Nmlize_Nml Ide_HcompNml
by auto
show par: "VPar (Inv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)ββ) βπΊβ[f, g, hβ]"
using assms 1 Inv_in_Hom red_in_Hom Ide_in_Hom by simp
show "ββInv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)ββββ = βββπΊβ[f, g, hβ]ββ"
proof -
have "ββInv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)ββββ = Dom ββInv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)ββββ"
proof -
have "Can (Inv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)ββ)"
using assms Nmlize_Inv Can_Inv
Arr.simps(10) Arr.simps(4) Can.simps(4) Can_red(1) Ide.simps(3)
Src.simps(3) Trg.simps(3) par
by presburger
hence "Ide ββInv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)ββββ"
using Ide_Nmlize_Can by blast
thus ?thesis
using Ide_in_Hom Dom_Ide by presburger
qed
also have 6: "... = ββ(f ββ g) ββ hββ"
using 1 Nmlize_Dom [of "Inv ((f ββ g ββ h)ββ) ββ
((f ββ g) ββ h)ββ"]
by (metis (mono_tags, lifting) mem_Collect_eq)
also have 5: "... = Dom βββπΊβ[f, g, hβ]ββ"
using assms 6 par Nmlize_Dom Nml_Nmlize(4) by metis
also have "... = βββπΊβ[f, g, hβ]ββ"
using assms 5 Ide_in_Hom by auto
finally show ?thesis by simp
qed
qed
also have "... = πΊ[β¦fβ¦, β¦gβ¦, β¦hβ¦]"
using assms E.eval_Assoc_Ide Ξ±_def by fastforce
finally show ?thesis by simp
qed
show "can ((f ββ g) ββ h) (f ββ g ββ h) = πΊβ§-β§1[β¦fβ¦, β¦gβ¦, β¦hβ¦]"
proof -
have "can ((f ββ g) ββ h) (f ββ g ββ h) = β¦Inv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)βββ¦"
using can_def by simp
also have "... = β¦βπΊβ§-β§1β[f, g, hβ]β¦"
proof (intro E.eval_eqI)
have 1: "Inv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)ββ β VHom (f ββ g ββ h) ((f ββ g) ββ h)"
using assms Inv_in_Hom [of "((f ββ g) ββ h)ββ"] Can_red [of "(f ββ g) ββ h"]
red_in_Hom [of "(f ββ g) ββ h"] red_in_Hom [of "f ββ g ββ h"]
Nmlize_Hcomp_Hcomp Nmlize_Hcomp_Hcomp'
Ide_implies_Arr Nml_HcompNml Nmlize_Nml Ide_HcompNml
by auto
show par: "VPar (Inv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)ββ) βπΊβ§-β§1β[f, g, hβ]"
using assms 1 Inv_in_Hom red_in_Hom Ide_in_Hom by simp
show "ββInv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)ββββ = βββπΊβ§-β§1β[f, g, hβ]ββ"
proof -
have "ββInv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)ββββ = Dom ββInv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)ββββ"
proof -
have "Can (Inv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)ββ)"
using assms Nmlize_Inv Can_Inv
Arr.simps(10) Arr.simps(4) Can.simps(4) Can_red(1) Ide.simps(3)
Src.simps(3) Trg.simps(3) par
by presburger
hence "Ide ββInv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)ββββ"
using Ide_Nmlize_Can by blast
thus ?thesis
using Ide_in_Hom Dom_Ide by presburger
qed
also have 6: "... = ββf ββ g ββ hββ"
using 1 Nmlize_Dom [of "Inv (((f ββ g) ββ h)ββ) ββ
(f ββ g ββ h)ββ"]
by (metis (mono_tags, lifting) mem_Collect_eq)
also have 5: "... = Dom βββπΊβ§-β§1β[f, g, hβ]ββ"
using assms 6 par Nmlize_Dom Nml_Nmlize(4) by metis
also have "... = βββπΊβ§-β§1β[f, g, hβ]ββ"
using assms 5 Ide_in_Hom by auto
finally show ?thesis by simp
qed
qed
also have "... = πΊβ§-β§1[β¦fβ¦, β¦gβ¦, β¦hβ¦]"
using assms E.eval_Assoc'_Ide by fastforce
finally show ?thesis by simp
qed
qed
lemma can_Ide_self:
assumes "Ide t"
shows "can t t = β¦tβ¦"
proof (unfold can_def)
show "β¦Inv (tββ) ββ
tβββ¦ = β¦tβ¦"
proof (intro E.eval_eqI)
show "VPar (Inv (tββ) ββ
tββ) t"
using assms red_in_Hom Inv_in_Hom Ide_implies_Can Can_Inv Can_red(1) Ide_in_Hom(2)
by auto
show "ββInv (tββ) ββ
tββββ = ββtββ"
using assms red_in_Hom Inv_in_Hom Ide_implies_Can Cod_Inv
by (metis (mono_tags, lifting) Can_red(1) Nml_Nmlize(1) Nmlize.simps(4)
Nmlize_Inv Ide_Nmlize_Ide Nmlize_red Inv_Ide VcompNml_Ide_Nml
βΉVPar (Inv (tββ) ββ
tββ) tβΊ)
qed
qed
subsection "Rules for Whiskering"
lemma whisker_can_right_0:
assumes "Ide t" and "Ide u" and "ββtββ = ββuββ" and "ide f" and "Src t = ββ¨trg fββ©β©0"
shows "can u t β f = can (u ββ ββ¨fββ©) (t ββ ββ¨fββ©)"
proof -
have "f = can ββ¨fββ© ββ¨fββ©"
using assms can_Ide_self by simp
thus ?thesis
using assms Ide_implies_Arr hcomp_can
by (metis Nml_Nmlize(2) Ide.simps(2) Trg.simps(2))
qed
lemma whisker_can_right_1:
assumes "Ide t" and "Ide u" and "ββtββ = ββuββ" and "obj a" and "Src t = ββ¨aββ©β©0"
shows "can u t β a = can (u ββ ββ¨aββ©β©0) (t ββ ββ¨aββ©β©0)"
proof -
have "a = can ββ¨aββ©β©0 ββ¨aββ©β©0"
using assms can_Ide_self by auto
thus ?thesis
using assms Ide_implies_Arr hcomp_can
by (metis Nml_Nmlize(2) Ide.simps(1) Trg.simps(1))
qed
lemma whisker_can_left_0:
assumes "Ide t" and "Ide u" and "ββtββ = ββuββ" and "ide g" and "Trg t = ββ¨src gββ©β©0"
shows "g β can u t = can (ββ¨gββ© ββ u) (ββ¨gββ© ββ t)"
proof -
have "g = can ββ¨gββ© ββ¨gββ©"
using assms can_Ide_self by simp
thus ?thesis
using assms Ide_implies_Arr hcomp_can
by (metis Nml_Nmlize(3) Ide.simps(2) Src.simps(2))
qed
lemma whisker_can_left_1:
assumes "Ide t" and "Ide u" and "ββtββ = ββuββ" and "obj b" and "Trg t = ββ¨bββ©β©0"
shows "b β can u t = can (ββ¨bββ©β©0 ββ u) (ββ¨bββ©β©0 ββ t)"
proof -
have "b = can ββ¨bββ©β©0 ββ¨bββ©β©0"
using assms can_Ide_self by auto
thus ?thesis
using assms Ide_implies_Arr hcomp_can
by (metis Nml_Nmlize(3) Ide.simps(1) Src.simps(1))
qed
end
end