[STATEMENT]
lemma (in disc_equity_market) remaining_qty_adapted:
  assumes "borel_adapt_stoch_proc F (prices Mkt asset)"
  and "trading_strategy pf"
and "support_adapt Mkt pf"
shows "borel_adapt_stoch_proc F (remaining_qty Mkt v pf asset)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. borel_adapt_stoch_proc F (remaining_qty Mkt v pf asset)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
borel_adapt_stoch_proc F (prices Mkt asset)
trading_strategy pf
support_adapt Mkt pf

goal (1 subgoal):
 1. borel_adapt_stoch_proc F (remaining_qty Mkt v pf asset)
[PROOF STEP]
unfolding adapt_stoch_proc_def
[PROOF STATE]
proof (prove)
using this:
\<forall>t. prices Mkt asset t \<in> borel_measurable (F t)
trading_strategy pf
support_adapt Mkt pf

goal (1 subgoal):
 1. \<forall>t. remaining_qty Mkt v pf asset t \<in> borel_measurable (F t)
[PROOF STEP]
using assms remaining_qty_adapt
[PROOF STATE]
proof (prove)
using this:
\<forall>t. prices Mkt asset t \<in> borel_measurable (F t)
trading_strategy pf
support_adapt Mkt pf
borel_adapt_stoch_proc F (prices Mkt asset)
trading_strategy pf
support_adapt Mkt pf
\<lbrakk>borel_adapt_stoch_proc F (prices Mkt ?asset); trading_strategy ?pf; support_adapt Mkt ?pf\<rbrakk> \<Longrightarrow> remaining_qty Mkt ?v ?pf ?asset ?n \<in> borel_measurable (F ?n)

goal (1 subgoal):
 1. \<forall>t. remaining_qty Mkt v pf asset t \<in> borel_measurable (F t)
[PROOF STEP]
by blast


