[STATEMENT]
lemma vector_eq_dot_span:
  assumes "x \<in> span B" "y \<in> span B" and i: "\<And>i. i \<in> B \<Longrightarrow> i \<bullet> x = i \<bullet> y"
  shows "x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = y
[PROOF STEP]
have "\<And>i. i \<in> B \<Longrightarrow> orthogonal (x - y) i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> B \<Longrightarrow> orthogonal (x - y) i
[PROOF STEP]
by (simp add: i inner_commute inner_diff_right orthogonal_def)
[PROOF STATE]
proof (state)
this:
?i \<in> B \<Longrightarrow> orthogonal (x - y) ?i

goal (1 subgoal):
 1. x = y
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?i \<in> B \<Longrightarrow> orthogonal (x - y) ?i

goal (1 subgoal):
 1. x = y
[PROOF STEP]
have "x - y \<in> span B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x - y \<in> span B
[PROOF STEP]
by (simp add: assms span_diff)
[PROOF STATE]
proof (state)
this:
x - y \<in> span B

goal (1 subgoal):
 1. x = y
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?i \<in> B \<Longrightarrow> orthogonal (x - y) ?i
x - y \<in> span B
[PROOF STEP]
have "x - y = 0"
[PROOF STATE]
proof (prove)
using this:
?i \<in> B \<Longrightarrow> orthogonal (x - y) ?i
x - y \<in> span B

