[STATEMENT]
lemma singleton_sub_trivial_uniq:
      fixes   x X
      assumes "{x} \<subseteq> X" and "trivial X"
      shows   "x = the_elem X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = the_elem X
[PROOF STEP]
(* CL: The following takes 16 ms in Isabelle2013-1-RC1:
   by (metis assms(1) assms(2) insert_not_empty insert_subset subset_empty subset_insert trivial_def trivial_imp_no_distinct) *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = the_elem X
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
{x} \<subseteq> X
trivial X

goal (1 subgoal):
 1. x = the_elem X
[PROOF STEP]
unfolding trivial_def
[PROOF STATE]
proof (prove)
using this:
{x} \<subseteq> X
X \<subseteq> {the_elem X}

goal (1 subgoal):
 1. x = the_elem X
[PROOF STEP]
by fast


[STATEMENT]
lemma keys_pm_of_poly: "keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}
[PROOF STEP]
have "keys (pm_of_poly x p) = {t. (poly.coeff p (lookup t x) when t \<in> .[{x}]) \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. keys (pm_of_poly x p) = {t. (poly.coeff p (lookup t x) when t \<in> .[{x}]) \<noteq> (0::'b)}
[PROOF STEP]
by (rule set_eqI) (simp add: pm_of_poly.rep_eq flip: lookup_not_eq_zero_eq_in_keys)
[PROOF STATE]
proof (state)
this:
keys (pm_of_poly x p) = {t. (poly.coeff p (lookup t x) when t \<in> .[{x}]) \<noteq> (0::'b)}

goal (1 subgoal):
 1. keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
keys (pm_of_poly x p) = {t. (poly.coeff p (lookup t x) when t \<in> .[{x}]) \<noteq> (0::'b)}

goal (1 subgoal):
 1. keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}
[PROOF STEP]
have "\<dots> = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t. (poly.coeff p (lookup t x) when t \<in> .[{x}]) \<noteq> (0::'b)} = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}
[PROOF STEP]
by (fact pm_of_poly_aux)
[PROOF STATE]
proof (state)
this:
{t. (poly.coeff p (lookup t x) when t \<in> .[{x}]) \<noteq> (0::'b)} = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}

goal (1 subgoal):
 1. keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}

goal (1 subgoal):
 1. keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
keys (pm_of_poly x p) = Poly_Mapping.single x ` {d. poly.coeff p d \<noteq> (0::'b)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounded_Un[simp]: "bounded (S \<union> T) \<longleftrightarrow> bounded S \<and> bounded T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded (S \<union> T) = (bounded S \<and> bounded T)
[PROOF STEP]
by (auto simp: bounded_def) (metis Un_iff bounded_any_center le_max_iff_disj)


[STATEMENT]
lemma pair_qbs_space[simp]: "qbs_space (X \<Otimes>\<^sub>Q Y) = qbs_space X \<times> qbs_space Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. qbs_space (X \<Otimes>\<^sub>Q Y) = qbs_space X \<times> qbs_space Y
[PROOF STEP]
by (simp add: qbs_space_def pair_qbs_correct)


[STATEMENT]
lemma ell2_norm_L2_set:
  assumes "has_ell2_norm x"
  shows "ell2_norm x = (SUP F\<in>{F. finite F}. L2_set (norm o x) F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ell2_norm x = \<Squnion> (L2_set (cmod \<circ> x) ` {F. finite F})
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ell2_norm x = \<Squnion> (L2_set (cmod \<circ> x) ` {F. finite F})
[PROOF STEP]
have "sqrt (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)) =
      (SUP F\<in>{F. finite F}. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)) = (\<Squnion>F\<in>{F. finite F}. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))
[PROOF STEP]
proof (subst continuous_at_Sup_mono)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. mono sqrt
 2. continuous (at_left (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite))) sqrt
 3. sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite \<noteq> {}
 4. bdd_above (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)
 5. \<Squnion> (sqrt ` sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite) = (\<Squnion>F\<in>Collect finite. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))
[PROOF STEP]
show "mono sqrt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono sqrt
[PROOF STEP]
by (simp add: mono_def)
[PROOF STATE]
proof (state)
this:
mono sqrt

goal (4 subgoals):
 1. continuous (at_left (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite))) sqrt
 2. sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite \<noteq> {}
 3. bdd_above (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)
 4. \<Squnion> (sqrt ` sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite) = (\<Squnion>F\<in>Collect finite. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))
[PROOF STEP]
show "continuous (at_left (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite))) sqrt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at_left (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite))) sqrt
[PROOF STEP]
using continuous_at_split isCont_real_sqrt
[PROOF STATE]
proof (prove)
using this:
isCont ?f ?x = (continuous (at_left ?x) ?f \<and> continuous (at_right ?x) ?f)
isCont sqrt ?x

goal (1 subgoal):
 1. continuous (at_left (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite))) sqrt
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
continuous (at_left (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite))) sqrt

goal (3 subgoals):
 1. sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite \<noteq> {}
 2. bdd_above (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)
 3. \<Squnion> (sqrt ` sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite) = (\<Squnion>F\<in>Collect finite. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))
[PROOF STEP]
show "sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite \<noteq> {}

goal (2 subgoals):
 1. bdd_above (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)
 2. \<Squnion> (sqrt ` sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite) = (\<Squnion>F\<in>Collect finite. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))
[PROOF STEP]
show "bdd_above (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)
[PROOF STEP]
using has_ell2_norm_bdd_above[THEN iffD1, OF assms]
[PROOF STATE]
proof (prove)
using this:
bdd_above (sum (\<lambda>xa. cmod ((x xa)\<^sup>2)) ` Collect finite)

goal (1 subgoal):
 1. bdd_above (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)
[PROOF STEP]
by (auto simp: norm_power)
[PROOF STATE]
proof (state)
this:
bdd_above (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)

goal (1 subgoal):
 1. \<Squnion> (sqrt ` sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite) = (\<Squnion>F\<in>Collect finite. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))
[PROOF STEP]
show "\<Squnion> (sqrt ` sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite) = (SUP F\<in>Collect finite. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (sqrt ` sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite) = (\<Squnion>F\<in>Collect finite. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))
[PROOF STEP]
by (metis image_image)
[PROOF STATE]
proof (state)
this:
\<Squnion> (sqrt ` sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite) = (\<Squnion>F\<in>Collect finite. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sqrt (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)) = (\<Squnion>F\<in>{F. finite F}. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))

goal (1 subgoal):
 1. ell2_norm x = \<Squnion> (L2_set (cmod \<circ> x) ` {F. finite F})
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
sqrt (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)) = (\<Squnion>F\<in>{F. finite F}. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))

goal (1 subgoal):
 1. ell2_norm x = \<Squnion> (L2_set (cmod \<circ> x) ` {F. finite F})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sqrt (\<Squnion> (sum (\<lambda>i. (cmod (x i))\<^sup>2) ` Collect finite)) = (\<Squnion>F\<in>{F. finite F}. sqrt (\<Sum>i\<in>F. (cmod (x i))\<^sup>2))
has_ell2_norm x

goal (1 subgoal):
 1. ell2_norm x = \<Squnion> (L2_set (cmod \<circ> x) ` {F. finite F})
[PROOF STEP]
by (auto simp: ell2_norm_SUP L2_set_def)
[PROOF STATE]
proof (state)
this:
ell2_norm x = \<Squnion> (L2_set (cmod \<circ> x) ` {F. finite F})

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma extending_Int:
     "[| extending C h F YA' YA;  extending C h F YB' YB |]
      ==> extending C h F (YA' \<inter> YB') (YA \<inter> YB)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>extending C h F YA' YA; extending C h F YB' YB\<rbrakk> \<Longrightarrow> extending C h F (YA' \<inter> YB') (YA \<inter> YB)
[PROOF STEP]
by (unfold extending_def, blast)


[STATEMENT]
lemma convex_on_closure:
  assumes "convex (C::'a::real_normed_vector set)"
          "convex_on C f"
          "continuous_on (closure C) f"
  shows "convex_on (closure C) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex_on (closure C) f
[PROOF STEP]
proof (rule convex_onI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
fix x y::'a and t::real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
assume "x \<in> closure C" "y \<in> closure C" "0 < t" "t < 1"
[PROOF STATE]
proof (state)
this:
x \<in> closure C
y \<in> closure C
0 < t
t < 1

goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
obtain u v::"nat \<Rightarrow> 'a" where *: "\<And>n. u n \<in> C" "u \<longlonglongrightarrow> x"
                                   "\<And>n. v n \<in> C" "v \<longlonglongrightarrow> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>\<And>n. u n \<in> C; u \<longlonglongrightarrow> x; \<And>n. v n \<in> C; v \<longlonglongrightarrow> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>x \<in> closure C\<close> \<open>y \<in> closure C\<close>
[PROOF STATE]
proof (prove)
using this:
x \<in> closure C
y \<in> closure C

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>\<And>n. u n \<in> C; u \<longlonglongrightarrow> x; \<And>n. v n \<in> C; v \<longlonglongrightarrow> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding closure_sequential
[PROOF STATE]
proof (prove)
using this:
\<exists>xa. (\<forall>n. xa n \<in> C) \<and> xa \<longlonglongrightarrow> x
\<exists>x. (\<forall>n. x n \<in> C) \<and> x \<longlonglongrightarrow> y

goal (1 subgoal):
 1. (\<And>u v. \<lbrakk>\<And>n. u n \<in> C; u \<longlonglongrightarrow> x; \<And>n. v n \<in> C; v \<longlonglongrightarrow> y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
u ?n \<in> C
u \<longlonglongrightarrow> x
v ?n \<in> C
v \<longlonglongrightarrow> y

goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
define w where "w = (\<lambda>n. (1-t) *\<^sub>R (u n) + t *\<^sub>R (v n))"
[PROOF STATE]
proof (state)
this:
w = (\<lambda>n. (1 - t) *\<^sub>R u n + t *\<^sub>R v n)

goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
have "w n \<in> C" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w n \<in> C
[PROOF STEP]
using \<open>0 < t\<close> \<open>t< 1\<close> convexD[OF \<open>convex C\<close> *(1)[of n] *(3)[of n]]
[PROOF STATE]
proof (prove)
using this:
0 < t
t < 1
\<lbrakk>0 \<le> ?u; 0 \<le> ?v; ?u + ?v = 1\<rbrakk> \<Longrightarrow> ?u *\<^sub>R u n + ?v *\<^sub>R v n \<in> C

goal (1 subgoal):
 1. w n \<in> C
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
using this:
0 < t
t < 1
\<lbrakk>0 \<le> ?u; 0 \<le> ?v; ?u + ?v = 1\<rbrakk> \<Longrightarrow> ?u *\<^sub>R u n + ?v *\<^sub>R v n \<in> C

goal (1 subgoal):
 1. (1 - t) *\<^sub>R u n + t *\<^sub>R v n \<in> C
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
w ?n \<in> C

goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
have "w \<longlonglongrightarrow> ((1-t) *\<^sub>R x + t *\<^sub>R y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<longlonglongrightarrow> (1 - t) *\<^sub>R x + t *\<^sub>R y
[PROOF STEP]
unfolding w_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (1 - t) *\<^sub>R u n + t *\<^sub>R v n) \<longlonglongrightarrow> (1 - t) *\<^sub>R x + t *\<^sub>R y
[PROOF STEP]
using *(2) *(4)
[PROOF STATE]
proof (prove)
using this:
u \<longlonglongrightarrow> x
v \<longlonglongrightarrow> y

goal (1 subgoal):
 1. (\<lambda>n. (1 - t) *\<^sub>R u n + t *\<^sub>R v n) \<longlonglongrightarrow> (1 - t) *\<^sub>R x + t *\<^sub>R y
[PROOF STEP]
by (intro tendsto_intros)
[PROOF STATE]
proof (state)
this:
w \<longlonglongrightarrow> (1 - t) *\<^sub>R x + t *\<^sub>R y

goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
have *: "f(w n) \<le> (1-t) * f(u n) + t * f (v n)" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f (w n) \<le> (1 - t) * f (u n) + t * f (v n)
[PROOF STEP]
using *(1) *(3) \<open>convex_on C f\<close> \<open>0<t\<close> \<open>t<1\<close> less_imp_le
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> C
v ?n \<in> C
convex_on C f
0 < t
t < 1
?x < ?y \<Longrightarrow> ?x \<le> ?y

goal (1 subgoal):
 1. f (w n) \<le> (1 - t) * f (u n) + t * f (v n)
[PROOF STEP]
unfolding w_def
    convex_on_alt
[PROOF STATE]
proof (prove)
using this:
u ?n \<in> C
v ?n \<in> C
\<forall>x\<in>C. \<forall>y\<in>C. \<forall>\<mu>. 0 \<le> \<mu> \<and> \<mu> \<le> 1 \<longrightarrow> f (\<mu> *\<^sub>R x + (1 - \<mu>) *\<^sub>R y) \<le> \<mu> * f x + (1 - \<mu>) * f y
0 < t
t < 1
?x < ?y \<Longrightarrow> ?x \<le> ?y

goal (1 subgoal):
 1. f ((1 - t) *\<^sub>R u n + t *\<^sub>R v n) \<le> (1 - t) * f (u n) + t * f (v n)
[PROOF STEP]
by (simp add: add.commute)
[PROOF STATE]
proof (state)
this:
f (w ?n) \<le> (1 - t) * f (u ?n) + t * f (v ?n)

goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
have i: "(\<lambda>n. f (w n)) \<longlonglongrightarrow> f ((1-t) *\<^sub>R x + t *\<^sub>R y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. f (w n)) \<longlonglongrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y)
[PROOF STEP]
by (rule continuous_on_closure_sequentially'[OF assms(3) \<open>\<And>n. w n \<in> C\<close> \<open>w \<longlonglongrightarrow> ((1-t) *\<^sub>R x + t *\<^sub>R y)\<close>])
[PROOF STATE]
proof (state)
this:
(\<lambda>n. f (w n)) \<longlonglongrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y)

goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
have ii: "(\<lambda>n. (1-t) * f(u n) + t * f (v n)) \<longlonglongrightarrow> (1-t) * f x + t * f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. (1 - t) * f (u n) + t * f (v n)) \<longlonglongrightarrow> (1 - t) * f x + t * f y
[PROOF STEP]
apply (intro tendsto_intros)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<lambda>x. f (u x)) \<longlonglongrightarrow> f x
 2. (\<lambda>x. f (v x)) \<longlonglongrightarrow> f y
[PROOF STEP]
apply (rule continuous_on_closure_sequentially'[OF assms(3) \<open>\<And>n. u n \<in> C\<close> \<open>u \<longlonglongrightarrow> x\<close>])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (v x)) \<longlonglongrightarrow> f y
[PROOF STEP]
apply (rule continuous_on_closure_sequentially'[OF assms(3) \<open>\<And>n. v n \<in> C\<close> \<open>v \<longlonglongrightarrow> y\<close>])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(\<lambda>n. (1 - t) * f (u n) + t * f (v n)) \<longlonglongrightarrow> (1 - t) * f x + t * f y

goal (1 subgoal):
 1. \<And>t x y. \<lbrakk>0 < t; t < 1; x \<in> closure C; y \<in> closure C\<rbrakk> \<Longrightarrow> f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
show "f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y
[PROOF STEP]
apply (rule LIMSEQ_le[OF i ii])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. f (w n) \<le> (1 - t) * f (u n) + t * f (v n)
[PROOF STEP]
using *
[PROOF STATE]
proof (prove)
using this:
f (w ?n) \<le> (1 - t) * f (u ?n) + t * f (v ?n)

goal (1 subgoal):
 1. \<exists>N. \<forall>n\<ge>N. f (w n) \<le> (1 - t) * f (u n) + t * f (v n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f ((1 - t) *\<^sub>R x + t *\<^sub>R y) \<le> (1 - t) * f x + t * f y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_exp_eq_not_mask:
  \<open>- (2 ^ n) = NOT (mask n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - ((2::'a) ^ n) = NOT (mask n)
[PROOF STEP]
by (rule bit_eqI) (simp add: bit_minus_iff bit_not_iff flip: mask_eq_exp_minus_1)


[STATEMENT]
lemma "filterlim (\<lambda>x::real. (1/x - 1/3) / (x^2 - 9)) (nhds (-1/54)) (at 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. (1 / x - 1 / 3) / (x\<^sup>2 - 9)) \<midarrow>3\<rightarrow> - 1 / 54
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma count_vec_sum_ones_alt:
  fixes v :: "'a :: {ring_1} vec"
  assumes "vec_set v \<subseteq> {0, 1}"
  shows "of_nat (count_vec v 1) = sum_vec v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
have "\<And> i. i < dim_vec v \<Longrightarrow> v $ i = 1 \<or> v $ i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
set\<^sub>v v \<subseteq> {0::'a, 1::'a}

goal (1 subgoal):
 1. \<And>i. i < dim_vec v \<Longrightarrow> v $ i = (1::'a) \<or> v $ i = (0::'a)
[PROOF STEP]
by (meson insertE singletonD subsetD vec_setI)
[PROOF STATE]
proof (state)
this:
?i < dim_vec v \<Longrightarrow> v $ ?i = (1::'a) \<or> v $ ?i = (0::'a)

goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?i < dim_vec v \<Longrightarrow> v $ ?i = (1::'a) \<or> v $ ?i = (0::'a)

goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
using count_vec_sum_ones
[PROOF STATE]
proof (prove)
using this:
?i < dim_vec v \<Longrightarrow> v $ ?i = (1::'a) \<or> v $ ?i = (0::'a)
(\<And>i. i < dim_vec ?v \<Longrightarrow> ?v $ i = (1::?'a) \<or> ?v $ i = (0::?'a)) \<Longrightarrow> of_nat (count_vec ?v (1::?'a)) = sum_vec ?v

goal (1 subgoal):
 1. of_nat (count_vec v (1::'a)) = sum_vec v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
of_nat (count_vec v (1::'a)) = sum_vec v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma basis_combination_unique:
  fixes X::"'a::{field}^'n^'n"
  assumes basis_X: "is_basis (set_of_vector X)" and sum_eq: "(\<Sum>i\<in>UNIV. g i *s X$i) = (\<Sum>i\<in>UNIV. f i *s X$i)"
  shows "f=g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f = g
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
assume "f\<noteq>g"
[PROOF STATE]
proof (state)
this:
f \<noteq> g

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
f \<noteq> g
[PROOF STEP]
obtain x where fx_gx: "f x \<noteq> g x"
[PROOF STATE]
proof (prove)
using this:
f \<noteq> g

goal (1 subgoal):
 1. (\<And>x. f x \<noteq> g x \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
f x \<noteq> g x

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
have "0=(\<Sum>i\<in>UNIV. g i *s X$i) - (\<Sum>i\<in>UNIV. f i *s X$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = (\<Sum>i\<in>UNIV. g i *s X $ i) - (\<Sum>i\<in>UNIV. f i *s X $ i)
[PROOF STEP]
using sum_eq
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>UNIV. g i *s X $ i) = (\<Sum>i\<in>UNIV. f i *s X $ i)

goal (1 subgoal):
 1. 0 = (\<Sum>i\<in>UNIV. g i *s X $ i) - (\<Sum>i\<in>UNIV. f i *s X $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 = (\<Sum>i\<in>UNIV. g i *s X $ i) - (\<Sum>i\<in>UNIV. f i *s X $ i)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 = (\<Sum>i\<in>UNIV. g i *s X $ i) - (\<Sum>i\<in>UNIV. f i *s X $ i)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
have "... = (\<Sum>i\<in>UNIV. g i *s X$i - f i *s X$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. g i *s X $ i) - (\<Sum>i\<in>UNIV. f i *s X $ i) = (\<Sum>i\<in>UNIV. g i *s X $ i - f i *s X $ i)
[PROOF STEP]
unfolding sum_subtractf[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>UNIV. g x *s X $ x - f x *s X $ x) = (\<Sum>i\<in>UNIV. g i *s X $ i - f i *s X $ i)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. g i *s X $ i) - (\<Sum>i\<in>UNIV. f i *s X $ i) = (\<Sum>i\<in>UNIV. g i *s X $ i - f i *s X $ i)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. g i *s X $ i) - (\<Sum>i\<in>UNIV. f i *s X $ i) = (\<Sum>i\<in>UNIV. g i *s X $ i - f i *s X $ i)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
have "... = (\<Sum>i\<in>UNIV. (g i - f i) *s X$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. g i *s X $ i - f i *s X $ i) = (\<Sum>i\<in>UNIV. (g i - f i) *s X $ i)
[PROOF STEP]
by (rule sum.cong, auto simp add: scaleR_diff_left)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. g i *s X $ i - f i *s X $ i) = (\<Sum>i\<in>UNIV. (g i - f i) *s X $ i)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. g i *s X $ i - f i *s X $ i) = (\<Sum>i\<in>UNIV. (g i - f i) *s X $ i)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
have "... = (\<Sum>i\<in>UNIV. (g - f) i *s X$i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. (g i - f i) *s X $ i) = (\<Sum>i\<in>UNIV. (g - f) i *s X $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>UNIV. (g i - f i) *s X $ i) = (\<Sum>i\<in>UNIV. (g - f) i *s X $ i)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 = (\<Sum>i\<in>UNIV. (g - f) i *s X $ i)
[PROOF STEP]
have sum_eq_1: "0 = (\<Sum>i\<in>UNIV. (g - f) i *s X$i)"
[PROOF STATE]
proof (prove)
using this:
0 = (\<Sum>i\<in>UNIV. (g - f) i *s X $ i)

goal (1 subgoal):
 1. 0 = (\<Sum>i\<in>UNIV. (g - f) i *s X $ i)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 = (\<Sum>i\<in>UNIV. (g - f) i *s X $ i)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
have "\<forall>i\<in>UNIV. (g - f) i = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>UNIV. (g - f) i = (0::'a)
[PROOF STEP]
by (rule scalars_zero_if_basis[OF basis_X sum_eq_1[symmetric]])
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>UNIV. (g - f) i = (0::'a)

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
hence "(g - f) x = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<in>UNIV. (g - f) i = (0::'a)

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

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
hence "f x = g x"
[PROOF STATE]
proof (prove)
using this:
(g - f) x = (0::'a)

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

goal (1 subgoal):
 1. f \<noteq> g \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
f x = g x

goal (1 subgoal):
 1. False
[PROOF STEP]
using fx_gx
[PROOF STATE]
proof (prove)
using this:
f x = g x
f x \<noteq> g x

goal (1 subgoal):
 1. False
[PROOF STEP]
by contradiction
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma normalized_corthogonal_mat_is_unitary:
  assumes W: "set ws \<subseteq> carrier_vec n"
    and orth: "corthogonal ws"
    and len: "length ws = n"
  shows "unitary (mat_of_cols n (map vec_normalize ws))" (is "unitary ?W")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
define vs where "vs = map vec_normalize ws"
[PROOF STATE]
proof (state)
this:
vs = map vec_normalize ws

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
define W where "W = mat_of_cols n vs"
[PROOF STATE]
proof (state)
this:
W = mat_of_cols n vs

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have W': "set vs \<subseteq> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set vs \<subseteq> carrier_vec n
[PROOF STEP]
using assms vs_def
[PROOF STATE]
proof (prove)
using this:
set ws \<subseteq> carrier_vec n
corthogonal ws
length ws = n
vs = map vec_normalize ws

goal (1 subgoal):
 1. set vs \<subseteq> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set vs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
set vs \<subseteq> carrier_vec n
[PROOF STEP]
have W'': "\<And>k. k < length vs \<Longrightarrow> vs ! k \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
using this:
set vs \<subseteq> carrier_vec n

goal (1 subgoal):
 1. \<And>k. k < length vs \<Longrightarrow> vs ! k \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k < length vs \<Longrightarrow> vs ! ?k \<in> carrier_vec n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have orth': "corthogonal vs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. corthogonal vs
[PROOF STEP]
using assms normalize_keep_corthogonal vs_def
[PROOF STATE]
proof (prove)
using this:
set ws \<subseteq> carrier_vec n
corthogonal ws
length ws = n
\<lbrakk>corthogonal ?vs; set ?vs \<subseteq> carrier_vec ?n\<rbrakk> \<Longrightarrow> corthogonal (map vec_normalize ?vs)
vs = map vec_normalize ws

goal (1 subgoal):
 1. corthogonal vs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
corthogonal vs

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have len'[simp]: "length vs = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length vs = n
[PROOF STEP]
using assms vs_def
[PROOF STATE]
proof (prove)
using this:
set ws \<subseteq> carrier_vec n
corthogonal ws
length ws = n
vs = map vec_normalize ws

goal (1 subgoal):
 1. length vs = n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length vs = n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have dimW: "W \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W \<in> carrier_mat n n
[PROOF STEP]
using W_def len
[PROOF STATE]
proof (prove)
using this:
W = mat_of_cols n vs
length ws = n

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

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have "adjoint W \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint W \<in> carrier_mat n n
[PROOF STEP]
using dimW
[PROOF STATE]
proof (prove)
using this:
W \<in> carrier_mat n n

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

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
adjoint W \<in> carrier_mat n n
[PROOF STEP]
have dimaW: "mat_adjoint W \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
using this:
adjoint W \<in> carrier_mat n n

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

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
adjoint W \<in> carrier_mat n n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
assume i: "i < n" and j: "j < n"
[PROOF STATE]
proof (state)
this:
i < n
j < n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have dimws: "(ws ! i) \<in> carrier_vec n" "(ws ! j) \<in> carrier_vec n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ws ! i \<in> carrier_vec n &&& ws ! j \<in> carrier_vec n
[PROOF STEP]
using W len i j
[PROOF STATE]
proof (prove)
using this:
set ws \<subseteq> carrier_vec n
length ws = n
i < n
j < n

goal (1 subgoal):
 1. ws ! i \<in> carrier_vec n &&& ws ! j \<in> carrier_vec n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ws ! i \<in> carrier_vec n
ws ! j \<in> carrier_vec n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have "(ws ! i) \<bullet>c (ws ! i) \<noteq> 0" "(ws ! j) \<bullet>c (ws ! j) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (ws ! i) (ws ! i) \<noteq> 0 &&& inner_prod (ws ! j) (ws ! j) \<noteq> 0
[PROOF STEP]
using orth corthogonal_def[of ws] len i j
[PROOF STATE]
proof (prove)
using this:
corthogonal ws
corthogonal ws \<equiv> \<forall>i<length ws. \<forall>j<length ws. (inner_prod (ws ! j) (ws ! i) = 0) = (i \<noteq> j)
length ws = n
i < n
j < n

goal (1 subgoal):
 1. inner_prod (ws ! i) (ws ! i) \<noteq> 0 &&& inner_prod (ws ! j) (ws ! j) \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (ws ! i) (ws ! i) \<noteq> 0
inner_prod (ws ! j) (ws ! j) \<noteq> 0

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inner_prod (ws ! i) (ws ! i) \<noteq> 0
inner_prod (ws ! j) (ws ! j) \<noteq> 0
[PROOF STEP]
have neq0: "(ws ! i) \<noteq> 0\<^sub>v n" "(ws ! j) \<noteq> 0\<^sub>v n"
[PROOF STATE]
proof (prove)
using this:
inner_prod (ws ! i) (ws ! i) \<noteq> 0
inner_prod (ws ! j) (ws ! j) \<noteq> 0

goal (1 subgoal):
 1. ws ! i \<noteq> 0\<^sub>v n &&& ws ! j \<noteq> 0\<^sub>v n
[PROOF STEP]
by (auto simp add: conjugate_square_eq_0_vec[of "ws ! i" n])
[PROOF STATE]
proof (state)
this:
ws ! i \<noteq> 0\<^sub>v n
ws ! j \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ws ! i \<noteq> 0\<^sub>v n
ws ! j \<noteq> 0\<^sub>v n
[PROOF STEP]
have "vec_norm (ws ! i) > 0" "vec_norm (ws ! j) > 0"
[PROOF STATE]
proof (prove)
using this:
ws ! i \<noteq> 0\<^sub>v n
ws ! j \<noteq> 0\<^sub>v n

goal (1 subgoal):
 1. 0 < vec_norm (ws ! i) &&& 0 < vec_norm (ws ! j)
[PROOF STEP]
using vec_norm_ge_0 dimws
[PROOF STATE]
proof (prove)
using this:
ws ! i \<noteq> 0\<^sub>v n
ws ! j \<noteq> 0\<^sub>v n
\<lbrakk>?v \<in> carrier_vec ?n; ?v \<noteq> 0\<^sub>v ?n\<rbrakk> \<Longrightarrow> 0 < vec_norm ?v
ws ! i \<in> carrier_vec n
ws ! j \<in> carrier_vec n

goal (1 subgoal):
 1. 0 < vec_norm (ws ! i) &&& 0 < vec_norm (ws ! j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < vec_norm (ws ! i)
0 < vec_norm (ws ! j)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < vec_norm (ws ! i)
0 < vec_norm (ws ! j)
[PROOF STEP]
have ge0: "vec_norm (ws ! i) * vec_norm (ws ! j) > 0"
[PROOF STATE]
proof (prove)
using this:
0 < vec_norm (ws ! i)
0 < vec_norm (ws ! j)

goal (1 subgoal):
 1. 0 < vec_norm (ws ! i) * vec_norm (ws ! j)
[PROOF STEP]
by (auto simp: less_complex_def)
[PROOF STATE]
proof (state)
this:
0 < vec_norm (ws ! i) * vec_norm (ws ! j)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have ws': "vs ! i = vec_normalize (ws ! i)"
        "vs ! j = vec_normalize (ws ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vs ! i = vec_normalize (ws ! i) &&& vs ! j = vec_normalize (ws ! j)
[PROOF STEP]
using len i j vs_def
[PROOF STATE]
proof (prove)
using this:
length ws = n
i < n
j < n
vs = map vec_normalize ws

goal (1 subgoal):
 1. vs ! i = vec_normalize (ws ! i) &&& vs ! j = vec_normalize (ws ! j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
vs ! i = vec_normalize (ws ! i)
vs ! j = vec_normalize (ws ! j)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have ii1: "(vs ! i) \<bullet>c (vs ! i) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (vs ! i) (vs ! i) = 1
[PROOF STEP]
apply (simp add: ws')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (vec_normalize (ws ! i)) (vec_normalize (ws ! i)) = 1
[PROOF STEP]
apply (rule normalized_vec_norm[of "ws ! i"], rule dimws, rule neq0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
inner_prod (vs ! i) (vs ! i) = 1

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have ij0: "i \<noteq> j \<Longrightarrow> (ws ! i)  \<bullet>c (ws ! j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = 0
[PROOF STEP]
using i j
[PROOF STATE]
proof (prove)
using this:
i < n
j < n

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = 0
[PROOF STEP]
by (insert orth, auto simp add: corthogonal_def[of ws] len)
[PROOF STATE]
proof (state)
this:
i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = 0

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have "i \<noteq> j \<Longrightarrow> (ws ! i)  \<bullet>c (ws ! j) =  (vec_norm (ws ! i) * vec_norm (ws ! j)) * ((vs ! i) \<bullet>c (vs ! j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = vec_norm (ws ! i) * vec_norm (ws ! j) * inner_prod (vs ! j) (vs ! i)
[PROOF STEP]
apply (auto simp add: ws')
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = vec_norm (ws ! i) * vec_norm (ws ! j) * inner_prod (vec_normalize (ws ! j)) (vec_normalize (ws ! i))
[PROOF STEP]
apply (rule normalized_cscalar_prod)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. i \<noteq> j \<Longrightarrow> ws ! i \<in> carrier_vec ?n1
 2. i \<noteq> j \<Longrightarrow> ws ! j \<in> carrier_vec ?n1
[PROOF STEP]
apply (rule dimws, rule dimws)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = vec_norm (ws ! i) * vec_norm (ws ! j) * inner_prod (vs ! j) (vs ! i)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
with ij0
[PROOF STATE]
proof (chain)
picking this:
i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = 0
i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = vec_norm (ws ! i) * vec_norm (ws ! j) * inner_prod (vs ! j) (vs ! i)
[PROOF STEP]
have ij0': "i \<noteq> j \<Longrightarrow> (vs ! i) \<bullet>c (vs ! j) = 0"
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = 0
i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = vec_norm (ws ! i) * vec_norm (ws ! j) * inner_prod (vs ! j) (vs ! i)

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> inner_prod (vs ! j) (vs ! i) = 0
[PROOF STEP]
using ge0
[PROOF STATE]
proof (prove)
using this:
i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = 0
i \<noteq> j \<Longrightarrow> inner_prod (ws ! j) (ws ! i) = vec_norm (ws ! i) * vec_norm (ws ! j) * inner_prod (vs ! j) (vs ! i)
0 < vec_norm (ws ! i) * vec_norm (ws ! j)

goal (1 subgoal):
 1. i \<noteq> j \<Longrightarrow> inner_prod (vs ! j) (vs ! i) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
i \<noteq> j \<Longrightarrow> inner_prod (vs ! j) (vs ! i) = 0

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have cWk: "\<And>k. k < n \<Longrightarrow> col W k = vs ! k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. k < n \<Longrightarrow> col W k = vs ! k
[PROOF STEP]
unfolding W_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. k < n \<Longrightarrow> col (mat_of_cols n vs) k = vs ! k
[PROOF STEP]
apply (subst col_mat_of_cols)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>k. k < n \<Longrightarrow> k < length vs
 2. \<And>k. k < n \<Longrightarrow> vs ! k \<in> carrier_vec n
 3. \<And>k. k < n \<Longrightarrow> vs ! k = vs ! k
[PROOF STEP]
apply (auto simp add: W'')
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
?k < n \<Longrightarrow> col W ?k = vs ! ?k

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have "(mat_adjoint W * W) $$ (j, i) = row (mat_adjoint W) j \<bullet> col W i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (adjoint W * W) $$ (j, i) = row (adjoint W) j \<bullet> col W i
[PROOF STEP]
by (insert dimW i j dimaW, auto)
[PROOF STATE]
proof (state)
this:
(adjoint W * W) $$ (j, i) = row (adjoint W) j \<bullet> col W i

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(adjoint W * W) $$ (j, i) = row (adjoint W) j \<bullet> col W i

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have "\<dots> = conjugate (col W j) \<bullet> col W i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (adjoint W) j \<bullet> col W i = conjugate (col W j) \<bullet> col W i
[PROOF STEP]
by (insert dimW i j dimaW, auto simp add: mat_adjoint_def)
[PROOF STATE]
proof (state)
this:
row (adjoint W) j \<bullet> col W i = conjugate (col W j) \<bullet> col W i

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row (adjoint W) j \<bullet> col W i = conjugate (col W j) \<bullet> col W i

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have "\<dots> = col W i \<bullet> conjugate (col W j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conjugate (col W j) \<bullet> col W i = inner_prod (col W j) (col W i)
[PROOF STEP]
using comm_scalar_prod[of "col W i" n] dimW
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>col W i \<in> carrier_vec n; ?v\<^sub>2 \<in> carrier_vec n\<rbrakk> \<Longrightarrow> col W i \<bullet> ?v\<^sub>2 = ?v\<^sub>2 \<bullet> col W i
W \<in> carrier_mat n n

goal (1 subgoal):
 1. conjugate (col W j) \<bullet> col W i = inner_prod (col W j) (col W i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
conjugate (col W j) \<bullet> col W i = inner_prod (col W j) (col W i)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
conjugate (col W j) \<bullet> col W i = inner_prod (col W j) (col W i)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have "\<dots> = (vs ! i) \<bullet>c (vs ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner_prod (col W j) (col W i) = inner_prod (vs ! j) (vs ! i)
[PROOF STEP]
using W_def col_mat_of_cols i j len cWk
[PROOF STATE]
proof (prove)
using this:
W = mat_of_cols n vs
\<lbrakk>?j < length ?vs; ?vs ! ?j \<in> carrier_vec ?n\<rbrakk> \<Longrightarrow> col (mat_of_cols ?n ?vs) ?j = ?vs ! ?j
i < n
j < n
length ws = n
?k < n \<Longrightarrow> col W ?k = vs ! ?k

goal (1 subgoal):
 1. inner_prod (col W j) (col W i) = inner_prod (vs ! j) (vs ! i)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inner_prod (col W j) (col W i) = inner_prod (vs ! j) (vs ! i)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(adjoint W * W) $$ (j, i) = inner_prod (vs ! j) (vs ! i)
[PROOF STEP]
have "(mat_adjoint W * W) $$ (j, i) = (vs ! i) \<bullet>c (vs ! j)"
[PROOF STATE]
proof (prove)
using this:
(adjoint W * W) $$ (j, i) = inner_prod (vs ! j) (vs ! i)

goal (1 subgoal):
 1. (adjoint W * W) $$ (j, i) = inner_prod (vs ! j) (vs ! i)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(adjoint W * W) $$ (j, i) = inner_prod (vs ! j) (vs ! i)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(adjoint W * W) $$ (j, i) = inner_prod (vs ! j) (vs ! i)
[PROOF STEP]
have "(mat_adjoint W * W) $$ (j, i) = (if (j = i) then 1 else 0)"
[PROOF STATE]
proof (prove)
using this:
(adjoint W * W) $$ (j, i) = inner_prod (vs ! j) (vs ! i)

goal (1 subgoal):
 1. (adjoint W * W) $$ (j, i) = (if j = i then 1 else 0)
[PROOF STEP]
by (auto simp add: ii1 ij0')
[PROOF STATE]
proof (state)
this:
(adjoint W * W) $$ (j, i) = (if j = i then 1 else 0)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> (adjoint W * W) $$ (?j2, ?i2) = (if ?j2 = ?i2 then 1 else 0)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
note maWW = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> (adjoint W * W) $$ (?j2, ?i2) = (if ?j2 = ?i2 then 1 else 0)

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> (adjoint W * W) $$ (?j2, ?i2) = (if ?j2 = ?i2 then 1 else 0)
[PROOF STEP]
have "mat_adjoint W * W = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> (adjoint W * W) $$ (?j2, ?i2) = (if ?j2 = ?i2 then 1 else 0)

goal (1 subgoal):
 1. adjoint W * W = 1\<^sub>m n
[PROOF STEP]
unfolding one_mat_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> (adjoint W * W) $$ (?j2, ?i2) = (if ?j2 = ?i2 then 1 else 0)

goal (1 subgoal):
 1. adjoint W * W = mat n n (\<lambda>(i, j). if i = j then 1 else 0)
[PROOF STEP]
using dimW dimaW
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?i2 < n; ?j2 < n\<rbrakk> \<Longrightarrow> (adjoint W * W) $$ (?j2, ?i2) = (if ?j2 = ?i2 then 1 else 0)
W \<in> carrier_mat n n
adjoint W \<in> carrier_mat n n

goal (1 subgoal):
 1. adjoint W * W = mat n n (\<lambda>(i, j). if i = j then 1 else 0)
[PROOF STEP]
by (auto simp add: maWW adjoint_def)
[PROOF STATE]
proof (state)
this:
adjoint W * W = 1\<^sub>m n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
adjoint W * W = 1\<^sub>m n
[PROOF STEP]
have iv0: "adjoint W * W = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
adjoint W * W = 1\<^sub>m n

goal (1 subgoal):
 1. adjoint W * W = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
adjoint W * W = 1\<^sub>m n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
have dimaW: "adjoint W \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. adjoint W \<in> carrier_mat n n
[PROOF STEP]
using dimaW
[PROOF STATE]
proof (prove)
using this:
adjoint W \<in> carrier_mat n n

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

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
adjoint W \<in> carrier_mat n n
[PROOF STEP]
have iv1: "W * adjoint W  = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
using this:
adjoint W \<in> carrier_mat n n

goal (1 subgoal):
 1. W * adjoint W = 1\<^sub>m n
[PROOF STEP]
using mat_mult_left_right_inverse dimW iv0
[PROOF STATE]
proof (prove)
using this:
adjoint W \<in> carrier_mat n n
\<lbrakk>?A \<in> carrier_mat ?n ?n; ?B \<in> carrier_mat ?n ?n; ?A * ?B = 1\<^sub>m ?n\<rbrakk> \<Longrightarrow> ?B * ?A = 1\<^sub>m ?n
W \<in> carrier_mat n n
adjoint W * W = 1\<^sub>m n

goal (1 subgoal):
 1. W * adjoint W = 1\<^sub>m n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
W * adjoint W = 1\<^sub>m n

goal (1 subgoal):
 1. unitary (mat_of_cols n (map vec_normalize ws))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
W * adjoint W = 1\<^sub>m n
[PROOF STEP]
show "unitary W"
[PROOF STATE]
proof (prove)
using this:
W * adjoint W = 1\<^sub>m n

goal (1 subgoal):
 1. unitary W
[PROOF STEP]
unfolding unitary_def inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
W * adjoint W = 1\<^sub>m n

goal (1 subgoal):
 1. W \<in> carrier_mat (dim_row W) (dim_row W) \<and> W * adjoint W = 1\<^sub>m (dim_row W)
[PROOF STEP]
using dimW dimaW iv0 iv1
[PROOF STATE]
proof (prove)
using this:
W * adjoint W = 1\<^sub>m n
W \<in> carrier_mat n n
adjoint W \<in> carrier_mat n n
adjoint W * W = 1\<^sub>m n
W * adjoint W = 1\<^sub>m n

goal (1 subgoal):
 1. W \<in> carrier_mat (dim_row W) (dim_row W) \<and> W * adjoint W = 1\<^sub>m (dim_row W)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
unitary W

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma maximal_existence_flowI:
  assumes "(x has_vderiv_on (\<lambda>t. f t (x t))) K"
  assumes "\<And>t. t \<in> K \<Longrightarrow> x t \<in> X"
  assumes "x t0 = x0"
  assumes K: "is_interval K" "t0 \<in> K" "K \<subseteq> T"
  shows "K \<subseteq> existence_ivl t0 x0" "\<And>t. t \<in> K \<Longrightarrow> flow t0 x0 t = x t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. K \<subseteq> existence_ivl t0 x0 &&& (\<And>t. t \<in> K \<Longrightarrow> flow t0 x0 t = x t)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. K \<subseteq> existence_ivl t0 x0
 2. \<And>t. t \<in> K \<Longrightarrow> flow t0 x0 t = x t
[PROOF STEP]
from assms(1,2)
[PROOF STATE]
proof (chain)
picking this:
(x has_vderiv_on (\<lambda>t. f t (x t))) K
?t \<in> K \<Longrightarrow> x ?t \<in> X
[PROOF STEP]
have sol: "(x solves_ode f) K X"
[PROOF STATE]
proof (prove)
using this:
(x has_vderiv_on (\<lambda>t. f t (x t))) K
?t \<in> K \<Longrightarrow> x ?t \<in> X

goal (1 subgoal):
 1. (x solves_ode f) K X
[PROOF STEP]
by (rule solves_odeI)
[PROOF STATE]
proof (state)
this:
(x solves_ode f) K X

goal (2 subgoals):
 1. K \<subseteq> existence_ivl t0 x0
 2. \<And>t. t \<in> K \<Longrightarrow> flow t0 x0 t = x t
[PROOF STEP]
from maximal_existence_flow[OF sol assms(3) K]
[PROOF STATE]
proof (chain)
picking this:
K \<subseteq> existence_ivl t0 x0
?t \<in> K \<Longrightarrow> flow t0 x0 ?t = x ?t
[PROOF STEP]
show "K \<subseteq> existence_ivl t0 x0" "\<And>t. t \<in> K \<Longrightarrow> flow t0 x0 t = x t"
[PROOF STATE]
proof (prove)
using this:
K \<subseteq> existence_ivl t0 x0
?t \<in> K \<Longrightarrow> flow t0 x0 ?t = x ?t

goal (1 subgoal):
 1. K \<subseteq> existence_ivl t0 x0 &&& (\<And>t. t \<in> K \<Longrightarrow> flow t0 x0 t = x t)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
K \<subseteq> existence_ivl t0 x0
?t \<in> K \<Longrightarrow> flow t0 x0 ?t = x ?t

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cbnd_mono: assumes "b \<le> d" shows "cbnd (a::nat) b \<le> cbnd a d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbnd a b \<le> cbnd a d
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cbnd a b \<le> cbnd a d
[PROOF STEP]
have "cbnd (a::nat) b \<le> cbnd a (b + d)" for b d
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cbnd a b \<le> cbnd a (b + d)
[PROOF STEP]
by(induction d arbitrary: a b; simp) (insert le_trans cbnd_grow, blast)
[PROOF STATE]
proof (state)
this:
cbnd a ?b \<le> cbnd a (?b + ?d)

goal (1 subgoal):
 1. cbnd a b \<le> cbnd a d
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cbnd a ?b \<le> cbnd a (?b + ?d)

goal (1 subgoal):
 1. cbnd a b \<le> cbnd a d
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cbnd a ?b \<le> cbnd a (?b + ?d)
b \<le> d

goal (1 subgoal):
 1. cbnd a b \<le> cbnd a d
[PROOF STEP]
using le_Suc_ex
[PROOF STATE]
proof (prove)
using this:
cbnd a ?b \<le> cbnd a (?b + ?d)
b \<le> d
?k \<le> ?l \<Longrightarrow> \<exists>n. ?l = ?k + n

goal (1 subgoal):
 1. cbnd a b \<le> cbnd a d
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cbnd a b \<le> cbnd a d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_card:
  fixes U :: "'a set set"
    and n :: nat
  assumes "\<forall>S \<in> U. card S \<le> n"
  shows "sum card U \<le> card U * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum card U \<le> card U * n
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> sum card U \<le> card U * n
 2. \<not> ?P \<Longrightarrow> sum card U \<le> card U * n
[PROOF STEP]
assume "infinite U \<or> U = {}"
[PROOF STATE]
proof (state)
this:
infinite U \<or> U = {}

goal (2 subgoals):
 1. ?P \<Longrightarrow> sum card U \<le> card U * n
 2. \<not> ?P \<Longrightarrow> sum card U \<le> card U * n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite U \<or> U = {}
[PROOF STEP]
have "sum card U = 0"
[PROOF STATE]
proof (prove)
using this:
infinite U \<or> U = {}

goal (1 subgoal):
 1. sum card U = 0
[PROOF STEP]
using sum.infinite
[PROOF STATE]
proof (prove)
using this:
infinite U \<or> U = {}
infinite ?A \<Longrightarrow> sum ?g ?A = (0::?'a)

goal (1 subgoal):
 1. sum card U = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum card U = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> sum card U \<le> card U * n
 2. \<not> ?P \<Longrightarrow> sum card U \<le> card U * n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum card U = 0
[PROOF STEP]
show "sum card U \<le> card U * n"
[PROOF STATE]
proof (prove)
using this:
sum card U = 0

goal (1 subgoal):
 1. sum card U \<le> card U * n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum card U \<le> card U * n

goal (1 subgoal):
 1. \<not> (infinite U \<or> U = {}) \<Longrightarrow> sum card U \<le> card U * n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (infinite U \<or> U = {}) \<Longrightarrow> sum card U \<le> card U * n
[PROOF STEP]
assume "\<not>(infinite U \<or> U = {})"
[PROOF STATE]
proof (state)
this:
\<not> (infinite U \<or> U = {})

goal (1 subgoal):
 1. \<not> (infinite U \<or> U = {}) \<Longrightarrow> sum card U \<le> card U * n
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>S\<in>U. card S \<le> n
\<not> (infinite U \<or> U = {})
[PROOF STEP]
have "finite U" and "U \<noteq> {}"and "\<forall>S \<in> U. card S \<le> n"
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<in>U. card S \<le> n
\<not> (infinite U \<or> U = {})

goal (1 subgoal):
 1. finite U &&& U \<noteq> {} &&& \<forall>S\<in>U. card S \<le> n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite U
U \<noteq> {}
\<forall>S\<in>U. card S \<le> n

goal (1 subgoal):
 1. \<not> (infinite U \<or> U = {}) \<Longrightarrow> sum card U \<le> card U * n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite U
U \<noteq> {}
\<forall>S\<in>U. card S \<le> n
[PROOF STEP]
show "sum card U \<le> card U * n"
[PROOF STATE]
proof (prove)
using this:
finite U
U \<noteq> {}
\<forall>S\<in>U. card S \<le> n

goal (1 subgoal):
 1. sum card U \<le> card U * n
[PROOF STEP]
proof (induct U rule: finite_ne_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. \<forall>S\<in>{x}. card S \<le> n \<Longrightarrow> sum card {x} \<le> card {x} * n
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
case (singleton x)
[PROOF STATE]
proof (state)
this:
\<forall>S\<in>{x}. card S \<le> n

goal (2 subgoals):
 1. \<And>x. \<forall>S\<in>{x}. card S \<le> n \<Longrightarrow> sum card {x} \<le> card {x} * n
 2. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>S\<in>{x}. card S \<le> n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<in>{x}. card S \<le> n

goal (1 subgoal):
 1. sum card {x} \<le> card {x} * n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum card {x} \<le> card {x} * n

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
F \<noteq> {}
x \<notin> F
\<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n
\<forall>S\<in>insert x F. card S \<le> n

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
assume "\<forall>S\<in>insert x F. card S \<le> n"
[PROOF STATE]
proof (state)
this:
\<forall>S\<in>insert x F. card S \<le> n

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>S\<in>insert x F. card S \<le> n
[PROOF STEP]
have 1:"card x \<le> n" and 2:"sum card F \<le> card F * n"
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<in>insert x F. card S \<le> n

goal (1 subgoal):
 1. card x \<le> n &&& sum card F \<le> card F * n
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
\<forall>S\<in>insert x F. card S \<le> n
finite F
F \<noteq> {}
x \<notin> F
\<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n

goal (1 subgoal):
 1. card x \<le> n &&& sum card F \<le> card F * n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card x \<le> n
sum card F \<le> card F * n

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card x \<le> n
sum card F \<le> card F * n
[PROOF STEP]
have "sum card (insert x F) = card x + sum card F"
[PROOF STATE]
proof (prove)
using this:
card x \<le> n
sum card F \<le> card F * n

goal (1 subgoal):
 1. sum card (insert x F) = card x + sum card F
[PROOF STEP]
using sum.insert_if and insert.hyps
[PROOF STATE]
proof (prove)
using this:
card x \<le> n
sum card F \<le> card F * n
finite ?A \<Longrightarrow> sum ?g (insert ?x ?A) = (if ?x \<in> ?A then sum ?g ?A else ?g ?x + sum ?g ?A)
finite F
F \<noteq> {}
x \<notin> F
\<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n

goal (1 subgoal):
 1. sum card (insert x F) = card x + sum card F
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
sum card (insert x F) = card x + sum card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum card (insert x F) = card x + sum card F

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
have "... \<le> n + card F * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card x + sum card F \<le> n + card F * n
[PROOF STEP]
using 1 and 2
[PROOF STATE]
proof (prove)
using this:
card x \<le> n
sum card F \<le> card F * n

goal (1 subgoal):
 1. card x + sum card F \<le> n + card F * n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card x + sum card F \<le> n + card F * n

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
card x + sum card F \<le> n + card F * n

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
have "... = card (insert x F) * n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n + card F * n = card (insert x F) * n
[PROOF STEP]
using card_insert_if and insert.hyps
[PROOF STATE]
proof (prove)
using this:
finite ?A \<Longrightarrow> card (insert ?x ?A) = (if ?x \<in> ?A then card ?A else Suc (card ?A))
finite F
F \<noteq> {}
x \<notin> F
\<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n

goal (1 subgoal):
 1. n + card F * n = card (insert x F) * n
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n + card F * n = card (insert x F) * n

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; F \<noteq> {}; x \<notin> F; \<forall>S\<in>F. card S \<le> n \<Longrightarrow> sum card F \<le> card F * n; \<forall>S\<in>insert x F. card S \<le> n\<rbrakk> \<Longrightarrow> sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
sum card (insert x F) \<le> card (insert x F) * n

goal (1 subgoal):
 1. sum card (insert x F) \<le> card (insert x F) * n
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum card (insert x F) \<le> card (insert x F) * n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
sum card U \<le> card U * n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma x_in_trapC:
  shows "(2,0) \<in> trapC"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2, 0) \<in> trapC
[PROOF STEP]
unfolding trapC_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2, 0) \<in> cball (0, 0) 2 - ball (0, 0) (1 / 2)
[PROOF STEP]
by (auto simp add: dist_Pair_Pair)


[STATEMENT]
lemma card_of_lists: "|A| \<le>o |lists A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A| \<le>o |lists A|
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |A| \<le>o |lists A|
[PROOF STEP]
let ?h = "\<lambda> a. [a]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. |A| \<le>o |lists A|
[PROOF STEP]
have "inj_on ?h A \<and> ?h ` A \<le> lists A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>a. [a]) A \<and> (\<lambda>a. [a]) ` A \<subseteq> lists A
[PROOF STEP]
unfolding inj_on_def lists_def2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>A. \<forall>y\<in>A. [x] = [y] \<longrightarrow> x = y) \<and> (\<lambda>a. [a]) ` A \<subseteq> {l. set l \<subseteq> A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>a. [a]) A \<and> (\<lambda>a. [a]) ` A \<subseteq> lists A

goal (1 subgoal):
 1. |A| \<le>o |lists A|
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>a. [a]) A \<and> (\<lambda>a. [a]) ` A \<subseteq> lists A

goal (1 subgoal):
 1. |A| \<le>o |lists A|
[PROOF STEP]
by (metis card_of_ordLeq)
[PROOF STATE]
proof (state)
this:
|A| \<le>o |lists A|

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma induced_edges_union:
  assumes "VH1 \<subseteq> S" "VH2 \<subseteq> T"
  assumes "graph_system VH1 EH1" "graph_system VH2 EH2"
  assumes "EH1 \<union> EH2 \<subseteq> (induced_edges (S \<union> T))"
  shows "EH1 \<subseteq> (induced_edges S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EH1 \<subseteq> induced_edges S
[PROOF STEP]
proof (intro subsetI, simp add: induced_edges_def, intro conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x. x \<in> EH1 \<Longrightarrow> x \<in> E
 2. \<And>x. x \<in> EH1 \<Longrightarrow> x \<subseteq> S
[PROOF STEP]
show "\<And>x. x \<in> EH1 \<Longrightarrow> x \<in> E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> EH1 \<Longrightarrow> x \<in> E
[PROOF STEP]
using assms(5)
[PROOF STATE]
proof (prove)
using this:
EH1 \<union> EH2 \<subseteq> induced_edges (S \<union> T)

goal (1 subgoal):
 1. \<And>x. x \<in> EH1 \<Longrightarrow> x \<in> E
[PROOF STEP]
by (simp add: induced_edges_def subset_iff)
[PROOF STATE]
proof (state)
this:
?x \<in> EH1 \<Longrightarrow> ?x \<in> E

goal (1 subgoal):
 1. \<And>x. x \<in> EH1 \<Longrightarrow> x \<subseteq> S
[PROOF STEP]
show "\<And>x. x \<in> EH1 \<Longrightarrow> x \<subseteq> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> EH1 \<Longrightarrow> x \<subseteq> S
[PROOF STEP]
using assms(1) assms(3) graph_system.wellformed
[PROOF STATE]
proof (prove)
using this:
VH1 \<subseteq> S
graph_system VH1 EH1
\<lbrakk>graph_system ?vertices ?edges; ?e \<in> ?edges\<rbrakk> \<Longrightarrow> ?e \<subseteq> ?vertices

goal (1 subgoal):
 1. \<And>x. x \<in> EH1 \<Longrightarrow> x \<subseteq> S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?x \<in> EH1 \<Longrightarrow> ?x \<subseteq> S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ce_set_lm_7: "\<lbrakk> A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> { p x | x. x \<in> A } \<in> ce_sets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
assume A1: "A \<in> ce_sets"
[PROOF STATE]
proof (state)
this:
A \<in> ce_sets

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
assume A2: "p \<in> PrimRec1"
[PROOF STATE]
proof (state)
this:
p \<in> PrimRec1

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
let ?B = "{ p x | x. x \<in> A }"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
have S1: "(y \<in> ?B) = (\<exists> x. x \<in> A \<and> (y = p x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<in> {p x |x. x \<in> A}) = (\<exists>x. x \<in> A \<and> y = p x)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(y \<in> {p x |x. x \<in> A}) = (\<exists>x. x \<in> A \<and> y = p x)

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
from A1
[PROOF STATE]
proof (chain)
picking this:
A \<in> ce_sets
[PROOF STEP]
have "\<exists> pA \<in> PrimRec2. A = fn_to_set pA"
[PROOF STATE]
proof (prove)
using this:
A \<in> ce_sets

goal (1 subgoal):
 1. \<exists>pA\<in>PrimRec2. A = fn_to_set pA
[PROOF STEP]
by (rule ce_set_lm_3)
[PROOF STATE]
proof (state)
this:
\<exists>pA\<in>PrimRec2. A = fn_to_set pA

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>pA\<in>PrimRec2. A = fn_to_set pA
[PROOF STEP]
obtain pA where pA_is_pr: "pA \<in> PrimRec2" and S2: "A = fn_to_set pA"
[PROOF STATE]
proof (prove)
using this:
\<exists>pA\<in>PrimRec2. A = fn_to_set pA

goal (1 subgoal):
 1. (\<And>pA. \<lbrakk>pA \<in> PrimRec2; A = fn_to_set pA\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
pA \<in> PrimRec2
A = fn_to_set pA

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
from S2
[PROOF STATE]
proof (chain)
picking this:
A = fn_to_set pA
[PROOF STEP]
have S3: "A = { x. \<exists> y. pA x y = 0 }"
[PROOF STATE]
proof (prove)
using this:
A = fn_to_set pA

goal (1 subgoal):
 1. A = {x. \<exists>y. pA x y = 0}
[PROOF STEP]
by (simp add: fn_to_set_def)
[PROOF STATE]
proof (state)
this:
A = {x. \<exists>y. pA x y = 0}

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
define q where "q y t = (if y = p (c_snd t) then pA (c_snd t) (c_fst t) else 1)" for y t
[PROOF STATE]
proof (state)
this:
q ?y ?t = (if ?y = p (c_snd ?t) then pA (c_snd ?t) (c_fst ?t) else 1)

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
from pA_is_pr A2
[PROOF STATE]
proof (chain)
picking this:
pA \<in> PrimRec2
p \<in> PrimRec1
[PROOF STEP]
have q_is_pr: "q \<in> PrimRec2"
[PROOF STATE]
proof (prove)
using this:
pA \<in> PrimRec2
p \<in> PrimRec1

goal (1 subgoal):
 1. q \<in> PrimRec2
[PROOF STEP]
unfolding q_def
[PROOF STATE]
proof (prove)
using this:
pA \<in> PrimRec2
p \<in> PrimRec1

goal (1 subgoal):
 1. (\<lambda>y t. if y = p (c_snd t) then pA (c_snd t) (c_fst t) else 1) \<in> PrimRec2
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
q \<in> PrimRec2

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
have L1: "\<And> y. (y \<in> ?B) = (\<exists> z. q y z = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. (y \<in> {p x |x. x \<in> A}) = (\<exists>z. q y z = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. (y \<in> {p x |x. x \<in> A}) = (\<exists>z. q y z = 0)
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. (y \<in> {p x |x. x \<in> A}) = (\<exists>z. q y z = 0)
[PROOF STEP]
show "(y \<in> ?B) = (\<exists> z. q y z = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (y \<in> {p x |x. x \<in> A}) = (\<exists>z. q y z = 0)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. y \<in> {p x |x. x \<in> A} \<Longrightarrow> \<exists>z. q y z = 0
 2. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
assume AA1: "y \<in> ?B"
[PROOF STATE]
proof (state)
this:
y \<in> {p x |x. x \<in> A}

goal (2 subgoals):
 1. y \<in> {p x |x. x \<in> A} \<Longrightarrow> \<exists>z. q y z = 0
 2. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<in> {p x |x. x \<in> A}
[PROOF STEP]
obtain x0 where LL_2: "x0 \<in> A" and LL_3: "y = p x0"
[PROOF STATE]
proof (prove)
using this:
y \<in> {p x |x. x \<in> A}

goal (1 subgoal):
 1. (\<And>x0. \<lbrakk>x0 \<in> A; y = p x0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x0 \<in> A
y = p x0

goal (2 subgoals):
 1. y \<in> {p x |x. x \<in> A} \<Longrightarrow> \<exists>z. q y z = 0
 2. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
from S3
[PROOF STATE]
proof (chain)
picking this:
A = {x. \<exists>y. pA x y = 0}
[PROOF STEP]
have LL_4: "(x0 \<in> A) = (\<exists> z. pA x0 z = 0)"
[PROOF STATE]
proof (prove)
using this:
A = {x. \<exists>y. pA x y = 0}

goal (1 subgoal):
 1. (x0 \<in> A) = (\<exists>z. pA x0 z = 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(x0 \<in> A) = (\<exists>z. pA x0 z = 0)

goal (2 subgoals):
 1. y \<in> {p x |x. x \<in> A} \<Longrightarrow> \<exists>z. q y z = 0
 2. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
from LL_2 LL_4
[PROOF STATE]
proof (chain)
picking this:
x0 \<in> A
(x0 \<in> A) = (\<exists>z. pA x0 z = 0)
[PROOF STEP]
obtain z0 where LL_5: "pA x0 z0 = 0"
[PROOF STATE]
proof (prove)
using this:
x0 \<in> A
(x0 \<in> A) = (\<exists>z. pA x0 z = 0)

goal (1 subgoal):
 1. (\<And>z0. pA x0 z0 = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pA x0 z0 = 0

goal (2 subgoals):
 1. y \<in> {p x |x. x \<in> A} \<Longrightarrow> \<exists>z. q y z = 0
 2. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
define t where "t = c_pair z0 x0"
[PROOF STATE]
proof (state)
this:
t = c_pair z0 x0

goal (2 subgoals):
 1. y \<in> {p x |x. x \<in> A} \<Longrightarrow> \<exists>z. q y z = 0
 2. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
from t_def q_def LL_3 LL_5
[PROOF STATE]
proof (chain)
picking this:
t = c_pair z0 x0
q ?y ?t = (if ?y = p (c_snd ?t) then pA (c_snd ?t) (c_fst ?t) else 1)
y = p x0
pA x0 z0 = 0
[PROOF STEP]
have "q y t = 0"
[PROOF STATE]
proof (prove)
using this:
t = c_pair z0 x0
q ?y ?t = (if ?y = p (c_snd ?t) then pA (c_snd ?t) (c_fst ?t) else 1)
y = p x0
pA x0 z0 = 0

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

goal (2 subgoals):
 1. y \<in> {p x |x. x \<in> A} \<Longrightarrow> \<exists>z. q y z = 0
 2. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
q y t = 0
[PROOF STEP]
show "\<exists> z. q y z = 0"
[PROOF STATE]
proof (prove)
using this:
q y t = 0

goal (1 subgoal):
 1. \<exists>z. q y z = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>z. q y z = 0

goal (1 subgoal):
 1. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
assume A1: "\<exists> z. q y z = 0"
[PROOF STATE]
proof (state)
this:
\<exists>z. q y z = 0

goal (1 subgoal):
 1. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>z. q y z = 0
[PROOF STEP]
obtain z0 where LL_1: "q y z0 = 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>z. q y z = 0

goal (1 subgoal):
 1. (\<And>z0. q y z0 = 0 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
q y z0 = 0

goal (1 subgoal):
 1. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
have LL2: "y = p (c_snd z0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y = p (c_snd z0)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y \<noteq> p (c_snd z0) \<Longrightarrow> False
[PROOF STEP]
assume "y \<noteq> p (c_snd z0)"
[PROOF STATE]
proof (state)
this:
y \<noteq> p (c_snd z0)

goal (1 subgoal):
 1. y \<noteq> p (c_snd z0) \<Longrightarrow> False
[PROOF STEP]
with q_def LL_1
[PROOF STATE]
proof (chain)
picking this:
q ?y ?t = (if ?y = p (c_snd ?t) then pA (c_snd ?t) (c_fst ?t) else 1)
q y z0 = 0
y \<noteq> p (c_snd z0)
[PROOF STEP]
have "q y z0 = 1"
[PROOF STATE]
proof (prove)
using this:
q ?y ?t = (if ?y = p (c_snd ?t) then pA (c_snd ?t) (c_fst ?t) else 1)
q y z0 = 0
y \<noteq> p (c_snd z0)

goal (1 subgoal):
 1. q y z0 = 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q y z0 = 1

goal (1 subgoal):
 1. y \<noteq> p (c_snd z0) \<Longrightarrow> False
[PROOF STEP]
with LL_1
[PROOF STATE]
proof (chain)
picking this:
q y z0 = 0
q y z0 = 1
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
q y z0 = 0
q y z0 = 1

goal (1 subgoal):
 1. False
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
y = p (c_snd z0)

goal (1 subgoal):
 1. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
from LL2 LL_1 q_def
[PROOF STATE]
proof (chain)
picking this:
y = p (c_snd z0)
q y z0 = 0
q ?y ?t = (if ?y = p (c_snd ?t) then pA (c_snd ?t) (c_fst ?t) else 1)
[PROOF STEP]
have LL3: "pA (c_snd z0) (c_fst z0) = 0"
[PROOF STATE]
proof (prove)
using this:
y = p (c_snd z0)
q y z0 = 0
q ?y ?t = (if ?y = p (c_snd ?t) then pA (c_snd ?t) (c_fst ?t) else 1)

goal (1 subgoal):
 1. pA (c_snd z0) (c_fst z0) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
pA (c_snd z0) (c_fst z0) = 0

goal (1 subgoal):
 1. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
with S3
[PROOF STATE]
proof (chain)
picking this:
A = {x. \<exists>y. pA x y = 0}
pA (c_snd z0) (c_fst z0) = 0
[PROOF STEP]
have LL4: "c_snd z0 \<in> A"
[PROOF STATE]
proof (prove)
using this:
A = {x. \<exists>y. pA x y = 0}
pA (c_snd z0) (c_fst z0) = 0

goal (1 subgoal):
 1. c_snd z0 \<in> A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
c_snd z0 \<in> A

goal (1 subgoal):
 1. \<exists>z. q y z = 0 \<Longrightarrow> y \<in> {p x |x. x \<in> A}
[PROOF STEP]
with LL2
[PROOF STATE]
proof (chain)
picking this:
y = p (c_snd z0)
c_snd z0 \<in> A
[PROOF STEP]
show "y \<in> {p x | x. x \<in> A}"
[PROOF STATE]
proof (prove)
using this:
y = p (c_snd z0)
c_snd z0 \<in> A

goal (1 subgoal):
 1. y \<in> {p x |x. x \<in> A}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y \<in> {p x |x. x \<in> A}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(y \<in> {p x |x. x \<in> A}) = (\<exists>z. q y z = 0)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(?y \<in> {p x |x. x \<in> A}) = (\<exists>z. q ?y z = 0)

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(?y \<in> {p x |x. x \<in> A}) = (\<exists>z. q ?y z = 0)
[PROOF STEP]
have L2: "?B = { y | y. \<exists> z. q y z = 0}"
[PROOF STATE]
proof (prove)
using this:
(?y \<in> {p x |x. x \<in> A}) = (\<exists>z. q ?y z = 0)

goal (1 subgoal):
 1. {p x |x. x \<in> A} = {y |y. \<exists>z. q y z = 0}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p x |x. x \<in> A} = {y |y. \<exists>z. q y z = 0}

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
with fn_to_set_def
[PROOF STATE]
proof (chain)
picking this:
fn_to_set ?f = {x. \<exists>y. ?f x y = 0}
{p x |x. x \<in> A} = {y |y. \<exists>z. q y z = 0}
[PROOF STEP]
have "?B = fn_to_set q"
[PROOF STATE]
proof (prove)
using this:
fn_to_set ?f = {x. \<exists>y. ?f x y = 0}
{p x |x. x \<in> A} = {y |y. \<exists>z. q y z = 0}

goal (1 subgoal):
 1. {p x |x. x \<in> A} = fn_to_set q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p x |x. x \<in> A} = fn_to_set q

goal (1 subgoal):
 1. \<lbrakk>A \<in> ce_sets; p \<in> PrimRec1\<rbrakk> \<Longrightarrow> {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
with q_is_pr ce_set_lm_1
[PROOF STATE]
proof (chain)
picking this:
q \<in> PrimRec2
?p \<in> PrimRec2 \<Longrightarrow> fn_to_set ?p \<in> ce_sets
{p x |x. x \<in> A} = fn_to_set q
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
q \<in> PrimRec2
?p \<in> PrimRec2 \<Longrightarrow> fn_to_set ?p \<in> ce_sets
{p x |x. x \<in> A} = fn_to_set q

goal (1 subgoal):
 1. {p x |x. x \<in> A} \<in> ce_sets
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{p x |x. x \<in> A} \<in> ce_sets

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma polysubst0_polybound0:
  assumes "polybound0 t"
  shows "polybound0 (polysubst0 t a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. polybound0 (polysubst0 t a)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
polybound0 t

goal (1 subgoal):
 1. polybound0 (polysubst0 t a)
[PROOF STEP]
by (induct a rule: poly.induct) auto


[STATEMENT]
lemma check_eqv_sound:
  "\<lbrakk>#\<^sub>V \<AA> = idx; check_eqv idx \<phi> \<psi>\<rbrakk> \<Longrightarrow> (WS1S.sat \<AA> \<phi> \<longleftrightarrow> WS1S.sat \<AA> \<psi>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>#\<^sub>V \<AA> = idx; check_eqv idx \<phi> \<psi>\<rbrakk> \<Longrightarrow> WS1S.sat \<AA> \<phi> = WS1S.sat \<AA> \<psi>
[PROOF STEP]
unfolding check_eqv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>#\<^sub>V \<AA> = idx; WS1S.check_eqv idx \<phi> \<psi>\<rbrakk> \<Longrightarrow> WS1S.sat \<AA> \<phi> = WS1S.sat \<AA> \<psi>
[PROOF STEP]
by (rule WS1S.check_eqv_soundness)


[STATEMENT]
lemma one_dim_ccsubspace_all_or_nothing: \<open>A = bot \<or> A = top\<close> for A :: \<open>_::one_dim ccsubspace\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = bot \<or> A = top
[PROOF STEP]
proof (rule Meson.disj_comm, rule disjCI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
assume \<open>A \<noteq> bot\<close>
[PROOF STATE]
proof (state)
this:
A \<noteq> bot

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
A \<noteq> bot
[PROOF STEP]
obtain \<psi> where \<open>\<psi> \<in> space_as_set A\<close> and \<open>\<psi> \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
A \<noteq> bot

goal (1 subgoal):
 1. (\<And>\<psi>. \<lbrakk>\<psi> \<in> space_as_set A; \<psi> \<noteq> (0::'b)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis ccsubspace_eqI singleton_iff space_as_set_bot zero_space_as_set)
[PROOF STATE]
proof (state)
this:
\<psi> \<in> space_as_set A
\<psi> \<noteq> (0::'b)

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<psi> \<in> space_as_set A
\<psi> \<noteq> (0::'b)
[PROOF STEP]
have \<open>A \<ge> ccspan {\<psi>}\<close> (is \<open>_ \<ge> \<dots>\<close>)
[PROOF STATE]
proof (prove)
using this:
\<psi> \<in> space_as_set A
\<psi> \<noteq> (0::'b)

goal (1 subgoal):
 1. ccspan {\<psi>} \<le> A
[PROOF STEP]
by (metis bot.extremum ccspan_leqI insert_absorb insert_mono)
[PROOF STATE]
proof (state)
this:
ccspan {\<psi>} \<le> A

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccspan {\<psi>} \<le> A

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
have \<open>\<dots> = ccspan {one_dim_iso \<psi> *\<^sub>C 1}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan {\<psi>} = ccspan {one_dim_iso \<psi> *\<^sub>C (1::'b)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ccspan {\<psi>} = ccspan {one_dim_iso \<psi> *\<^sub>C (1::'b)}

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccspan {\<psi>} = ccspan {one_dim_iso \<psi> *\<^sub>C (1::'b)}

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
have \<open>\<dots> = ccspan {1}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan {one_dim_iso \<psi> *\<^sub>C (1::'b)} = ccspan {1::'b}
[PROOF STEP]
apply (rule ccspan_singleton_scaleC)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_dim_iso \<psi> \<noteq> 0
[PROOF STEP]
using \<open>\<psi> \<noteq> 0\<close> one_dim_iso_of_zero'
[PROOF STATE]
proof (prove)
using this:
\<psi> \<noteq> (0::'b)
one_dim_iso ?x = (0::?'a) \<Longrightarrow> ?x = (0::?'b)

goal (1 subgoal):
 1. one_dim_iso \<psi> \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ccspan {one_dim_iso \<psi> *\<^sub>C (1::'b)} = ccspan {1::'b}

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ccspan {one_dim_iso \<psi> *\<^sub>C (1::'b)} = ccspan {1::'b}

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
have \<open>\<dots> = top\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan {1::'b} = top
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
ccspan {1::'b} = top

goal (1 subgoal):
 1. A \<noteq> bot \<Longrightarrow> A = top
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
top \<le> A
[PROOF STEP]
show \<open>A = top\<close>
[PROOF STATE]
proof (prove)
using this:
top \<le> A

goal (1 subgoal):
 1. A = top
[PROOF STEP]
by (simp add: top.extremum_uniqueI)
[PROOF STATE]
proof (state)
this:
A = top

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_subst_Var_simp2[simp]:
assumes "wls (asSort xs) Y"
shows "((Var xs x) #[Y / x]_xs) = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Var xs x #[Y / x]_xs = Y
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls (asSort xs) Y

goal (1 subgoal):
 1. Var xs x #[Y / x]_xs = Y
[PROOF STEP]
unfolding subst_def
[PROOF STATE]
proof (prove)
using this:
wls (asSort xs) Y

goal (1 subgoal):
 1. Var xs x #[idEnv [x \<leftarrow> Y]_xs] = Y
[PROOF STEP]
by auto


[STATEMENT]
lemma minSet_eq_SomeD: "minSet A = Some x ==> x \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minSet A = Some x \<Longrightarrow> x \<in> A
[PROOF STEP]
apply (unfold minSet_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if A = {} then None else Some (LEAST x. x \<in> A)) = Some x \<Longrightarrow> x \<in> A
[PROOF STEP]
apply (simp split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<noteq> {}; (LEAST x. x \<in> A) = x\<rbrakk> \<Longrightarrow> x \<in> A
[PROOF STEP]
apply (fast intro: LeastI)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma holomorphic_fun_eq_on_connected:
  assumes "f holomorphic_on S" "g holomorphic_on S" and "open S"  "connected S"
      and "\<And>n. (deriv ^^ n) f z = (deriv ^^ n) g z"
      and "z \<in> S" "w \<in> S"
    shows "f w = g w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f w = g w
[PROOF STEP]
proof (rule holomorphic_fun_eq_0_on_connected [of "\<lambda>x. f x - g x" S z, simplified])
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. (\<lambda>x. f x - g x) holomorphic_on S
 2. open S
 3. connected S
 4. \<And>n. (deriv ^^ n) (\<lambda>x. f x - g x) z = 0
 5. z \<in> S
 6. w \<in> S
[PROOF STEP]
show "(\<lambda>x. f x - g x) holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x - g x) holomorphic_on S
[PROOF STEP]
by (intro assms holomorphic_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x - g x) holomorphic_on S

goal (5 subgoals):
 1. open S
 2. connected S
 3. \<And>n. (deriv ^^ n) (\<lambda>x. f x - g x) z = 0
 4. z \<in> S
 5. w \<in> S
[PROOF STEP]
show "\<And>n. (deriv ^^ n) (\<lambda>x. f x - g x) z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (deriv ^^ n) (\<lambda>x. f x - g x) z = 0
[PROOF STEP]
using assms higher_deriv_diff
[PROOF STATE]
proof (prove)
using this:
f holomorphic_on S
g holomorphic_on S
open S
connected S
(deriv ^^ ?n) f z = (deriv ^^ ?n) g z
z \<in> S
w \<in> S
\<lbrakk>?f holomorphic_on ?S; ?g holomorphic_on ?S; open ?S; ?z \<in> ?S\<rbrakk> \<Longrightarrow> (deriv ^^ ?n) (\<lambda>w. ?f w - ?g w) ?z = (deriv ^^ ?n) ?f ?z - (deriv ^^ ?n) ?g ?z

goal (1 subgoal):
 1. \<And>n. (deriv ^^ n) (\<lambda>x. f x - g x) z = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(deriv ^^ ?n) (\<lambda>x. f x - g x) z = 0

goal (4 subgoals):
 1. open S
 2. connected S
 3. z \<in> S
 4. w \<in> S
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma indets_minus_subset: "indets (p - q) \<subseteq> indets p \<union> indets q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. indets (p - q) \<subseteq> indets p \<union> indets q
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indets (p - q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> indets (p - q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
assume "x \<in> indets (p - q)"
[PROOF STATE]
proof (state)
this:
x \<in> indets (p - q)

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p - q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> indets (p - q)
[PROOF STEP]
obtain t where "x \<in> keys t" and "t \<in> keys (p - q)"
[PROOF STATE]
proof (prove)
using this:
x \<in> indets (p - q)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>x \<in> keys t; t \<in> keys (p - q)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis UN_E indets_def)
[PROOF STATE]
proof (state)
this:
x \<in> keys t
t \<in> keys (p - q)

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p - q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
hence "t \<in> keys p \<union> keys q"
[PROOF STATE]
proof (prove)
using this:
x \<in> keys t
t \<in> keys (p - q)

goal (1 subgoal):
 1. t \<in> keys p \<union> keys q
[PROOF STEP]
by (metis keys_minus subsetCE)
[PROOF STATE]
proof (state)
this:
t \<in> keys p \<union> keys q

goal (1 subgoal):
 1. \<And>x. x \<in> indets (p - q) \<Longrightarrow> x \<in> indets p \<union> indets q
[PROOF STEP]
thus "x \<in> indets p \<union> indets q"
[PROOF STATE]
proof (prove)
using this:
t \<in> keys p \<union> keys q

goal (1 subgoal):
 1. x \<in> indets p \<union> indets q
[PROOF STEP]
using indets_def \<open>x \<in> keys t\<close>
[PROOF STATE]
proof (prove)
using this:
t \<in> keys p \<union> keys q
indets ?p = \<Union> (keys ` keys ?p)
x \<in> keys t

goal (1 subgoal):
 1. x \<in> indets p \<union> indets q
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
x \<in> indets p \<union> indets q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_ffact:
  fixes m :: "'a :: {ord, ring_1, comm_monoid_mult, comm_semiring_1_cancel}"
  shows "(\<Prod>i = 0..<n. m - of_nat i) = ffact n m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
have "inj_on (\<lambda>j. j - 1) {1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>j. j - 1) {1..n}
[PROOF STEP]
by (force intro: inj_on_diff_nat)
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>j. j - 1) {1..n}

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inj_on (\<lambda>j. j - 1) {1..n}

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
have "{0..<n} = (\<lambda>j. j - 1) ` {1..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..<n} = (\<lambda>j. j - 1) ` {1..n}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. {0..<n} = (\<lambda>j. j - 1) ` {1..n}
[PROOF STEP]
have "i \<in> (\<lambda>j. j - 1) ` {1..n}" if "i \<in> {0..<n}" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> (\<lambda>j. j - 1) ` {1..n}
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
i \<in> {0..<n}

goal (1 subgoal):
 1. i \<in> (\<lambda>j. j - 1) ` {1..n}
[PROOF STEP]
by (auto intro: image_eqI[where x="i + 1"])
[PROOF STATE]
proof (state)
this:
?i \<in> {0..<n} \<Longrightarrow> ?i \<in> (\<lambda>j. j - 1) ` {1..n}

goal (1 subgoal):
 1. {0..<n} = (\<lambda>j. j - 1) ` {1..n}
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
?i \<in> {0..<n} \<Longrightarrow> ?i \<in> (\<lambda>j. j - 1) ` {1..n}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?i \<in> {0..<n} \<Longrightarrow> ?i \<in> (\<lambda>j. j - 1) ` {1..n}

goal (1 subgoal):
 1. {0..<n} = (\<lambda>j. j - 1) ` {1..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..<n} = (\<lambda>j. j - 1) ` {1..n}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
{0..<n} = (\<lambda>j. j - 1) ` {1..n}

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{0..<n} = (\<lambda>j. j - 1) ` {1..n}

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
have "m - of_nat (i - 1) = m + 1 - of_nat n + of_nat (n - i)" if "i \<in> {1..n}" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m - of_nat (i - 1) = m + (1::'a) - of_nat n + of_nat (n - i)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
i \<in> {1..n}

goal (1 subgoal):
 1. m - of_nat (i - 1) = m + (1::'a) - of_nat n + of_nat (n - i)
[PROOF STEP]
by (simp add: of_nat_diff)
[PROOF STATE]
proof (state)
this:
?i \<in> {1..n} \<Longrightarrow> m - of_nat (?i - 1) = m + (1::'a) - of_nat n + of_nat (n - ?i)

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
inj_on (\<lambda>j. j - 1) {1..n}
{0..<n} = (\<lambda>j. j - 1) ` {1..n}
?i \<in> {1..n} \<Longrightarrow> m - of_nat (?i - 1) = m + (1::'a) - of_nat n + of_nat (n - ?i)
[PROOF STEP]
have "(\<Prod>i = 0..<n. m - of_nat i) = (\<Prod>i = 1..n. m + 1 - of_nat n + of_nat (n - i))"
[PROOF STATE]
proof (prove)
using this:
inj_on (\<lambda>j. j - 1) {1..n}
{0..<n} = (\<lambda>j. j - 1) ` {1..n}
?i \<in> {1..n} \<Longrightarrow> m - of_nat (?i - 1) = m + (1::'a) - of_nat n + of_nat (n - ?i)

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = (\<Prod>i = 1..n. m + (1::'a) - of_nat n + of_nat (n - i))
[PROOF STEP]
by (rule prod.reindex_cong)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<n. m - of_nat i) = (\<Prod>i = 1..n. m + (1::'a) - of_nat n + of_nat (n - i))

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
(\<Prod>i = 0..<n. m - of_nat i) = (\<Prod>i = 1..n. m + (1::'a) - of_nat n + of_nat (n - i))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 0..<n. m - of_nat i) = (\<Prod>i = 1..n. m + (1::'a) - of_nat n + of_nat (n - i))

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = ffact n m
[PROOF STEP]
unfolding ffact_def
[PROOF STATE]
proof (prove)
using this:
(\<Prod>i = 0..<n. m - of_nat i) = (\<Prod>i = 1..n. m + (1::'a) - of_nat n + of_nat (n - i))

goal (1 subgoal):
 1. (\<Prod>i = 0..<n. m - of_nat i) = pochhammer (m + (1::'a) - of_nat n) n
[PROOF STEP]
by (simp only: pochhammer_prod_rev)
[PROOF STATE]
proof (state)
this:
(\<Prod>i = 0..<n. m - of_nat i) = ffact n m

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hom_dvd[intro,simp]: assumes "p dvd q" shows "hom p dvd hom q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hom p dvd hom q
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. hom p dvd hom q
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
p dvd q
[PROOF STEP]
obtain r where "q = p * r"
[PROOF STATE]
proof (prove)
using this:
p dvd q

goal (1 subgoal):
 1. (\<And>r. q = p * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
\<exists>k. q = p * k

goal (1 subgoal):
 1. (\<And>r. q = p * r \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
q = p * r

goal (1 subgoal):
 1. hom p dvd hom q
[PROOF STEP]
from arg_cong[OF this, of hom]
[PROOF STATE]
proof (chain)
picking this:
hom q = hom (p * r)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
hom q = hom (p * r)

goal (1 subgoal):
 1. hom p dvd hom q
[PROOF STEP]
unfolding dvd_def
[PROOF STATE]
proof (prove)
using this:
hom q = hom (p * r)

goal (1 subgoal):
 1. \<exists>k. hom q = hom p * k
[PROOF STEP]
by (auto simp: hom_distribs)
[PROOF STATE]
proof (state)
this:
hom p dvd hom q

goal:
No subgoals!
[PROOF STEP]
qed