[STATEMENT]
lemma sim_trc_commute:
  assumes M: "kripke M"
      and s: "sim M M' f"
      and t: "t \<in> worlds M"
  shows "f ` ((\<Union>a. relations M a)\<^sup>* `` {t})
       = (\<Union>a. relations M' a)\<^sup>* `` {f t}" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ` (\<Union> (range (relations M)))\<^sup>* `` {t} = (\<Union> (range (relations M')))\<^sup>* `` {f t}
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f ` (\<Union> (range (relations M)))\<^sup>* `` {t} \<subseteq> (\<Union> (range (relations M')))\<^sup>* `` {f t}
 2. (\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}
[PROOF STEP]
from M s
[PROOF STATE]
proof (chain)
picking this:
kripke M
sim M M' f
[PROOF STEP]
show "?lhs \<subseteq> ?rhs"
[PROOF STATE]
proof (prove)
using this:
kripke M
sim M M' f

goal (1 subgoal):
 1. f ` (\<Union> (range (relations M)))\<^sup>* `` {t} \<subseteq> (\<Union> (range (relations M')))\<^sup>* `` {f t}
[PROOF STEP]
by (auto intro: sim_f_trc)
[PROOF STATE]
proof (state)
this:
f ` (\<Union> (range (relations M)))\<^sup>* `` {t} \<subseteq> (\<Union> (range (relations M')))\<^sup>* `` {f t}

goal (1 subgoal):
 1. (\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}
[PROOF STEP]
from M s t
[PROOF STATE]
proof (chain)
picking this:
kripke M
sim M M' f
t \<in> worlds M
[PROOF STEP]
show "?rhs \<subseteq> ?lhs"
[PROOF STATE]
proof (prove)
using this:
kripke M
sim M M' f
t \<in> worlds M

goal (1 subgoal):
 1. (\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}
[PROOF STEP]
by (auto elim: sim_r_trc)
[PROOF STATE]
proof (state)
this:
(\<Union> (range (relations M')))\<^sup>* `` {f t} \<subseteq> f ` (\<Union> (range (relations M)))\<^sup>* `` {t}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma zlcms_pos: "\<forall>i \<in> set is. i\<noteq>0 \<Longrightarrow> zlcms is > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>set is. i \<noteq> 0 \<Longrightarrow> 0 < zlcms is
[PROOF STEP]
by(induct "is")(auto simp:lcm_pos_int)


[STATEMENT]
lemma to_int_mod_ring_of_int_M: "to_int_mod_ring (of_int x :: 'a mod_ring) = M x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (of_int x) = M x
[PROOF STEP]
unfolding M_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (of_int x) = x mod m
[PROOF STEP]
unfolding m
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_int_mod_ring (of_int x) = x mod int CARD('a)
[PROOF STEP]
by transfer auto


[STATEMENT]
theorem secure_implies_c_secure:
  assumes S: "secure (c_process step out s\<^sub>0) I (c_dom D)"
  shows "c_secure step out s\<^sub>0 I D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_secure step out s\<^sub>0 I D
[PROOF STEP]
proof (simp add: c_secure_def, (rule allI)+)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x
[PROOF STEP]
fix x xs
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x
[PROOF STEP]
have "out (foldl step (foldl step s\<^sub>0 []) xs) x =
    out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out (foldl step (foldl step s\<^sub>0 []) xs) x = out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x
[PROOF STEP]
using S
[PROOF STATE]
proof (prove)
using this:
secure (c_process step out s\<^sub>0) I (c_dom D)

goal (1 subgoal):
 1. out (foldl step (foldl step s\<^sub>0 []) xs) x = out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x
[PROOF STEP]
by (rule secure_implies_c_secure_aux)
[PROOF STATE]
proof (state)
this:
out (foldl step (foldl step s\<^sub>0 []) xs) x = out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x

goal (1 subgoal):
 1. \<And>x xs. out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x
[PROOF STEP]
thus "out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x"
[PROOF STATE]
proof (prove)
using this:
out (foldl step (foldl step s\<^sub>0 []) xs) x = out (foldl step (foldl step s\<^sub>0 []) (c_ipurge I D (D x) xs)) x

goal (1 subgoal):
 1. out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
out (foldl step s\<^sub>0 xs) x = out (foldl step s\<^sub>0 (c_ipurge I D (D x) xs)) x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dim_zero [simp]: "dim {0} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim {0::'b} = 0
[PROOF STEP]
using dim_span_eq_card_independent independent_empty
[PROOF STATE]
proof (prove)
using this:
local.independent ?B \<Longrightarrow> local.dim (local.span ?B) = card ?B
local.independent {}

goal (1 subgoal):
 1. local.dim {0::'b} = 0
[PROOF STEP]
by fastforce


[STATEMENT]
lemma topological_space_quotient: "class.topological_space (openin (map_topology f euclidean))"
  if "surj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. class.topological_space (openin (map_topology f euclidean))
[PROOF STEP]
apply standard
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. openin (map_topology f euclidean) UNIV
 2. \<And>S T. \<lbrakk>openin (map_topology f euclidean) S; openin (map_topology f euclidean) T\<rbrakk> \<Longrightarrow> openin (map_topology f euclidean) (S \<inter> T)
 3. \<And>K. \<forall>S\<in>K. openin (map_topology f euclidean) S \<Longrightarrow> openin (map_topology f euclidean) (\<Union> K)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (map_topology f euclidean) UNIV
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
surj f

goal (1 subgoal):
 1. openin (map_topology f euclidean) UNIV
[PROOF STEP]
by (auto simp: openin_map_topology)


[STATEMENT]
lemma length_butlast [simp]: "length (butlast xs) = length xs - 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (butlast xs) = length xs - 1
[PROOF STEP]
by (induct xs rule: rev_induct) auto


[STATEMENT]
lemma mult_2: assumes "invariant_2 x" "invariant_2 y"
  shows "real_of_2 (mult_2 x y) = real_of_2 x * real_of_2 y"
  "invariant_2 (mult_2 x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_2 (mult_2 x y) = real_of_2 x * real_of_2 y &&& invariant_2 (mult_2 x y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invariant_2 x
invariant_2 y

goal (1 subgoal):
 1. real_of_2 (mult_2 x y) = real_of_2 x * real_of_2 y &&& invariant_2 (mult_2 x y)
[PROOF STEP]
by (atomize(full), (cases x; cases y; auto simp: mult_rat_1 mult_1 hom_distribs))


[STATEMENT]
lemma create_opt_sol_sat_eq_mat:
  assumes "dim_vec c = dim_row A\<^sup>T"
    and "dim_vec b = dim_col A\<^sup>T"
  assumes "create_optimal_solutions A b c = Sat X"
    and "(x, y) = split_i_j_x (dim_vec c) (dim_vec c + dim_vec b) X"
  shows "[y \<^sub>v* A]=c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
have *: "\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)
[PROOF STEP]
using create_opt_sol_satisfies[of A b c X] sat_mono[of "(mat_leqb_eqc A b c)" _ X]
      assms(2) assms
[PROOF STATE]
proof (prove)
using this:
create_optimal_solutions A b c = Inr X \<Longrightarrow> \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (x_times_c_geq_y_times_b c b # mat_leqb_eqc A b c @ from_index_geq0_vector (dim_vec c) (0\<^sub>v (dim_vec b)))
\<lbrakk>set (mat_leqb_eqc A b c) \<subseteq> set ?B; \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set ?B\<rbrakk> \<Longrightarrow> \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)
dim_vec b = dim_col A\<^sup>T
dim_vec c = dim_row A\<^sup>T
dim_vec b = dim_col A\<^sup>T
create_optimal_solutions A b c = Inr X
(x, y) = split_n_m_x (dim_vec c) (dim_vec b) X

goal (1 subgoal):
 1. \<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)
[PROOF STEP]
by (metis UnCI list.set_intros(2) set_append)
[PROOF STATE]
proof (state)
this:
\<langle>X\<rangle> \<Turnstile>\<^sub>c\<^sub>s set (mat_leqb_eqc A b c)

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
have "dim_row A\<^sup>T = dim_vec c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row A\<^sup>T = dim_vec c
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
dim_vec c = dim_row A\<^sup>T

goal (1 subgoal):
 1. dim_row A\<^sup>T = dim_vec c
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
dim_row A\<^sup>T = dim_vec c

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_row A\<^sup>T = dim_vec c

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
have "dim_col A\<^sup>T = dim_vec b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col A\<^sup>T = dim_vec b
[PROOF STEP]
by (simp add: assms(2))
[PROOF STATE]
proof (state)
this:
dim_col A\<^sup>T = dim_vec b

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim_row A\<^sup>T = dim_vec c
dim_col A\<^sup>T = dim_vec b
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim_row A\<^sup>T = dim_vec c
dim_col A\<^sup>T = dim_vec b

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
dim_row A\<^sup>T = dim_vec c
dim_col A\<^sup>T = dim_vec b
dim_vec c = dim_row A\<^sup>T
dim_vec b = dim_col A\<^sup>T
create_optimal_solutions A b c = Inr X
(x, y) = split_n_m_x (dim_vec c) (dim_vec b) X

goal (1 subgoal):
 1. [y\<^sub>v*A]=c
[PROOF STEP]
by (metis mat_leqb_eqc_split_correct2[of c A b X x y, OF assms(1) assms(2) *]
        \<open>dim_vec b = dim_col A\<^sup>T\<close> \<open>dim_vec c = dim_row A\<^sup>T\<close>)
[PROOF STATE]
proof (state)
this:
[y\<^sub>v*A]=c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iMODb_0_iMOD_subset_conv: "
  ([r', mod m', 0] \<subseteq> [r, mod m]) =
  (r' mod m = r mod m \<and> r \<le> r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ([ r', mod m', 0 ] \<subseteq> [ r, mod m ]) = (r' mod m = r mod m \<and> r \<le> r')
[PROOF STEP]
by (simp add: iMODb_0 iIN_0 singleton_subset_conv iMOD_iff)


[STATEMENT]
lemma birkhoff_sum_1 [simp]:
  "birkhoff_sum f 0 x = 0"
  "birkhoff_sum f 1 x = f x"
  "birkhoff_sum f (Suc 0) x = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. birkhoff_sum f 0 x = (0::'b) &&& birkhoff_sum f 1 x = f x &&& birkhoff_sum f (Suc 0) x = f x
[PROOF STEP]
unfolding birkhoff_sum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<0. f ((T ^^ i) x)) = (0::'b) &&& (\<Sum>i<1. f ((T ^^ i) x)) = f x &&& (\<Sum>i<Suc 0. f ((T ^^ i) x)) = f x
[PROOF STEP]
by auto


[STATEMENT]
lemma exp_eq_0_iff[simp]: "eexp x = 0 \<longleftrightarrow> x = -\<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eexp x = 0) = (x = - \<infinity>)
[PROOF STEP]
using eexp_inj[of x "-\<infinity>"]
[PROOF STATE]
proof (prove)
using this:
(eexp x = eexp (- \<infinity>)) = (x = - \<infinity>)

goal (1 subgoal):
 1. (eexp x = 0) = (x = - \<infinity>)
[PROOF STEP]
unfolding eexp_minus_infty
[PROOF STATE]
proof (prove)
using this:
(eexp x = 0) = (x = - \<infinity>)

goal (1 subgoal):
 1. (eexp x = 0) = (x = - \<infinity>)
[PROOF STEP]
.


[STATEMENT]
lemma is_left_adjoint_char:
    shows "is_left_adjoint f \<longleftrightarrow> ide f \<and> C.iso (Leg0 (Dom f))"
    and "is_left_adjoint f \<Longrightarrow>
           adjunction_in_bicategory vcomp hcomp assoc unit src trg f
              (adjoint_of_map f) (unit_for_map f) (counit_for_map f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_left_adjoint f = (ide f \<and> C.iso (Leg0 (Dom f))) &&& (is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. is_left_adjoint f \<Longrightarrow> ide f \<and> C.iso (Leg0 (Dom f))
 2. ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> is_left_adjoint f
 3. is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
show 1: "is_left_adjoint f \<Longrightarrow> ide f \<and> C.iso (Leg0 (Dom f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> ide f \<and> C.iso (Leg0 (Dom f))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_left_adjoint f \<Longrightarrow> ide f
 2. is_left_adjoint f \<Longrightarrow> C.iso (Leg0 (Dom f))
[PROOF STEP]
assume f: "is_left_adjoint f"
[PROOF STATE]
proof (state)
this:
is_left_adjoint f

goal (2 subgoals):
 1. is_left_adjoint f \<Longrightarrow> ide f
 2. is_left_adjoint f \<Longrightarrow> C.iso (Leg0 (Dom f))
[PROOF STEP]
obtain g \<eta> \<epsilon> where adj: "adjunction_in_bicategory vcomp hcomp assoc unit src trg f g \<eta> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g \<eta> \<epsilon>. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using f adjoint_pair_def
[PROOF STATE]
proof (prove)
using this:
is_left_adjoint f
adjoint_pair ?f ?g \<equiv> \<exists>\<eta> \<epsilon>. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg ?f ?g \<eta> \<epsilon>

goal (1 subgoal):
 1. (\<And>g \<eta> \<epsilon>. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>

goal (2 subgoals):
 1. is_left_adjoint f \<Longrightarrow> ide f
 2. is_left_adjoint f \<Longrightarrow> C.iso (Leg0 (Dom f))
[PROOF STEP]
interpret adjunction_in_bicategory vcomp hcomp assoc unit src trg f g \<eta> \<epsilon>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>
[PROOF STEP]
using adj
[PROOF STATE]
proof (prove)
using this:
adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>

goal (1 subgoal):
 1. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_left_adjoint f \<Longrightarrow> ide f
 2. is_left_adjoint f \<Longrightarrow> C.iso (Leg0 (Dom f))
[PROOF STEP]
show "ide f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ide f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ide f

goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso (Leg0 (Dom f))
[PROOF STEP]
interpret f: identity_arrow_of_spans C f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) f
[PROOF STEP]
using ide_char' [of f]
[PROOF STATE]
proof (prove)
using this:
ide f = identity_arrow_of_spans (\<cdot>) f

goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret g: identity_arrow_of_spans C g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) g
[PROOF STEP]
using ide_char' [of g]
[PROOF STATE]
proof (prove)
using this:
ide g = identity_arrow_of_spans (\<cdot>) g

goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret gf: two_composable_identity_arrows_of_spans C prj0 prj1 g f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_composable_identity_arrows_of_spans (\<cdot>) prj0 prj1 g f
[PROOF STEP]
using antipar
[PROOF STATE]
proof (prove)
using this:
trg g = src f
src g = trg f

goal (1 subgoal):
 1. two_composable_identity_arrows_of_spans (\<cdot>) prj0 prj1 g f
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret fg: two_composable_identity_arrows_of_spans C prj0 prj1 f g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_composable_identity_arrows_of_spans (\<cdot>) prj0 prj1 f g
[PROOF STEP]
using antipar
[PROOF STATE]
proof (prove)
using this:
trg g = src f
src g = trg f

goal (1 subgoal):
 1. two_composable_identity_arrows_of_spans (\<cdot>) prj0 prj1 f g
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret fgf: three_composable_identity_arrows_of_spans C prj0 prj1 f g f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. three_composable_identity_arrows_of_spans (\<cdot>) prj0 prj1 f g f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret src_f: arrow_of_spans C \<open>src f\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) (src f)
[PROOF STEP]
using arr_char gf.are_arrows(2)
[PROOF STATE]
proof (prove)
using this:
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
arr f

goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) (src f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret src_f: identity_arrow_of_spans C \<open>src f\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) (src f)
[PROOF STEP]
using ide_char ide_src src_def
[PROOF STATE]
proof (prove)
using this:
ide ?\<mu> = (arrow_of_spans (\<cdot>) ?\<mu> \<and> C.ide (Chn ?\<mu>))
arr ?\<mu> \<Longrightarrow> ide (src ?\<mu>)
src ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg0 (Dom ?\<mu>))) else null

goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) (src f)
[PROOF STEP]
by (unfold_locales, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret \<eta>: arrow_of_spans C \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<eta>
[PROOF STEP]
using arr_char unit_in_hom
[PROOF STATE]
proof (prove)
using this:
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
in_hhom \<eta> (src f) (src f)
\<guillemotleft>\<eta> : src f \<Rightarrow> g \<star> f\<guillemotright>

goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<eta>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret \<epsilon>: arrow_of_spans C \<epsilon>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<epsilon>
[PROOF STEP]
using arr_char counit_in_hom
[PROOF STATE]
proof (prove)
using this:
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
in_hhom \<epsilon> (trg f) (trg f)
\<guillemotleft>\<epsilon> : f \<star> g \<Rightarrow> trg f\<guillemotright>

goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<epsilon>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
interpret adjunction_data_in_span_bicategory C prj0 prj1 f g \<eta> \<epsilon>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjunction_data_in_span_bicategory (\<cdot>) prj0 prj1 f g \<eta> \<epsilon>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> C.iso f.leg0
[PROOF STEP]
show "C.iso f.leg0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C.iso f.leg0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C.iso f.leg0
[PROOF STEP]
have "C.section f.leg0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C.section f.leg0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. C.section f.leg0
[PROOF STEP]
have "f.chine = (gf.prj\<^sub>0 \<cdot> \<eta>.chine) \<cdot> f.leg0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f.chine = (gf.prj\<^sub>0 \<cdot> \<eta>.chine) \<cdot> f.leg0
[PROOF STEP]
using triangle_left' Chn_triangle_eq(1) C.comp_assoc
[PROOF STATE]
proof (prove)
using this:
\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] = f
Chn (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) = gf.prj\<^sub>0 \<cdot> \<eta>.chine \<cdot> f.leg0
(?h \<cdot> ?g) \<cdot> ?f = ?h \<cdot> ?g \<cdot> ?f

goal (1 subgoal):
 1. f.chine = (gf.prj\<^sub>0 \<cdot> \<eta>.chine) \<cdot> f.leg0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f.chine = (gf.prj\<^sub>0 \<cdot> \<eta>.chine) \<cdot> f.leg0

goal (1 subgoal):
 1. C.section f.leg0
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
f.chine = (gf.prj\<^sub>0 \<cdot> \<eta>.chine) \<cdot> f.leg0

goal (1 subgoal):
 1. C.section f.leg0
[PROOF STEP]
using f.chine_is_identity
[PROOF STATE]
proof (prove)
using this:
f.chine = (gf.prj\<^sub>0 \<cdot> \<eta>.chine) \<cdot> f.leg0
C.ide f.chine

goal (1 subgoal):
 1. C.section f.leg0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C.section f.leg0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
C.section f.leg0

goal (1 subgoal):
 1. C.iso f.leg0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
C.section f.leg0

goal (1 subgoal):
 1. C.iso f.leg0
[PROOF STEP]
have "C.retraction f.leg0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. C.retraction f.leg0
[PROOF STEP]
using C.retractionI [of f.leg0 "gf.prj\<^sub>0 \<cdot> \<eta>.chine"] hcomp_def C.comp_assoc
                  \<eta>.leg0_commutes gf.leg0_composite \<eta>_leg_simps
[PROOF STATE]
proof (prove)
using this:
C.ide (f.leg0 \<cdot> gf.prj\<^sub>0 \<cdot> \<eta>.chine) \<Longrightarrow> C.retraction f.leg0
?\<nu> \<star> ?\<mu> \<equiv> if arr ?\<mu> \<and> arr ?\<nu> \<and> src ?\<nu> = trg ?\<mu> then \<lparr>Chn = chine_hcomp ?\<nu> ?\<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)], Leg1 = Leg1 (Dom ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)], Leg1 = Leg1 (Cod ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)]\<rparr>\<rparr> else null
(?h \<cdot> ?g) \<cdot> ?f = ?h \<cdot> ?g \<cdot> ?f
\<eta>.cod.leg0 \<cdot> \<eta>.chine = \<eta>.dom.leg0
gf.leg0 = f.leg0 \<cdot> gf.prj\<^sub>0
\<eta>.dom.leg0 = f.dsrc
\<eta>.dom.leg1 = f.dsrc
\<eta>.cod.leg0 = gf.leg0
\<eta>.cod.leg1 = gf.leg1

