[STATEMENT]
lemma \<Delta>\<Phi>_merge:
  assumes "h1 = Node hs1 x1 Leaf" "h2 = Node hs2 x2 Leaf"
  shows "\<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (size h1 + size h2) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
let ?hs = "Node hs1 x1 (Node hs2 x2 Leaf)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
have "\<Phi> (merge h1 h2) = \<Phi> (link ?hs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> (merge h1 h2) = \<Phi> (link \<langle>hs1, x1, \<langle>hs2, x2, \<langle>\<rangle>\<rangle>\<rangle>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h1 = \<langle>hs1, x1, \<langle>\<rangle>\<rangle>
h2 = \<langle>hs2, x2, \<langle>\<rangle>\<rangle>

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) = \<Phi> (link \<langle>hs1, x1, \<langle>hs2, x2, \<langle>\<rangle>\<rangle>\<rangle>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Phi> (merge h1 h2) = \<Phi> (link \<langle>hs1, x1, \<langle>hs2, x2, \<langle>\<rangle>\<rangle>\<rangle>)

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Phi> (merge h1 h2) = \<Phi> (link \<langle>hs1, x1, \<langle>hs2, x2, \<langle>\<rangle>\<rangle>\<rangle>)

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
have "\<dots> = \<Phi> hs1 + \<Phi> hs2 + log 2 (size hs1 + size hs2 + 1) + log 2 (size hs1 + size hs2 + 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> (link \<langle>hs1, x1, \<langle>hs2, x2, \<langle>\<rangle>\<rangle>\<rangle>) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size hs1 + size hs2 + 2))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<Phi> (link \<langle>hs1, x1, \<langle>hs2, x2, \<langle>\<rangle>\<rangle>\<rangle>) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size hs1 + size hs2 + 2))

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Phi> (link \<langle>hs1, x1, \<langle>hs2, x2, \<langle>\<rangle>\<rangle>\<rangle>) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size hs1 + size hs2 + 2))

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
have "\<dots> = \<Phi> hs1 + \<Phi> hs2 + log 2 (size hs1 + size hs2 + 1) + log 2 (size h1 + size h2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size hs1 + size hs2 + 2)) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h1 = \<langle>hs1, x1, \<langle>\<rangle>\<rangle>
h2 = \<langle>hs2, x2, \<langle>\<rangle>\<rangle>

goal (1 subgoal):
 1. \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size hs1 + size hs2 + 2)) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size hs1 + size hs2 + 2)) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2))

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Phi> (merge h1 h2) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2))
[PROOF STEP]
have "\<Phi> (merge h1 h2) = \<dots>"
[PROOF STATE]
proof (prove)
using this:
\<Phi> (merge h1 h2) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2))

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Phi> (merge h1 h2) = \<Phi> hs1 + \<Phi> hs2 + log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2))

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
have "\<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 =
   log 2 (size hs1 + size hs2 + 1) + log 2 (size h1 + size h2)
   - log 2 (size hs1 + 1) - log 2 (size hs2 + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 = log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2)) - log 2 (real (size hs1 + 1)) - log 2 (real (size hs2 + 1))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
h1 = \<langle>hs1, x1, \<langle>\<rangle>\<rangle>
h2 = \<langle>hs2, x2, \<langle>\<rangle>\<rangle>

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 = log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2)) - log 2 (real (size hs1 + 1)) - log 2 (real (size hs2 + 1))
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
\<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 = log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2)) - log 2 (real (size hs1 + 1)) - log 2 (real (size hs2 + 1))

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 = log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2)) - log 2 (real (size hs1 + 1)) - log 2 (real (size hs2 + 1))

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
have "\<dots> \<le> log 2 (size h1 + size h2) + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2)) - log 2 (real (size hs1 + 1)) - log 2 (real (size hs2 + 1)) \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
using ld_le_2ld[of "size hs1" "size hs2"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> real (size hs1); 0 \<le> real (size hs2)\<rbrakk> \<Longrightarrow> log 2 (1 + real (size hs1) + real (size hs2)) \<le> 1 + log 2 (1 + real (size hs1)) + log 2 (1 + real (size hs2))
h1 = \<langle>hs1, x1, \<langle>\<rangle>\<rangle>
h2 = \<langle>hs2, x2, \<langle>\<rangle>\<rangle>

goal (1 subgoal):
 1. log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2)) - log 2 (real (size hs1 + 1)) - log 2 (real (size hs2 + 1)) \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
