[STATEMENT]
lemma local_lipschitz_temp_dyn:
  assumes "0 < (a::real)"
  shows "local_lipschitz UNIV UNIV (\<lambda>t::real. f a L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local_lipschitz UNIV UNIV (\<lambda>t. f a L)
[PROOF STEP]
apply(unfold local_lipschitz_def lipschitz_on_def dist_norm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>UNIV. \<forall>t\<in>UNIV. \<exists>u>0. \<exists>La. \<forall>t\<in>cball t u \<inter> UNIV. 0 \<le> La \<and> (\<forall>xa\<in>cball x u \<inter> UNIV. \<forall>y\<in>cball x u \<inter> UNIV. \<parallel>f a L xa - f a L y\<parallel> \<le> La \<cdot> \<parallel>xa - y\<parallel>)
[PROOF STEP]
apply(clarsimp, rule_tac x=1 in exI, clarsimp, rule_tac x=a in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x t ta. dist t ta \<le> 1 \<Longrightarrow> 0 \<le> a \<and> (\<forall>xa\<in>cball x 1. \<forall>y\<in>cball x 1. \<parallel>f a L xa - f a L y\<parallel> \<le> a \<cdot> \<parallel>xa - y\<parallel>)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. \<And>x t ta. dist t ta \<le> 1 \<Longrightarrow> 0 \<le> a \<and> (\<forall>xa\<in>cball x 1. \<forall>y\<in>cball x 1. \<parallel>f a L xa - f a L y\<parallel> \<le> a \<cdot> \<parallel>xa - y\<parallel>)
[PROOF STEP]
apply(simp_all add: norm_diff_temp_dyn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x t ta. \<lbrakk>dist t ta \<le> 1; 0 < a\<rbrakk> \<Longrightarrow> \<forall>xa\<in>cball x 1. \<forall>y\<in>cball x 1. \<bar>xa $ 1 - y $ 1\<bar> \<le> \<parallel>xa - y\<parallel>
[PROOF STEP]
apply(simp add: norm_vec_def L2_set_def, unfold UNIV_4, clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x t ta xa y. \<lbrakk>dist t ta \<le> 1; 0 < a; dist x xa \<le> 1; dist x y \<le> 1\<rbrakk> \<Longrightarrow> \<bar>xa $ 1 - y $ 1\<bar> \<le> sqrt ((xa $ 1 - y $ 1)\<^sup>2 + ((xa $ 2 - y $ 2)\<^sup>2 + ((xa $ 3 - y $ 3)\<^sup>2 + (xa $ 4 - y $ 4)\<^sup>2)))
[PROOF STEP]
unfolding real_sqrt_abs[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x t ta xa y. \<lbrakk>dist t ta \<le> 1; 0 < a; dist x xa \<le> 1; dist x y \<le> 1\<rbrakk> \<Longrightarrow> sqrt ((xa $ 1 - y $ 1)\<^sup>2) \<le> sqrt ((xa $ 1 - y $ 1)\<^sup>2 + ((xa $ 2 - y $ 2)\<^sup>2 + ((xa $ 3 - y $ 3)\<^sup>2 + (xa $ 4 - y $ 4)\<^sup>2)))
[PROOF STEP]
by (rule real_le_lsqrt) auto


[STATEMENT]
lemma tan_60: "tan (pi / 3) = sqrt 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (pi / 3) = sqrt 3
[PROOF STEP]
unfolding tan_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sin (pi / 3) / cos (pi / 3) = sqrt 3
[PROOF STEP]
by (simp add: sin_60 cos_60)


[STATEMENT]
lemma foldl1_map:
  assumes "associative f"
      and "xs \<noteq> []"
      and "ys \<noteq> []"
  shows "foldl1 f (map h (xs @ ys))
         = f (foldl1 f (map h xs)) (foldl1 f (map h ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
have
  "foldl1 f (map h (xs @ ys))
   = foldl1 f (map h xs @ map h ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl1 f (map h (xs @ ys)) = foldl1 f (map h xs @ map h ys)
[PROOF STEP]
using L5
[PROOF STATE]
proof (prove)
using this:
map ?f (?xs @ ?ys) = map ?f ?xs @ map ?f ?ys

goal (1 subgoal):
 1. foldl1 f (map h (xs @ ys)) = foldl1 f (map h xs @ map h ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldl1 f (map h (xs @ ys)) = foldl1 f (map h xs @ map h ys)

goal (1 subgoal):
 1. foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
foldl1 f (map h (xs @ ys)) = foldl1 f (map h xs @ map h ys)

goal (1 subgoal):
 1. foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
have
  "\<dots> = f (foldl1 f (map h xs)) (foldl1 f (map h ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl1 f (map h xs @ map h ys) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
using assms and L8 [where f=f]
[PROOF STATE]
proof (prove)
using this:
associative f
xs \<noteq> []
ys \<noteq> []
\<lbrakk>associative f; ?xs \<noteq> []; ?ys \<noteq> []\<rbrakk> \<Longrightarrow> foldl1 f (?xs @ ?ys) = f (foldl1 f ?xs) (foldl1 f ?ys)

goal (1 subgoal):
 1. foldl1 f (map h xs @ map h ys) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
foldl1 f (map h xs @ map h ys) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))

goal (1 subgoal):
 1. foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))

goal (1 subgoal):
 1. foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
foldl1 f (map h (xs @ ys)) = f (foldl1 f (map h xs)) (foldl1 f (map h ys))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_Un_ge:
  fixes f :: "_ \<Rightarrow> real"
  assumes "finite M" "finite N" "\<forall>B \<in> M \<union> N. 0 < f B"
  shows "sum f M \<le> sum f (M \<union> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f M \<le> sum f (M \<union> N)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum f M \<le> sum f (M \<union> N)
[PROOF STEP]
have "0 \<le> sum f N - sum f (M \<inter> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> sum f N - sum f (M \<inter> N)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite M
finite N
\<forall>B\<in>M \<union> N. 0 < f B

goal (1 subgoal):
 1. 0 \<le> sum f N - sum f (M \<inter> N)
[PROOF STEP]
by (smt DiffD1 inf.cobounded2 UnCI sum_mono2)
[PROOF STATE]
proof (state)
this:
0 \<le> sum f N - sum f (M \<inter> N)

goal (1 subgoal):
 1. sum f M \<le> sum f (M \<union> N)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> sum f N - sum f (M \<inter> N)
[PROOF STEP]
have "sum f M \<le> sum f M + sum f N - sum f (M \<inter> N)"
[PROOF STATE]
proof (prove)
using this:
0 \<le> sum f N - sum f (M \<inter> N)

goal (1 subgoal):
 1. sum f M \<le> sum f M + sum f N - sum f (M \<inter> N)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f M \<le> sum f M + sum f N - sum f (M \<inter> N)

goal (1 subgoal):
 1. sum f M \<le> sum f (M \<union> N)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum f M \<le> sum f M + sum f N - sum f (M \<inter> N)

goal (1 subgoal):
 1. sum f M \<le> sum f (M \<union> N)
[PROOF STEP]
have "... = sum f (M \<union> N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f M + sum f N - sum f (M \<inter> N) = sum f (M \<union> N)
[PROOF STEP]
using sum_Un[OF assms(1,2), symmetric]
[PROOF STATE]
proof (prove)
using this:
sum ?f M + sum ?f N - sum ?f (M \<inter> N) = sum ?f (M \<union> N)

goal (1 subgoal):
 1. sum f M + sum f N - sum f (M \<inter> N) = sum f (M \<union> N)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f M + sum f N - sum f (M \<inter> N) = sum f (M \<union> N)

goal (1 subgoal):
 1. sum f M \<le> sum f (M \<union> N)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum f M \<le> sum f (M \<union> N)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum f M \<le> sum f (M \<union> N)

goal (1 subgoal):
 1. sum f M \<le> sum f (M \<union> N)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum f M \<le> sum f (M \<union> N)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma leq_antisym: "\<lbrakk> (x, y) \<in> leq; (y, x) \<in> leq \<rbrakk> \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(x, y) \<in> leq; (y, x) \<in> leq\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
using po
[PROOF STATE]
proof (prove)
using this:
Partial_order leq

goal (1 subgoal):
 1. \<lbrakk>(x, y) \<in> leq; (y, x) \<in> leq\<rbrakk> \<Longrightarrow> x = y
[PROOF STEP]
by(simp add: order_on_defs antisym_def)


[STATEMENT]
lemma sum_squares_bound: "2 * x * y \<le> x\<^sup>2 + y\<^sup>2"
  for x y :: "'a::linordered_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2::'a) * x * y \<le> x\<^sup>2 + y\<^sup>2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (2::'a) * x * y \<le> x\<^sup>2 + y\<^sup>2
[PROOF STEP]
have "(x - y)\<^sup>2 = x * x - 2 * x * y + y * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - y)\<^sup>2 = x * x - (2::'a) * x * y + y * y
[PROOF STEP]
by algebra
[PROOF STATE]
proof (state)
this:
(x - y)\<^sup>2 = x * x - (2::'a) * x * y + y * y

goal (1 subgoal):
 1. (2::'a) * x * y \<le> x\<^sup>2 + y\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(x - y)\<^sup>2 = x * x - (2::'a) * x * y + y * y
[PROOF STEP]
have "0 \<le> x\<^sup>2 - 2 * x * y + y\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
(x - y)\<^sup>2 = x * x - (2::'a) * x * y + y * y

goal (1 subgoal):
 1. (0::'a) \<le> x\<^sup>2 - (2::'a) * x * y + y\<^sup>2
[PROOF STEP]
by (metis sum_power2_ge_zero zero_le_double_add_iff_zero_le_single_add power2_eq_square)
[PROOF STATE]
proof (state)
this:
(0::'a) \<le> x\<^sup>2 - (2::'a) * x * y + y\<^sup>2

goal (1 subgoal):
 1. (2::'a) * x * y \<le> x\<^sup>2 + y\<^sup>2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(0::'a) \<le> x\<^sup>2 - (2::'a) * x * y + y\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(0::'a) \<le> x\<^sup>2 - (2::'a) * x * y + y\<^sup>2

goal (1 subgoal):
 1. (2::'a) * x * y \<le> x\<^sup>2 + y\<^sup>2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
(2::'a) * x * y \<le> x\<^sup>2 + y\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finprod_Suc2:
  "f \<in> {..Suc n} \<rightarrow> carrier G \<Longrightarrow>
   finprod G f {..Suc n} = (finprod G (%i. f (Suc i)) {..n} \<otimes> f 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> {..Suc n} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc n} = (\<Otimes>i\<in>{..n}. f (Suc i)) \<otimes> f 0
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> {..Suc 0} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc 0} = (\<Otimes>i\<in>{..0}. f (Suc i)) \<otimes> f 0
 2. \<And>n. \<lbrakk>f \<in> {..Suc n} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc n} = (\<Otimes>i\<in>{..n}. f (Suc i)) \<otimes> f 0; f \<in> {..Suc (Suc n)} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {..Suc (Suc n)} = (\<Otimes>i\<in>{..Suc n}. f (Suc i)) \<otimes> f 0
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
f \<in> {..Suc 0} \<rightarrow> carrier G

goal (2 subgoals):
 1. f \<in> {..Suc 0} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc 0} = (\<Otimes>i\<in>{..0}. f (Suc i)) \<otimes> f 0
 2. \<And>n. \<lbrakk>f \<in> {..Suc n} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc n} = (\<Otimes>i\<in>{..n}. f (Suc i)) \<otimes> f 0; f \<in> {..Suc (Suc n)} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {..Suc (Suc n)} = (\<Otimes>i\<in>{..Suc n}. f (Suc i)) \<otimes> f 0
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
f \<in> {..Suc 0} \<rightarrow> carrier G

goal (1 subgoal):
 1. finprod G f {..Suc 0} = (\<Otimes>i\<in>{..0}. f (Suc i)) \<otimes> f 0
[PROOF STEP]
by (simp add: Pi_def)
[PROOF STATE]
proof (state)
this:
finprod G f {..Suc 0} = (\<Otimes>i\<in>{..0}. f (Suc i)) \<otimes> f 0

goal (1 subgoal):
 1. \<And>n. \<lbrakk>f \<in> {..Suc n} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc n} = (\<Otimes>i\<in>{..n}. f (Suc i)) \<otimes> f 0; f \<in> {..Suc (Suc n)} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {..Suc (Suc n)} = (\<Otimes>i\<in>{..Suc n}. f (Suc i)) \<otimes> f 0
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>f \<in> {..Suc n} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc n} = (\<Otimes>i\<in>{..n}. f (Suc i)) \<otimes> f 0; f \<in> {..Suc (Suc n)} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {..Suc (Suc n)} = (\<Otimes>i\<in>{..Suc n}. f (Suc i)) \<otimes> f 0
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
f \<in> {..Suc n_} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc n_} = (\<Otimes>i\<in>{..n_}. f (Suc i)) \<otimes> f 0
f \<in> {..Suc (Suc n_)} \<rightarrow> carrier G

goal (1 subgoal):
 1. \<And>n. \<lbrakk>f \<in> {..Suc n} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc n} = (\<Otimes>i\<in>{..n}. f (Suc i)) \<otimes> f 0; f \<in> {..Suc (Suc n)} \<rightarrow> carrier G\<rbrakk> \<Longrightarrow> finprod G f {..Suc (Suc n)} = (\<Otimes>i\<in>{..Suc n}. f (Suc i)) \<otimes> f 0
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
f \<in> {..Suc n_} \<rightarrow> carrier G \<Longrightarrow> finprod G f {..Suc n_} = (\<Otimes>i\<in>{..n_}. f (Suc i)) \<otimes> f 0
f \<in> {..Suc (Suc n_)} \<rightarrow> carrier G

goal (1 subgoal):
 1. finprod G f {..Suc (Suc n_)} = (\<Otimes>i\<in>{..Suc n_}. f (Suc i)) \<otimes> f 0
[PROOF STEP]
by (simp add: m_assoc Pi_def)
[PROOF STATE]
proof (state)
this:
finprod G f {..Suc (Suc n_)} = (\<Otimes>i\<in>{..Suc n_}. f (Suc i)) \<otimes> f 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) ord_conv_Least: (* Manuel Eberl *)
  assumes "x \<in> carrier G" "\<exists>n::nat > 0. x [^] n = \<one>"
  shows   "ord x = (LEAST n::nat. 0 < n \<and> x [^] n = \<one>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord x = (LEAST n. 0 < n \<and> x [^] n = \<one>)
[PROOF STEP]
proof (rule antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ord x \<le> (LEAST n. 0 < n \<and> x [^] n = \<one>)
 2. (LEAST n. 0 < n \<and> x [^] n = \<one>) \<le> ord x
[PROOF STEP]
show "ord x \<le> (LEAST n::nat. 0 < n \<and> x [^] n = \<one>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord x \<le> (LEAST n. 0 < n \<and> x [^] n = \<one>)
[PROOF STEP]
using assms LeastI_ex[OF assms(2)]
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
\<exists>n>0. x [^] n = \<one>
0 < (LEAST n. 0 < n \<and> x [^] n = \<one>) \<and> x [^] (LEAST n. 0 < n \<and> x [^] n = \<one>) = \<one>

goal (1 subgoal):
 1. ord x \<le> (LEAST n. 0 < n \<and> x [^] n = \<one>)
[PROOF STEP]
by (intro ord_le) auto
[PROOF STATE]
proof (state)
this:
ord x \<le> (LEAST n. 0 < n \<and> x [^] n = \<one>)

goal (1 subgoal):
 1. (LEAST n. 0 < n \<and> x [^] n = \<one>) \<le> ord x
[PROOF STEP]
show "ord x \<ge> (LEAST n::nat. 0 < n \<and> x [^] n = \<one>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST n. 0 < n \<and> x [^] n = \<one>) \<le> ord x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
\<exists>n>0. x [^] n = \<one>

goal (1 subgoal):
 1. (LEAST n. 0 < n \<and> x [^] n = \<one>) \<le> ord x
[PROOF STEP]
by (intro Least_le) (auto intro: pow_ord_eq_1 ord_pos)
[PROOF STATE]
proof (state)
this:
(LEAST n. 0 < n \<and> x [^] n = \<one>) \<le> ord x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma tensor_vec_dim[simp]:
  shows "dim_vec (tensor_vec u v) = dim_vec u * (dim_vec v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (u \<otimes> v) = dim_vec u * dim_vec v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dim_vec (u \<otimes> v) = dim_vec u * dim_vec v
[PROOF STEP]
have "length (mult.vec_vec_Tensor (*) (list_of_vec u) (list_of_vec v)) =
    length (list_of_vec u) * length (list_of_vec v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (mult.vec_vec_Tensor (*) (list_of_vec u) (list_of_vec v)) = length (list_of_vec u) * length (list_of_vec v)
[PROOF STEP]
using  mult.vec_vec_Tensor_length[of "1::real" "(*)" "list_of_vec u" "list_of_vec v"]
[PROOF STATE]
proof (prove)
using this:
Matrix_Tensor.mult (complex_of_real 1) (*) \<Longrightarrow> length (mult.vec_vec_Tensor (*) (list_of_vec u) (list_of_vec v)) = length (list_of_vec u) * length (list_of_vec v)

goal (1 subgoal):
 1. length (mult.vec_vec_Tensor (*) (list_of_vec u) (list_of_vec v)) = length (list_of_vec u) * length (list_of_vec v)
[PROOF STEP]
by (simp add: Matrix_Tensor.mult_def)
[PROOF STATE]
proof (state)
this:
length (mult.vec_vec_Tensor (*) (list_of_vec u) (list_of_vec v)) = length (list_of_vec u) * length (list_of_vec v)

goal (1 subgoal):
 1. dim_vec (u \<otimes> v) = dim_vec u * dim_vec v
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
length (mult.vec_vec_Tensor (*) (list_of_vec u) (list_of_vec v)) = length (list_of_vec u) * length (list_of_vec v)

goal (1 subgoal):
 1. dim_vec (u \<otimes> v) = dim_vec u * dim_vec v
[PROOF STEP]
unfolding tensor_vec_def
[PROOF STATE]
proof (prove)
using this:
length (mult.vec_vec_Tensor (*) (list_of_vec u) (list_of_vec v)) = length (list_of_vec u) * length (list_of_vec v)

goal (1 subgoal):
 1. dim_vec (vec_of_list (mult.vec_vec_Tensor (*) (list_of_vec u) (list_of_vec v))) = dim_vec u * dim_vec v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dim_vec (u \<otimes> v) = dim_vec u * dim_vec v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_of_2_squares_nat_mult [intro]:
  assumes "sum_of_2_squares_nat x" "sum_of_2_squares_nat y"
  shows   "sum_of_2_squares_nat (x * y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_of_2_squares_nat (x * y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum_of_2_squares_nat (x * y)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
sum_of_2_squares_nat x
sum_of_2_squares_nat y
[PROOF STEP]
obtain z1 z2 where "x = gauss_int_norm z1" "y = gauss_int_norm z2"
[PROOF STATE]
proof (prove)
using this:
sum_of_2_squares_nat x
sum_of_2_squares_nat y

goal (1 subgoal):
 1. (\<And>z1 z2. \<lbrakk>x = gauss_int_norm z1; y = gauss_int_norm z2\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: sum_of_2_squares_nat_altdef)
[PROOF STATE]
proof (state)
this:
x = gauss_int_norm z1
y = gauss_int_norm z2

goal (1 subgoal):
 1. sum_of_2_squares_nat (x * y)
[PROOF STEP]
hence "x * y = gauss_int_norm (z1 * z2)"
[PROOF STATE]
proof (prove)
using this:
x = gauss_int_norm z1
y = gauss_int_norm z2

goal (1 subgoal):
 1. x * y = gauss_int_norm (z1 * z2)
[PROOF STEP]
by (simp add: gauss_int_norm_mult)
[PROOF STATE]
proof (state)
this:
x * y = gauss_int_norm (z1 * z2)

goal (1 subgoal):
 1. sum_of_2_squares_nat (x * y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x * y = gauss_int_norm (z1 * z2)

goal (1 subgoal):
 1. sum_of_2_squares_nat (x * y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum_of_2_squares_nat (x * y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_bijections_domain_and_range_permutation_eq_1:
  assumes "finite A" "finite B"
  assumes "card A = card B"
  shows "card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_and_range_permutation A B) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_and_range_permutation A B) = 1
[PROOF STEP]
using bij_betw_quotient_domain_and_range_permutation_eq[OF assms]
[PROOF STATE]
proof (prove)
using this:
{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_and_range_permutation A B = {{f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B}}

goal (1 subgoal):
 1. card ({f \<in> A \<rightarrow>\<^sub>E B. bij_betw f A B} // domain_and_range_permutation A B) = 1
[PROOF STEP]
by auto


[STATEMENT]
theorem prime_gauss_int_of_nat:
  fixes n :: nat
  assumes prime: "prime n" and "[n = 3] (mod 4)"
  shows   "prime (of_nat n :: gauss_int)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime (of_nat n)
[PROOF STEP]
using prime_elem_gauss_int_of_nat[OF assms]
[PROOF STATE]
proof (prove)
using this:
prime_elem (of_nat n)

goal (1 subgoal):
 1. prime (of_nat n)
[PROOF STEP]
unfolding prime_def
[PROOF STATE]
proof (prove)
using this:
prime_elem (of_nat n)

goal (1 subgoal):
 1. prime_elem (of_nat n) \<and> normalize (of_nat n) = of_nat n
[PROOF STEP]
by simp


[STATEMENT]
theorem wens_set_single_eq:
     "[|F = mk_program (init, {act}, allowed); single_valued act|]
      ==> wens_set F B =
          insert (wens_single act B) (range (wens_single_finite act B))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F = mk_program (init, {act}, allowed); single_valued act\<rbrakk> \<Longrightarrow> wens_set F B = insert (wens_single act B) (range (wens_single_finite act B))
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>F = mk_program (init, {act}, allowed); single_valued act\<rbrakk> \<Longrightarrow> wens_set F B \<subseteq> insert (wens_single act B) (range (wens_single_finite act B))
 2. \<lbrakk>F = mk_program (init, {act}, allowed); single_valued act\<rbrakk> \<Longrightarrow> insert (wens_single act B) (range (wens_single_finite act B)) \<subseteq> wens_set F B
[PROOF STEP]
apply (simp add: wens_set_subset_single)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>F = mk_program (init, {act}, allowed); single_valued act\<rbrakk> \<Longrightarrow> insert (wens_single act B) (range (wens_single_finite act B)) \<subseteq> wens_set F B
[PROOF STEP]
apply (erule ssubst, erule single_subset_wens_set)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mat_inv_mult_mm:
  assumes "mat_det A \<noteq> 0" and "mat_det B \<noteq> 0"
  shows "mat_inv (A *\<^sub>m\<^sub>m B) = mat_inv B *\<^sub>m\<^sub>m mat_inv A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_inv (A *\<^sub>m\<^sub>m B) = mat_inv B *\<^sub>m\<^sub>m mat_inv A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det A \<noteq> 0
mat_det B \<noteq> 0

goal (1 subgoal):
 1. mat_inv (A *\<^sub>m\<^sub>m B) = mat_inv B *\<^sub>m\<^sub>m mat_inv A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>mat_det A \<noteq> 0; mat_det B \<noteq> 0\<rbrakk> \<Longrightarrow> mat_inv (A *\<^sub>m\<^sub>m B) = mat_inv B *\<^sub>m\<^sub>m mat_inv A
[PROOF STEP]
have "(A *\<^sub>m\<^sub>m B) *\<^sub>m\<^sub>m (mat_inv B *\<^sub>m\<^sub>m mat_inv A) = eye"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *\<^sub>m\<^sub>m B *\<^sub>m\<^sub>m (mat_inv B *\<^sub>m\<^sub>m mat_inv A) = eye
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
mat_det A \<noteq> 0
mat_det B \<noteq> 0

goal (1 subgoal):
 1. A *\<^sub>m\<^sub>m B *\<^sub>m\<^sub>m (mat_inv B *\<^sub>m\<^sub>m mat_inv A) = eye
[PROOF STEP]
by (metis mat_inv_r mult_mm_assoc mult_mm_inv_r)
[PROOF STATE]
proof (state)
this:
A *\<^sub>m\<^sub>m B *\<^sub>m\<^sub>m (mat_inv B *\<^sub>m\<^sub>m mat_inv A) = eye

goal (1 subgoal):
 1. \<lbrakk>mat_det A \<noteq> 0; mat_det B \<noteq> 0\<rbrakk> \<Longrightarrow> mat_inv (A *\<^sub>m\<^sub>m B) = mat_inv B *\<^sub>m\<^sub>m mat_inv A
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>m\<^sub>m B *\<^sub>m\<^sub>m (mat_inv B *\<^sub>m\<^sub>m mat_inv A) = eye

goal (1 subgoal):
 1. mat_inv (A *\<^sub>m\<^sub>m B) = mat_inv B *\<^sub>m\<^sub>m mat_inv A
[PROOF STEP]
using mult_mm_inv_l[of "A *\<^sub>m\<^sub>m B" "mat_inv B *\<^sub>m\<^sub>m mat_inv A" eye] assms mat_eye_r
[PROOF STATE]
proof (prove)
using this:
A *\<^sub>m\<^sub>m B *\<^sub>m\<^sub>m (mat_inv B *\<^sub>m\<^sub>m mat_inv A) = eye
\<lbrakk>mat_det (A *\<^sub>m\<^sub>m B) \<noteq> 0; A *\<^sub>m\<^sub>m B *\<^sub>m\<^sub>m (mat_inv B *\<^sub>m\<^sub>m mat_inv A) = eye\<rbrakk> \<Longrightarrow> mat_inv B *\<^sub>m\<^sub>m mat_inv A = mat_inv (A *\<^sub>m\<^sub>m B) *\<^sub>m\<^sub>m eye
mat_det A \<noteq> 0
mat_det B \<noteq> 0
?A *\<^sub>m\<^sub>m eye = ?A

goal (1 subgoal):
 1. mat_inv (A *\<^sub>m\<^sub>m B) = mat_inv B *\<^sub>m\<^sub>m mat_inv A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
mat_inv (A *\<^sub>m\<^sub>m B) = mat_inv B *\<^sub>m\<^sub>m mat_inv A

goal:
No subgoals!
[PROOF STEP]
qed