goal (1 subgoal):
 1. C.retraction f.leg0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
C.retraction f.leg0

goal (1 subgoal):
 1. C.iso f.leg0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
C.section f.leg0
C.retraction f.leg0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
C.section f.leg0
C.retraction f.leg0

goal (1 subgoal):
 1. C.iso f.leg0
[PROOF STEP]
by (simp add: C.iso_iff_section_and_retraction)
[PROOF STATE]
proof (state)
this:
C.iso f.leg0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
C.iso f.leg0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_left_adjoint f \<Longrightarrow> ide f \<and> C.iso (Leg0 (Dom f))

goal (2 subgoals):
 1. ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> is_left_adjoint f
 2. is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
have 2: "ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow>
                 adjunction_in_bicategory vcomp hcomp assoc unit src trg f
                   (adjoint_of_map f) (unit_for_map f) (counit_for_map f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
assume f: "ide f \<and> C.iso (Leg0 (Dom f))"
[PROOF STATE]
proof (state)
this:
ide f \<and> C.iso (Leg0 (Dom f))

goal (1 subgoal):
 1. ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret f: identity_arrow_of_spans C f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) f
[PROOF STEP]
using f ide_char'
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso (Leg0 (Dom f))
ide ?\<mu> = identity_arrow_of_spans (\<cdot>) ?\<mu>

goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret Dom_src: span_in_category C \<open>\<lparr>Leg0 = f.dsrc, Leg1 = f.dsrc\<rparr>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span_in_category (\<cdot>) \<lparr>Leg0 = f.dsrc, Leg1 = f.dsrc\<rparr>
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0

goal (1 subgoal):
 1. span_in_category (\<cdot>) \<lparr>Leg0 = f.dsrc, Leg1 = f.dsrc\<rparr>
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret Dom_trg: span_in_category C \<open>\<lparr>Leg0 = f.dtrg, Leg1 = f.dtrg\<rparr>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span_in_category (\<cdot>) \<lparr>Leg0 = f.dtrg, Leg1 = f.dtrg\<rparr>
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0

goal (1 subgoal):
 1. span_in_category (\<cdot>) \<lparr>Leg0 = f.dtrg, Leg1 = f.dtrg\<rparr>
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
define g where "g = adjoint_of_map f"
[PROOF STATE]
proof (state)
this:
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret Dom_g: span_in_category C \<open>\<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span_in_category (\<cdot>) \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>
[PROOF STEP]
by (unfold_locales, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret g: arrow_of_spans C g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) g
[PROOF STEP]
unfolding g_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
[PROOF STEP]
using Dom_g.apex_def f.leg0_commutes f.leg1_commutes
[PROOF STATE]
proof (prove)
using this:
Dom_g.apex \<equiv> C.dom Dom_g.leg0
f.cod.leg0 \<cdot> f.chine = f.leg0
f.cod.leg1 \<cdot> f.chine = f.leg1

goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret g: identity_arrow_of_spans C g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) g
[PROOF STEP]
using g_def
[PROOF STATE]
proof (prove)
using this:
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>

goal (1 subgoal):
 1. identity_arrow_of_spans (\<cdot>) g
[PROOF STEP]
by (unfold_locales, auto)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
have ide_g: "ide g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ide g
[PROOF STEP]
using f ide_char g.arrow_of_spans_axioms
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0
ide ?\<mu> = (arrow_of_spans (\<cdot>) ?\<mu> \<and> C.ide (Chn ?\<mu>))
arrow_of_spans (\<cdot>) g

goal (1 subgoal):
 1. ide g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ide g

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret fg: two_composable_arrows_of_spans C prj0 prj1 f g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_composable_arrows_of_spans (\<cdot>) prj0 prj1 f g
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. src f = trg g
[PROOF STEP]
using g_def src_def trg_def arr_char f.arrow_of_spans_axioms g.arrow_of_spans_axioms
[PROOF STATE]
proof (prove)
using this:
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
src ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg0 (Dom ?\<mu>))) else null
trg ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg1 (Dom ?\<mu>))) else null
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
arrow_of_spans (\<cdot>) f
arrow_of_spans (\<cdot>) g

goal (1 subgoal):
 1. src f = trg g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret fg: two_composable_identity_arrows_of_spans C prj0 prj1 f g
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_composable_identity_arrows_of_spans (\<cdot>) prj0 prj1 f g
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret gf: two_composable_arrows_of_spans C prj0 prj1 g f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_composable_arrows_of_spans (\<cdot>) prj0 prj1 g f
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. src g = trg f
[PROOF STEP]
using g_def src_def trg_def arr_char f.arrow_of_spans_axioms g.arrow_of_spans_axioms
[PROOF STATE]
proof (prove)
using this:
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
src ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg0 (Dom ?\<mu>))) else null
trg ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg1 (Dom ?\<mu>))) else null
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
arrow_of_spans (\<cdot>) f
arrow_of_spans (\<cdot>) g

goal (1 subgoal):
 1. src g = trg f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret gf: two_composable_identity_arrows_of_spans C prj0 prj1 g f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_composable_identity_arrows_of_spans (\<cdot>) prj0 prj1 g f
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
have hcomp_fg_eq: "hcomp f g = \<lparr>Chn = f.leg0 \<down>\<down> f.leg0,
                                         Dom = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0],
                                                Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>,
                                         Cod = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0],
                                                Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<star> g = \<lparr>Chn = f.leg0 \<down>\<down> f.leg0, Dom = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>, Cod = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>\<rparr>
[PROOF STEP]
using f g_def hcomp_def fg.composable src_def trg_def arr_char f.arrow_of_spans_axioms
                g.arrow_of_spans_axioms chine_hcomp_def gf.are_identities(1) chine_hcomp_ide_ide
                C.pullback_iso_self
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
?\<nu> \<star> ?\<mu> \<equiv> if arr ?\<mu> \<and> arr ?\<nu> \<and> src ?\<nu> = trg ?\<mu> then \<lparr>Chn = chine_hcomp ?\<nu> ?\<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)], Leg1 = Leg1 (Dom ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)], Leg1 = Leg1 (Cod ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)]\<rparr>\<rparr> else null
src f = trg g
src ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg0 (Dom ?\<mu>))) else null
trg ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg1 (Dom ?\<mu>))) else null
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
arrow_of_spans (\<cdot>) f
arrow_of_spans (\<cdot>) g
chine_hcomp ?\<nu> ?\<mu> \<equiv> \<langle>Chn ?\<nu> \<cdot> \<p>\<^sub>1[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)] \<lbrakk>Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)\<rbrakk> Chn ?\<mu> \<cdot> \<p>\<^sub>0[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)]\<rangle>
ide g
\<lbrakk>ide ?g; ide ?f; src ?g = trg ?f\<rbrakk> \<Longrightarrow> chine_hcomp ?g ?f = Leg0 (Dom ?g) \<down>\<down> Leg1 (Dom ?f)
C.iso ?f \<Longrightarrow> \<p>\<^sub>0[?f, ?f] = \<p>\<^sub>1[?f, ?f]

goal (1 subgoal):
 1. f \<star> g = \<lparr>Chn = f.leg0 \<down>\<down> f.leg0, Dom = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>, Cod = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<star> g = \<lparr>Chn = f.leg0 \<down>\<down> f.leg0, Dom = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>, Cod = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>\<rparr>

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
have hcomp_gf_eq: "hcomp g f = \<lparr>Chn = f.leg1 \<down>\<down> f.leg1,
                                         Dom = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1],
                                                Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>,
                                         Cod = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1],
                                                Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>\<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<star> f = \<lparr>Chn = f.leg1 \<down>\<down> f.leg1, Dom = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>, Cod = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>\<rparr>