log 2 (real (size hs1 + size hs2 + 1)) + log 2 (real (size h1 + size h2)) - log 2 (real (size hs1 + 1)) - log 2 (real (size hs2 + 1)) \<le> log 2 (real (size h1 + size h2)) + 1

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1

goal (1 subgoal):
 1. \<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Phi> (merge h1 h2) - \<Phi> h1 - \<Phi> h2 \<le> log 2 (real (size h1 + size h2)) + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_bound_lemma:
  assumes "norm z \<le> 1/2"
  shows "norm (exp z) \<le> 1 + 2 * norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
have *: "(norm z)\<^sup>2 \<le> norm z * 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm z)\<^sup>2 \<le> norm z * 1
[PROOF STEP]
unfolding power2_eq_square
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm z * norm z \<le> norm z * 1
[PROOF STEP]
by (rule mult_left_mono) (use assms in auto)
[PROOF STATE]
proof (state)
this:
(norm z)\<^sup>2 \<le> norm z * 1

goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
have "norm (exp z) \<le> exp (norm z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (exp z) \<le> exp (norm z)
[PROOF STEP]
by (rule norm_exp)
[PROOF STATE]
proof (state)
this:
norm (exp z) \<le> exp (norm z)

goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (exp z) \<le> exp (norm z)

goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
have "\<dots> \<le> 1 + (norm z) + (norm z)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (norm z) \<le> 1 + norm z + (norm z)\<^sup>2
[PROOF STEP]
using assms exp_bound
[PROOF STATE]
proof (prove)
using this:
norm z \<le> 1 / 2
\<lbrakk>0 \<le> ?x; ?x \<le> 1\<rbrakk> \<Longrightarrow> exp ?x \<le> 1 + ?x + ?x\<^sup>2

goal (1 subgoal):
 1. exp (norm z) \<le> 1 + norm z + (norm z)\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
exp (norm z) \<le> 1 + norm z + (norm z)\<^sup>2

goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
exp (norm z) \<le> 1 + norm z + (norm z)\<^sup>2

goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
have "\<dots> \<le> 1 + 2 * norm z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + norm z + (norm z)\<^sup>2 \<le> 1 + 2 * norm z
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
(norm z)\<^sup>2 \<le> norm z * 1

goal (1 subgoal):
 1. 1 + norm z + (norm z)\<^sup>2 \<le> 1 + 2 * norm z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
1 + norm z + (norm z)\<^sup>2 \<le> 1 + 2 * norm z

goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (exp z) \<le> 1 + 2 * norm z

goal (1 subgoal):
 1. norm (exp z) \<le> 1 + 2 * norm z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (exp z) \<le> 1 + 2 * norm z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_unique_favorites_altdef:
  "has_unique_favorites R \<longleftrightarrow> (\<forall>i\<in>agents. is_singleton (favorites R i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. has_unique_favorites R = (\<forall>i\<in>agents. is_singleton (favorites R i))
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>has_unique_favorites R; i \<in> agents\<rbrakk> \<Longrightarrow> is_singleton (favorites R i)
 2. \<forall>i\<in>agents. is_singleton (favorites R i) \<Longrightarrow> has_unique_favorites R
[PROOF STEP]
fix i
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>has_unique_favorites R; i \<in> agents\<rbrakk> \<Longrightarrow> is_singleton (favorites R i)
 2. \<forall>i\<in>agents. is_singleton (favorites R i) \<Longrightarrow> has_unique_favorites R
[PROOF STEP]
assume "has_unique_favorites R" "i \<in> agents"
[PROOF STATE]
proof (state)
this:
has_unique_favorites R
i \<in> agents

goal (2 subgoals):
 1. \<And>i. \<lbrakk>has_unique_favorites R; i \<in> agents\<rbrakk> \<Longrightarrow> is_singleton (favorites R i)
 2. \<forall>i\<in>agents. is_singleton (favorites R i) \<Longrightarrow> has_unique_favorites R
[PROOF STEP]
thus "is_singleton (favorites R i)"
[PROOF STATE]
proof (prove)
using this:
has_unique_favorites R
i \<in> agents

goal (1 subgoal):
 1. is_singleton (favorites R i)
[PROOF STEP]
using favorites_nonempty[of i]
[PROOF STATE]
proof (prove)
using this:
has_unique_favorites R
i \<in> agents
i \<in> agents \<Longrightarrow> favorites R i \<noteq> {}

goal (1 subgoal):
 1. is_singleton (favorites R i)
[PROOF STEP]
by (auto simp: has_unique_favorites_def)
[PROOF STATE]
proof (state)
this:
is_singleton (favorites R i)