goal (1 subgoal):
 1. x - y = (0::'a)
[PROOF STEP]
using orthogonal_to_span orthogonal_self
[PROOF STATE]
proof (prove)
using this:
?i \<in> B \<Longrightarrow> orthogonal (x - y) ?i
x - y \<in> span B
\<lbrakk>?a \<in> span ?S; \<And>y. y \<in> ?S \<Longrightarrow> orthogonal ?x y\<rbrakk> \<Longrightarrow> orthogonal ?x ?a
orthogonal ?x ?x = (?x = (0::?'a))

goal (1 subgoal):
 1. x - y = (0::'a)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x - y = (0::'a)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x - y = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x - y = (0::'a)

goal (1 subgoal):
 1. x = y
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x = y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma totient_power_Suc: "totient (n ^ Suc m) = n ^ m * totient n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (n ^ Suc m) = n ^ m * totient n
[PROOF STEP]
proof (induction m arbitrary: n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n. totient (n ^ Suc 0) = n ^ 0 * totient n
 2. \<And>m n. (\<And>n. totient (n ^ Suc m) = n ^ m * totient n) \<Longrightarrow> totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n
[PROOF STEP]
case (Suc m n)
[PROOF STATE]
proof (state)
this:
totient (?n ^ Suc m) = ?n ^ m * totient ?n

goal (2 subgoals):
 1. \<And>n. totient (n ^ Suc 0) = n ^ 0 * totient n
 2. \<And>m n. (\<And>n. totient (n ^ Suc m) = n ^ m * totient n) \<Longrightarrow> totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n
[PROOF STEP]
have "totient (n ^ Suc (Suc m)) = totient (n * n ^ Suc m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (n ^ Suc (Suc m)) = totient (n * n ^ Suc m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
totient (n ^ Suc (Suc m)) = totient (n * n ^ Suc m)

goal (2 subgoals):
 1. \<And>n. totient (n ^ Suc 0) = n ^ 0 * totient n
 2. \<And>m n. (\<And>n. totient (n ^ Suc m) = n ^ m * totient n) \<Longrightarrow> totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
totient (n ^ Suc (Suc m)) = totient (n * n ^ Suc m)

goal (2 subgoals):
 1. \<And>n. totient (n ^ Suc 0) = n ^ 0 * totient n
 2. \<And>m n. (\<And>n. totient (n ^ Suc m) = n ^ m * totient n) \<Longrightarrow> totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n
[PROOF STEP]
have "\<dots> = n ^ Suc m * totient n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. totient (n * n ^ Suc m) = n ^ Suc m * totient n
[PROOF STEP]
using Suc.IH
[PROOF STATE]
proof (prove)
using this:
totient (?n ^ Suc m) = ?n ^ m * totient ?n

goal (1 subgoal):
 1. totient (n * n ^ Suc m) = n ^ Suc m * totient n
[PROOF STEP]
by (subst totient_mult) simp
[PROOF STATE]
proof (state)
this:
totient (n * n ^ Suc m) = n ^ Suc m * totient n

goal (2 subgoals):
 1. \<And>n. totient (n ^ Suc 0) = n ^ 0 * totient n
 2. \<And>m n. (\<And>n. totient (n ^ Suc m) = n ^ m * totient n) \<Longrightarrow> totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n

goal (1 subgoal):
 1. totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
totient (n ^ Suc (Suc m)) = n ^ Suc m * totient n

goal (1 subgoal):
 1. \<And>n. totient (n ^ Suc 0) = n ^ 0 * totient n
[PROOF STEP]
qed simp_all


[STATEMENT]
theorem pumping_lemma:
  fixes r :: "'a :: finite rexp"
  obtains n where
    "\<And>z. z \<in> lang r \<Longrightarrow> length z \<ge> n \<Longrightarrow>
            \<exists>u v w. z = u @ v @ w \<and> length (u @ v) \<le> n \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>n. (\<And>z. \<lbrakk>z \<in> lang r; n \<le> length z\<rbrakk> \<Longrightarrow> \<exists>u v w. z = u @ v @ w \<and> length (u @ v) \<le> n \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n. (\<And>z. \<lbrakk>z \<in> lang r; n \<le> length z\<rbrakk> \<Longrightarrow> \<exists>u v w. z = u @ v @ w \<and> length (u @ v) \<le> n \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
let ?n = "card (range (\<lambda>w. Derivs w (lang r)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>n. (\<And>z. \<lbrakk>z \<in> lang r; n \<le> length z\<rbrakk> \<Longrightarrow> \<exists>u v w. z = u @ v @ w \<and> length (u @ v) \<le> n \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<exists>u v w. z = u @ v @ w \<and> length (u @ v) \<le> ?n \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)"
    if "z \<in> lang r" and "length z \<ge> ?n" for z
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>u v w. z = u @ v @ w \<and> length (u @ v) \<le> card (range (\<lambda>w. Derivs w (lang r))) \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)
[PROOF STEP]
by (intro pumping_lemma_aux[of z] that regular_Derivs_finite)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?z \<in> lang r; card (range (\<lambda>w. Derivs w (lang r))) \<le> length ?z\<rbrakk> \<Longrightarrow> \<exists>u v w. ?z = u @ v @ w \<and> length (u @ v) \<le> card (range (\<lambda>w. Derivs w (lang r))) \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)

goal (1 subgoal):
 1. (\<And>n. (\<And>z. \<lbrakk>z \<in> lang r; n \<le> length z\<rbrakk> \<Longrightarrow> \<exists>u v w. z = u @ v @ w \<and> length (u @ v) \<le> n \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?z \<in> lang r; card (range (\<lambda>w. Derivs w (lang r))) \<le> length ?z\<rbrakk> \<Longrightarrow> \<exists>u v w. ?z = u @ v @ w \<and> length (u @ v) \<le> card (range (\<lambda>w. Derivs w (lang r))) \<and> v \<noteq> [] \<and> (\<forall>i. u @ repeat i v @ w \<in> lang r)

goal (1 subgoal):
 1. thesis
[PROOF STEP]
by (rule that)
[PROOF STATE]
proof (state)
this:
thesis

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eucl_of_list_map_const[simp]:
  assumes [simp]: "length xs = DIM('a::executable_euclidean_space)"
  shows "(eucl_of_list (map (\<lambda>x. c) xs)::'a) = c *\<^sub>R One"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_of_list (map (\<lambda>x. c) xs) = c *\<^sub>R One
[PROOF STEP]
by (auto intro!: euclidean_eqI[where 'a='a] simp: algebra_simps eucl_of_list_inner)


[STATEMENT]
lemma sum_mset_0_left: "(\<And> x . f x \<ge> 0) \<Longrightarrow> (\<Sum> x \<in># A. f x ) = 0 \<Longrightarrow> (\<forall> x \<in># A .f x = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. (0::'a) \<le> f x; \<Sum>\<^sub># (image_mset f A) = (0::'a)\<rbrakk> \<Longrightarrow> \<forall>x\<in>#A. f x = (0::'a)
[PROOF STEP]
apply (induction A)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<And>x. (0::'a) \<le> f x; \<Sum>\<^sub># (image_mset f {#}) = (0::'a)\<rbrakk> \<Longrightarrow> \<forall>x\<in>#{#}. f x = (0::'a)
 2. \<And>x A. \<lbrakk>\<lbrakk>\<And>x. (0::'a) \<le> f x; \<Sum>\<^sub># (image_mset f A) = (0::'a)\<rbrakk> \<Longrightarrow> \<forall>x\<in>#A. f x = (0::'a); \<And>x. (0::'a) \<le> f x; \<Sum>\<^sub># (image_mset f (add_mset x A)) = (0::'a)\<rbrakk> \<Longrightarrow> \<forall>x\<in>#add_mset x A. f x = (0::'a)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x A. \<lbrakk>\<Sum>\<^sub># (image_mset f A) = (0::'a) \<Longrightarrow> \<forall>x\<in>#A. f x = (0::'a); \<And>x. (0::'a) \<le> f x; f x + \<Sum>\<^sub># (image_mset f A) = (0::'a)\<rbrakk> \<Longrightarrow> f x = (0::'a)
 2. \<And>x A xa. \<lbrakk>\<Sum>\<^sub># (image_mset f A) = (0::'a) \<Longrightarrow> \<forall>x\<in>#A. f x = (0::'a); \<And>x. (0::'a) \<le> f x; f x + \<Sum>\<^sub># (image_mset f A) = (0::'a); xa \<in># A\<rbrakk> \<Longrightarrow> f xa = (0::'a)
[PROOF STEP]
using local.add_nonneg_eq_0_iff sum_mset_ge0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) \<le> ?x; (0::'a) \<le> ?y\<rbrakk> \<Longrightarrow> (?x + ?y = (0::'a)) = (?x = (0::'a) \<and> ?y = (0::'a))
(\<And>x. (0::'a) \<le> ?f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset ?f ?A)

goal (2 subgoals):
 1. \<And>x A. \<lbrakk>\<Sum>\<^sub># (image_mset f A) = (0::'a) \<Longrightarrow> \<forall>x\<in>#A. f x = (0::'a); \<And>x. (0::'a) \<le> f x; f x + \<Sum>\<^sub># (image_mset f A) = (0::'a)\<rbrakk> \<Longrightarrow> f x = (0::'a)
 2. \<And>x A xa. \<lbrakk>\<Sum>\<^sub># (image_mset f A) = (0::'a) \<Longrightarrow> \<forall>x\<in>#A. f x = (0::'a); \<And>x. (0::'a) \<le> f x; f x + \<Sum>\<^sub># (image_mset f A) = (0::'a); xa \<in># A\<rbrakk> \<Longrightarrow> f xa = (0::'a)
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x A xa. \<lbrakk>\<Sum>\<^sub># (image_mset f A) = (0::'a) \<Longrightarrow> \<forall>x\<in>#A. f x = (0::'a); \<And>x. (0::'a) \<le> f x; f x + \<Sum>\<^sub># (image_mset f A) = (0::'a); xa \<in># A\<rbrakk> \<Longrightarrow> f xa = (0::'a)
[PROOF STEP]
using local.add_nonneg_eq_0_iff sum_mset_ge0
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(0::'a) \<le> ?x; (0::'a) \<le> ?y\<rbrakk> \<Longrightarrow> (?x + ?y = (0::'a)) = (?x = (0::'a) \<and> ?y = (0::'a))
(\<And>x. (0::'a) \<le> ?f x) \<Longrightarrow> (0::'a) \<le> \<Sum>\<^sub># (image_mset ?f ?A)

goal (1 subgoal):
 1. \<And>x A xa. \<lbrakk>\<Sum>\<^sub># (image_mset f A) = (0::'a) \<Longrightarrow> \<forall>x\<in>#A. f x = (0::'a); \<And>x. (0::'a) \<le> f x; f x + \<Sum>\<^sub># (image_mset f A) = (0::'a); xa \<in># A\<rbrakk> \<Longrightarrow> f xa = (0::'a)
[PROOF STEP]
by blast


[STATEMENT]
lemma winding_number_linepath_pos_lt:
    assumes "0 < Im ((b - a) * cnj (b - z))"
      shows "0 < Re(winding_number(linepath a b) z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re (winding_number (linepath a b) z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 < Re (winding_number (linepath a b) z)
[PROOF STEP]
have z: "z \<notin> path_image (linepath a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> path_image (linepath a b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < Im ((b - a) * cnj (b - z))

goal (1 subgoal):
 1. z \<notin> path_image (linepath a b)
[PROOF STEP]
by (simp add: closed_segment_def) (force simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
z \<notin> path_image (linepath a b)

goal (1 subgoal):
 1. 0 < Re (winding_number (linepath a b) z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re (winding_number (linepath a b) z)
[PROOF STEP]
by (intro winding_number_pos_lt [OF valid_path_linepath z assms]) (simp add: linepath_def algebra_simps)
[PROOF STATE]
proof (state)
this:
0 < Re (winding_number (linepath a b) z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_state_set_cons:
  fixes as s h
  shows "
    (card (state_set (state_list s (h # as)))
    = Suc (card (state_set (state_list (state_succ s h) as))))
  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (state_set (state_list s (h # as))) = Suc (card (state_set (state_list (state_succ s h) as)))
[PROOF STEP]
by (metis length_Cons state_list.simps(2) state_set_card)


[STATEMENT]
lemma Gamma_numeral: "Gamma (numeral n) = fact (pred_numeral n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Gamma (numeral n) = fact (pred_numeral n)
[PROOF STEP]
by (subst of_nat_numeral[symmetric], subst numeral_eq_Suc,
      subst of_nat_Suc, subst Gamma_fact) (rule refl)


[STATEMENT]
lemma affine_hull_convex_hull [simp]: "affine hull (convex hull S) = affine hull S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull (convex hull S) = affine hull S
[PROOF STEP]
by (metis Int_absorb1 Int_absorb2 convex_hull_subset_affine_hull hull_hull hull_mono hull_subset)


[STATEMENT]
lemma Join_left_commute: "A\<squnion>(B\<squnion>C) = B\<squnion>(A\<squnion>C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<squnion> (B \<squnion> C) = B \<squnion> (A \<squnion> C)
[PROOF STEP]
by (simp add: Un_ac Int_ac Join_def insert_absorb)


[STATEMENT]
lemma convex_hull_2_alt: "convex hull {a,b} = {a + u *\<^sub>R (b - a) | u.  0 \<le> u \<and> u \<le> 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex hull {a, b} = {a + u *\<^sub>R (b - a) |u. 0 \<le> u \<and> u \<le> 1}
[PROOF STEP]
unfolding convex_hull_2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {u *\<^sub>R a + v *\<^sub>R b |u v. 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1} = {a + u *\<^sub>R (b - a) |u. 0 \<le> u \<and> u \<le> 1}
[PROOF STEP]
proof (rule Collect_cong)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>uu_. (\<exists>u v. uu_ = u *\<^sub>R a + v *\<^sub>R b \<and> 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1) = (\<exists>u. uu_ = a + u *\<^sub>R (b - a) \<and> 0 \<le> u \<and> u \<le> 1)
[PROOF STEP]
have *: "\<And>x y ::real. x + y = 1 \<longleftrightarrow> x = 1 - y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x y. (x + y = 1) = (x = 1 - y)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(?x + ?y = 1) = (?x = 1 - ?y)

goal (1 subgoal):
 1. \<And>uu_. (\<exists>u v. uu_ = u *\<^sub>R a + v *\<^sub>R b \<and> 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1) = (\<exists>u. uu_ = a + u *\<^sub>R (b - a) \<and> 0 \<le> u \<and> u \<le> 1)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>uu_. (\<exists>u v. uu_ = u *\<^sub>R a + v *\<^sub>R b \<and> 0 \<le> u \<and> 0 \<le> v \<and> u + v = 1) = (\<exists>u. uu_ = a + u *\<^sub>R (b - a) \<and> 0 \<le> u \<and> u \<le> 1)
[PROOF STEP]
show "(\<exists>v u. x = v *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> v \<and> 0 \<le> u \<and> v + u = 1) \<longleftrightarrow>
    (\<exists>u. x = a + u *\<^sub>R (b - a) \<and> 0 \<le> u \<and> u \<le> 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>v u. x = v *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> v \<and> 0 \<le> u \<and> v + u = 1) = (\<exists>u. x = a + u *\<^sub>R (b - a) \<and> 0 \<le> u \<and> u \<le> 1)
[PROOF STEP]
apply (simp add: *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>u. x = (1 - u) *\<^sub>R a + u *\<^sub>R b \<and> u \<le> 1 \<and> 0 \<le> u) = (\<exists>u. x = a + u *\<^sub>R (b - a) \<and> 0 \<le> u \<and> u \<le> 1)
[PROOF STEP]
by (rule ex_cong1) (auto simp: algebra_simps)
[PROOF STATE]
proof (state)
this:
(\<exists>v u. x = v *\<^sub>R a + u *\<^sub>R b \<and> 0 \<le> v \<and> 0 \<le> u \<and> v + u = 1) = (\<exists>u. x = a + u *\<^sub>R (b - a) \<and> 0 \<le> u \<and> u \<le> 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cspan_to_conjugate_space[simp]: "cspan (to_conjugate_space ` X) = to_conjugate_space ` cspan X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cspan (to_conjugate_space ` X) = to_conjugate_space ` cspan X
[PROOF STEP]
unfolding complex_vector.span_def complex_vector.subspace_def hull_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Inter> {t. (0 \<in> t \<and> (\<forall>x\<in>t. \<forall>y\<in>t. x + y \<in> t) \<and> (\<forall>c. \<forall>x\<in>t. c *\<^sub>C x \<in> t)) \<and> to_conjugate_space ` X \<subseteq> t} = to_conjugate_space ` \<Inter> {t. ((0::'a) \<in> t \<and> (\<forall>x\<in>t. \<forall>y\<in>t. x + y \<in> t) \<and> (\<forall>c. \<forall>x\<in>t. c *\<^sub>C x \<in> t)) \<and> X \<subseteq> t}
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<Inter> {t. ((0::'a) \<in> t \<and> (\<forall>x\<in>t. \<forall>y\<in>t. x + y \<in> t) \<and> (\<forall>c. \<forall>x\<in>t. cnj c *\<^sub>C x \<in> t)) \<and> (\<lambda>x. x) ` X \<subseteq> t} = (\<lambda>x. x) ` \<Inter> {t. ((0::'a) \<in> t \<and> (\<forall>x\<in>t. \<forall>y\<in>t. x + y \<in> t) \<and> (\<forall>c. \<forall>x\<in>t. c *\<^sub>C x \<in> t)) \<and> X \<subseteq> t}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>X. \<Inter> {t. (0::'a) \<in> t \<and> (\<forall>x\<in>t. \<forall>y\<in>t. x + y \<in> t) \<and> (\<forall>c. \<forall>x\<in>t. cnj c *\<^sub>C x \<in> t) \<and> X \<subseteq> t} = \<Inter> {t. (0::'a) \<in> t \<and> (\<forall>x\<in>t. \<forall>y\<in>t. x + y \<in> t) \<and> (\<forall>c. \<forall>x\<in>t. c *\<^sub>C x \<in> t) \<and> X \<subseteq> t}
[PROOF STEP]
by (metis (no_types, opaque_lifting) complex_cnj_cnj)


[STATEMENT]
lemma even_set_encode_iff: "finite A \<Longrightarrow> even (set_encode A) \<longleftrightarrow> 0 \<notin> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> even (set_encode A) = (0 \<notin> A)
[PROOF STEP]
by (induct set: finite) (auto simp: set_encode_def)


[STATEMENT]
lemma continuous_map_span_sum:
  fixes B :: "'a::real_normed_vector set"
  assumes biB: "\<And>i. i \<in> I \<Longrightarrow> b i \<in> B"
  shows "continuous_map euclidean (top_of_set (span B)) (\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_map euclidean (top_of_set (span B)) (\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i)
[PROOF STEP]
proof (rule continuous_map_euclidean_top_of_set)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i) -` span B = UNIV
 2. continuous_on UNIV (\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i)
[PROOF STEP]
show "(\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i) -` span B = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i) -` span B = UNIV
[PROOF STEP]
by auto (meson biB lessThan_iff span_base span_scale span_sum)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i) -` span B = UNIV

goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i)
[PROOF STEP]
show "continuous_on UNIV (\<lambda>x. \<Sum>i\<in> I. x i *\<^sub>R b i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on UNIV (\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i)
[PROOF STEP]
by (intro continuous_intros) auto
[PROOF STATE]
proof (state)
this:
continuous_on UNIV (\<lambda>x. \<Sum>i\<in>I. x i *\<^sub>R b i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_mset_set_eq_card:
  assumes "finite A"
  shows "size (mset_set A) = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (mset_set A) = card A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A

goal (1 subgoal):
 1. size (mset_set A) = card A
[PROOF STEP]
by (induct A) auto


[STATEMENT]
theorem diff_induct: (* cf. Nat.thy *)
  "(!!x. P x 0) ==> (!!y. P 0 (Suc y)) ==>
    (!!x y. P x y ==> P (Suc x) (Suc y)) ==> P m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x. P x 0; \<And>y. P 0 (Suc y); \<And>x y. P x y \<Longrightarrow> P (Suc x) (Suc y)\<rbrakk> \<Longrightarrow> P m n
[PROOF STEP]
by induction_schema (pat_completeness, lexicographic_order)


[STATEMENT]
lemma card_PiE_dflt:
  assumes "finite A" "\<And>x. x \<in> A \<Longrightarrow> finite (B x)"
  shows   "card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite A
?x \<in> A \<Longrightarrow> finite (B ?x)
[PROOF STEP]
have "(\<Prod>x\<in>A. card (B x)) = card (PiE A B)"
[PROOF STATE]
proof (prove)
using this:
finite A
?x \<in> A \<Longrightarrow> finite (B ?x)

goal (1 subgoal):
 1. (\<Prod>x\<in>A. card (B x)) = card (Pi\<^sub>E A B)
[PROOF STEP]
by (intro card_PiE [symmetric]) auto
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>A. card (B x)) = card (Pi\<^sub>E A B)

goal (1 subgoal):
 1. card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Prod>x\<in>A. card (B x)) = card (Pi\<^sub>E A B)

goal (1 subgoal):
 1. card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))
[PROOF STEP]
have "PiE A B = (\<lambda>f. restrict f A) ` PiE_dflt A d B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi\<^sub>E A B = (\<lambda>f. restrict f A) ` PiE_dflt A d B
[PROOF STEP]
by (rule restrict_PiE_dflt [symmetric])
[PROOF STATE]
proof (state)
this:
Pi\<^sub>E A B = (\<lambda>f. restrict f A) ` PiE_dflt A d B

goal (1 subgoal):
 1. card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Pi\<^sub>E A B = (\<lambda>f. restrict f A) ` PiE_dflt A d B

goal (1 subgoal):
 1. card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))
[PROOF STEP]
have "card \<dots> = card (PiE_dflt A d B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>f. restrict f A) ` PiE_dflt A d B) = card (PiE_dflt A d B)
[PROOF STEP]
by (intro card_image) (force simp: inj_on_def restrict_def fun_eq_iff PiE_dflt_def)
[PROOF STATE]
proof (state)
this:
card ((\<lambda>f. restrict f A) ` PiE_dflt A d B) = card (PiE_dflt A d B)

goal (1 subgoal):
 1. card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>x\<in>A. card (B x)) = card (PiE_dflt A d B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Prod>x\<in>A. card (B x)) = card (PiE_dflt A d B)

goal (1 subgoal):
 1. card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
card (PiE_dflt A d B) = (\<Prod>x\<in>A. card (B x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rangeC_Int_rangeC:
  "\<lbrakk> \<forall>f \<in> A. \<forall>g \<in> B. \<forall>x y. f x \<noteq> g y \<rbrakk> \<Longrightarrow> rangeC A \<inter> rangeC B = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>f\<in>A. \<forall>g\<in>B. \<forall>x y. f x \<noteq> g y \<Longrightarrow> rangeC A \<inter> rangeC B = {}
[PROOF STEP]
by(auto simp add: rangeC_def)


[STATEMENT]
lemma permutation_mat_row[simp]: "p permutes {..<n} \<Longrightarrow> i < n \<Longrightarrow>
  Matrix.row (permutation_mat n p) i = unit_vec n (inv p i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p permutes {..<n}; i < n\<rbrakk> \<Longrightarrow> Matrix.row (permutation_mat n p) i = unit_vec n (inv p i)
[PROOF STEP]
unfolding permutation_mat_def unit_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p permutes {..<n}; i < n\<rbrakk> \<Longrightarrow> Matrix.row (Matrix.mat n n (\<lambda>(i, j). if i = p j then 1::'a else (0::'a))) i = Matrix.vec n (\<lambda>j. if j = inv p i then 1::'a else (0::'a))
[PROOF STEP]
by (intro eq_vecI, auto simp: permutes_inverses)


[STATEMENT]
lemma rot_diff_commute: "rot (b - a) = -rot(a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rot (b - a) = - rot (a - b)
[PROOF STEP]
apply (auto simp: rot_def algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_of_list [(b - a) $\<^sub>e Suc 0, - (b - a) $\<^sub>e 0] = - eucl_of_list [(a - b) $\<^sub>e Suc 0, - (a - b) $\<^sub>e 0]
[PROOF STEP]
by (metis One_nat_def minus_diff_eq rot_def rot_rot)


[STATEMENT]
lemma iT_Minus_Min_singleton: "I \<noteq> {} \<Longrightarrow> (iMin I) \<ominus> I = {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<noteq> {} \<Longrightarrow> iMin I \<ominus> I = {0}
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. I \<noteq> {} \<Longrightarrow> (x \<in> iMin I \<ominus> I) = (x \<in> {0})
[PROOF STEP]
apply (simp add: iT_Minus_mem_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. I \<noteq> {} \<Longrightarrow> (x \<le> iMin I \<and> iMin I - x \<in> I) = (x = 0)
[PROOF STEP]
apply (fastforce intro: iMinI_ex2)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma degree_polysub:
  assumes np: "isnpolyh p n0"
    and nq: "isnpolyh q n1"
  shows "degree (p -\<^sub>p q) \<le> max (degree p) (degree q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Reflected_Multivariate_Polynomial.degree (p -\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree q)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Reflected_Multivariate_Polynomial.degree (p -\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree q)
[PROOF STEP]
from nq
[PROOF STATE]
proof (chain)
picking this:
isnpolyh q n1
[PROOF STEP]
have nq': "isnpolyh (~\<^sub>p q) n1"
[PROOF STATE]
proof (prove)
using this:
isnpolyh q n1

goal (1 subgoal):
 1. isnpolyh (~\<^sub>p q) n1
[PROOF STEP]
using polyneg_normh
[PROOF STATE]
proof (prove)
using this:
isnpolyh q n1
isnpolyh ?p ?n \<Longrightarrow> isnpolyh (~\<^sub>p ?p) ?n

goal (1 subgoal):
 1. isnpolyh (~\<^sub>p q) n1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
isnpolyh (~\<^sub>p q) n1

goal (1 subgoal):
 1. Reflected_Multivariate_Polynomial.degree (p -\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree q)
[PROOF STEP]
from degree_polyadd[OF np nq']
[PROOF STATE]
proof (chain)
picking this:
Reflected_Multivariate_Polynomial.degree (p +\<^sub>p ~\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree (~\<^sub>p q))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Reflected_Multivariate_Polynomial.degree (p +\<^sub>p ~\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree (~\<^sub>p q))

goal (1 subgoal):
 1. Reflected_Multivariate_Polynomial.degree (p -\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree q)
[PROOF STEP]
by (simp add: polysub_def degree_polyneg[OF nq])
[PROOF STATE]
proof (state)
this:
Reflected_Multivariate_Polynomial.degree (p -\<^sub>p q) \<le> max (Reflected_Multivariate_Polynomial.degree p) (Reflected_Multivariate_Polynomial.degree q)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Collect_not_greater_Max: "\<lbrakk> finite {x. P x}; Max {x. P x} < k \<rbrakk> \<Longrightarrow> \<not> P k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite {x. P x}; Max {x. P x} < k\<rbrakk> \<Longrightarrow> \<not> P k
[PROOF STEP]
by (drule not_greater_Max, assumption, drule Collect_not_in_imp_not)


[STATEMENT]
lemma not_icard_Diff1_less: "\<exists>(A::nat set)x. x \<in> A \<and> \<not> icard (A - {x}) < icard A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>A x. x \<in> A \<and> \<not> icard (A - {x}) < icard A
[PROOF STEP]
by (rule_tac x="{0..}" in exI, simp)


[STATEMENT]
lemma subset_dual: "(\<partial> ` X = Y) \<longleftrightarrow> (X = \<partial>\<^sup>- ` Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<partial> ` X = Y) = (X = \<partial>\<^sup>- ` Y)
[PROOF STEP]
by (metis dual_inj image_comp image_inv_f_f inv_o_cancel dual_inv2)


[STATEMENT]
lemma invertible_lf_imp_invertible_matrix':
fixes f:: "'a::{field}^'b \<Rightarrow> 'a^'b"
assumes "invertible_lf ((*s)) ((*s)) f" and basis_X: "is_basis (set_of_vector X)" and basis_Y: "is_basis (set_of_vector Y)"
shows "invertible (matrix' X Y f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible (matrix' X Y f)
[PROOF STEP]
by (metis (lifting) assms(1) basis_X basis_Y invertible_lf_def invertible_lf_imp_invertible_matrix
    invertible_matrix_change_of_basis invertible_mult is_basis_cart_basis' matrix'_eq_matrix matrix'_matrix_change_of_basis)


[STATEMENT]
lemma ordLeq_Sigma_cong:
assumes "bij_betw f I J" and
        "\<forall>j \<in> J. p j =o r j"
shows "|SIGMA i : I. Field(p(f i))| =o |SIGMA j : J. Field(r j)|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |SIGMA i:I. Field (p (f i))| =o |SIGMA j:J. Field (r j)|
[PROOF STEP]
using assms card_of_cong card_of_Sigma_cong
      [of f I J "\<lambda> j. Field(p j)" "\<lambda> j. Field(r j)"]
[PROOF STATE]
proof (prove)
using this:
bij_betw f I J
\<forall>j\<in>J. p j =o r j
?r =o ?r' \<Longrightarrow> |Field ?r| =o |Field ?r'|
\<lbrakk>bij_betw f I J; \<forall>j\<in>J. |Field (p j)| =o |Field (r j)|\<rbrakk> \<Longrightarrow> |SIGMA i:I. Field (p (f i))| =o |SIGMA j:J. Field (r j)|

goal (1 subgoal):
 1. |SIGMA i:I. Field (p (f i))| =o |SIGMA j:J. Field (r j)|
[PROOF STEP]
by blast


[STATEMENT]
lemma sgn_mult: "sgn (x * y) = sgn x * sgn y"
  for x y :: "'a::real_normed_div_algebra"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sgn (x * y) = sgn x * sgn y
[PROOF STEP]
by (simp add: sgn_div_norm norm_mult)


[STATEMENT]
lemma concat_replicate_length : "length (concat (replicate n xs)) = n * (length xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (concat (replicate n xs)) = n * length xs
[PROOF STEP]
by (induction n; simp)


[STATEMENT]
lemma SUP_Lim:
  fixes X :: "nat \<Rightarrow> 'a::{complete_linorder,linorder_topology}"
  assumes inc: "incseq X"
    and l: "X \<longlonglongrightarrow> l"
  shows "(SUP n. X n) = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sup (range X) = l
[PROOF STEP]
using LIMSEQ_SUP[OF inc] tendsto_unique[OF trivial_limit_sequentially l]
[PROOF STATE]
proof (prove)
using this:
X \<longlonglongrightarrow> Sup (range X)
X \<longlonglongrightarrow> ?b \<Longrightarrow> l = ?b

goal (1 subgoal):
 1. Sup (range X) = l
[PROOF STEP]
by simp


[STATEMENT]
lemma of_real_linepath: "of_real (linepath a b x) = linepath (of_real a) (of_real b) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_real (linepath a b x) = linepath (of_real a) (of_real b) x
[PROOF STEP]
by (metis linepath_of_real mult.right_neutral of_real_def real_scaleR_def)


[STATEMENT]
lemma measure_pmf_prob_product:
  assumes "countable A" "countable B"
  shows "measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
have "measure_pmf.prob (pair_pmf M N) (A \<times> B) = (\<Sum>\<^sub>a(a, b)\<in>A \<times> B. pmf M a * pmf N b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. measure_pmf.prob (pair_pmf M N) (A \<times> B) = (\<Sum>\<^sub>a(a, b)\<in>A \<times> B. pmf M a * pmf N b)
[PROOF STEP]
by (auto intro!: infsetsum_cong simp add: measure_pmf_conv_infsetsum pmf_pair)
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (pair_pmf M N) (A \<times> B) = (\<Sum>\<^sub>a(a, b)\<in>A \<times> B. pmf M a * pmf N b)

goal (1 subgoal):
 1. measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (pair_pmf M N) (A \<times> B) = (\<Sum>\<^sub>a(a, b)\<in>A \<times> B. pmf M a * pmf N b)

goal (1 subgoal):
 1. measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
have "\<dots> = measure_pmf.prob M A * measure_pmf.prob N B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>a(a, b)\<in>A \<times> B. pmf M a * pmf N b) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
countable A
countable B

goal (1 subgoal):
 1. (\<Sum>\<^sub>a(a, b)\<in>A \<times> B. pmf M a * pmf N b) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
by (subst infsetsum_product) (auto simp add: measure_pmf_conv_infsetsum)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>a(a, b)\<in>A \<times> B. pmf M a * pmf N b) = measure_pmf.prob M A * measure_pmf.prob N B

goal (1 subgoal):
 1. measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B

goal (1 subgoal):
 1. measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
measure_pmf.prob (pair_pmf M N) (A \<times> B) = measure_pmf.prob M A * measure_pmf.prob N B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polytope_imp_closed:
  fixes S :: "'a::real_normed_vector set"
  shows "polytope S \<Longrightarrow> closed S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polytope S \<Longrightarrow> closed S
[PROOF STEP]
by (simp add: compact_imp_closed polytope_imp_compact)


[STATEMENT]
lemma ivl_integral_has_vector_derivative_compact_interval:
  fixes f :: "real \<Rightarrow> 'a::banach"
  assumes "continuous_on A f"
    and "is_interval A" "compact A" "x \<in> A" "c \<in> A"
  shows "((\<lambda>u. ivl_integral c u f) has_vector_derivative f x) (at x within A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vector_derivative f x) (at x within A)
[PROOF STEP]
using ivl_integral_has_vderiv_on_compact_interval[OF assms(1)] assms(2-)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?c \<in> A; is_interval A; compact A\<rbrakk> \<Longrightarrow> ((\<lambda>u. ivl_integral ?c u f) has_vderiv_on f) A
is_interval A
compact A
x \<in> A
c \<in> A

goal (1 subgoal):
 1. ((\<lambda>u. ivl_integral c u f) has_vector_derivative f x) (at x within A)
[PROOF STEP]
by (auto simp: has_vderiv_on_def)


[STATEMENT]
lemma isCont_iff_lsc_usc:
  fixes f :: "'a::metric_space \<Rightarrow> ereal"
  shows "isCont f x0 \<longleftrightarrow> (lsc_at x0 f) \<and> (usc_at x0 f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isCont f x0 = (lsc_at x0 f \<and> usc_at x0 f)
[PROOF STEP]
by (metis continuous_iff_lsc_usc continuous_isCont)


[STATEMENT]
lemma unionIntersectionEmpty:
  "(\<forall>x\<in>X. \<forall>y\<in>Y. x\<inter>y = {}) = ((\<Union>X)\<inter>(\<Union> Y)={})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>X. \<forall>y\<in>Y. x \<inter> y = {}) = (\<Union> X \<inter> \<Union> Y = {})
[PROOF STEP]
by blast


[STATEMENT]
lemma Real_gcard: "gcard (UNIV::real set) = C_continuum"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcard UNIV = C_continuum
[PROOF STEP]
by (metis C_continuum_def V_of_Real_set bij_betw_def gcard_eq_vcard gcard_image)


[STATEMENT]
lemma (in Group) Nfunc_LeastTr2_5:"\<lbrakk>\<forall>l\<le> (n::nat). G \<guillemotright> f l; \<forall>l \<le> n. G \<guillemotright> g l;
      \<exists>i \<le> n. (f i \<noteq> g i)\<rbrakk>  \<Longrightarrow>
      f (LEAST k. (f k \<noteq> g k)) \<noteq> g ((LEAST k. f k \<noteq> g k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; \<exists>i\<le>n. f i \<noteq> g i\<rbrakk> \<Longrightarrow> f (LEAST k. f k \<noteq> g k) \<noteq> g (LEAST k. f k \<noteq> g k)
[PROOF STEP]
apply (erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<forall>l\<le>n. G \<guillemotright> f l ; \<forall>l\<le>n. G \<guillemotright> g l ; i \<le> n \<and> f i \<noteq> g i\<rbrakk> \<Longrightarrow> f (LEAST k. f k \<noteq> g k) \<noteq> g (LEAST k. f k \<noteq> g k)
[PROOF STEP]
apply (rule_tac i = i in Nfunc_LeastTr2_3[of n f g], assumption+, simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma suffixes_rev: "suffixes (rev xs) = map rev (prefixes xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. suffixes (rev xs) = map rev (prefixes xs)
[PROOF STEP]
by (induction xs) auto


[STATEMENT]
lemma galois_connectionI':
  assumes
    "partial_order A" "partial_order B"
    "L \<in> carrier A \<rightarrow> carrier B" "R \<in> carrier B \<rightarrow> carrier A"
    "isotone A B L" "isotone B A R"
    "\<And> X. X \<in> carrier(B) \<Longrightarrow> L(R(X)) \<sqsubseteq>\<^bsub>B\<^esub> X"
    "\<And> X. X \<in> carrier(A) \<Longrightarrow> X \<sqsubseteq>\<^bsub>A\<^esub> R(L(X))"
  shows "galois_connection \<lparr> orderA = A, orderB = B, lower = L, upper = R \<rparr>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. galois_connection \<lparr>orderA = A, orderB = B, lower = L, upper = R\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
partial_order A
partial_order B
L \<in> carrier A \<rightarrow> carrier B
R \<in> carrier B \<rightarrow> carrier A
isotone A B L
isotone B A R
?X \<in> carrier B \<Longrightarrow> L (R ?X) \<sqsubseteq>\<^bsub>B\<^esub> ?X
?X \<in> carrier A \<Longrightarrow> ?X \<sqsubseteq>\<^bsub>A\<^esub> R (L ?X)

goal (1 subgoal):
 1. galois_connection \<lparr>orderA = A, orderB = B, lower = L, upper = R\<rparr>
[PROOF STEP]
by (auto simp add: galois_connection_def connection_def galois_connection_axioms_def, (meson PiE isotone_def weak_partial_order.le_trans)+)


[STATEMENT]
lemma inter_empty_fst2: "(\<lambda>(p, m, a). (p, m)) ` S \<inter> (\<lambda>(p, m, a). (p, m)) ` T = {} \<Longrightarrow> S \<inter> T = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>(p, m, a). (p, m)) ` S \<inter> (\<lambda>(p, m, a). (p, m)) ` T = {} \<Longrightarrow> S \<inter> T = {}
[PROOF STEP]
by blast


[STATEMENT]
lemma le_Sup_iff_less:
  fixes x :: "'a :: {complete_linorder, dense_linorder}"
  shows "x \<le> (SUP i\<in>A. f i) \<longleftrightarrow> (\<forall>y<x. \<exists>i\<in>A. y \<le> f i)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> Sup (f ` A)) = (\<forall>y<x. \<exists>i\<in>A. y \<le> f i)
[PROOF STEP]
unfolding le_SUP_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>y<x. \<exists>i\<in>A. y < f i) = (\<forall>y<x. \<exists>i\<in>A. y \<le> f i)
[PROOF STEP]
by (blast intro: less_imp_le less_trans less_le_trans dest: dense)


[STATEMENT]
lemma genuine_roots_step:
  "genuine_roots p xs = genuine_roots p (filter (f prec) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. genuine_roots p xs = genuine_roots p (filter (f prec) xs)
[PROOF STEP]
unfolding genuine_roots_def filter_filter
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. filter (\<lambda>x. poly p x = (0::'a)) xs = filter (\<lambda>x. f prec x \<and> poly p x = (0::'a)) xs
[PROOF STEP]
using ff[unfolded filter_fun_def, rule_format, of _ prec]
[PROOF STATE]
proof (prove)
using this:
poly p ?x = (0::'a) \<Longrightarrow> f prec ?x

goal (1 subgoal):
 1. filter (\<lambda>x. poly p x = (0::'a)) xs = filter (\<lambda>x. f prec x \<and> poly p x = (0::'a)) xs
[PROOF STEP]
by metis


[STATEMENT]
lemma Least_Max:
assumes phi: "phi (n::nat)" and fin: "finite {n. phi n}"
shows "(LEAST m. \<forall> n. phi n \<longrightarrow> n \<le> m) =
       Max {n. phi n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST m. \<forall>n. phi n \<longrightarrow> n \<le> m) = Max {n. phi n}
[PROOF STEP]
using assms Max_in
[PROOF STATE]
proof (prove)
using this:
phi n
finite {n. phi n}
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max ?A \<in> ?A

goal (1 subgoal):
 1. (LEAST m. \<forall>n. phi n \<longrightarrow> n \<le> m) = Max {n. phi n}
[PROOF STEP]
by (intro Least_equality) auto


[STATEMENT]
lemma real_sqrt_eq_iff [simp]: "sqrt x = sqrt y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sqrt x = sqrt y) = (x = y)
[PROOF STEP]
unfolding sqrt_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (root 2 x = root 2 y) = (x = y)
[PROOF STEP]
by (rule real_root_eq_iff [OF pos2])


[STATEMENT]
lemma gauss_mult_cnj:
  \<open>z * cnj z = of_int ((Re z)\<^sup>2 + (Im z)\<^sup>2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z * cnj z = of_int ((Re z)\<^sup>2 + (Im z)\<^sup>2)
[PROOF STEP]
by (simp add: gauss_eq_iff power2_eq_square)


[STATEMENT]
lemma weakly_Pareto_optimal_for_men_def2:
  "weakly_Pareto_optimal_for_men \<mu>
     \<longleftrightarrow> simple \<mu> \<and> (\<forall>\<mu>'. simple \<mu>' \<and> strictly_preferred_by_a_man \<mu> \<mu>' \<longrightarrow> strictly_preferred_by_a_man \<mu>' \<mu>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. weakly_Pareto_optimal_for_men \<mu> = (simple \<mu> \<and> (\<forall>\<mu>'. simple \<mu>' \<and> strictly_preferred_by_a_man \<mu> \<mu>' \<longrightarrow> strictly_preferred_by_a_man \<mu>' \<mu>))
[PROOF STEP]
unfolding weakly_Pareto_optimal_for_men_def simple_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((match \<mu> \<and> (\<forall>m w. blocks m w \<mu> \<longrightarrow> w \<notin> Range \<mu>)) \<and> (\<nexists>\<mu>'. (match \<mu>' \<and> (\<forall>m w. blocks m w \<mu>' \<longrightarrow> w \<notin> Range \<mu>')) \<and> weakly_preferred_by_men \<mu> \<mu>' \<and> strictly_preferred_by_a_man \<mu> \<mu>')) = ((match \<mu> \<and> (\<forall>m w. blocks m w \<mu> \<longrightarrow> w \<notin> Range \<mu>)) \<and> (\<forall>\<mu>'. (match \<mu>' \<and> (\<forall>m w. blocks m w \<mu>' \<longrightarrow> w \<notin> Range \<mu>')) \<and> strictly_preferred_by_a_man \<mu> \<mu>' \<longrightarrow> strictly_preferred_by_a_man \<mu>' \<mu>))
[PROOF STEP]
by (meson weakly_preferred_by_men_strictly_preferred_by_a_man)


[STATEMENT]
lemma Y_square_unfold: "(\<lambda>x. (Y x)^2) = (\<lambda>x. \<Sum>i \<in> I. \<Sum>j \<in> I. rind (A i \<inter> A j) x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (Y x)\<^sup>2) = (\<lambda>x. \<Sum>i\<in>I. \<Sum>j\<in>I. rind (A i \<inter> A j) x)
[PROOF STEP]
unfolding fun_eq_iff Y_def X_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (\<Sum>i\<in>I. rind (A i) x)\<^sup>2 = (\<Sum>i\<in>I. \<Sum>j\<in>I. rind (A i \<inter> A j) x)
[PROOF STEP]
by (auto simp: sum_square product_indicator)


[STATEMENT]
lemma Bernstein_Poly_eq_rescale_01:
  assumes "c \<noteq> d"
  shows "Bernstein_Poly j p c d = Bernstein_Poly_01 j p
            \<circ>\<^sub>p [:0, 1/(d-c):] \<circ>\<^sub>p [:-c, 1:]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Bernstein_Poly j p c d = Bernstein_Poly_01 j p \<circ>\<^sub>p [:0, 1 / (d - c):] \<circ>\<^sub>p [:- c, 1:]
[PROOF STEP]
apply (subst Bernstein_Poly_rescale_01[symmetric])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ?c \<noteq> ?d
 2. Bernstein_Poly j p c d = Bernstein_Poly j p ?c ?d \<circ>\<^sub>p [:?c, 1:] \<circ>\<^sub>p [:0, ?d - ?c:] \<circ>\<^sub>p [:0, 1 / (d - c):] \<circ>\<^sub>p [:- c, 1:]
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
c \<noteq> d

goal (2 subgoals):
 1. ?c \<noteq> ?d
 2. Bernstein_Poly j p c d = Bernstein_Poly j p ?c ?d \<circ>\<^sub>p [:?c, 1:] \<circ>\<^sub>p [:0, ?d - ?c:] \<circ>\<^sub>p [:0, 1 / (d - c):] \<circ>\<^sub>p [:- c, 1:]
[PROOF STEP]
by (auto simp: pcompose_pCons pcompose_assoc[symmetric])


[STATEMENT]
lemma out_degree_eq_card_arc_ends: "out_degree G v = card ((arc_to_ends G) ` (out_arcs G v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. out_degree G v = card (arc_to_ends G ` out_arcs G v)
[PROOF STEP]
apply (simp add: out_degree_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (out_arcs G v) = card (arc_to_ends G ` out_arcs G v)
[PROOF STEP]
using no_multi_arcs
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?e1.0 \<in> arcs G; ?e2.0 \<in> arcs G; arc_to_ends G ?e1.0 = arc_to_ends G ?e2.0\<rbrakk> \<Longrightarrow> ?e1.0 = ?e2.0

goal (1 subgoal):
 1. card (out_arcs G v) = card (arc_to_ends G ` out_arcs G v)
[PROOF STEP]
by (metis card_image out_arcs_in_arcs inj_onI)


[STATEMENT]
lemma floor_log_add_eqI:
  "\<lfloor>log b (a + r)\<rfloor> = \<lfloor>log b a\<rfloor>" if "b > 1" "a \<ge> 1" "0 \<le> r" "r < 1"
    for a b :: nat and r :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>log (real b) (real a + r)\<rfloor> = \<lfloor>log (real b) (real a)\<rfloor>
[PROOF STEP]
proof (rule floor_eq2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. real_of_int \<lfloor>log (real b) (real a)\<rfloor> \<le> log (real b) (real a + r)
 2. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
have "log b a \<le> log b (a + r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (real b) (real a) \<le> log (real b) (real a + r)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
1 < b
1 \<le> a
0 \<le> r
r < 1

goal (1 subgoal):
 1. log (real b) (real a) \<le> log (real b) (real a + r)
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
log (real b) (real a) \<le> log (real b) (real a + r)

goal (2 subgoals):
 1. real_of_int \<lfloor>log (real b) (real a)\<rfloor> \<le> log (real b) (real a + r)
 2. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
log (real b) (real a) \<le> log (real b) (real a + r)
[PROOF STEP]
show "\<lfloor>log b a\<rfloor> \<le> log b (a + r)"
[PROOF STATE]
proof (prove)
using this:
log (real b) (real a) \<le> log (real b) (real a + r)

goal (1 subgoal):
 1. real_of_int \<lfloor>log (real b) (real a)\<rfloor> \<le> log (real b) (real a + r)
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>log (real b) (real a)\<rfloor> \<le> log (real b) (real a + r)

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
define l::int where "l = int b ^ (nat \<lfloor>log b a\<rfloor> + 1)"
[PROOF STATE]
proof (state)
this:
l = int b ^ (nat \<lfloor>log (real b) (real a)\<rfloor> + 1)

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
have l_def_real: "l = b powr (\<lfloor>log b a\<rfloor> + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int l = real b powr real_of_int (\<lfloor>log (real b) (real a)\<rfloor> + 1)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
1 < b
1 \<le> a
0 \<le> r
r < 1

goal (1 subgoal):
 1. real_of_int l = real b powr real_of_int (\<lfloor>log (real b) (real a)\<rfloor> + 1)
[PROOF STEP]
by (simp add: l_def powr_add powr_real_of_int)
[PROOF STATE]
proof (state)
this:
real_of_int l = real b powr real_of_int (\<lfloor>log (real b) (real a)\<rfloor> + 1)

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
have "a < l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int a < l
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. int a < l
[PROOF STEP]
have "a = b powr (log b a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real a = real b powr log (real b) (real a)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
1 < b
1 \<le> a
0 \<le> r
r < 1

goal (1 subgoal):
 1. real a = real b powr log (real b) (real a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real a = real b powr log (real b) (real a)

goal (1 subgoal):
 1. int a < l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real a = real b powr log (real b) (real a)

goal (1 subgoal):
 1. int a < l
[PROOF STEP]
have "\<dots> < b powr floor ((log b a) + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real b powr log (real b) (real a) < real b powr real_of_int \<lfloor>log (real b) (real a) + 1\<rfloor>
[PROOF STEP]
using that(1)
[PROOF STATE]
proof (prove)
using this:
1 < b

goal (1 subgoal):
 1. real b powr log (real b) (real a) < real b powr real_of_int \<lfloor>log (real b) (real a) + 1\<rfloor>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real b powr log (real b) (real a) < real b powr real_of_int \<lfloor>log (real b) (real a) + 1\<rfloor>

goal (1 subgoal):
 1. int a < l
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real b powr log (real b) (real a) < real b powr real_of_int \<lfloor>log (real b) (real a) + 1\<rfloor>

goal (1 subgoal):
 1. int a < l
[PROOF STEP]
have "\<dots> = l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real b powr real_of_int \<lfloor>log (real b) (real a) + 1\<rfloor> = real_of_int l
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
1 < b
1 \<le> a
0 \<le> r
r < 1

goal (1 subgoal):
 1. real b powr real_of_int \<lfloor>log (real b) (real a) + 1\<rfloor> = real_of_int l
[PROOF STEP]
by (simp add: l_def powr_real_of_int powr_add)
[PROOF STATE]
proof (state)
this:
real b powr real_of_int \<lfloor>log (real b) (real a) + 1\<rfloor> = real_of_int l

goal (1 subgoal):
 1. int a < l
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real a < real_of_int l
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real a < real_of_int l

goal (1 subgoal):
 1. int a < l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
int a < l

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
int a < l

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
int a < l
[PROOF STEP]
have "a + r < l"
[PROOF STATE]
proof (prove)
using this:
int a < l

goal (1 subgoal):
 1. real a + r < real_of_int l
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
int a < l
1 < b
1 \<le> a
0 \<le> r
r < 1

goal (1 subgoal):
 1. real a + r < real_of_int l
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real a + r < real_of_int l

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real a + r < real_of_int l
[PROOF STEP]
have "log b (a + r) < log b l"
[PROOF STATE]
proof (prove)
using this:
real a + r < real_of_int l

goal (1 subgoal):
 1. log (real b) (real a + r) < log (real b) (real_of_int l)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
real a + r < real_of_int l
1 < b
1 \<le> a
0 \<le> r
r < 1

goal (1 subgoal):
 1. log (real b) (real a + r) < log (real b) (real_of_int l)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
log (real b) (real a + r) < log (real b) (real_of_int l)

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
log (real b) (real a + r) < log (real b) (real_of_int l)

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
have "\<dots> = real_of_int \<lfloor>log b a\<rfloor> + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log (real b) (real_of_int l) = real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
1 < b
1 \<le> a
0 \<le> r
r < 1

goal (1 subgoal):
 1. log (real b) (real_of_int l) = real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
by (simp add: l_def_real)
[PROOF STATE]
proof (state)
this:
log (real b) (real_of_int l) = real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
show "log b (a + r) < real_of_int \<lfloor>log b a\<rfloor> + 1"
[PROOF STATE]
proof (prove)
using this:
log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1

goal (1 subgoal):
 1. log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
log (real b) (real a + r) < real_of_int \<lfloor>log (real b) (real a)\<rfloor> + 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iprev_inext_nth_pred: "
  I \<rightarrow> (n - Suc 0) \<noteq> Max I \<or> infinite I \<Longrightarrow>
  iprev (I \<rightarrow> n) I = I \<rightarrow> (n - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. I \<rightarrow> (n - Suc 0) \<noteq> Max I \<or> infinite I \<Longrightarrow> iprev (I \<rightarrow> n) I = I \<rightarrow> (n - Suc 0)
[PROOF STEP]
apply (case_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>I \<rightarrow> (n - Suc 0) \<noteq> Max I \<or> infinite I; n = 0\<rbrakk> \<Longrightarrow> iprev (I \<rightarrow> n) I = I \<rightarrow> (n - Suc 0)
 2. \<And>nat. \<lbrakk>I \<rightarrow> (n - Suc 0) \<noteq> Max I \<or> infinite I; n = Suc nat\<rbrakk> \<Longrightarrow> iprev (I \<rightarrow> n) I = I \<rightarrow> (n - Suc 0)
[PROOF STEP]
apply (simp add: iprev_iMin)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. \<lbrakk>I \<rightarrow> (n - Suc 0) \<noteq> Max I \<or> infinite I; n = Suc nat\<rbrakk> \<Longrightarrow> iprev (I \<rightarrow> n) I = I \<rightarrow> (n - Suc 0)
[PROOF STEP]
apply (simp add: iprev_inext)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma affine_hull_halfspace_gt:
  fixes a :: "'a::euclidean_space"
  shows "affine hull {x. a \<bullet> x > r} = (if a = 0 \<and> r \<ge> 0 then {} else UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine hull {x. r < a \<bullet> x} = (if a = (0::'a) \<and> 0 \<le> r then {} else UNIV)
[PROOF STEP]
using halfspace_eq_empty_gt [of r a]
[PROOF STATE]
proof (prove)
using this:
({x. r < a \<bullet> x} = {}) = (a = (0::'a) \<and> 0 \<le> r)

goal (1 subgoal):
 1. affine hull {x. r < a \<bullet> x} = (if a = (0::'a) \<and> 0 \<le> r then {} else UNIV)
[PROOF STEP]
by (simp add: open_halfspace_gt affine_hull_open)


[STATEMENT]
lemma M0_mult_ket_k_R:
  "M0 *\<^sub>v ket_k R = ket_k R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M0 *\<^sub>v ket_k R = ket_k R
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (ket_k R) \<Longrightarrow> (M0 *\<^sub>v ket_k R) $ i = ket_k R $ i
 2. dim_vec (M0 *\<^sub>v ket_k R) = dim_vec (ket_k R)
[PROOF STEP]
unfolding M0_def ket_k_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (Matrix.vec K (\<lambda>k. if k = R then 1 else 0)) \<Longrightarrow> (mat K K (\<lambda>(i, j). if i = j \<and> R \<le> i then 1 else 0) *\<^sub>v Matrix.vec K (\<lambda>k. if k = R then 1 else 0)) $ i = Matrix.vec K (\<lambda>k. if k = R then 1 else 0) $ i
 2. dim_vec (mat K K (\<lambda>(i, j). if i = j \<and> R \<le> i then 1 else 0) *\<^sub>v Matrix.vec K (\<lambda>k. if k = R then 1 else 0)) = dim_vec (Matrix.vec K (\<lambda>k. if k = R then 1 else 0))
[PROOF STEP]
by (auto simp add: scalar_prod_def sum_only_one_neq_0)


[STATEMENT]
lemma hermitian_decomp_sim:
  assumes "hermitian_decomp A B U"
  shows "similar_mat_wit A B U (Complex_Matrix.adjoint U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
hermitian_decomp A B U

goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U)
[PROOF STEP]
unfolding hermitian_decomp_def
[PROOF STATE]
proof (prove)
using this:
similar_mat_wit A B U (Complex_Matrix.adjoint U) \<and> diagonal_mat B \<and> diag_mat B = eigvals A \<and> Complex_Matrix.unitary U \<and> (\<forall>i<dim_row B. B $$ (i, i) \<in> \<real>)

goal (1 subgoal):
 1. similar_mat_wit A B U (Complex_Matrix.adjoint U)
[PROOF STEP]
by simp


[STATEMENT]
lemma min_p_min:
  assumes "is_binqueue l xs"
  and "xs \<noteq> []"
  and "normalized xs"
  and "distinct (vals xs)"
  and "distinct (prios xs)"
  shows "min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
from \<open>xs \<noteq> []\<close> \<open>normalized xs\<close>
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
normalized xs
[PROOF STEP]
have "\<not> PQ.is_empty (pqueue xs)"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
normalized xs

goal (1 subgoal):
 1. \<not> PQ.is_empty (pqueue xs)
[PROOF STEP]
by (simp add: empty_empty)
[PROOF STATE]
proof (state)
this:
\<not> PQ.is_empty (pqueue xs)

goal (1 subgoal):
 1. Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<not> PQ.is_empty (pqueue xs)

goal (1 subgoal):
 1. Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_binqueue l xs
xs \<noteq> []
normalized xs
distinct (vals xs)
distinct (prios xs)
[PROOF STEP]
have "min xs = Some (Min (set (prios xs)))"
[PROOF STATE]
proof (prove)
using this:
is_binqueue l xs
xs \<noteq> []
normalized xs
distinct (vals xs)
distinct (prios xs)

goal (1 subgoal):
 1. Binomial_Queue.min xs = Some (Min (set (prios xs)))
[PROOF STEP]
by (simp add: is_binqueue_min_Min_prios)
[PROOF STATE]
proof (state)
this:
Binomial_Queue.min xs = Some (Min (set (prios xs)))

goal (1 subgoal):
 1. Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
with \<open>distinct (vals xs)\<close>
[PROOF STATE]
proof (chain)
picking this:
distinct (vals xs)
Binomial_Queue.min xs = Some (Min (set (prios xs)))
[PROOF STEP]
have "min xs = Some (Min (set \<parallel>pqueue xs\<parallel> ))"
[PROOF STATE]
proof (prove)
using this:
distinct (vals xs)
Binomial_Queue.min xs = Some (Min (set (prios xs)))

goal (1 subgoal):
 1. Binomial_Queue.min xs = Some (Min (set \<parallel>pqueue xs\<parallel>))
[PROOF STEP]
by (simp add: prios_pqueue)
[PROOF STATE]
proof (state)
this:
Binomial_Queue.min xs = Some (Min (set \<parallel>pqueue xs\<parallel>))

goal (1 subgoal):
 1. Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<not> PQ.is_empty (pqueue xs)
Binomial_Queue.min xs = Some (Min (set \<parallel>pqueue xs\<parallel>))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> PQ.is_empty (pqueue xs)
Binomial_Queue.min xs = Some (Min (set \<parallel>pqueue xs\<parallel>))

goal (1 subgoal):
 1. Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))
[PROOF STEP]
by (simp add: priority_Min_priorities [where q = "pqueue xs"] )
[PROOF STATE]
proof (state)
this:
Binomial_Queue.min xs = PQ.priority (pqueue xs) (PQ.min (pqueue xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cosh_real_ge_1: "cosh (x :: real) \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> cosh x
[PROOF STEP]
using plus_inverse_ge_2[of "exp x"]
[PROOF STATE]
proof (prove)
using this:
0 < exp x \<Longrightarrow> 2 \<le> exp x + inverse (exp x)

goal (1 subgoal):
 1. 1 \<le> cosh x
[PROOF STEP]
by (simp add: cosh_def exp_minus)


[STATEMENT]
lemma strict_trans [simp]: "x \<succ> y \<Longrightarrow> y \<succ> z \<Longrightarrow> x \<succ> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<succeq> y \<and> (y, x) \<notin> relation; y \<succeq> z \<and> (z, y) \<notin> relation\<rbrakk> \<Longrightarrow> x \<succeq> z \<and> (z, x) \<notin> relation
[PROOF STEP]
by (meson transE transitivity)


[STATEMENT]
lemma asymmetric_iff_irreflexive_antisymmetric:
  fixes less (infix "\<sqsubset>" 50)
  shows "asymmetric A (\<sqsubset>) \<longleftrightarrow> irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)" (is "?l \<longleftrightarrow> ?r")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. asymmetric A (\<sqsubset>) = (irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. asymmetric A (\<sqsubset>) \<Longrightarrow> irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)
 2. irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>) \<Longrightarrow> asymmetric A (\<sqsubset>)
[PROOF STEP]
assume ?l
[PROOF STATE]
proof (state)
this:
asymmetric A (\<sqsubset>)

goal (2 subgoals):
 1. asymmetric A (\<sqsubset>) \<Longrightarrow> irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)
 2. irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>) \<Longrightarrow> asymmetric A (\<sqsubset>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
asymmetric A (\<sqsubset>)
[PROOF STEP]
interpret asymmetric
[PROOF STATE]
proof (prove)
using this:
asymmetric A (\<sqsubset>)

goal (1 subgoal):
 1. asymmetric A (\<sqsubset>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. asymmetric A (\<sqsubset>) \<Longrightarrow> irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)
 2. irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>) \<Longrightarrow> asymmetric A (\<sqsubset>)
[PROOF STEP]
show ?r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)
[PROOF STEP]
by (auto dest: asym)
[PROOF STATE]
proof (state)
this:
irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)

goal (1 subgoal):
 1. irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>) \<Longrightarrow> asymmetric A (\<sqsubset>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>) \<Longrightarrow> asymmetric A (\<sqsubset>)
[PROOF STEP]
assume ?r
[PROOF STATE]
proof (state)
this:
irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)

goal (1 subgoal):
 1. irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>) \<Longrightarrow> asymmetric A (\<sqsubset>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)
[PROOF STEP]
interpret irreflexive + antisymmetric A "(\<sqsubset>)"
[PROOF STATE]
proof (prove)
using this:
irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>)

goal (1 subgoal):
 1. irreflexive A (\<sqsubset>) &&& antisymmetric A (\<sqsubset>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. irreflexive A (\<sqsubset>) \<and> antisymmetric A (\<sqsubset>) \<Longrightarrow> asymmetric A (\<sqsubset>)
[PROOF STEP]
show ?l
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. asymmetric A (\<sqsubset>)
[PROOF STEP]
by (auto intro!:asymmetric.intro dest: antisym irrefl)
[PROOF STATE]
proof (state)
this:
asymmetric A (\<sqsubset>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma RPDs_Star: "RPDs (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (RPDs r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. RPDs (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (RPDs r)
[PROOF STEP]
unfolding RPDs_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>i. RPDi i (MStar r)) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>i. RPDi i r)
[PROOF STEP]
using RPDi_Star[OF order_refl, of _ r]
[PROOF STATE]
proof (prove)
using this:
RPDi ?i (MStar r) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>j\<le>?i. RPDi j r)

goal (1 subgoal):
 1. (\<Union>i. RPDi i (MStar r)) \<subseteq> {MStar r} \<union> MTimesL (MStar r) (\<Union>i. RPDi i r)
[PROOF STEP]
by (force simp: MTimesL_def)


[STATEMENT]
lemma rel_to_pred_union_hom: "R \<subseteq> Id \<Longrightarrow> S \<subseteq> Id \<Longrightarrow> r2p (R \<union> S) = (r2p R) \<squnion> (r2p S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>R \<subseteq> Id; S \<subseteq> Id\<rbrakk> \<Longrightarrow> r2p (R \<union> S) = r2p R \<squnion> r2p S
[PROOF STEP]
by (simp add: Domain_Un_eq r2s2p s2p_union_hom)


[STATEMENT]
lemma subdegree_mult [simp]:
  fixes   f g :: "'a :: {semiring_no_zero_divisors} fps"
  assumes "f \<noteq> 0" "g \<noteq> 0"
  shows   "subdegree (f * g) = subdegree f + subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (f * g) = subdegree f + subdegree g
[PROOF STEP]
using   assms
[PROOF STATE]
proof (prove)
using this:
f \<noteq> 0
g \<noteq> 0

goal (1 subgoal):
 1. subdegree (f * g) = subdegree f + subdegree g
[PROOF STEP]
by      (intro subdegree_mult') simp


[STATEMENT]
lemma p_all_zeroes:
  assumes D: "D = v\<^sup>2 - 2 * a * s0"
  shows "p t = 0 \<longleftrightarrow> ((a \<noteq> 0 \<and> 0 \<le> D \<and> ((t = (- v + sqrt D) / a) \<or> t = (- v - sqrt D) / a)) \<or>
    (a = 0 \<and> v = 0 \<and> s0 = 0) \<or> (a = 0 \<and> v \<noteq> 0 \<and> t = (- s0 / v)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p t = 0) = (a \<noteq> 0 \<and> 0 \<le> D \<and> (t = (- v + sqrt D) / a \<or> t = (- v - sqrt D) / a) \<or> a = 0 \<and> v = 0 \<and> s0 = 0 \<or> a = 0 \<and> v \<noteq> 0 \<and> t = - s0 / v)
[PROOF STEP]
using quadratic_eq_zeroes_iff[OF refl refl refl, of "a / 2" t v s0]
[PROOF STATE]
proof (prove)
using this:
a / 2 \<noteq> 0 \<Longrightarrow> (a / 2 * t\<^sup>2 + v * t + s0 = 0) = (0 \<le> v\<^sup>2 - 4 * (a / 2) * s0 \<and> (t = (- v + sqrt (v\<^sup>2 - 4 * (a / 2) * s0)) / (2 * (a / 2)) \<or> t = (- v - sqrt (v\<^sup>2 - 4 * (a / 2) * s0)) / (2 * (a / 2))))

goal (1 subgoal):
 1. (p t = 0) = (a \<noteq> 0 \<and> 0 \<le> D \<and> (t = (- v + sqrt D) / a \<or> t = (- v - sqrt D) / a) \<or> a = 0 \<and> v = 0 \<and> s0 = 0 \<or> a = 0 \<and> v \<noteq> 0 \<and> t = - s0 / v)
[PROOF STEP]
by (auto simp: movement.p_def D power2_eq_square field_split_simps)


[STATEMENT]
lemma prod_list_ge1:
  assumes "Ball (set x) (\<lambda> (a::real). a \<ge> 1)"
  shows "prod_list x \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> prod_list x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set x. 1 \<le> a

goal (1 subgoal):
 1. 1 \<le> prod_list x
[PROOF STEP]
proof(induct x)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. Ball (set []) ((\<le>) 1) \<Longrightarrow> 1 \<le> prod_list []
 2. \<And>a x. \<lbrakk>Ball (set x) ((\<le>) 1) \<Longrightarrow> 1 \<le> prod_list x; Ball (set (a # x)) ((\<le>) 1)\<rbrakk> \<Longrightarrow> 1 \<le> prod_list (a # x)
[PROOF STEP]
case (Cons a as)
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set as. 1 \<le> a \<Longrightarrow> 1 \<le> prod_list as
\<forall>a\<in>set (a # as). 1 \<le> a

goal (2 subgoals):
 1. Ball (set []) ((\<le>) 1) \<Longrightarrow> 1 \<le> prod_list []
 2. \<And>a x. \<lbrakk>Ball (set x) ((\<le>) 1) \<Longrightarrow> 1 \<le> prod_list x; Ball (set (a # x)) ((\<le>) 1)\<rbrakk> \<Longrightarrow> 1 \<le> prod_list (a # x)
[PROOF STEP]
have "\<forall>a\<in>set as. 1 \<le> a" "1 \<le> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a\<in>set as. 1 \<le> a &&& 1 \<le> a
[PROOF STEP]
using Cons(2)
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set (a # as). 1 \<le> a

goal (1 subgoal):
 1. \<forall>a\<in>set as. 1 \<le> a &&& 1 \<le> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>a\<in>set as. 1 \<le> a
1 \<le> a

goal (2 subgoals):
 1. Ball (set []) ((\<le>) 1) \<Longrightarrow> 1 \<le> prod_list []
 2. \<And>a x. \<lbrakk>Ball (set x) ((\<le>) 1) \<Longrightarrow> 1 \<le> prod_list x; Ball (set (a # x)) ((\<le>) 1)\<rbrakk> \<Longrightarrow> 1 \<le> prod_list (a # x)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set as. 1 \<le> a
1 \<le> a

goal (1 subgoal):
 1. 1 \<le> prod_list (a # as)
[PROOF STEP]
using Cons.hyps mult_mono'
[PROOF STATE]
proof (prove)
using this:
\<forall>a\<in>set as. 1 \<le> a
1 \<le> a
\<forall>a\<in>set as. 1 \<le> a \<Longrightarrow> 1 \<le> prod_list as
\<lbrakk>?a \<le> ?b; ?c \<le> ?d; (0::?'a) \<le> ?a; (0::?'a) \<le> ?c\<rbrakk> \<Longrightarrow> ?a * ?c \<le> ?b * ?d

goal (1 subgoal):
 1. 1 \<le> prod_list (a # as)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
1 \<le> prod_list (a # as)

goal (1 subgoal):
 1. Ball (set []) ((\<le>) 1) \<Longrightarrow> 1 \<le> prod_list []
[PROOF STEP]
qed auto


[STATEMENT]
lemma (in prob_space) AE_stream_space:
  assumes [measurable]: "Measurable.pred (stream_space M) P"
  shows "(AE X in stream_space M. P X) = (AE x in M. AE X in stream_space M. P (x ## X))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere (stream_space M) P = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. almost_everywhere (stream_space M) P = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
interpret stream: prob_space "stream_space M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (stream_space M)
[PROOF STEP]
by (rule prob_space_stream_space)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. almost_everywhere (stream_space M) P = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
have eq: "\<And>x X. indicator {x. \<not> P x} (x ## X) = indicator {X. \<not> P (x ## X)} X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x X. indicator {x. \<not> P x} (x ## X) = indicator {X. \<not> P (x ## X)} X
[PROOF STEP]
by (auto split: split_indicator)
[PROOF STATE]
proof (state)
this:
indicator {x. \<not> P x} (?x3 ## ?X3) = indicator {X. \<not> P (?x3 ## X)} ?X3

goal (1 subgoal):
 1. almost_everywhere (stream_space M) P = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. almost_everywhere (stream_space M) P = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
apply (subst AE_iff_nn_integral, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (integral\<^sup>N (stream_space M) (indicator {x. \<not> P x}) = 0) = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
apply (subst nn_integral_stream_space, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+ x. \<integral>\<^sup>+ X. indicator {x. \<not> P x} (x ## X) \<partial>stream_space M \<partial>M = 0) = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
apply (subst eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<integral>\<^sup>+ x. integral\<^sup>N (stream_space M) (indicator {X. \<not> P (x ## X)}) \<partial>M = 0) = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
apply (subst nn_integral_0_iff_AE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (AE x in M. integral\<^sup>N (stream_space M) (indicator {X. \<not> P (x ## X)}) = 0) = (AE x in M. AE X in stream_space M. P (x ## X))
[PROOF STEP]
apply (simp add: AE_iff_nn_integral[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
almost_everywhere (stream_space M) P = (AE x in M. AE X in stream_space M. P (x ## X))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_remdups_card_conv: "length(remdups xs) = card(set xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (remdups xs) = card (set xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length (remdups xs) = card (set xs)
[PROOF STEP]
have xs: "concat[xs] = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. concat [xs] = xs
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
concat [xs] = xs

goal (1 subgoal):
 1. length (remdups xs) = card (set xs)
[PROOF STEP]
from length_remdups_concat[of "[xs]"]
[PROOF STATE]
proof (chain)
picking this:
length (remdups (concat [xs])) = card (\<Union> (set ` set [xs]))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length (remdups (concat [xs])) = card (\<Union> (set ` set [xs]))

goal (1 subgoal):
 1. length (remdups xs) = card (set xs)
[PROOF STEP]
unfolding xs
[PROOF STATE]
proof (prove)
using this:
length (remdups xs) = card (\<Union> (set ` set [xs]))

goal (1 subgoal):
 1. length (remdups xs) = card (set xs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (remdups xs) = card (set xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma trace_outer_prod_right:
  fixes A :: "'a::conjugatable_field mat" and v w :: "'a vec"
  assumes A: "A \<in> carrier_mat n n"
    and v: "v \<in> carrier_vec n" and w: "w \<in> carrier_vec n"
  shows "trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
define B where "B = outer_prod v w"
[PROOF STATE]
proof (state)
this:
B = outer_prod v w

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B = outer_prod v w
[PROOF STEP]
have B: "B \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
B = outer_prod v w

goal (1 subgoal):
 1. B \<in> carrier_mat n n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
B = outer_prod v w
A \<in> carrier_mat n n
v \<in> carrier_vec n
w \<in> carrier_vec n

goal (1 subgoal):
 1. B \<in> carrier_mat n n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat n n

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
have "trace(A * B) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i,j) * B $$ (j,i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (A * B) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * B $$ (j, i))
[PROOF STEP]
unfolding trace_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row (A * B). (A * B) $$ (i, i)) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * B $$ (j, i))
[PROOF STEP]
using A B
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
B \<in> carrier_mat n n

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_row (A * B). (A * B) $$ (i, i)) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * B $$ (j, i))
[PROOF STEP]
by (simp add: scalar_prod_def)
[PROOF STATE]
proof (state)
this:
trace (A * B) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * B $$ (j, i))

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
trace (A * B) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * B $$ (j, i))

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
have "\<dots> = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i,j) * v $ j * conjugate (w $ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * B $$ (j, i)) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
[PROOF STEP]
unfolding B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * outer_prod v w $$ (j, i)) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
[PROOF STEP]
apply (rule sum.cong, simp, rule sum.cong, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. \<lbrakk>x \<in> {0..<n}; xa \<in> {0..<n}\<rbrakk> \<Longrightarrow> A $$ (x, xa) * outer_prod v w $$ (xa, x) = A $$ (x, xa) * v $ xa * conjugate (w $ x)
[PROOF STEP]
by (insert v w, auto simp add: index_outer_prod)
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * B $$ (j, i)) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
trace (A * B) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
[PROOF STEP]
have "?lhs = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i,j) * v $ j * conjugate (w $ i))"
[PROOF STATE]
proof (prove)
using this:
trace (A * B) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))

goal (1 subgoal):
 1. trace (A * outer_prod v w) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
[PROOF STEP]
using B_def
[PROOF STATE]
proof (prove)
using this:
trace (A * B) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
B = outer_prod v w

goal (1 subgoal):
 1. trace (A * outer_prod v w) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (A * outer_prod v w) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
trace (A * outer_prod v w) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
have "?rhs = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i,j) * v $ j * conjugate (w $ i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod w (A *\<^sub>v v) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
[PROOF STEP]
using A v w
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
v \<in> carrier_vec n
w \<in> carrier_vec n

goal (1 subgoal):
 1. inner_prod w (A *\<^sub>v v) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
[PROOF STEP]
by (simp add: scalar_prod_def sum_distrib_right)
[PROOF STATE]
proof (state)
this:
inner_prod w (A *\<^sub>v v) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
trace (A * outer_prod v w) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
inner_prod w (A *\<^sub>v v) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
trace (A * outer_prod v w) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))
inner_prod w (A *\<^sub>v v) = (\<Sum>i = 0..<n. \<Sum>j = 0..<n. A $$ (i, j) * v $ j * conjugate (w $ i))

goal (1 subgoal):
 1. trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (A * outer_prod v w) = inner_prod w (A *\<^sub>v v)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_intersection_of_Inter:
   "\<lbrakk>finite \<U>; \<And>S. S \<in> \<U> \<Longrightarrow> (finite intersection_of P) S\<rbrakk> \<Longrightarrow> (finite intersection_of P) (\<Inter>\<U>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite \<U>; \<And>S. S \<in> \<U> \<Longrightarrow> (finite intersection_of P) S\<rbrakk> \<Longrightarrow> (finite intersection_of P) (\<Inter> \<U>)
[PROOF STEP]
using finite_intersection_of_idempot [of P]
[PROOF STATE]
proof (prove)
using this:
finite intersection_of finite intersection_of P = finite intersection_of P

goal (1 subgoal):
 1. \<lbrakk>finite \<U>; \<And>S. S \<in> \<U> \<Longrightarrow> (finite intersection_of P) S\<rbrakk> \<Longrightarrow> (finite intersection_of P) (\<Inter> \<U>)
[PROOF STEP]
by (metis intersection_of_def mem_Collect_eq subsetI)


[STATEMENT]
lemma convex_hull_eq_empty[simp]: "convex hull S = {} \<longleftrightarrow> S = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (convex hull S = {}) = (S = {})
[PROOF STEP]
using hull_subset[of S convex] convex_hull_empty
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> convex hull S
convex hull {} = {}

goal (1 subgoal):
 1. (convex hull S = {}) = (S = {})
[PROOF STEP]
by auto


[STATEMENT]
lemma compow_matrix_mul_diag_mat_eq: "((**) (diag_mat f) ^^ n) (mat 1) = diag_mat (\<lambda>i. f i^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((**) (diag_mat f) ^^ n) (mat (1::'a)) = diag_mat (\<lambda>i. f i ^ n)
[PROOF STEP]
apply(induct n, simp_all add: matrix_mul_diag_matl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. ((\<lambda>a. \<chi>i j. f i * a $ i $ j) ^^ n) (mat (1::'a)) = diag_mat (\<lambda>i. f i ^ n) \<Longrightarrow> (\<chi>i j. f i * diag_mat (\<lambda>i. f i ^ n) $ i $ j) = diag_mat (\<lambda>i. f i * f i ^ n)
[PROOF STEP]
by (auto simp: vec_eq_iff diag_mat_def)


[STATEMENT]
lemma inner_prod_mult_mat_vec_right:
assumes "v \<in> carrier_vec n"
  and "w \<in> carrier_vec n'"
  and "A \<in> carrier_mat m n"
  and "B \<in> carrier_mat m n'"
shows "inner_prod (A *\<^sub>v v) (B *\<^sub>v w) =
  inner_prod v (((Complex_Matrix.adjoint A) * B) *\<^sub>v w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
have "inner_prod (A *\<^sub>v v) (B *\<^sub>v w) =
    inner_prod ((Complex_Matrix.adjoint (Complex_Matrix.adjoint A)) *\<^sub>v v)
      (B *\<^sub>v w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod (Complex_Matrix.adjoint (Complex_Matrix.adjoint A) *\<^sub>v v) (B *\<^sub>v w)
[PROOF STEP]
by (simp add: Complex_Matrix.adjoint_adjoint)
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod (Complex_Matrix.adjoint (Complex_Matrix.adjoint A) *\<^sub>v v) (B *\<^sub>v w)

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod (Complex_Matrix.adjoint (Complex_Matrix.adjoint A) *\<^sub>v v) (B *\<^sub>v w)

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
have "... = inner_prod v ((Complex_Matrix.adjoint A) *\<^sub>v (B *\<^sub>v w))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod (Complex_Matrix.adjoint (Complex_Matrix.adjoint A) *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w))
[PROOF STEP]
proof (rule adjoint_def_alter[symmetric])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. v \<in> carrier_vec ?n
 2. B *\<^sub>v w \<in> carrier_vec ?m
 3. Complex_Matrix.adjoint A \<in> carrier_mat ?n ?m
[PROOF STEP]
show "v \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<in> carrier_vec n
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n'
A \<in> carrier_mat m n
B \<in> carrier_mat m n'

goal (1 subgoal):
 1. v \<in> carrier_vec n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
v \<in> carrier_vec n

goal (2 subgoals):
 1. B *\<^sub>v w \<in> carrier_vec ?m
 2. Complex_Matrix.adjoint A \<in> carrier_mat n ?m
[PROOF STEP]
show "B *\<^sub>v w \<in> carrier_vec m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B *\<^sub>v w \<in> carrier_vec m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n'
A \<in> carrier_mat m n
B \<in> carrier_mat m n'

goal (1 subgoal):
 1. B *\<^sub>v w \<in> carrier_vec m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
B *\<^sub>v w \<in> carrier_vec m

goal (1 subgoal):
 1. Complex_Matrix.adjoint A \<in> carrier_mat n m
[PROOF STEP]
show "Complex_Matrix.adjoint A \<in> carrier_mat n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint A \<in> carrier_mat n m
[PROOF STEP]
using assms adjoint_dim'[of A]
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n'
A \<in> carrier_mat m n
B \<in> carrier_mat m n'
A \<in> carrier_mat ?n ?m \<Longrightarrow> Complex_Matrix.adjoint A \<in> carrier_mat ?m ?n

goal (1 subgoal):
 1. Complex_Matrix.adjoint A \<in> carrier_mat n m
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint A \<in> carrier_mat n m

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (Complex_Matrix.adjoint (Complex_Matrix.adjoint A) *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w))

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (Complex_Matrix.adjoint (Complex_Matrix.adjoint A) *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w))

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
have "... = inner_prod v (((Complex_Matrix.adjoint A) * B) *\<^sub>v w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w)) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n'
A \<in> carrier_mat m n
B \<in> carrier_mat m n'

goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w)) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; w \<in> carrier_vec n'; A \<in> carrier_mat m n; B \<in> carrier_mat m n'\<rbrakk> \<Longrightarrow> Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w)) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
have "(Complex_Matrix.adjoint A) *\<^sub>v (B *\<^sub>v w) =
      ((Complex_Matrix.adjoint A) * B) *\<^sub>v w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w) = Complex_Matrix.adjoint A * B *\<^sub>v w
[PROOF STEP]
proof (rule assoc_mult_mat_vec[symmetric], (auto simp add: assms))
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. B \<in> carrier_mat (dim_row A) ?n\<^sub>3
 2. w \<in> carrier_vec ?n\<^sub>3
[PROOF STEP]
show "w \<in> carrier_vec n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<in> carrier_vec n'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n'
A \<in> carrier_mat m n
B \<in> carrier_mat m n'

goal (1 subgoal):
 1. w \<in> carrier_vec n'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
w \<in> carrier_vec n'

goal (1 subgoal):
 1. B \<in> carrier_mat (dim_row A) n'
[PROOF STEP]
show "B \<in> carrier_mat (dim_row A) n'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<in> carrier_mat (dim_row A) n'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> carrier_vec n
w \<in> carrier_vec n'
A \<in> carrier_mat m n
B \<in> carrier_mat m n'

goal (1 subgoal):
 1. B \<in> carrier_mat (dim_row A) n'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B \<in> carrier_mat (dim_row A) n'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w) = Complex_Matrix.adjoint A * B *\<^sub>v w

goal (1 subgoal):
 1. \<lbrakk>v \<in> carrier_vec n; w \<in> carrier_vec n'; A \<in> carrier_mat m n; B \<in> carrier_mat m n'\<rbrakk> \<Longrightarrow> Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w)) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w) = Complex_Matrix.adjoint A * B *\<^sub>v w

goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w)) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w)) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A *\<^sub>v (B *\<^sub>v w)) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)

goal (1 subgoal):
 1. Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod (A *\<^sub>v v) (B *\<^sub>v w) = Complex_Matrix.inner_prod v (Complex_Matrix.adjoint A * B *\<^sub>v w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma valid_path_join_eq [simp]:
  fixes g2 :: "real \<Rightarrow> 'a::real_normed_field"
  shows "pathfinish g1 = pathstart g2 \<Longrightarrow> (valid_path(g1 +++ g2) \<longleftrightarrow> valid_path g1 \<and> valid_path g2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pathfinish g1 = pathstart g2 \<Longrightarrow> valid_path (g1 +++ g2) = (valid_path g1 \<and> valid_path g2)
[PROOF STEP]
using valid_path_join_D1 valid_path_join_D2 valid_path_join
[PROOF STATE]
proof (prove)
using this:
valid_path (?g1.0 +++ ?g2.0) \<Longrightarrow> valid_path ?g1.0
\<lbrakk>valid_path (?g1.0 +++ ?g2.0); pathfinish ?g1.0 = pathstart ?g2.0\<rbrakk> \<Longrightarrow> valid_path ?g2.0
\<lbrakk>valid_path ?g1.0; valid_path ?g2.0; pathfinish ?g1.0 = pathstart ?g2.0\<rbrakk> \<Longrightarrow> valid_path (?g1.0 +++ ?g2.0)

goal (1 subgoal):
 1. pathfinish g1 = pathstart g2 \<Longrightarrow> valid_path (g1 +++ g2) = (valid_path g1 \<and> valid_path g2)
[PROOF STEP]
by blast


[STATEMENT]
lemma filterlim_powr_zero_cong:
  "filterlim (\<lambda>x. P (x::real) (x powr (0::real))) F at_top = filterlim (\<lambda>x. P x 1) F at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LIM x at_top. P x (x powr 0) :> F) = (LIM x at_top. P x 1 :> F)
[PROOF STEP]
apply (rule filterlim_cong[OF refl refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. P x (x powr 0) = P x 1
[PROOF STEP]
using eventually_gt_at_top[of "0::real"]
[PROOF STATE]
proof (prove)
using this:
eventually ((<) 0) at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. P x (x powr 0) = P x 1
[PROOF STEP]
by eventually_elim simp_all


[STATEMENT]
lemma objectsCounterModel: "objects (counterModel f) =  { z . ? i . z = obj i }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. objects (counterModel f) = {z. \<exists>i. z = obj i}
[PROOF STEP]
apply(simp add: objects_def counterModel_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (Rep_model (Abs_model (counterM f, counterEvalP f))) = {z. \<exists>i. z = obj i}
[PROOF STEP]
apply(simp add: Abs_counterModel_inverse)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. counterM f = {z. \<exists>i. z = obj i}
[PROOF STEP]
apply(simp add: counterM_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. range obj = {z. \<exists>i. z = obj i}
[PROOF STEP]
by force


[STATEMENT]
lemma seqs_Suc: "seqs (Suc n) = (\<lambda>xs. True # xs) ` seqs n \<union> (\<lambda>xs. False # xs) ` seqs n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. seqs (Suc n) = (#) True ` seqs n \<union> (#) False ` seqs n
[PROOF STEP]
by (auto simp: seqs_def length_Suc_conv)


[STATEMENT]
lemma root_nat_ceiling [simp]: "root_nat_ceiling p x = ceiling (root p x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root_nat_ceiling p x = \<lceil>root p (real x)\<rceil>
[PROOF STEP]
unfolding root_nat_ceiling_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root_int_ceiling_pos p (int x) = \<lceil>root p (real x)\<rceil>
[PROOF STEP]
using root_int_ceiling_pos[of x p]
[PROOF STATE]
proof (prove)
using this:
0 \<le> int x \<Longrightarrow> root_int_ceiling_pos p (int x) = \<lceil>root p (real_of_int (int x))\<rceil>

goal (1 subgoal):
 1. root_int_ceiling_pos p (int x) = \<lceil>root p (real x)\<rceil>
[PROOF STEP]
by auto


[STATEMENT]
lemma minus_one_power_one_word: "(-1 :: real) ^ unat (x :: 1 word) = (if unat x = 0 then 1 else -1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 1) ^ unat x = (if unat x = 0 then 1 else - 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- 1) ^ unat x = (if unat x = 0 then 1 else - 1)
[PROOF STEP]
have "unat x = 0 \<or> unat x = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat x = 0 \<or> unat x = 1
[PROOF STEP]
using le_SucE[OF unat_one_word_le]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>unat ?a1 \<le> 0 \<Longrightarrow> ?R; unat ?a1 = Suc 0 \<Longrightarrow> ?R\<rbrakk> \<Longrightarrow> ?R

goal (1 subgoal):
 1. unat x = 0 \<or> unat x = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unat x = 0 \<or> unat x = 1

goal (1 subgoal):
 1. (- 1) ^ unat x = (if unat x = 0 then 1 else - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
unat x = 0 \<or> unat x = 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
unat x = 0 \<or> unat x = 1

goal (1 subgoal):
 1. (- 1) ^ unat x = (if unat x = 0 then 1 else - 1)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(- 1) ^ unat x = (if unat x = 0 then 1 else - 1)

goal:
No subgoals!
[PROOF STEP]
qed