[PROOF STEP]
using g_def hcomp_def gf.composable src_def trg_def chine_hcomp_ide_ide
                arr_char f.arrow_of_spans_axioms g.arrow_of_spans_axioms ide_char
[PROOF STATE]
proof (prove)
using this:
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
?\<nu> \<star> ?\<mu> \<equiv> if arr ?\<mu> \<and> arr ?\<nu> \<and> src ?\<nu> = trg ?\<mu> then \<lparr>Chn = chine_hcomp ?\<nu> ?\<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)], Leg1 = Leg1 (Dom ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)], Leg1 = Leg1 (Cod ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)]\<rparr>\<rparr> else null
src g = trg f
src ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg0 (Dom ?\<mu>))) else null
trg ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg1 (Dom ?\<mu>))) else null
\<lbrakk>ide ?g; ide ?f; src ?g = trg ?f\<rbrakk> \<Longrightarrow> chine_hcomp ?g ?f = Leg0 (Dom ?g) \<down>\<down> Leg1 (Dom ?f)
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
arrow_of_spans (\<cdot>) f
arrow_of_spans (\<cdot>) g
ide ?\<mu> = (arrow_of_spans (\<cdot>) ?\<mu> \<and> C.ide (Chn ?\<mu>))

goal (1 subgoal):
 1. g \<star> f = \<lparr>Chn = f.leg1 \<down>\<down> f.leg1, Dom = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>, Cod = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>\<rparr>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
g \<star> f = \<lparr>Chn = f.leg1 \<down>\<down> f.leg1, Dom = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>, Cod = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>\<rparr>

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
define \<eta> where "\<eta> = unit_for_map f"
[PROOF STATE]
proof (state)
this:
\<eta> = unit_for_map f

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret Dom_gf: span_in_category C \<open>\<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1],
                                               Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span_in_category (\<cdot>) \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>
[PROOF STEP]
by (unfold_locales, simp_all)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret \<eta>: arrow_of_spans C \<eta>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<eta>
[PROOF STEP]
using f g_def \<eta>_def hcomp_def src_def trg_def f.arrow_of_spans_axioms
                g.arrow_of_spans_axioms arr_char C.comp_arr_inv'
                C.tuple_in_hom [of f.leg1 f.leg1 "C.inv f.leg0" "C.inv f.leg0"]
                Dom_src.apex_def Dom_gf.apex_def
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
\<eta> = unit_for_map f
?\<nu> \<star> ?\<mu> \<equiv> if arr ?\<mu> \<and> arr ?\<nu> \<and> src ?\<nu> = trg ?\<mu> then \<lparr>Chn = chine_hcomp ?\<nu> ?\<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)], Leg1 = Leg1 (Dom ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)], Leg1 = Leg1 (Cod ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)]\<rparr>\<rparr> else null
src ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg0 (Dom ?\<mu>))) else null
trg ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg1 (Dom ?\<mu>))) else null
arrow_of_spans (\<cdot>) f
arrow_of_spans (\<cdot>) g
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
C.iso ?f \<Longrightarrow> ?f \<cdot> C.inv ?f = C.cod ?f
C.commutative_square f.leg1 f.leg1 (C.inv f.leg0) (C.inv f.leg0) \<Longrightarrow> \<guillemotleft>\<langle>C.inv f.leg0 \<lbrakk>f.leg1, f.leg1\<rbrakk> C.inv f.leg0\<rangle> : C.dom (C.inv f.leg0) \<rightarrow>\<^sub>C f.leg1 \<down>\<down> f.leg1\<guillemotright>
Dom_src.apex \<equiv> C.dom Dom_src.leg0
Dom_gf.apex \<equiv> C.dom Dom_gf.leg0

goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<eta>
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<eta> = unit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f. C.iso f \<Longrightarrow> f \<cdot> C.inv f = C.cod f; C.commutative_square f.leg1 f.leg1 (C.inv f.leg0) (C.inv f.leg0) \<Longrightarrow> \<guillemotleft>\<langle>C.inv f.leg0 \<lbrakk>f.leg1, f.leg1\<rbrakk> C.inv f.leg0\<rangle> : C.dom (C.inv f.leg0) \<rightarrow>\<^sub>C f.leg1 \<down>\<down> f.leg1\<guillemotright>; Dom_src.apex \<equiv> C.dom Dom_src.leg0; Dom_gf.apex \<equiv> C.dom Dom_gf.leg0\<rbrakk> \<Longrightarrow> C.span (Leg0 (Dom \<eta>)) (Leg1 (Dom \<eta>))
 2. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<eta> = unit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f. C.iso f \<Longrightarrow> f \<cdot> C.inv f = C.cod f; C.commutative_square f.leg1 f.leg1 (C.inv f.leg0) (C.inv f.leg0) \<Longrightarrow> \<guillemotleft>\<langle>C.inv f.leg0 \<lbrakk>f.leg1, f.leg1\<rbrakk> C.inv f.leg0\<rangle> : C.dom (C.inv f.leg0) \<rightarrow>\<^sub>C f.leg1 \<down>\<down> f.leg1\<guillemotright>; Dom_src.apex \<equiv> C.dom Dom_src.leg0; Dom_gf.apex \<equiv> C.dom Dom_gf.leg0\<rbrakk> \<Longrightarrow> C.span (Leg0 (Cod \<eta>)) (Leg1 (Cod \<eta>))
 3. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<eta> = unit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f. C.iso f \<Longrightarrow> f \<cdot> C.inv f = C.cod f; C.commutative_square f.leg1 f.leg1 (C.inv f.leg0) (C.inv f.leg0) \<Longrightarrow> \<guillemotleft>\<langle>C.inv f.leg0 \<lbrakk>f.leg1, f.leg1\<rbrakk> C.inv f.leg0\<rangle> : C.dom (C.inv f.leg0) \<rightarrow>\<^sub>C f.leg1 \<down>\<down> f.leg1\<guillemotright>; Dom_src.apex \<equiv> C.dom Dom_src.leg0; Dom_gf.apex \<equiv> C.dom Dom_gf.leg0\<rbrakk> \<Longrightarrow> \<guillemotleft>Chn \<eta> : span_in_category.apex (\<cdot>) (Dom \<eta>) \<rightarrow>\<^sub>C span_in_category.apex (\<cdot>) (Cod \<eta>)\<guillemotright>
 4. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<eta> = unit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f. C.iso f \<Longrightarrow> f \<cdot> C.inv f = C.cod f; C.commutative_square f.leg1 f.leg1 (C.inv f.leg0) (C.inv f.leg0) \<Longrightarrow> \<guillemotleft>\<langle>C.inv f.leg0 \<lbrakk>f.leg1, f.leg1\<rbrakk> C.inv f.leg0\<rangle> : C.dom (C.inv f.leg0) \<rightarrow>\<^sub>C f.leg1 \<down>\<down> f.leg1\<guillemotright>; Dom_src.apex \<equiv> C.dom Dom_src.leg0; Dom_gf.apex \<equiv> C.dom Dom_gf.leg0\<rbrakk> \<Longrightarrow> Leg0 (Cod \<eta>) \<cdot> Chn \<eta> = Leg0 (Dom \<eta>)
 5. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<eta> = unit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f. C.iso f \<Longrightarrow> f \<cdot> C.inv f = C.cod f; C.commutative_square f.leg1 f.leg1 (C.inv f.leg0) (C.inv f.leg0) \<Longrightarrow> \<guillemotleft>\<langle>C.inv f.leg0 \<lbrakk>f.leg1, f.leg1\<rbrakk> C.inv f.leg0\<rangle> : C.dom (C.inv f.leg0) \<rightarrow>\<^sub>C f.leg1 \<down>\<down> f.leg1\<guillemotright>; Dom_src.apex \<equiv> C.dom Dom_src.leg0; Dom_gf.apex \<equiv> C.dom Dom_gf.leg0\<rbrakk> \<Longrightarrow> Leg1 (Cod \<eta>) \<cdot> Chn \<eta> = Leg1 (Dom \<eta>)