goal (1 subgoal):
 1. \<forall>i\<in>agents. is_singleton (favorites R i) \<Longrightarrow> has_unique_favorites R
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i\<in>agents. is_singleton (favorites R i) \<Longrightarrow> has_unique_favorites R
[PROOF STEP]
assume "\<forall>i\<in>agents. is_singleton (favorites R i)"
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>agents. is_singleton (favorites R i)

goal (1 subgoal):
 1. \<forall>i\<in>agents. is_singleton (favorites R i) \<Longrightarrow> has_unique_favorites R
[PROOF STEP]
hence "is_singleton (favorites R i) \<or> favorites R i = {}" for i
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>agents. is_singleton (favorites R i)

goal (1 subgoal):
 1. is_singleton (favorites R i) \<or> favorites R i = {}
[PROOF STEP]
by (cases "i \<in> agents") (simp add: favorites_nonempty, simp add: favorites_altdef')
[PROOF STATE]
proof (state)
this:
is_singleton (favorites R ?i) \<or> favorites R ?i = {}

goal (1 subgoal):
 1. \<forall>i\<in>agents. is_singleton (favorites R i) \<Longrightarrow> has_unique_favorites R
[PROOF STEP]
thus "has_unique_favorites R"
[PROOF STATE]
proof (prove)
using this:
is_singleton (favorites R ?i) \<or> favorites R ?i = {}

goal (1 subgoal):
 1. has_unique_favorites R
[PROOF STEP]
by (auto simp: has_unique_favorites_def)
[PROOF STATE]
proof (state)
this:
has_unique_favorites R

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem equivalence_implies_bisimilarity: assumes "P =\<cdot> Q" shows "P \<sim>\<cdot> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<sim>\<cdot> Q
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P =\<cdot> Q

goal (1 subgoal):
 1. P \<sim>\<cdot> Q
[PROOF STEP]
by (metis bisimilar_def equivalence_is_bisimulation)


[STATEMENT]
lemma smult_carrier_mat[simp]:
  "A \<in> carrier_mat nr nc \<Longrightarrow> k \<cdot>\<^sub>m A \<in> carrier_mat nr nc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> carrier_mat nr nc \<Longrightarrow> k \<cdot>\<^sub>m A \<in> carrier_mat nr nc
[PROOF STEP]
unfolding carrier_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<in> {m. dim_row m = nr \<and> dim_col m = nc} \<Longrightarrow> k \<cdot>\<^sub>m A \<in> {m. dim_row m = nr \<and> dim_col m = nc}
[PROOF STEP]
by auto


[STATEMENT]
lemma star_loop_mu:
  "\<mu> (\<lambda>x . y * x \<squnion> z) = y\<^sup>\<star> * z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<mu> (\<lambda>x. y * x \<squnion> z) = y\<^sup>\<star> * z
[PROOF STEP]
by (metis least_fixpoint_same star_loop_is_least_fixpoint)


[STATEMENT]
lemma poly_gcd_0_iff:
  "poly (gcd p q) x = 0 \<longleftrightarrow> poly p x=0 \<and> poly q x=0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (poly (gcd p q) x = (0::'a)) = (poly p x = (0::'a) \<and> poly q x = (0::'a))
[PROOF STEP]
by (simp add:poly_eq_0_iff_dvd)


[STATEMENT]
lemma dim_eq_full:
  shows "dim S = dimension \<longleftrightarrow> span S = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (dim S = dimension) = (span S = UNIV)
[PROOF STEP]
by (metis dim_eq_span dim_subset_UNIV span_Basis span_span subset_UNIV
        dim_UNIV dim_span dimension_def)


[STATEMENT]
theorem updVal_over[simp]:
"((val (x := sX)_xs) (x := sX')_xs) = (val (x := sX')_xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. val (x := sX)_xs (x := sX')_xs = val (x := sX')_xs
[PROOF STEP]
unfolding updVal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>ys y. if ys = xs \<and> y = x then sX' else if ys = xs \<and> y = x then sX else val ys y) = (\<lambda>ys y. if ys = xs \<and> y = x then sX' else val ys y)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma param_map_prod[param]:
  "(map_prod, map_prod)
  \<in> (Ra\<rightarrow>Rb) \<rightarrow> (Rc\<rightarrow>Rd) \<rightarrow> \<langle>Ra,Rc\<rangle>prod_rel \<rightarrow> \<langle>Rb,Rd\<rangle>prod_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (map_prod, map_prod) \<in> (Ra \<rightarrow> Rb) \<rightarrow> (Rc \<rightarrow> Rd) \<rightarrow> Ra \<times>\<^sub>r Rc \<rightarrow> Rb \<times>\<^sub>r Rd