[PROOF STEP]
by (simp_all add: C.comp_assoc)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
have unit_in_hom: "\<guillemotleft>\<eta> : src f \<Rightarrow> hcomp g f\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>\<eta> : src f \<Rightarrow> g \<star> f\<guillemotright>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. arr \<eta>
 2. local.dom \<eta> = src f
 3. cod \<eta> = g \<star> f
[PROOF STEP]
show 1: "arr \<eta>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr \<eta>
[PROOF STEP]
using arr_char \<eta>.arrow_of_spans_axioms
[PROOF STATE]
proof (prove)
using this:
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
arrow_of_spans (\<cdot>) \<eta>

goal (1 subgoal):
 1. arr \<eta>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arr \<eta>

goal (2 subgoals):
 1. local.dom \<eta> = src f
 2. cod \<eta> = g \<star> f
[PROOF STEP]
show "dom \<eta> = src f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dom \<eta> = src f
[PROOF STEP]
using 1 \<eta>_def dom_char src_def Dom_src.apex_def
[PROOF STATE]
proof (prove)
using this:
arr \<eta>
\<eta> = unit_for_map f
local.dom = (\<lambda>\<mu>. if arr \<mu> then \<lparr>Chn = span_in_category.apex (\<cdot>) (Dom \<mu>), Dom = Dom \<mu>, Cod = Dom \<mu>\<rparr> else null)
src ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg0 (Dom ?\<mu>))) else null
Dom_src.apex \<equiv> C.dom Dom_src.leg0

goal (1 subgoal):
 1. local.dom \<eta> = src f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.dom \<eta> = src f

goal (1 subgoal):
 1. cod \<eta> = g \<star> f
[PROOF STEP]
show "cod \<eta> = hcomp g f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cod \<eta> = g \<star> f
[PROOF STEP]
using 1 \<eta>_def g_def cod_char hcomp_gf_eq Dom_gf.apex_def
[PROOF STATE]
proof (prove)
using this:
arr \<eta>
\<eta> = unit_for_map f
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
cod = (\<lambda>\<mu>. if arr \<mu> then \<lparr>Chn = span_in_category.apex (\<cdot>) (Cod \<mu>), Dom = Cod \<mu>, Cod = Cod \<mu>\<rparr> else null)
g \<star> f = \<lparr>Chn = f.leg1 \<down>\<down> f.leg1, Dom = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>, Cod = \<lparr>Leg0 = f.leg0 \<cdot> \<p>\<^sub>0[f.leg1, f.leg1], Leg1 = f.leg0 \<cdot> \<p>\<^sub>1[f.leg1, f.leg1]\<rparr>\<rparr>
Dom_gf.apex \<equiv> C.dom Dom_gf.leg0

goal (1 subgoal):
 1. cod \<eta> = g \<star> f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cod \<eta> = g \<star> f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<eta> : src f \<Rightarrow> g \<star> f\<guillemotright>

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
define \<epsilon> where "\<epsilon> = counit_for_map f"
[PROOF STATE]
proof (state)
this:
\<epsilon> = counit_for_map f

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret Dom_fg: span_in_category C \<open>\<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0],
                                               Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. span_in_category (\<cdot>) \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>
[PROOF STEP]
by (unfold_locales, simp_all)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret \<epsilon>: arrow_of_spans C \<epsilon>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<epsilon>
[PROOF STEP]
using f g_def \<epsilon>_def hcomp_def src_def trg_def f.arrow_of_spans_axioms
                g.arrow_of_spans_axioms arr_char C.comp_cod_arr C.pullback_iso_self
                Dom_trg.apex_def Dom_fg.apex_def
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
\<epsilon> = counit_for_map f
?\<nu> \<star> ?\<mu> \<equiv> if arr ?\<mu> \<and> arr ?\<nu> \<and> src ?\<nu> = trg ?\<mu> then \<lparr>Chn = chine_hcomp ?\<nu> ?\<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)], Leg1 = Leg1 (Dom ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom ?\<nu>), Leg1 (Dom ?\<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod ?\<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)], Leg1 = Leg1 (Cod ?\<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod ?\<nu>), Leg1 (Cod ?\<mu>)]\<rparr>\<rparr> else null
src ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg0 (Dom ?\<mu>))) else null
trg ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg1 (Dom ?\<mu>))) else null
arrow_of_spans (\<cdot>) f
arrow_of_spans (\<cdot>) g
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
\<lbrakk>C.arr ?f; C.cod ?f = ?b\<rbrakk> \<Longrightarrow> ?b \<cdot> ?f = ?f
C.iso ?f \<Longrightarrow> \<p>\<^sub>0[?f, ?f] = \<p>\<^sub>1[?f, ?f]
Dom_trg.apex \<equiv> C.dom Dom_trg.leg0
Dom_fg.apex \<equiv> C.dom Dom_fg.leg0

goal (1 subgoal):
 1. arrow_of_spans (\<cdot>) \<epsilon>