[PROOF STEP]
unfolding map_prod_def[abs_def]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f g (x, y). (f x, g y), \<lambda>f g (x, y). (f x, g y)) \<in> (Ra \<rightarrow> Rb) \<rightarrow> (Rc \<rightarrow> Rd) \<rightarrow> Ra \<times>\<^sub>r Rc \<rightarrow> Rb \<times>\<^sub>r Rd
[PROOF STEP]
by parametricity


[STATEMENT]
lemma tree_chop_plus: "tree_chop (t + t') = tree_chop t + tree_chop t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tree_chop (t + t') = tree_chop t + tree_chop t'
[PROOF STEP]
by(simp add: plus_tree_def)


[STATEMENT]
lemma ordinal_less_timesR: "\<lbrakk>0 < x; oSuc 0 < y\<rbrakk> \<Longrightarrow> x < x * (y::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; oSuc 0 < y\<rbrakk> \<Longrightarrow> x < x * y
[PROOF STEP]
by (drule ordinal_times_strict_monoR, assumption, simp)


[STATEMENT]
lemma measure_pmf_conv_infsetsum: "measure (measure_pmf p) A = infsetsum (pmf p) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob p A = infsetsum (pmf p) A
[PROOF STEP]
unfolding infsetsum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob p A = integral\<^sup>L (count_space A) (pmf p)
[PROOF STEP]
by (simp add: integral_eq_nn_integral nn_integral_pmf measure_def)


[STATEMENT]
lemma setprod_atMost_Suc[simp]:
  "(\<Prod>i \<le> Suc n. f i) = (\<Prod>i \<le> n. f i) * f(Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prod f {..Suc n} = prod f {..n} * f (Suc n)
[PROOF STEP]
by(simp add:atMost_Suc mult_ac)


[STATEMENT]
lemma add_mset_lt_right_lt: "A < B \<Longrightarrow> add_mset a A < add_mset a B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A < B \<Longrightarrow> add_mset a A < add_mset a B
[PROOF STEP]
unfolding less_multiset\<^sub>H\<^sub>O
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<noteq> B \<and> (\<forall>y. count B y < count A y \<longrightarrow> (\<exists>x>y. count A x < count B x)) \<Longrightarrow> add_mset a A \<noteq> add_mset a B \<and> (\<forall>y. count (add_mset a B) y < count (add_mset a A) y \<longrightarrow> (\<exists>x>y. count (add_mset a A) x < count (add_mset a B) x))
[PROOF STEP]
by auto


[STATEMENT]
lemma integral_map_pmf[simp]:
  fixes f::"real \<Rightarrow> real"
  shows "(\<integral>x. f x \<partial>(map_pmf g M)) = (\<integral>x. f (g x) \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.expectation (map_pmf g M) f = measure_pmf.expectation M (\<lambda>x. f (g x))
[PROOF STEP]
unfolding map_pmf_rep_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L (distr (measure_pmf M) (count_space UNIV) g) f = measure_pmf.expectation M (\<lambda>x. f (g x))
[PROOF STEP]
using integral_distr[of g "(measure_pmf M)" "(count_space UNIV)" f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>measure_pmf.random_variable M (count_space UNIV) g; f \<in> borel_measurable (count_space UNIV)\<rbrakk> \<Longrightarrow> integral\<^sup>L (distr (measure_pmf M) (count_space UNIV) g) f = measure_pmf.expectation M (\<lambda>x. f (g x))

goal (1 subgoal):
 1. integral\<^sup>L (distr (measure_pmf M) (count_space UNIV) g) f = measure_pmf.expectation M (\<lambda>x. f (g x))
[PROOF STEP]
by auto


[STATEMENT]
lemma lower_asymptotic_density_one_finite_Intersection:
  assumes "finite I" "\<And>i. i \<in> I \<Longrightarrow> lower_asymptotic_density (A i) = 1"
  shows "lower_asymptotic_density (\<Inter>i\<in>I. A i) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_asymptotic_density (\<Inter> (A ` I)) = 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite I
?i \<in> I \<Longrightarrow> lower_asymptotic_density (A ?i) = 1

goal (1 subgoal):
 1. lower_asymptotic_density (\<Inter> (A ` I)) = 1
[PROOF STEP]
by (induction rule: finite_induct, auto intro!: lower_asymptotic_density_one_intersection)


[STATEMENT]
lemma r_preserves_product :
  "measure_to_qbs (X \<Otimes>\<^sub>M Y) = measure_to_qbs X \<Otimes>\<^sub>Q measure_to_qbs Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_to_qbs (X \<Otimes>\<^sub>M Y) = measure_to_qbs X \<Otimes>\<^sub>Q measure_to_qbs Y
[PROOF STEP]
by(auto intro!: qbs_eqI simp: measurable_pair_iff pair_qbs_Mx_def)


[STATEMENT]
lemma path_conc:
  assumes P1: "path E u la v"
  assumes P2: "path E v lb w"
  shows "path E u (la@lb) w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path E u (la @ lb) w
[PROOF STEP]
using P1 P2
[PROOF STATE]
proof (prove)
using this:
path E u la v
path E v lb w

goal (1 subgoal):
 1. path E u (la @ lb) w
[PROOF STEP]
apply induct
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>u. path E u lb w \<Longrightarrow> path E u ([] @ lb) w
 2. \<And>u v l wa. \<lbrakk>(u, v) \<in> E; path E v l wa; path E wa lb w \<Longrightarrow> path E v (l @ lb) w; path E wa lb w\<rbrakk> \<Longrightarrow> path E u ((u # l) @ lb) w
[PROOF STEP]
by (auto intro: path.intros)


[STATEMENT]
lemma eqpoll_iff_card_of_ordIso: "A \<approx> B \<longleftrightarrow> ordIso2 (card_of A) (card_of B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<approx> B) = ordIso2 (card_of A) (card_of B)
[PROOF STEP]
by (simp add: card_of_ordIso eqpoll_def)


[STATEMENT]
lemma var_factor_mult:
  assumes "I = J0 \<union> J1"
  assumes "J1 \<subseteq> I"
  assumes "J1 \<inter> J0 = {}"
  assumes "P \<in> carrier (Pring R I)"
  assumes "Q \<in> carrier (Pring R I)"
  shows "var_factor I J0 J1 (P \<otimes>\<^bsub>Pring R I\<^esub> Q) = var_factor I J0 J1 P \<otimes>\<^bsub>Pring (Pring R J0) J1\<^esub>
                                                 var_factor I J0 J1 Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. var_factor I J0 J1 (P \<otimes>\<^bsub>Pring R I\<^esub> Q) = var_factor I J0 J1 P \<otimes>\<^bsub>Pring (Pring R J0) J1\<^esub> var_factor I J0 J1 Q
[PROOF STEP]
using assms var_factor_morphism'[of I J0 J1] ring_hom_ring.homh
[PROOF STATE]
proof (prove)
using this:
I = J0 \<union> J1
J1 \<subseteq> I
J1 \<inter> J0 = {}
P \<in> carrier (Pring R I)
Q \<in> carrier (Pring R I)
\<lbrakk>I = J0 \<union> J1; J1 \<subseteq> I; J1 \<inter> J0 = {}; ?\<psi> = var_factor I J0 J1\<rbrakk> \<Longrightarrow> ring_hom_ring (Pring R I) (Pring (Pring R J0) J1) ?\<psi>
\<lbrakk>I = J0 \<union> J1; J1 \<subseteq> I; J1 \<inter> J0 = {}; ?\<psi> = var_factor I J0 J1; ?i \<in> J1\<rbrakk> \<Longrightarrow> ?\<psi> (pvar R ?i) = pvar (Pring R J0) ?i
\<lbrakk>I = J0 \<union> J1; J1 \<subseteq> I; J1 \<inter> J0 = {}; ?\<psi> = var_factor I J0 J1; ?a \<in> carrier (Pring R (J0 \<inter> I))\<rbrakk> \<Longrightarrow> ?\<psi> ?a = ring.indexed_const (Pring R J0) ?a
ring_hom_ring ?R ?S ?h \<Longrightarrow> ?h \<in> ring_hom ?R ?S

goal (1 subgoal):
 1. var_factor I J0 J1 (P \<otimes>\<^bsub>Pring R I\<^esub> Q) = var_factor I J0 J1 P \<otimes>\<^bsub>Pring (Pring R J0) J1\<^esub> var_factor I J0 J1 Q
[PROOF STEP]
by (metis (no_types, lifting) ring_hom_mult)


[STATEMENT]
lemma filtermap_at_bot_linear_eq:
  fixes c::"'a::linordered_field"
  assumes "c\<noteq>0"
  shows "filtermap (\<lambda>x. x * c + b) at_bot = (if c>0 then at_bot else at_top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
proof (cases "c>0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
 2. \<not> (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
(0::'a) < c

goal (2 subgoals):
 1. (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
 2. \<not> (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'a) < c
[PROOF STEP]
have "filtermap (\<lambda>x. x * c + b) at_bot = at_bot"
[PROOF STATE]
proof (prove)
using this:
(0::'a) < c

goal (1 subgoal):
 1. filtermap (\<lambda>x. x * c + b) at_bot = at_bot
[PROOF STEP]
apply (intro filtermap_fun_inverse[of "\<lambda>x. (x-b) / c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. (0::'a) < c \<Longrightarrow> LIM x at_bot. (x - b) / c :> at_bot
 2. (0::'a) < c \<Longrightarrow> LIM x at_bot. x * c + b :> at_bot
 3. (0::'a) < c \<Longrightarrow> \<forall>\<^sub>F x in at_bot. (x - b) / c * c + b = x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < c \<Longrightarrow> LIM x at_bot. (x - b) / c :> at_bot
[PROOF STEP]
unfolding eventually_at_bot_linorder filterlim_at_bot
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < c \<Longrightarrow> \<forall>Z. \<exists>N. \<forall>n\<le>N. (n - b) / c \<le> Z
[PROOF STEP]
by (auto simp add: field_simps)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (0::'a) < c \<Longrightarrow> LIM x at_bot. x * c + b :> at_bot
 2. (0::'a) < c \<Longrightarrow> \<forall>\<^sub>F x in at_bot. (x - b) / c * c + b = x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < c \<Longrightarrow> LIM x at_bot. x * c + b :> at_bot
[PROOF STEP]
unfolding eventually_at_bot_linorder filterlim_at_bot
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < c \<Longrightarrow> \<forall>Z. \<exists>N. \<forall>n\<le>N. n * c + b \<le> Z
[PROOF STEP]
by (metis mult.commute real_affinity_le)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) < c \<Longrightarrow> \<forall>\<^sub>F x in at_bot. (x - b) / c * c + b = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap (\<lambda>x. x * c + b) at_bot = at_bot

goal (2 subgoals):
 1. (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
 2. \<not> (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filtermap (\<lambda>x. x * c + b) at_bot = at_bot
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. x * c + b) at_bot = at_bot

goal (1 subgoal):
 1. filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
using \<open>c>0\<close>
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. x * c + b) at_bot = at_bot
(0::'a) < c

goal (1 subgoal):
 1. filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)

goal (1 subgoal):
 1. \<not> (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (0::'a) < c

goal (1 subgoal):
 1. \<not> (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (0::'a) < c
[PROOF STEP]
have "c<0"
[PROOF STATE]
proof (prove)
using this:
\<not> (0::'a) < c

goal (1 subgoal):
 1. c < (0::'a)
[PROOF STEP]
using \<open>c\<noteq>0\<close>
[PROOF STATE]
proof (prove)
using this:
\<not> (0::'a) < c
c \<noteq> (0::'a)

goal (1 subgoal):
 1. c < (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c < (0::'a)

goal (1 subgoal):
 1. \<not> (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c < (0::'a)
[PROOF STEP]
have "filtermap (\<lambda>x. x * c + b) at_bot = at_top"
[PROOF STATE]
proof (prove)
using this:
c < (0::'a)

goal (1 subgoal):
 1. filtermap (\<lambda>x. x * c + b) at_bot = at_top
[PROOF STEP]
apply (intro filtermap_fun_inverse[of "\<lambda>x. (x-b) / c"])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. c < (0::'a) \<Longrightarrow> LIM x at_top. (x - b) / c :> at_bot
 2. c < (0::'a) \<Longrightarrow> LIM x at_bot. x * c + b :> at_top
 3. c < (0::'a) \<Longrightarrow> \<forall>\<^sub>F x in at_top. (x - b) / c * c + b = x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> LIM x at_top. (x - b) / c :> at_bot
[PROOF STEP]
unfolding eventually_at_top_linorder filterlim_at_bot
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> \<forall>Z. \<exists>N. \<forall>n\<ge>N. (n - b) / c \<le> Z
[PROOF STEP]
by (meson le_diff_eq neg_divide_le_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. c < (0::'a) \<Longrightarrow> LIM x at_bot. x * c + b :> at_top
 2. c < (0::'a) \<Longrightarrow> \<forall>\<^sub>F x in at_top. (x - b) / c * c + b = x
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> LIM x at_bot. x * c + b :> at_top
[PROOF STEP]
unfolding eventually_at_bot_linorder filterlim_at_top
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> \<forall>Z. \<exists>N. \<forall>n\<le>N. Z \<le> n * c + b
[PROOF STEP]
using \<open>c < 0\<close>
[PROOF STATE]
proof (prove)
using this:
c < (0::'a)

goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> \<forall>Z. \<exists>N. \<forall>n\<le>N. Z \<le> n * c + b
[PROOF STEP]
by (meson False diff_le_eq le_divide_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c < (0::'a) \<Longrightarrow> \<forall>\<^sub>F x in at_top. (x - b) / c * c + b = x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap (\<lambda>x. x * c + b) at_bot = at_top

goal (1 subgoal):
 1. \<not> (0::'a) < c \<Longrightarrow> filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
filtermap (\<lambda>x. x * c + b) at_bot = at_top
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. x * c + b) at_bot = at_top

goal (1 subgoal):
 1. filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
using \<open>c<0\<close>
[PROOF STATE]
proof (prove)
using this:
filtermap (\<lambda>x. x * c + b) at_bot = at_top
c < (0::'a)

goal (1 subgoal):
 1. filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
filtermap (\<lambda>x. x * c + b) at_bot = (if (0::'a) < c then at_bot else at_top)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_add_0 [simp]:
  fixes A :: "'a::comm_monoid_add set"
  shows "{0} + A = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0::'a} + A = A
[PROOF STEP]
by (metis comm_monoid_add_class.add_0 set_zero)


[STATEMENT]
lemma cong_cong_prod_coprime_nat:
  "[x = y] (mod (\<Prod>i\<in>A. m i))" if
    "(\<forall>i\<in>A. [x = y] (mod m i))"
    "(\<forall>i\<in>A. (\<forall>j\<in>A. i \<noteq> j \<longrightarrow> coprime (m i) (m j)))"
  for x y :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [x = y] (mod prod m A)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>A. [x = y] (mod m i)
\<forall>i\<in>A. \<forall>j\<in>A. i \<noteq> j \<longrightarrow> coprime (m i) (m j)

goal (1 subgoal):
 1. [x = y] (mod prod m A)
[PROOF STEP]
by (induct A rule: infinite_finite_induct)
    (auto intro!: coprime_cong_mult_nat prod_coprime_right)


[STATEMENT]
lemma [simp]: "`-p + p = 1`"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (\<iota> p) + \<iota> p = (1::'b)
[PROOF STEP]
by kat_hom (metis compl_sup_top)


[STATEMENT]
lemma snd_pseudo_mod_smult_left[simp]:
  shows "snd (pseudo_divmod (smult (x::'a::idom) p) q) = (smult x (snd (pseudo_divmod p q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (pseudo_divmod (Polynomial.smult x p) q) = Polynomial.smult x (snd (pseudo_divmod p q))
[PROOF STEP]
unfolding pseudo_divmod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (if q = 0 then (0, Polynomial.smult x p) else pseudo_divmod_main (lead_coeff q) 0 (Polynomial.smult x p) q (degree (Polynomial.smult x p)) (1 + length (coeffs (Polynomial.smult x p)) - length (coeffs q))) = Polynomial.smult x (snd (if q = 0 then (0, p) else pseudo_divmod_main (lead_coeff q) 0 p q (degree p) (1 + length (coeffs p) - length (coeffs q))))
[PROOF STEP]
by (auto simp:snd_pseudo_mod_smult_invar_left[of _ _ _ _ _ _ _ 0] Polynomial.coeffs_smult)


[STATEMENT]
lemma prime_nat_code: "prime p = (1 < p \<and> (\<forall>x. 1 < x \<and> x < p \<longrightarrow> \<not> x dvd p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime p = (1 < p \<and> (\<forall>x. 1 < x \<and> x < p \<longrightarrow> \<not> x dvd p))
[PROOF STEP]
by auto2


[STATEMENT]
lemma mult_eSuc: "((m::eint) + 1) * n = m * n + n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (m + 1) * n = m * n + n
[PROOF STEP]
by (simp add: distrib_right)


[STATEMENT]
lemma (in strategic_space_2p) U\<^sub>B_times_U\<^sub>B_cnj:
  shows "U\<^sub>B * (U\<^sub>B\<^sup>\<dagger>) = 1\<^sub>m 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = 1\<^sub>m 2
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m 2); j < dim_col (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)
 2. dim_row (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 2)
 3. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m 2); j < dim_col (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)
 2. dim_row (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 2)
 3. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
assume a0:"i < dim_row (1\<^sub>m 2)" and a1:"j < dim_col (1\<^sub>m 2)"
[PROOF STATE]
proof (state)
this:
i < dim_row (1\<^sub>m 2)
j < dim_col (1\<^sub>m 2)

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (1\<^sub>m 2); j < dim_col (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)
 2. dim_row (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 2)
 3. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row (1\<^sub>m 2)
j < dim_col (1\<^sub>m 2)
[PROOF STEP]
show "(U\<^sub>B * (U\<^sub>B\<^sup>\<dagger>)) $$ (i,j) = 1\<^sub>m 2 $$ (i,j)"
[PROOF STATE]
proof (prove)
using this:
i < dim_row (1\<^sub>m 2)
j < dim_col (1\<^sub>m 2)

goal (1 subgoal):
 1. (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>i < dim_row (1\<^sub>m 2); j < dim_col (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)
[PROOF STEP]
have "i\<in>{0,1} \<and> j\<in>{0,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> {0, 1} \<and> j \<in> {0, 1}
[PROOF STEP]
using a0 a1 mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
i < dim_row (1\<^sub>m 2)
j < dim_col (1\<^sub>m 2)
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. i \<in> {0, 1} \<and> j \<in> {0, 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<in> {0, 1} \<and> j \<in> {0, 1}

goal (1 subgoal):
 1. \<lbrakk>i < dim_row (1\<^sub>m 2); j < dim_col (1\<^sub>m 2)\<rbrakk> \<Longrightarrow> (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
i \<in> {0, 1} \<and> j \<in> {0, 1}

goal (1 subgoal):
 1. (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)
[PROOF STEP]
using mat_of_cols_list_def cos_sin_squared_add_cpx hermite_cnj_of_U\<^sub>B exp_sin_cos_squared_add[of "\<phi>\<^sub>B" "\<theta>\<^sub>B / 2"]
[PROOF STATE]
proof (prove)
using this:
i \<in> {0, 1} \<and> j \<in> {0, 1}
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)
complex_of_real (cos (?\<gamma> / 2)) * complex_of_real (cos (?\<gamma> / 2)) - \<i> * complex_of_real (sin (?\<gamma> / 2)) * (\<i> * complex_of_real (sin (?\<gamma> / 2))) = 1
Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger> = Tensor.mat_of_cols_list 2 [exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [sin (\<theta>\<^sub>B / 2)], [complex_of_real (- sin (\<theta>\<^sub>B / 2)), exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]
exp (- (\<i> * complex_of_real \<phi>\<^sub>B)) * complex_of_real (cos (\<theta>\<^sub>B / 2)) * (exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))) + complex_of_real (sin (\<theta>\<^sub>B / 2) * sin (\<theta>\<^sub>B / 2)) = 1

goal (1 subgoal):
 1. (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)
[PROOF STEP]
by (auto simp add: set_2 algebra_simps)
[PROOF STATE]
proof (state)
this:
(Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) $$ (i, j) = 1\<^sub>m 2 $$ (i, j)

goal (2 subgoals):
 1. dim_row (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 2)
 2. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. dim_row (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 2)
 2. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
show "dim_row (U\<^sub>B * (U\<^sub>B\<^sup>\<dagger>)) = dim_row (1\<^sub>m 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 2)
[PROOF STEP]
using mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. dim_row (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_row (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_row (1\<^sub>m 2)

goal (1 subgoal):
 1. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
show "dim_col (U\<^sub>B * (U\<^sub>B\<^sup>\<dagger>)) = dim_col (1\<^sub>m 2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
using mat_of_cols_list_def
[PROOF STATE]
proof (prove)
using this:
Tensor.mat_of_cols_list ?nr ?cs = Matrix.mat ?nr (length ?cs) (\<lambda>(i, j). ?cs ! j ! i)

goal (1 subgoal):
 1. dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_col (Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]] * Tensor.mat_of_cols_list 2 [exp (\<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2)) # map complex_of_real [- sin (\<theta>\<^sub>B / 2)], [complex_of_real (sin (\<theta>\<^sub>B / 2)), exp (- \<i> * complex_of_real \<phi>\<^sub>B) * complex_of_real (cos (\<theta>\<^sub>B / 2))]]\<^sup>\<dagger>) = dim_col (1\<^sub>m 2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<exists>(x::'a::linordered_field) y z. x + 7 * y - 5 * z < 0 \<and> 5 * y + 7 * z + 3 * x < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x y z. x + (7::'a) * y - (5::'a) * z < (0::'a) \<and> (5::'a) * y + (7::'a) * z + (3::'a) * x < (0::'a)
[PROOF STEP]
by ferrack