[PROOF STEP]
apply unfold_locales
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<epsilon> = counit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f b. \<lbrakk>C.arr f; C.cod f = b\<rbrakk> \<Longrightarrow> b \<cdot> f = f; \<And>f. C.iso f \<Longrightarrow> \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]; Dom_trg.apex \<equiv> C.dom Dom_trg.leg0; Dom_fg.apex \<equiv> C.dom Dom_fg.leg0\<rbrakk> \<Longrightarrow> C.span (Leg0 (Dom \<epsilon>)) (Leg1 (Dom \<epsilon>))
 2. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<epsilon> = counit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f b. \<lbrakk>C.arr f; C.cod f = b\<rbrakk> \<Longrightarrow> b \<cdot> f = f; \<And>f. C.iso f \<Longrightarrow> \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]; Dom_trg.apex \<equiv> C.dom Dom_trg.leg0; Dom_fg.apex \<equiv> C.dom Dom_fg.leg0\<rbrakk> \<Longrightarrow> C.span (Leg0 (Cod \<epsilon>)) (Leg1 (Cod \<epsilon>))
 3. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<epsilon> = counit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f b. \<lbrakk>C.arr f; C.cod f = b\<rbrakk> \<Longrightarrow> b \<cdot> f = f; \<And>f. C.iso f \<Longrightarrow> \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]; Dom_trg.apex \<equiv> C.dom Dom_trg.leg0; Dom_fg.apex \<equiv> C.dom Dom_fg.leg0\<rbrakk> \<Longrightarrow> \<guillemotleft>Chn \<epsilon> : span_in_category.apex (\<cdot>) (Dom \<epsilon>) \<rightarrow>\<^sub>C span_in_category.apex (\<cdot>) (Cod \<epsilon>)\<guillemotright>
 4. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<epsilon> = counit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f b. \<lbrakk>C.arr f; C.cod f = b\<rbrakk> \<Longrightarrow> b \<cdot> f = f; \<And>f. C.iso f \<Longrightarrow> \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]; Dom_trg.apex \<equiv> C.dom Dom_trg.leg0; Dom_fg.apex \<equiv> C.dom Dom_fg.leg0\<rbrakk> \<Longrightarrow> Leg0 (Cod \<epsilon>) \<cdot> Chn \<epsilon> = Leg0 (Dom \<epsilon>)
 5. \<lbrakk>ide f \<and> C.iso f.leg0; g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>; \<epsilon> = counit_for_map f; \<And>\<nu> \<mu>. \<nu> \<star> \<mu> \<equiv> if arr \<mu> \<and> arr \<nu> \<and> src \<nu> = trg \<mu> then \<lparr>Chn = chine_hcomp \<nu> \<mu>, Dom = \<lparr>Leg0 = Leg0 (Dom \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)], Leg1 = Leg1 (Dom \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Dom \<nu>), Leg1 (Dom \<mu>)]\<rparr>, Cod = \<lparr>Leg0 = Leg0 (Cod \<mu>) \<cdot> \<p>\<^sub>0[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)], Leg1 = Leg1 (Cod \<nu>) \<cdot> \<p>\<^sub>1[Leg0 (Cod \<nu>), Leg1 (Cod \<mu>)]\<rparr>\<rparr> else null; \<And>\<mu>. src \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg0 (Dom \<mu>))) else null; \<And>\<mu>. trg \<mu> \<equiv> if arr \<mu> then mkObj (C.cod (Leg1 (Dom \<mu>))) else null; arrow_of_spans (\<cdot>) f; arrow_of_spans (\<cdot>) g; \<And>\<mu>. arr \<mu> = arrow_of_spans (\<cdot>) \<mu>; \<And>f b. \<lbrakk>C.arr f; C.cod f = b\<rbrakk> \<Longrightarrow> b \<cdot> f = f; \<And>f. C.iso f \<Longrightarrow> \<p>\<^sub>0[f, f] = \<p>\<^sub>1[f, f]; Dom_trg.apex \<equiv> C.dom Dom_trg.leg0; Dom_fg.apex \<equiv> C.dom Dom_fg.leg0\<rbrakk> \<Longrightarrow> Leg1 (Cod \<epsilon>) \<cdot> Chn \<epsilon> = Leg1 (Dom \<epsilon>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
have counit_in_hom: "\<guillemotleft>\<epsilon> : hcomp f g \<Rightarrow> trg f\<guillemotright>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<guillemotleft>\<epsilon> : f \<star> g \<Rightarrow> trg f\<guillemotright>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. arr \<epsilon>
 2. local.dom \<epsilon> = f \<star> g
 3. cod \<epsilon> = trg f
[PROOF STEP]
show 1: "arr \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arr \<epsilon>
[PROOF STEP]
using arr_char \<epsilon>.arrow_of_spans_axioms
[PROOF STATE]
proof (prove)
using this:
arr ?\<mu> = arrow_of_spans (\<cdot>) ?\<mu>
arrow_of_spans (\<cdot>) \<epsilon>

goal (1 subgoal):
 1. arr \<epsilon>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
arr \<epsilon>

goal (2 subgoals):
 1. local.dom \<epsilon> = f \<star> g
 2. cod \<epsilon> = trg f
[PROOF STEP]
show "cod \<epsilon> = trg f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cod \<epsilon> = trg f
[PROOF STEP]
using 1 \<epsilon>_def cod_char trg_def Dom_trg.apex_def
[PROOF STATE]
proof (prove)
using this:
arr \<epsilon>
\<epsilon> = counit_for_map f
cod = (\<lambda>\<mu>. if arr \<mu> then \<lparr>Chn = span_in_category.apex (\<cdot>) (Cod \<mu>), Dom = Cod \<mu>, Cod = Cod \<mu>\<rparr> else null)
trg ?\<mu> \<equiv> if arr ?\<mu> then mkObj (C.cod (Leg1 (Dom ?\<mu>))) else null
Dom_trg.apex \<equiv> C.dom Dom_trg.leg0

goal (1 subgoal):
 1. cod \<epsilon> = trg f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cod \<epsilon> = trg f

goal (1 subgoal):
 1. local.dom \<epsilon> = f \<star> g
[PROOF STEP]
show "dom \<epsilon> = hcomp f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dom \<epsilon> = f \<star> g
[PROOF STEP]
using 1 g_def \<epsilon>_def dom_char hcomp_fg_eq Dom_fg.apex_def
[PROOF STATE]
proof (prove)
using this:
arr \<epsilon>
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
\<epsilon> = counit_for_map f
local.dom = (\<lambda>\<mu>. if arr \<mu> then \<lparr>Chn = span_in_category.apex (\<cdot>) (Dom \<mu>), Dom = Dom \<mu>, Cod = Dom \<mu>\<rparr> else null)
f \<star> g = \<lparr>Chn = f.leg0 \<down>\<down> f.leg0, Dom = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>, Cod = \<lparr>Leg0 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0], Leg1 = f.leg1 \<cdot> \<p>\<^sub>1[f.leg0, f.leg0]\<rparr>\<rparr>
Dom_fg.apex \<equiv> C.dom Dom_fg.leg0

goal (1 subgoal):
 1. local.dom \<epsilon> = f \<star> g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.dom \<epsilon> = f \<star> g

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<guillemotleft>\<epsilon> : f \<star> g \<Rightarrow> trg f\<guillemotright>

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret adj: adjunction_data_in_bicategory vcomp hcomp assoc unit src trg f g \<eta> \<epsilon>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjunction_data_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>
[PROOF STEP]
using f ide_g unit_in_hom counit_in_hom gf.composable
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0
ide g
\<guillemotleft>\<eta> : src f \<Rightarrow> g \<star> f\<guillemotright>
\<guillemotleft>\<epsilon> : f \<star> g \<Rightarrow> trg f\<guillemotright>
src g = trg f

goal (1 subgoal):
 1. adjunction_data_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>
[PROOF STEP]
by (unfold_locales, simp_all)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret adjunction_data_in_span_bicategory C prj0 prj1 f g \<eta> \<epsilon>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjunction_data_in_span_bicategory (\<cdot>) prj0 prj1 f g \<eta> \<epsilon>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
have triangle_left: "(\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]
[PROOF STEP]
have "\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] = f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] = f
[PROOF STEP]
proof (intro arr_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. par (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) f
 2. Chn (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) = f.chine
[PROOF STEP]
show "par (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. par (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) f
[PROOF STEP]
using f ide_in_hom [of f] adj.triangle_in_hom(3)
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0
ide f \<Longrightarrow> in_hhom f (src f) (trg f)
ide f \<Longrightarrow> \<guillemotleft>f : f \<Rightarrow> f\<guillemotright>
\<guillemotleft>\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] : f \<Rightarrow> f\<guillemotright>

goal (1 subgoal):
 1. par (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) f
[PROOF STEP]
by (metis (no_types, lifting) in_homE)
[PROOF STATE]
proof (state)
this:
par (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) f

goal (1 subgoal):
 1. Chn (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) = f.chine
[PROOF STEP]
show "Chn (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) = f.chine"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Chn (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) = f.chine
[PROOF STEP]
using f g_def \<eta>_def Chn_triangle_eq(1) C.comp_tuple_arr C.comp_inv_arr'
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
\<eta> = unit_for_map f
Chn (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) = gf.prj\<^sub>0 \<cdot> \<eta>.chine \<cdot> f.leg0
\<lbrakk>C.commutative_square ?f ?g ?h ?k; C.seq ?h ?l\<rbrakk> \<Longrightarrow> \<langle>?h \<lbrakk>?f, ?g\<rbrakk> ?k\<rangle> \<cdot> ?l = \<langle>?h \<cdot> ?l \<lbrakk>?f, ?g\<rbrakk> ?k \<cdot> ?l\<rangle>
C.iso ?f \<Longrightarrow> C.inv ?f \<cdot> ?f = C.dom ?f

goal (1 subgoal):
 1. Chn (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) = f.chine
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Chn (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f]) = f.chine

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] = f

goal (1 subgoal):
 1. (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] = f

goal (1 subgoal):
 1. (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]
[PROOF STEP]
using adj.triangle_equiv_form
[PROOF STATE]
proof (prove)
using this:
\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] = f
((\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]) = (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] = f)
((g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]) = (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g] = g)

goal (1 subgoal):
 1. (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
have triangle_right: "(g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]
[PROOF STEP]
have "\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g] = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g] = g
[PROOF STEP]
proof (intro arr_eqI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. par (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) g
 2. Chn (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) = g.chine
[PROOF STEP]
show "par (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. par (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) g
[PROOF STEP]
using adj.ide_right ide_in_hom [of g] adj.triangle_in_hom(4)
[PROOF STATE]
proof (prove)
using this:
ide g
ide g \<Longrightarrow> in_hhom g (src g) (trg g)
ide g \<Longrightarrow> \<guillemotleft>g : g \<Rightarrow> g\<guillemotright>
\<guillemotleft>\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g] : g \<Rightarrow> g\<guillemotright>

goal (1 subgoal):
 1. par (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) g
[PROOF STEP]
by (metis (no_types, lifting) in_homE)
[PROOF STATE]
proof (state)
this:
par (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) g

goal (1 subgoal):
 1. Chn (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) = g.chine
[PROOF STEP]
show "Chn (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) = g.chine"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Chn (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) = g.chine
[PROOF STEP]
using f g_def \<eta>_def Chn_triangle_eq(2) C.comp_tuple_arr C.comp_inv_arr'
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso f.leg0
g = \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr>
\<eta> = unit_for_map f
Chn (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) = gf.prj\<^sub>1 \<cdot> \<eta>.chine \<cdot> g.leg1
\<lbrakk>C.commutative_square ?f ?g ?h ?k; C.seq ?h ?l\<rbrakk> \<Longrightarrow> \<langle>?h \<lbrakk>?f, ?g\<rbrakk> ?k\<rangle> \<cdot> ?l = \<langle>?h \<cdot> ?l \<lbrakk>?f, ?g\<rbrakk> ?k \<cdot> ?l\<rangle>
C.iso ?f \<Longrightarrow> C.inv ?f \<cdot> ?f = C.dom ?f

goal (1 subgoal):
 1. Chn (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) = g.chine
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Chn (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g]) = g.chine

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g] = g

goal (1 subgoal):
 1. (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g] = g

goal (1 subgoal):
 1. (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]
[PROOF STEP]
using adj.triangle_equiv_form
[PROOF STATE]
proof (prove)
using this:
\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g] = g
((\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]) = (\<l>[f] \<bullet> (\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) \<bullet> \<r>\<^sup>-\<^sup>1[f] = f)
((g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]) = (\<r>[g] \<bullet> (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) \<bullet> \<l>\<^sup>-\<^sup>1[g] = g)

goal (1 subgoal):
 1. (g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]

goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
interpret adj: adjunction_in_bicategory vcomp hcomp assoc unit src trg f g \<eta> \<epsilon>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>
[PROOF STEP]
using triangle_left triangle_right
[PROOF STATE]
proof (prove)
using this:
(\<epsilon> \<star> f) \<bullet> \<a>\<^sup>-\<^sup>1[f, g, f] \<bullet> (f \<star> \<eta>) = \<l>\<^sup>-\<^sup>1[f] \<bullet> \<r>[f]
(g \<star> \<epsilon>) \<bullet> \<a>[g, f, g] \<bullet> (\<eta> \<star> g) = \<r>\<^sup>-\<^sup>1[g] \<bullet> \<l>[g]

goal (1 subgoal):
 1. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>
[PROOF STEP]
by (unfold_locales, simp_all)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ide f \<and> C.iso f.leg0 \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = f.chine, Dom = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>, Cod = \<lparr>Leg0 = f.leg1, Leg1 = f.leg0\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
show "adjunction_in_bicategory vcomp hcomp assoc unit src trg f g \<eta> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f g \<eta> \<epsilon>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)

goal (2 subgoals):
 1. ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> is_left_adjoint f
 2. is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
show "ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> is_left_adjoint f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> is_left_adjoint f
[PROOF STEP]
using 2 adjoint_pair_def
[PROOF STATE]
proof (prove)
using this:
ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
adjoint_pair ?f ?g \<equiv> \<exists>\<eta> \<epsilon>. adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg ?f ?g \<eta> \<epsilon>

goal (1 subgoal):
 1. ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> is_left_adjoint f
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> is_left_adjoint f

goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
show "is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory vcomp hcomp assoc unit src trg f
              (adjoint_of_map f) (unit_for_map f) (counit_for_map f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
is_left_adjoint f \<Longrightarrow> ide f \<and> C.iso (Leg0 (Dom f))
ide f \<and> C.iso (Leg0 (Dom f)) \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)

goal (1 subgoal):
 1. is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_left_adjoint f \<Longrightarrow> adjunction_in_bicategory (\<bullet>) (\<star>) assoc unit src trg f \<lparr>Chn = Chn f, Dom = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>, Cod = \<lparr>Leg0 = Leg1 (Dom f), Leg1 = Leg0 (Dom f)\<rparr>\<rparr> (unit_for_map f) (counit_for_map f)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma l4_13:
  assumes "Col A B C" and
    "A B C Cong3 A' B' C'"
  shows "Col A' B' C'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Col A' B' C'
[PROOF STEP]
by (metis Tarski_neutral_dimensionless.Col_def Tarski_neutral_dimensionless.cong_3_swap Tarski_neutral_dimensionless.cong_3_swap_2 Tarski_neutral_dimensionless_axioms assms(1) assms(2) l4_6)


[STATEMENT]
lemma (in padic_integers) residue_of_sum:
"(a \<oplus> b) k = (a k) \<oplus>\<^bsub>Zp_res_ring k\<^esub> (b k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<oplus> b) k = a k \<oplus>\<^bsub>residue_ring (p ^ k)\<^esub> b k
[PROOF STEP]
using Zp_def residue_ring_def[of "p^k"] Zp_defs(5) padic_add_res
[PROOF STATE]
proof (prove)
using this:
Zp \<equiv> padic_int p
residue_ring (p ^ k) = \<lparr>carrier = {0..p ^ k - 1}, monoid.mult = \<lambda>x y. x * y mod p ^ k, one = 1, zero = 0, add = \<lambda>x y. (x + y) mod p ^ k\<rparr>
(\<oplus>) = padic_add p
padic_add ?p ?f ?g ?n = ?f ?n \<oplus>\<^bsub>residue_ring (?p ^ ?n)\<^esub> ?g ?n

goal (1 subgoal):
 1. (a \<oplus> b) k = a k \<oplus>\<^bsub>residue_ring (p ^ k)\<^esub> b k
[PROOF STEP]
by auto


[STATEMENT]
lemma relations_set_eq_mset: "set_mset (relations_mset t) = relations t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (relations_mset t) = relations t
[PROOF STEP]
using mset_implies_set set_implies_mset
[PROOF STATE]
proof (prove)
using this:
?x \<in># relations_mset ?t \<Longrightarrow> ?x \<in> relations ?t
?x \<in> relations ?t \<Longrightarrow> ?x \<in># relations_mset ?t

goal (1 subgoal):
 1. set_mset (relations_mset t) = relations t
[PROOF STEP]
by fast