[STATEMENT]
lemma add_col_sub_row_carrier[simp]:
  "dim_row (add_col_sub_row a k l A) = dim_row A"
  "dim_col (add_col_sub_row a k l A) = dim_col A"
  "A \<in> carrier_mat n n \<Longrightarrow> add_col_sub_row a k l A \<in> carrier_mat n n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (add_col_sub_row a k l A) = dim_row A &&& dim_col (add_col_sub_row a k l A) = dim_col A &&& (A \<in> carrier_mat n n \<Longrightarrow> add_col_sub_row a k l A \<in> carrier_mat n n)
[PROOF STEP]
unfolding add_col_sub_row_def carrier_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (addrow (- a) k l (addcol a l k A)) = dim_row A &&& dim_col (addrow (- a) k l (addcol a l k A)) = dim_col A &&& (A \<in> {m. dim_row m = n \<and> dim_col m = n} \<Longrightarrow> addrow (- a) k l (addcol a l k A) \<in> {m. dim_row m = n \<and> dim_col m = n})
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_merge_pairs: "mset_heap (merge_pairs hs) = sum_mset(image_mset mset_hp (mset hs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_heap (merge_pairs hs) = \<Sum>\<^sub># (image_mset mset_hp (mset hs))
[PROOF STEP]
by(induction hs rule: merge_pairs.induct)
  (auto simp: mset_merge mset_link mset_heap_def Let_def split: option.split)


[STATEMENT]
lemma prime_elem_aprimedivisor_nat: "d > Suc 0 \<Longrightarrow> prime_elem (aprimedivisor d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suc 0 < d \<Longrightarrow> prime_elem (aprimedivisor d)
[PROOF STEP]
using prime_aprimedivisor'[of d]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>d \<noteq> 0; \<not> is_unit d\<rbrakk> \<Longrightarrow> prime (aprimedivisor d)

goal (1 subgoal):
 1. Suc 0 < d \<Longrightarrow> prime_elem (aprimedivisor d)
[PROOF STEP]
by simp


[STATEMENT]
lemma iT_Mult_iAll_i_expand_nth_iff:
  "0 < k \<Longrightarrow> (\<box> t (I \<otimes> k). P ((f \<odot>\<^sub>i k) t)) = (\<box> t I. P (f t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> (\<box> t I \<otimes> k. P ((f \<odot> k) t)) = (\<box> t I. P (f t))
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < k; \<box> t I \<otimes> k. P ((f \<odot> k) t)\<rbrakk> \<Longrightarrow> \<box> t I. P (f t)
 2. \<lbrakk>0 < k; \<box> t I. P (f t)\<rbrakk> \<Longrightarrow> \<box> t I \<otimes> k. P ((f \<odot> k) t)
[PROOF STEP]
apply clarify
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t. \<lbrakk>0 < k; \<box> t I \<otimes> k. P ((f \<odot> k) t); t \<in> I\<rbrakk> \<Longrightarrow> P (f t)
 2. \<lbrakk>0 < k; \<box> t I. P (f t)\<rbrakk> \<Longrightarrow> \<box> t I \<otimes> k. P ((f \<odot> k) t)
[PROOF STEP]
apply (drule_tac t="t * k" in ispec)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>t. \<lbrakk>0 < k; t \<in> I\<rbrakk> \<Longrightarrow> t * k \<in> I \<otimes> k
 2. \<And>t. \<lbrakk>0 < k; t \<in> I; P ((f \<odot> k) (t * k))\<rbrakk> \<Longrightarrow> P (f t)
 3. \<lbrakk>0 < k; \<box> t I. P (f t)\<rbrakk> \<Longrightarrow> \<box> t I \<otimes> k. P ((f \<odot> k) t)
[PROOF STEP]
apply (simp add: iT_Mult_mem_iff2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t. \<lbrakk>0 < k; t \<in> I; P ((f \<odot> k) (t * k))\<rbrakk> \<Longrightarrow> P (f t)
 2. \<lbrakk>0 < k; \<box> t I. P (f t)\<rbrakk> \<Longrightarrow> \<box> t I \<otimes> k. P ((f \<odot> k) t)
[PROOF STEP]
apply (simp add: i_expand_nth_mult)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < k; \<box> t I. P (f t)\<rbrakk> \<Longrightarrow> \<box> t I \<otimes> k. P ((f \<odot> k) t)
[PROOF STEP]
apply (fastforce simp: iT_Mult_mem_iff mult.commute[of k] i_expand_nth_mod_eq_0)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bounded_le_Sup:
  assumes "bounded (f ` S)"
  shows "\<forall>x\<in>S. norm (f x) \<le> Sup (norm ` f ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>S. norm (f x) \<le> Sup (norm ` f ` S)
[PROOF STEP]
by (auto intro!: cSup_upper bounded_imp_bdd_above simp: bounded_norm_comp assms)


[STATEMENT]
lemma fine_Un: "d fine p1 \<Longrightarrow> d fine p2 \<Longrightarrow> d fine (p1 \<union> p2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>d fine p1; d fine p2\<rbrakk> \<Longrightarrow> d fine p1 \<union> p2
[PROOF STEP]
unfolding fine_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>(x, k)\<in>p1. k \<subseteq> d x; \<forall>(x, k)\<in>p2. k \<subseteq> d x\<rbrakk> \<Longrightarrow> \<forall>(x, k)\<in>p1 \<union> p2. k \<subseteq> d x
[PROOF STEP]
by blast


[STATEMENT]
lemma subspace_substandard: "subspace {x::'a::euclidean_space. (\<forall>i\<in>Basis. P i \<longrightarrow> x\<bullet>i = 0)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace {x. \<forall>i\<in>Basis. P i \<longrightarrow> x \<bullet> i = 0}
[PROOF STEP]
by (auto simp: subspace_def inner_add_left)


[STATEMENT]
lemma supp_of_multiset_union:
  fixes M N::"('a::fs) multiset"
  shows "supp (M + N) = supp M \<union> supp N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp (M + N) = supp M \<union> supp N
[PROOF STEP]
by (auto simp: supp_of_multisets)


[STATEMENT]
lemma FSet_Lex_Wrapper_UNIV:
  "(UNIV :: 'a FSet_Lex_Wrapper set) = (Wrapp \<circ> Abs_fset) ` (Fpow (UNIV :: 'a set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = (Wrapp \<circ> Abs_fset) ` Fpow UNIV
[PROOF STEP]
by (simp add: comp_def image_def Fpow_def)
       (metis (mono_tags, lifting) Abs_fset_cases Abs_fset_inverse Collect_cong FSet_Lex_Wrapper.induct iso_tuple_UNIV_I mem_Collect_eq top_set_def)


[STATEMENT]
lemma HFinite_inverse: "x \<in> HFinite \<Longrightarrow> x \<notin> Infinitesimal \<Longrightarrow> inverse x \<in> HFinite"
  for x :: "'a::real_normed_div_algebra star"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> HFinite; x \<notin> Infinitesimal\<rbrakk> \<Longrightarrow> inverse x \<in> HFinite
[PROOF STEP]
using HInfinite_inverse_Infinitesimal not_HFinite_HInfinite
[PROOF STATE]
proof (prove)
using this:
?x \<in> HInfinite \<Longrightarrow> inverse ?x \<in> Infinitesimal
?x \<notin> HFinite \<Longrightarrow> ?x \<in> HInfinite

goal (1 subgoal):
 1. \<lbrakk>x \<in> HFinite; x \<notin> Infinitesimal\<rbrakk> \<Longrightarrow> inverse x \<in> HFinite
[PROOF STEP]
by force


[STATEMENT]
lemma finite_cross_intros:
  "\<lbrakk>Re a\<noteq>Re z \<or> Re b \<noteq>Re z; Im a\<noteq>Im z \<or> Im b\<noteq>Im z\<rbrakk>\<Longrightarrow>finite_axes_cross (linepath a b) z"
  "\<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z"
  "\<lbrakk>finite_axes_cross g1 z;finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1+++g2) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z) &&& (\<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z) &&& (\<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z
 2. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 3. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
assume asm:"Re a\<noteq>Re z \<or> Re b \<noteq>Re z" "Im a\<noteq>Im z \<or> Im b\<noteq>Im z"
[PROOF STATE]
proof (state)
this:
Re a \<noteq> Re z \<or> Re b \<noteq> Re z
Im a \<noteq> Im z \<or> Im b \<noteq> Im z

goal (3 subgoals):
 1. \<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z
 2. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 3. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
let ?S1="{t. Re (linepath a b t-z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
  and ?S2="{t. Im (linepath a b t-z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z
 2. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 3. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "finite ?S1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
using linepath_half_finite_inter[of a "Complex 1 0" "Re z" b] asm(1)
[PROOF STATE]
proof (prove)
using this:
a \<bullet> Complex 1 0 \<noteq> Re z \<or> b \<bullet> Complex 1 0 \<noteq> Re z \<Longrightarrow> finite {t. linepath a b t \<bullet> Complex 1 0 = Re z \<and> 0 \<le> t \<and> t \<le> 1}
Re a \<noteq> Re z \<or> Re b \<noteq> Re z

goal (1 subgoal):
 1. finite {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto simp add:inner_complex_def)
[PROOF STATE]
proof (state)
this:
finite {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (3 subgoals):
 1. \<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z
 2. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 3. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (3 subgoals):
 1. \<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z
 2. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 3. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "finite ?S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
using linepath_half_finite_inter[of a "Complex 0 1" "Im z" b] asm(2)
[PROOF STATE]
proof (prove)
using this:
a \<bullet> Complex 0 1 \<noteq> Im z \<or> b \<bullet> Complex 0 1 \<noteq> Im z \<Longrightarrow> finite {t. linepath a b t \<bullet> Complex 0 1 = Im z \<and> 0 \<le> t \<and> t \<le> 1}
Im a \<noteq> Im z \<or> Im b \<noteq> Im z

goal (1 subgoal):
 1. finite {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto simp add:inner_complex_def)
[PROOF STATE]
proof (state)
this:
finite {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (3 subgoals):
 1. \<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z
 2. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 3. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (3 subgoals):
 1. \<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z
 2. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 3. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "{t. (Re (linepath a b t-z) = 0 \<or> Im (linepath a b t-z) = 0) \<and> 0 \<le> t \<and> t \<le> 1}
      = ?S1 \<union> ?S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t. (Re (linepath a b t - z) = 0 \<or> Im (linepath a b t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
{t. (Re (linepath a b t - z) = 0 \<or> Im (linepath a b t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (3 subgoals):
 1. \<lbrakk>Re a \<noteq> Re z \<or> Re b \<noteq> Re z; Im a \<noteq> Im z \<or> Im b \<noteq> Im z\<rbrakk> \<Longrightarrow> finite_axes_cross (linepath a b) z
 2. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 3. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re (linepath a b t - z) = 0 \<or> Im (linepath a b t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
show "finite_axes_cross (linepath a b) z"
[PROOF STATE]
proof (prove)
using this:
finite {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re (linepath a b t - z) = 0 \<or> Im (linepath a b t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite_axes_cross (linepath a b) z
[PROOF STEP]
unfolding finite_axes_cross_def
[PROOF STATE]
proof (prove)
using this:
finite {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re (linepath a b t - z) = 0 \<or> Im (linepath a b t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (linepath a b t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. (Re (linepath a b t - z) = 0 \<or> Im (linepath a b t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
finite_axes_cross (linepath a b) z

goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
assume asm: "st \<noteq>tt" "r\<noteq>0"
[PROOF STATE]
proof (state)
this:
st \<noteq> tt
r \<noteq> 0

goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
let ?S1="{t. Re (part_circlepath z0 r st tt t-z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
  and ?S2="{t. Im (part_circlepath z0 r st tt t-z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "finite ?S1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
using part_circlepath_half_finite_inter[of st tt r "Complex 1 0" z0 "Re z"] asm
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>st \<noteq> tt; r \<noteq> 0; Complex 1 0 \<noteq> 0\<rbrakk> \<Longrightarrow> finite {t. part_circlepath z0 r st tt t \<bullet> Complex 1 0 = Re z \<and> 0 \<le> t \<and> t \<le> 1}
st \<noteq> tt
r \<noteq> 0

goal (1 subgoal):
 1. finite {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto simp add:inner_complex_def Complex_eq_0)
[PROOF STATE]
proof (state)
this:
finite {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "finite ?S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
using part_circlepath_half_finite_inter[of st tt r "Complex 0 1" z0 "Im z"] asm
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>st \<noteq> tt; r \<noteq> 0; Complex 0 1 \<noteq> 0\<rbrakk> \<Longrightarrow> finite {t. part_circlepath z0 r st tt t \<bullet> Complex 0 1 = Im z \<and> 0 \<le> t \<and> t \<le> 1}
st \<noteq> tt
r \<noteq> 0

goal (1 subgoal):
 1. finite {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto simp add:inner_complex_def Complex_eq_0)
[PROOF STATE]
proof (state)
this:
finite {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "{t. (Re (part_circlepath z0 r st tt t-z) = 0
      \<or> Im (part_circlepath z0 r st tt t-z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = ?S1 \<union> ?S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t. (Re (part_circlepath z0 r st tt t - z) = 0 \<or> Im (part_circlepath z0 r st tt t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
{t. (Re (part_circlepath z0 r st tt t - z) = 0 \<or> Im (part_circlepath z0 r st tt t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (2 subgoals):
 1. \<lbrakk>st \<noteq> tt; r \<noteq> 0\<rbrakk> \<Longrightarrow> finite_axes_cross (part_circlepath z0 r st tt) z
 2. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re (part_circlepath z0 r st tt t - z) = 0 \<or> Im (part_circlepath z0 r st tt t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
show "finite_axes_cross (part_circlepath z0 r st tt) z"
[PROOF STATE]
proof (prove)
using this:
finite {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re (part_circlepath z0 r st tt t - z) = 0 \<or> Im (part_circlepath z0 r st tt t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite_axes_cross (part_circlepath z0 r st tt) z
[PROOF STEP]
unfolding finite_axes_cross_def
[PROOF STATE]
proof (prove)
using this:
finite {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re (part_circlepath z0 r st tt t - z) = 0 \<or> Im (part_circlepath z0 r st tt t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (part_circlepath z0 r st tt t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. (Re (part_circlepath z0 r st tt t - z) = 0 \<or> Im (part_circlepath z0 r st tt t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite_axes_cross (part_circlepath z0 r st tt) z

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
assume asm:"finite_axes_cross g1 z" "finite_axes_cross g2 z"
[PROOF STATE]
proof (state)
this:
finite_axes_cross g1 z
finite_axes_cross g2 z

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
let ?g1R="{t. Re (g1 t-z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
  and ?g1I="{t. Im (g1 t-z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
  and ?g2R="{t. Re (g2 t-z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
  and ?g2I="{t. Im (g2 t-z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "finite ?g1R" "finite ?g1I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} &&& finite {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
 2. finite {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
have "{t. (Re (g1 t - z) = 0 \<or> Im (g1 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = ?g1R \<union> ?g1I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t. (Re (g1 t - z) = 0 \<or> Im (g1 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{t. (Re (g1 t - z) = 0 \<or> Im (g1 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (2 subgoals):
 1. finite {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
 2. finite {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{t. (Re (g1 t - z) = 0 \<or> Im (g1 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
have "finite (?g1R \<union> ?g1I)"
[PROOF STATE]
proof (prove)
using this:
{t. (Re (g1 t - z) = 0 \<or> Im (g1 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite ({t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})
[PROOF STEP]
using asm(1)
[PROOF STATE]
proof (prove)
using this:
{t. (Re (g1 t - z) = 0 \<or> Im (g1 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite_axes_cross g1 z

goal (1 subgoal):
 1. finite ({t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})
[PROOF STEP]
unfolding finite_axes_cross_def
[PROOF STATE]
proof (prove)
using this:
{t. (Re (g1 t - z) = 0 \<or> Im (g1 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. (Re (g1 t - z) = 0 \<or> Im (g1 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite ({t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ({t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})

goal (2 subgoals):
 1. finite {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
 2. finite {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite ({t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})
[PROOF STEP]
show "finite ?g1R" "finite ?g1I"
[PROOF STATE]
proof (prove)
using this:
finite ({t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})

goal (1 subgoal):
 1. finite {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} &&& finite {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
finite {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "finite ?g2R" "finite ?g2I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} &&& finite {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
 2. finite {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
have "{t. (Re (g2 t - z) = 0 \<or> Im (g2 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = ?g2R \<union> ?g2I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t. (Re (g2 t - z) = 0 \<or> Im (g2 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{t. (Re (g2 t - z) = 0 \<or> Im (g2 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (2 subgoals):
 1. finite {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
 2. finite {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{t. (Re (g2 t - z) = 0 \<or> Im (g2 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
have "finite (?g2R \<union> ?g2I)"
[PROOF STATE]
proof (prove)
using this:
{t. (Re (g2 t - z) = 0 \<or> Im (g2 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite ({t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})
[PROOF STEP]
using asm(2)
[PROOF STATE]
proof (prove)
using this:
{t. (Re (g2 t - z) = 0 \<or> Im (g2 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite_axes_cross g2 z

goal (1 subgoal):
 1. finite ({t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})
[PROOF STEP]
unfolding finite_axes_cross_def
[PROOF STATE]
proof (prove)
using this:
{t. (Re (g2 t - z) = 0 \<or> Im (g2 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. (Re (g2 t - z) = 0 \<or> Im (g2 t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite ({t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ({t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})

goal (2 subgoals):
 1. finite {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
 2. finite {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite ({t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})
[PROOF STEP]
show "finite ?g2R" "finite ?g2I"
[PROOF STATE]
proof (prove)
using this:
finite ({t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1})

goal (1 subgoal):
 1. finite {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} &&& finite {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
finite {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
finite {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
let ?S1 = "{t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
  and ?S2 = "{t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "finite ?S1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
using finite_half_joinpaths_inter[of g1 "Complex 1 0" "Re z" g2,simplified]
      \<open>finite ?g1R\<close> \<open>finite ?g2R\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {t. g1 t \<bullet> Complex 1 0 = Re z \<and> 0 \<le> t \<and> t \<le> 1}; finite {t. g2 t \<bullet> Complex 1 0 = Re z \<and> 0 \<le> t \<and> t \<le> 1}\<rbrakk> \<Longrightarrow> finite {t. (g1 +++ g2) t \<bullet> Complex 1 0 = Re z \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Re (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Re (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto simp add:inner_complex_def)
[PROOF STATE]
proof (state)
this:
finite {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "finite ?S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
using finite_half_joinpaths_inter[of g1 "Complex 0 1" "Im z" g2,simplified]
      \<open>finite ?g1I\<close> \<open>finite ?g2I\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite {t. g1 t \<bullet> Complex 0 1 = Im z \<and> 0 \<le> t \<and> t \<le> 1}; finite {t. g2 t \<bullet> Complex 0 1 = Im z \<and> 0 \<le> t \<and> t \<le> 1}\<rbrakk> \<Longrightarrow> finite {t. (g1 +++ g2) t \<bullet> Complex 0 1 = Im z \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (g1 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im (g2 t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by (auto simp add:inner_complex_def)
[PROOF STATE]
proof (state)
this:
finite {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
have "{t. (Re ((g1 +++ g2) t - z) = 0 \<or> Im ((g1 +++ g2) t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1}
        = ?S1 \<union> ?S2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {t. (Re ((g1 +++ g2) t - z) = 0 \<or> Im ((g1 +++ g2) t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{t. (Re ((g1 +++ g2) t - z) = 0 \<or> Im ((g1 +++ g2) t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. \<lbrakk>finite_axes_cross g1 z; finite_axes_cross g2 z\<rbrakk> \<Longrightarrow> finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re ((g1 +++ g2) t - z) = 0 \<or> Im ((g1 +++ g2) t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
show "finite_axes_cross (g1 +++ g2) z"
[PROOF STATE]
proof (prove)
using this:
finite {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re ((g1 +++ g2) t - z) = 0 \<or> Im ((g1 +++ g2) t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite_axes_cross (g1 +++ g2) z
[PROOF STEP]
unfolding finite_axes_cross_def
[PROOF STATE]
proof (prove)
using this:
finite {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
finite {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}
{t. (Re ((g1 +++ g2) t - z) = 0 \<or> Im ((g1 +++ g2) t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1} = {t. Re ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1} \<union> {t. Im ((g1 +++ g2) t - z) = 0 \<and> 0 \<le> t \<and> t \<le> 1}

goal (1 subgoal):
 1. finite {t. (Re ((g1 +++ g2) t - z) = 0 \<or> Im ((g1 +++ g2) t - z) = 0) \<and> 0 \<le> t \<and> t \<le> 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite_axes_cross (g1 +++ g2) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma real_root_increasing: "0 < n \<Longrightarrow> n \<le> N \<Longrightarrow> 0 \<le> x \<Longrightarrow> x \<le> 1 \<Longrightarrow> root n x \<le> root N x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; n \<le> N; 0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> root n x \<le> root N x
[PROOF STEP]
by (auto simp add: order_le_less real_root_strict_increasing)


[STATEMENT]
lemma homotopy_eqv_translation:
    fixes S :: "'a::real_normed_vector set"
    shows "(+) a ` S homotopy_eqv S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (+) a ` S homotopy_eqv S
[PROOF STEP]
using homeomorphic_imp_homotopy_eqv homeomorphic_translation homeomorphic_sym
[PROOF STATE]
proof (prove)
using this:
?S homeomorphic ?T \<Longrightarrow> ?S homotopy_eqv ?T
?S homeomorphic (+) ?a ` ?S
?s homeomorphic ?t = ?t homeomorphic ?s

goal (1 subgoal):
 1. (+) a ` S homotopy_eqv S
[PROOF STEP]
by blast


[STATEMENT]
lemma sum_nodes:
      assumes "\<Inter> (alphabet\<^sub>1 ` set AA) = \<Union> (alphabet\<^sub>1 ` set AA)"
      shows "b.nodes (sum AA) \<subseteq> (\<Union> k < length AA. {k} \<times> a.nodes (AA ! k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b.nodes' (local.sum AA) \<subseteq> (\<Union>k<length AA. {k} \<times> a.nodes' (AA ! k))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> b.nodes' (local.sum AA) \<Longrightarrow> x \<in> (\<Union>k<length AA. {k} \<times> a.nodes' (AA ! k))
[PROOF STEP]
show "kp \<in> (\<Union> k < length AA. {k} \<times> a.nodes (AA ! k))" if "kp \<in> b.nodes (sum AA)" for kp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. kp \<in> (\<Union>k<length AA. {k} \<times> a.nodes' (AA ! k))
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
kp \<in> b.nodes' (local.sum AA)
\<Inter> (alphabet\<^sub>1 ` set AA) = \<Union> (alphabet\<^sub>1 ` set AA)

goal (1 subgoal):
 1. kp \<in> (\<Union>k<length AA. {k} \<times> a.nodes' (AA ! k))
[PROOF STEP]
by (induct) (auto 0 4)
[PROOF STATE]
proof (state)
this:
?kp \<in> b.nodes' (local.sum AA) \<Longrightarrow> ?kp \<in> (\<Union>k<length AA. {k} \<times> a.nodes' (AA ! k))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Class_is_Left_Coset:
  "g \<in> G \<Longrightarrow> Class g = g \<cdot>| K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g \<in> G \<Longrightarrow> Class g = g \<cdot>| K
[PROOF STEP]
using Left_Coset_Class_unit Class_unit_normal_subgroup
[PROOF STATE]
proof (prove)
using this:
?g \<in> G \<Longrightarrow> ?g \<cdot>| K = Class ?g
Class \<one> = K

goal (1 subgoal):
 1. g \<in> G \<Longrightarrow> Class g = g \<cdot>| K
[PROOF STEP]
by simp


[STATEMENT]
lemma iMOD_subset_conv: "0 < m \<Longrightarrow>
  ([r', mod m'] \<subseteq> [r, mod m]) =
  (r' mod m = r mod m  \<and>  r \<le> r'  \<and>  m' mod m = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < m \<Longrightarrow> ([ r', mod m' ] \<subseteq> [ r, mod m ]) = (r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m; [ r', mod m' ] \<subseteq> [ r, mod m ]\<rbrakk> \<Longrightarrow> r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0
 2. \<lbrakk>0 < m; r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0\<rbrakk> \<Longrightarrow> [ r', mod m' ] \<subseteq> [ r, mod m ]
[PROOF STEP]
apply (frule subsetD[of _ _ r'])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>0 < m; [ r', mod m' ] \<subseteq> [ r, mod m ]\<rbrakk> \<Longrightarrow> r' \<in> [ r', mod m' ]
 2. \<lbrakk>0 < m; [ r', mod m' ] \<subseteq> [ r, mod m ]; r' \<in> [ r, mod m ]\<rbrakk> \<Longrightarrow> r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0
 3. \<lbrakk>0 < m; r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0\<rbrakk> \<Longrightarrow> [ r', mod m' ] \<subseteq> [ r, mod m ]
[PROOF STEP]
apply (simp add: iMOD_iff)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m; [ r', mod m' ] \<subseteq> [ r, mod m ]; r' \<in> [ r, mod m ]\<rbrakk> \<Longrightarrow> r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0
 2. \<lbrakk>0 < m; r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0\<rbrakk> \<Longrightarrow> [ r', mod m' ] \<subseteq> [ r, mod m ]
[PROOF STEP]
apply (drule iMOD_subset_imp_divisor_mod_0)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < m; r' \<in> [ r, mod m ]; m' mod m = 0\<rbrakk> \<Longrightarrow> r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0
 2. \<lbrakk>0 < m; r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0\<rbrakk> \<Longrightarrow> [ r', mod m' ] \<subseteq> [ r, mod m ]
[PROOF STEP]
apply (simp add: iMOD_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < m; r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0\<rbrakk> \<Longrightarrow> [ r', mod m' ] \<subseteq> [ r, mod m ]
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < m; r' mod m = r mod m \<and> r \<le> r' \<and> m' mod m = 0; x \<in> [ r', mod m' ]\<rbrakk> \<Longrightarrow> x \<in> [ r, mod m ]
[PROOF STEP]
apply (simp add: iMOD_iff, elim conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>0 < m; r' mod m = r mod m; x mod m' = r' mod m'; r' \<le> x; r \<le> r'; m' mod m = 0\<rbrakk> \<Longrightarrow> x mod m = r mod m
[PROOF STEP]
apply (drule mod_eq_mod_0_imp_mod_eq[where m'=m' and m=m])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>0 < m; r' mod m = r mod m; r' \<le> x; r \<le> r'; m' mod m = 0\<rbrakk> \<Longrightarrow> m' mod m = 0
 2. \<And>x. \<lbrakk>0 < m; r' mod m = r mod m; r' \<le> x; r \<le> r'; m' mod m = 0; x mod m = r' mod m\<rbrakk> \<Longrightarrow> x mod m = r mod m
[PROOF STEP]
apply simp+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma left_invertible_transpose:
  "(\<exists>(B). B ** transpose (A) = mat (1::'a::comm_semiring_1)) \<longleftrightarrow> (\<exists>(B). A ** B = mat 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>B. B ** Finite_Cartesian_Product.transpose A = mat (1::'a)) = (\<exists>B. A ** B = mat (1::'a))
[PROOF STEP]
by (metis matrix_transpose_mul transpose_mat transpose_transpose)


[STATEMENT]
lemma (in Ring) nsum_ideal_incTr:"ideal R A \<Longrightarrow>
               (\<forall>i \<le> n. f i \<in> A) \<longrightarrow>  nsum R f n \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ideal R A \<Longrightarrow> (\<forall>i\<le>n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> A
[PROOF STEP]
apply (induct_tac n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ideal R A \<Longrightarrow> (\<forall>i\<le>0. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f 0 \<in> A
 2. \<And>n. \<lbrakk>ideal R A; (\<forall>i\<le>n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> A\<rbrakk> \<Longrightarrow> (\<forall>i\<le>Suc n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> A
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>ideal R A; \<forall>i\<le>0. f i \<in> A\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R f 0 \<in> A
 2. \<And>n. \<lbrakk>ideal R A; (\<forall>i\<le>n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> A\<rbrakk> \<Longrightarrow> (\<forall>i\<le>Suc n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R A; (\<forall>i\<le>n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> A\<rbrakk> \<Longrightarrow> (\<forall>i\<le>Suc n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> A
[PROOF STEP]
(** n **)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R A; (\<forall>i\<le>n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> A\<rbrakk> \<Longrightarrow> (\<forall>i\<le>Suc n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> A
[PROOF STEP]
apply (rule impI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R A; (\<forall>i\<le>n. f i \<in> A) \<longrightarrow> \<Sigma>\<^sub>e R f n \<in> A; \<forall>i\<le>Suc n. f i \<in> A\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R f Suc n \<in> A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R A; \<Sigma>\<^sub>e R f n \<in> A; \<forall>i\<le>Suc n. f i \<in> A\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e R f n \<plusminus> f (Suc n) \<in> A
[PROOF STEP]
apply (rule ideal_pOp_closed, assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>ideal R A; \<Sigma>\<^sub>e R f n \<in> A; \<forall>i\<le>Suc n. f i \<in> A\<rbrakk> \<Longrightarrow> f (Suc n) \<in> A
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma vec_to_iarray_matrix_matrix_mult[code_unfold]:
  fixes A::"'a::{semiring_1}^'m::{mod_type}^'n::{mod_type}" and x::"'a^'m::{mod_type}"
  shows "vec_to_iarray (A *v x) = (matrix_to_iarray A) *iv (vec_to_iarray x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (A *v x) = matrix_to_iarray A *iv vec_to_iarray x
[PROOF STEP]
unfolding matrix_vector_mult_iarray_def matrix_vector_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_to_iarray (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * x $ j) = IArray.of_fun (\<lambda>i. \<Sum>j = 0..<IArray.length (vec_to_iarray x). matrix_to_iarray A !! i !! j * vec_to_iarray x !! j) (nrows_iarray (matrix_to_iarray A))
[PROOF STEP]
unfolding o_def tabulate2_def nrows_iarray_def ncols_iarray_def matrix_to_iarray_def vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * x $ j) $ mod_type_class.from_nat i) CARD('n) = IArray.of_fun (\<lambda>i. \<Sum>j = 0..<IArray.length (IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('m)). IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)]) !! i !! j * IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('m) !! j) (IArray.length (IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)])))
[PROOF STEP]
using sum.reindex[of "from_nat::nat=>'m"]
[PROOF STATE]
proof (prove)
using this:
inj_on mod_type_class.from_nat ?A \<Longrightarrow> sum ?g (mod_type_class.from_nat ` ?A) = sum (?g \<circ> mod_type_class.from_nat) ?A

goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * x $ j) $ mod_type_class.from_nat i) CARD('n) = IArray.of_fun (\<lambda>i. \<Sum>j = 0..<IArray.length (IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('m)). IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)]) !! i !! j * IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('m) !! j) (IArray.length (IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)])))
[PROOF STEP]
using bij_from_nat
[PROOF STATE]
proof (prove)
using this:
inj_on mod_type_class.from_nat ?A \<Longrightarrow> sum ?g (mod_type_class.from_nat ` ?A) = sum (?g \<circ> mod_type_class.from_nat) ?A
bij_betw mod_type_class.from_nat {0..<CARD(?'a)} UNIV

goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * x $ j) $ mod_type_class.from_nat i) CARD('n) = IArray.of_fun (\<lambda>i. \<Sum>j = 0..<IArray.length (IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('m)). IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)]) !! i !! j * IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('m) !! j) (IArray.length (IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)])))
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on mod_type_class.from_nat ?A \<Longrightarrow> sum ?g (mod_type_class.from_nat ` ?A) = sum (?g \<circ> mod_type_class.from_nat) ?A
inj_on mod_type_class.from_nat {0..<CARD(?'a)} \<and> mod_type_class.from_nat ` {0..<CARD(?'a)} = UNIV

goal (1 subgoal):
 1. IArray.of_fun (\<lambda>i. (\<chi>i. \<Sum>j\<in>UNIV. A $ i $ j * x $ j) $ mod_type_class.from_nat i) CARD('n) = IArray.of_fun (\<lambda>i. \<Sum>j = 0..<IArray.length (IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('m)). IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)]) !! i !! j * IArray.of_fun (\<lambda>i. x $ mod_type_class.from_nat i) CARD('m) !! j) (IArray.length (IArray (map (\<lambda>x. IArray.of_fun (\<lambda>i. A $ mod_type_class.from_nat x $ mod_type_class.from_nat i) CARD('m)) [0..<CARD('n)])))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma bst_baliL:
  "\<lbrakk>bst l; bst r; \<forall>x\<in>set_tree l. x < a; \<forall>x\<in>set_tree r. a < x\<rbrakk>
   \<Longrightarrow> bst (baliL l a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Tree2.bst l; Tree2.bst r; \<forall>x\<in>Tree2.set_tree l. x < a; \<forall>x\<in>Tree2.set_tree r. a < x\<rbrakk> \<Longrightarrow> Tree2.bst (baliL l a r)
[PROOF STEP]
by(cases "(l,a,r)" rule: baliL.cases) (auto simp: ball_Un)


[STATEMENT]
lemma map_SSup_iso_pres:
  fixes F :: "'a::complete_lattice downset \<Rightarrow> 'b::complete_lattice downset"
  shows "mono F \<Longrightarrow> mono (map_SSup F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono F \<Longrightarrow> mono (map_SSup F)
[PROOF STEP]
unfolding fun_eq_iff mono_def map_SSup_def ds_def SSup_def comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y. x \<le> y \<longrightarrow> F x \<le> F y \<Longrightarrow> \<forall>x y. x \<le> y \<longrightarrow> \<Squnion> Rep_downset (F (Abs_downset (\<down> x))) \<le> \<Squnion> Rep_downset (F (Abs_downset (\<down> y)))
[PROOF STEP]
by (metis Abs_downset_inverse Sup_subset_mono downset_iso_iff less_eq_downset.rep_eq rangeI)


[STATEMENT]
lemma VLambda_iff2: "\<langle>a, b\<rangle> \<in>\<^sub>\<circ> (\<lambda>a\<in>\<^sub>\<circ>A. f a) \<longleftrightarrow> b = f a \<and> a \<in>\<^sub>\<circ> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>a, b\<rangle> \<in>\<^sub>\<circ> VLambda A f) = (b = f a \<and> a \<in>\<^sub>\<circ> A)
[PROOF STEP]
by auto


[STATEMENT]
lemma hom_into_subgroup:
   "\<lbrakk>h \<in> hom G G'; h ` (carrier G) \<subseteq> H\<rbrakk> \<Longrightarrow> h \<in> hom G (subgroup_generated G' H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>h \<in> hom G G'; h ` carrier G \<subseteq> H\<rbrakk> \<Longrightarrow> h \<in> hom G (subgroup_generated G' H)
[PROOF STEP]
by (auto simp: hom_def carrier_subgroup_generated Pi_iff generate.incl image_subset_iff)


[STATEMENT]
lemma cycle_free_0_0:
  fixes M :: "('a::linordered_ab_monoid_add) mat"
  assumes "cycle_free M n"
  shows "M 0 0 \<ge> \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<one> \<le> M 0 0
[PROOF STEP]
using cyc_free_diag_dest[OF cycle_free_diag_dest[OF assms], of 0 "[]"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> n; set [] \<subseteq> {0..n}\<rbrakk> \<Longrightarrow> \<one> \<le> len M 0 0 []

goal (1 subgoal):
 1. \<one> \<le> M 0 0
[PROOF STEP]
by auto


[STATEMENT]
lemma length_replicate [simp]: "length (replicate n x) = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (replicate n x) = n
[PROOF STEP]
by (induct n) auto


[STATEMENT]
lemma support_and: "support (\<lambda>l s. P l s \<and> Q l s) \<subseteq> support P \<union> support Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. support (\<lambda>l s. P l s \<and> Q l s) \<subseteq> support P \<union> support Q
[PROOF STEP]
unfolding support_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. \<exists>l1 l2 s. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> (P l1 s \<and> Q l1 s) \<noteq> (P l2 s \<and> Q l2 s)} \<subseteq> {x. \<exists>l1 l2 s. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> P l1 s \<noteq> P l2 s} \<union> {x. \<exists>l1 l2 s. (\<forall>y. y \<noteq> x \<longrightarrow> l1 y = l2 y) \<and> Q l1 s \<noteq> Q l2 s}
[PROOF STEP]
by blast


[STATEMENT]
lemma DERIV_arctan: "DERIV arctan x :> inverse (1 + x\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (arctan has_real_derivative inverse (1 + x\<^sup>2)) (at x)
[PROOF STEP]
proof (rule DERIV_inverse_function)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. (?f has_real_derivative 1 + x\<^sup>2) (at (arctan x))
 2. 1 + x\<^sup>2 \<noteq> 0
 3. ?a < x
 4. x < ?b
 5. \<And>y. \<lbrakk>?a < y; y < ?b\<rbrakk> \<Longrightarrow> ?f (arctan y) = y
 6. isCont arctan x
[PROOF STEP]
have "inverse ((cos (arctan x))\<^sup>2) = 1 + x\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse ((cos (arctan x))\<^sup>2) = 1 + x\<^sup>2
[PROOF STEP]
by (metis arctan cos_arctan_not_zero power_inverse tan_sec)
[PROOF STATE]
proof (state)
this:
inverse ((cos (arctan x))\<^sup>2) = 1 + x\<^sup>2

goal (6 subgoals):
 1. (?f has_real_derivative 1 + x\<^sup>2) (at (arctan x))
 2. 1 + x\<^sup>2 \<noteq> 0
 3. ?a < x
 4. x < ?b
 5. \<And>y. \<lbrakk>?a < y; y < ?b\<rbrakk> \<Longrightarrow> ?f (arctan y) = y
 6. isCont arctan x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inverse ((cos (arctan x))\<^sup>2) = 1 + x\<^sup>2
[PROOF STEP]
show "(tan has_real_derivative 1 + x\<^sup>2) (at (arctan x))"
[PROOF STATE]
proof (prove)
using this:
inverse ((cos (arctan x))\<^sup>2) = 1 + x\<^sup>2

goal (1 subgoal):
 1. (tan has_real_derivative 1 + x\<^sup>2) (at (arctan x))
[PROOF STEP]
by (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
(tan has_real_derivative 1 + x\<^sup>2) (at (arctan x))

goal (5 subgoals):
 1. 1 + x\<^sup>2 \<noteq> 0
 2. ?a < x
 3. x < ?b
 4. \<And>y. \<lbrakk>?a < y; y < ?b\<rbrakk> \<Longrightarrow> tan (arctan y) = y
 5. isCont arctan x
[PROOF STEP]
show "\<And>y. \<lbrakk>x - 1 < y; y < x + 1\<rbrakk> \<Longrightarrow> tan (arctan y) = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>x - 1 < y; y < x + 1\<rbrakk> \<Longrightarrow> tan (arctan y) = y
[PROOF STEP]
using tan_arctan
[PROOF STATE]
proof (prove)
using this:
tan (arctan ?y) = ?y

goal (1 subgoal):
 1. \<And>y. \<lbrakk>x - 1 < y; y < x + 1\<rbrakk> \<Longrightarrow> tan (arctan y) = y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<lbrakk>x - 1 < ?y; ?y < x + 1\<rbrakk> \<Longrightarrow> tan (arctan ?y) = ?y

goal (4 subgoals):
 1. 1 + x\<^sup>2 \<noteq> 0
 2. x - 1 < x
 3. x < x + 1
 4. isCont arctan x
[PROOF STEP]
show "1 + x\<^sup>2 \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 + x\<^sup>2 \<noteq> 0
[PROOF STEP]
by (metis power_one sum_power2_eq_zero_iff zero_neq_one)
[PROOF STATE]
proof (state)
this:
1 + x\<^sup>2 \<noteq> 0

goal (3 subgoals):
 1. x - 1 < x
 2. x < x + 1
 3. isCont arctan x
[PROOF STEP]
qed (use isCont_arctan in auto)


[STATEMENT]
lemma cnj_0[simp]: "cnj 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
have "cnj 0 = cnj (0 + 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = cnj_class.cnj ((0::'a) + (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (0::'a) = cnj_class.cnj ((0::'a) + (0::'a))

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (0::'a) = cnj_class.cnj ((0::'a) + (0::'a))

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
have "... = cnj 0 + cnj 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj ((0::'a) + (0::'a)) = cnj_class.cnj (0::'a) + cnj_class.cnj (0::'a)
[PROOF STEP]
unfolding cnj_add
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj (0::'a) + cnj_class.cnj (0::'a) = cnj_class.cnj (0::'a) + cnj_class.cnj (0::'a)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
cnj_class.cnj ((0::'a) + (0::'a)) = cnj_class.cnj (0::'a) + cnj_class.cnj (0::'a)

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cnj_class.cnj ((0::'a) + (0::'a)) = cnj_class.cnj (0::'a) + cnj_class.cnj (0::'a)

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
have "... = 2 * (cnj 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj_class.cnj (0::'a) + cnj_class.cnj (0::'a) = (2::'a) * cnj_class.cnj (0::'a)
[PROOF STEP]
by (simp add: local.mult_2)
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (0::'a) + cnj_class.cnj (0::'a) = (2::'a) * cnj_class.cnj (0::'a)

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cnj_class.cnj (0::'a) = (2::'a) * cnj_class.cnj (0::'a)
[PROOF STEP]
have "cnj 0 = 2 * cnj 0"
[PROOF STATE]
proof (prove)
using this:
cnj_class.cnj (0::'a) = (2::'a) * cnj_class.cnj (0::'a)

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (2::'a) * cnj_class.cnj (0::'a)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (0::'a) = (2::'a) * cnj_class.cnj (0::'a)

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
cnj_class.cnj (0::'a) = (2::'a) * cnj_class.cnj (0::'a)

goal (1 subgoal):
 1. cnj_class.cnj (0::'a) = (0::'a)
[PROOF STEP]
by (auto simp add: two_not_one)
[PROOF STATE]
proof (state)
this:
cnj_class.cnj (0::'a) = (0::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ccSUP_upper: "countable A \<Longrightarrow> i \<in> A \<Longrightarrow> f i \<le> (SUP i \<in> A. f i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable A; i \<in> A\<rbrakk> \<Longrightarrow> f i \<le> Sup (f ` A)
[PROOF STEP]
using ccSup_upper [of "f ` A"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>countable (f ` A); ?x \<in> f ` A\<rbrakk> \<Longrightarrow> ?x \<le> Sup (f ` A)

goal (1 subgoal):
 1. \<lbrakk>countable A; i \<in> A\<rbrakk> \<Longrightarrow> f i \<le> Sup (f ` A)
[PROOF STEP]
by simp


[STATEMENT]
lemma mat_of_cblinfun_Proj_ccspan:
  fixes S :: "'a::onb_enum list"
  shows "mat_of_cblinfun (Proj (ccspan (set S))) =
    (let d = length (canonical_basis :: 'a list) in
      mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
define d gs
    where "d = length (canonical_basis :: 'a list)"
      and "gs = gram_schmidt0 d (map vec_of_basis_enum S)"
[PROOF STATE]
proof (state)
this:
d = length canonical_basis
gs = gram_schmidt0 d (map vec_of_basis_enum S)

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
interpret complex_vec_space d
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
have gs_dim: "x \<in> set gs \<Longrightarrow> dim_vec x = d" for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> set gs \<Longrightarrow> dim_vec x = d
[PROOF STEP]
by (smt carrier_vecD carrier_vec_dim_vec d_def dim_vec_of_basis_enum' ex_map_conv gram_schmidt0_result(1) gs_def subset_code(1))
[PROOF STATE]
proof (state)
this:
?x1 \<in> set gs \<Longrightarrow> dim_vec ?x1 = d

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
have ortho_gs: "is_ortho_set (set (map basis_enum_of_vec gs :: 'a list))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_ortho_set (set (map basis_enum_of_vec gs))
[PROOF STEP]
apply (subst corthogonal_vec_of_basis_enum[THEN iffD1], auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. corthogonal (map (vec_of_basis_enum \<circ> basis_enum_of_vec) gs)
[PROOF STEP]
by (smt carrier_dim_vec cof_vec_space.gram_schmidt0_result(1) d_def dim_vec_of_basis_enum' gram_schmidt0_result(3) gs_def imageE map_idI map_map o_apply set_map subset_code(1) basis_enum_of_vec_inverse)
[PROOF STATE]
proof (state)
this:
is_ortho_set (set (map basis_enum_of_vec gs))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
have distinct_gs: "distinct (map basis_enum_of_vec gs :: 'a list)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (map basis_enum_of_vec gs)
[PROOF STEP]
by (metis (mono_tags, opaque_lifting) carrier_vec_dim_vec cof_vec_space.gram_schmidt0_result(2) d_def dim_vec_of_basis_enum' distinct_map gs_def gs_dim image_iff inj_on_inverseI set_map subsetI basis_enum_of_vec_inverse)
[PROOF STATE]
proof (state)
this:
distinct (map basis_enum_of_vec gs)

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
have "mk_projector_orthog d gs
      = mk_projector_orthog d (map vec_of_basis_enum (map basis_enum_of_vec gs :: 'a list))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_projector_orthog d gs = mk_projector_orthog d (map vec_of_basis_enum (map basis_enum_of_vec gs))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_projector_orthog d gs = mk_projector_orthog d (map (vec_of_basis_enum \<circ> basis_enum_of_vec) gs)
[PROOF STEP]
apply (subst map_cong[where ys=gs and g=id], simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. x \<in> set gs \<Longrightarrow> (vec_of_basis_enum \<circ> basis_enum_of_vec) x = id x
 2. mk_projector_orthog d gs = mk_projector_orthog d (map id gs)
[PROOF STEP]
using gs_dim
[PROOF STATE]
proof (prove)
using this:
?x1 \<in> set gs \<Longrightarrow> dim_vec ?x1 = d

goal (2 subgoals):
 1. \<And>x. x \<in> set gs \<Longrightarrow> (vec_of_basis_enum \<circ> basis_enum_of_vec) x = id x
 2. mk_projector_orthog d gs = mk_projector_orthog d (map id gs)
[PROOF STEP]
by (auto intro!: vec_of_basis_enum_inverse simp: d_def)
[PROOF STATE]
proof (state)
this:
mk_projector_orthog d gs = mk_projector_orthog d (map vec_of_basis_enum (map basis_enum_of_vec gs))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mk_projector_orthog d gs = mk_projector_orthog d (map vec_of_basis_enum (map basis_enum_of_vec gs))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
have "\<dots> = mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs :: 'a list))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_projector_orthog d (map vec_of_basis_enum (map basis_enum_of_vec gs)) = mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs))))
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_projector_orthog (length canonical_basis) (map vec_of_basis_enum (map basis_enum_of_vec gs)) = mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs))))
[PROOF STEP]
apply (subst mk_projector_orthog_correct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. is_ortho_set (set (map basis_enum_of_vec gs))
 2. distinct (map basis_enum_of_vec gs)
 3. mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs)))) = mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs))))
[PROOF STEP]
using ortho_gs distinct_gs
[PROOF STATE]
proof (prove)
using this:
is_ortho_set (set (map basis_enum_of_vec gs))
distinct (map basis_enum_of_vec gs)

goal (3 subgoals):
 1. is_ortho_set (set (map basis_enum_of_vec gs))
 2. distinct (map basis_enum_of_vec gs)
 3. mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs)))) = mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs))))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mk_projector_orthog d (map vec_of_basis_enum (map basis_enum_of_vec gs)) = mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs))))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
mk_projector_orthog d (map vec_of_basis_enum (map basis_enum_of_vec gs)) = mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs))))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
have "\<dots> = mat_of_cblinfun (Proj (ccspan (set S)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs)))) = mat_of_cblinfun (Proj (ccspan (set S)))
[PROOF STEP]
apply (rule arg_cong[where f="\<lambda>x. mat_of_cblinfun (Proj x)"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (set (map basis_enum_of_vec gs)) = ccspan (set S)
[PROOF STEP]
unfolding gs_def d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccspan (set (map basis_enum_of_vec (gram_schmidt0 (length canonical_basis) (map vec_of_basis_enum S)))) = ccspan (set S)
[PROOF STEP]
apply (subst ccspan_gram_schmidt0_invariant)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. set (map vec_of_basis_enum S) \<subseteq> carrier_vec (length canonical_basis)
 2. ccspan (set (map basis_enum_of_vec (map vec_of_basis_enum S))) = ccspan (set S)
[PROOF STEP]
by (auto simp add: carrier_vecI dim_vec_of_basis_enum')
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (Proj (ccspan (set (map basis_enum_of_vec gs)))) = mat_of_cblinfun (Proj (ccspan (set S)))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
mk_projector_orthog d gs = mat_of_cblinfun (Proj (ccspan (set S)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
mk_projector_orthog d gs = mat_of_cblinfun (Proj (ccspan (set S)))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
unfolding d_def gs_def
[PROOF STATE]
proof (prove)
using this:
mk_projector_orthog (length canonical_basis) (gram_schmidt0 (length canonical_basis) (map vec_of_basis_enum S)) = mat_of_cblinfun (Proj (ccspan (set S)))

goal (1 subgoal):
 1. mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
mat_of_cblinfun (Proj (ccspan (set S))) = (let d = length canonical_basis in mk_projector_orthog d (gram_schmidt0 d (map vec_of_basis_enum S)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in real_distribution) cdf_cts_step:
  assumes [arith]: "x < y"
  shows "cdf M x \<le> integral\<^sup>L M (cts_step x y)" and "integral\<^sup>L M (cts_step x y) \<le> cdf M y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cdf M x \<le> expectation (cts_step x y) &&& expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. cdf M x \<le> expectation (cts_step x y)
 2. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
have "cdf M x = integral\<^sup>L M (indicator {..x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cdf M x = expectation (indicat_real {..x})
[PROOF STEP]
by (simp add: cdf_def)
[PROOF STATE]
proof (state)
this:
cdf M x = expectation (indicat_real {..x})

goal (2 subgoals):
 1. cdf M x \<le> expectation (cts_step x y)
 2. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cdf M x = expectation (indicat_real {..x})

goal (2 subgoals):
 1. cdf M x \<le> expectation (cts_step x y)
 2. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
have "\<dots> \<le> expectation (cts_step x y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (indicat_real {..x}) \<le> expectation (cts_step x y)
[PROOF STEP]
by (intro integral_mono integrable_cts_step)
       (auto simp: cts_step_def less_top[symmetric] split: split_indicator)
[PROOF STATE]
proof (state)
this:
expectation (indicat_real {..x}) \<le> expectation (cts_step x y)

goal (2 subgoals):
 1. cdf M x \<le> expectation (cts_step x y)
 2. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cdf M x \<le> expectation (cts_step x y)
[PROOF STEP]
show "cdf M x \<le> expectation (cts_step x y)"
[PROOF STATE]
proof (prove)
using this:
cdf M x \<le> expectation (cts_step x y)

goal (1 subgoal):
 1. cdf M x \<le> expectation (cts_step x y)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cdf M x \<le> expectation (cts_step x y)

goal (1 subgoal):
 1. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
have "expectation (cts_step x y) \<le> integral\<^sup>L M (indicator {..y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (cts_step x y) \<le> expectation (indicat_real {..y})
[PROOF STEP]
by (intro integral_mono integrable_cts_step)
       (auto simp: cts_step_def less_top[symmetric] split: split_indicator)
[PROOF STATE]
proof (state)
this:
expectation (cts_step x y) \<le> expectation (indicat_real {..y})

goal (1 subgoal):
 1. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
expectation (cts_step x y) \<le> expectation (indicat_real {..y})

goal (1 subgoal):
 1. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
have "\<dots> = cdf M y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. expectation (indicat_real {..y}) = cdf M y
[PROOF STEP]
by (simp add: cdf_def)
[PROOF STATE]
proof (state)
this:
expectation (indicat_real {..y}) = cdf M y

goal (1 subgoal):
 1. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
show "expectation (cts_step x y) \<le> cdf M y"
[PROOF STATE]
proof (prove)
using this:
expectation (cts_step x y) \<le> cdf M y

goal (1 subgoal):
 1. expectation (cts_step x y) \<le> cdf M y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
expectation (cts_step x y) \<le> cdf M y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gfinprod_cong:
  "\<lbrakk>A = B; f \<in> B \<rightarrow> carrier G;
    \<And>i. i \<in> B =simp=> f i = g i\<rbrakk> \<Longrightarrow> gfinprod G f A = gfinprod G g B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; f \<in> B \<rightarrow> carrier G; \<And>i. i \<in> B =simp=> f i = g i\<rbrakk> \<Longrightarrow> gfinprod G f A = gfinprod G g B
[PROOF STEP]
unfolding gfinprod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A = B; f \<in> B \<rightarrow> carrier G; \<And>i. i \<in> B =simp=> f i = g i\<rbrakk> \<Longrightarrow> (if finite {x \<in> A. f x \<noteq> \<one>} then finprod G f {x \<in> A. f x \<noteq> \<one>} else \<one>) = (if finite {x \<in> B. g x \<noteq> \<one>} then finprod G g {x \<in> B. g x \<noteq> \<one>} else \<one>)
[PROOF STEP]
by (auto simp: simp_implies_def cong: conj_cong intro: finprod_cong)


[STATEMENT]
lemma enat_ltl_Suc: "enat n < llength (ltl xs) \<Longrightarrow> enat (Suc n) < llength xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. enat n < llength (ltl xs) \<Longrightarrow> enat (Suc n) < llength xs
[PROOF STEP]
by (metis eSuc_enat ldrop_ltl leD leI lnull_ldrop)


[STATEMENT]
lemma det_nfa_accepts:
  assumes A: "wf_nfa A n"
  and w: "list_all (is_alph n) bss"
  shows "dfa_accepts (det_nfa A) bss = nfa_accepts A bss"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dfa_accepts (det_nfa A) bss = nfa_accepts A bss
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dfa_accepts (det_nfa A) bss = nfa_accepts A bss
[PROOF STEP]
from A
[PROOF STATE]
proof (chain)
picking this:
wf_nfa A n
[PROOF STEP]
interpret subset_DFS A n
[PROOF STATE]
proof (prove)
using this:
wf_nfa A n

goal (1 subgoal):
 1. subset_DFS A n
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. dfa_accepts (det_nfa A) bss = nfa_accepts A bss
[PROOF STEP]
from w
[PROOF STATE]
proof (chain)
picking this:
list_all (is_alph n) bss
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
list_all (is_alph n) bss

goal (1 subgoal):
 1. dfa_accepts (det_nfa A) bss = nfa_accepts A bss
[PROOF STEP]
by (rule det_nfa_accepts)
[PROOF STATE]
proof (state)
this:
dfa_accepts (det_nfa A) bss = nfa_accepts A bss

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "map (\<lambda>i::int. i + 1) [0, 1] = [1, 2]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map (\<lambda>i. i + 1) [0, 1] = [1, 2]
[PROOF STEP]
by (smt (verit) list.map)


[STATEMENT]
lemma prop_ids:
  "eval e f g (Iff (And p q) (And q p))"
  "eval e f g (Iff (Or p q) (Or q p))"
  "eval e f g (Iff (Or p (Or q r)) (Or (Or p q) r))"
  "eval e f g (Iff (And p (And q r)) (And (And p q) r))"
  "eval e f g (Iff (Neg (Or p q)) (And (Neg p) (Neg q)))"
  "eval e f g (Iff (Neg (And p q)) (Or (Neg p) (Neg q)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eval e f g (Iff (And p q) (And q p)) &&& eval e f g (Iff (Or p q) (Or q p)) &&& eval e f g (Iff (Or p (Or q r)) (Or (Or p q) r))) &&& eval e f g (Iff (And p (And q r)) (And (And p q) r)) &&& eval e f g (Iff (Neg (Or p q)) (And (Neg p) (Neg q))) &&& eval e f g (Iff (Neg (And p q)) (Or (Neg p) (Neg q)))
[PROOF STEP]
(* ... *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (eval e f g (Iff (And p q) (And q p)) &&& eval e f g (Iff (Or p q) (Or q p)) &&& eval e f g (Iff (Or p (Or q r)) (Or (Or p q) r))) &&& eval e f g (Iff (And p (And q r)) (And (And p q) r)) &&& eval e f g (Iff (Neg (Or p q)) (And (Neg p) (Neg q))) &&& eval e f g (Iff (Neg (And p q)) (Or (Neg p) (Neg q)))
[PROOF STEP]
by (auto simp: Iff_def)


[STATEMENT]
lemma sum_flatten2:
  fixes f :: "'a \<Rightarrow> 'a \<Rightarrow> 'b::join_semilattice_zero"
  assumes "finite A"
  and "finite B"
  shows "\<Sum>{\<Sum> {f x y |x. x \<in> A} |y. y \<in> B} = \<Sum>{f x y |x y. x \<in> A \<and> y \<in> B}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {\<Sum> {f x y |x. x \<in> A} |y. y \<in> B} = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply (simp add: fset_to_im assms flatten2_im)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> ((\<lambda>x. f (fst x) (snd x)) ` (A \<times> B)) = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply (subst fset_to_im[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {f (fst x) (snd x) |x. x \<in> A \<times> B} = \<Sum> {f x y |x y. x \<in> A \<and> y \<in> B}
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma div_exp_sub: "2^l  < n \<Longrightarrow> n div (2^l) = 2^(N-l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ l < n \<Longrightarrow> n div 2 ^ l = 2 ^ (N - l)
[PROOF STEP]
using n_two_pot
[PROOF STATE]
proof (prove)
using this:
n = 2 ^ N

goal (1 subgoal):
 1. 2 ^ l < n \<Longrightarrow> n div 2 ^ l = 2 ^ (N - l)
[PROOF STEP]
by (smt (z3) One_nat_def diff_is_0_eq diff_le_diff_pow div_if div_le_dividend eq_imp_le le_0_eq le_Suc_eq n_lst2 nat_less_le not_less_eq_eq numeral_2_eq_2 power_0 two_powr_div)


[STATEMENT]
lemma aux1_lm0246:"a\<preceq>b \<longrightarrow> (\<forall>n. nth_bit (b-a) n = nth_bit b n - nth_bit a n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<preceq> b \<longrightarrow> (\<forall>n. (b - a) \<exclamdown> n = b \<exclamdown> n - a \<exclamdown> n)
[PROOF STEP]
using aux0_lm0246 masks_leq
[PROOF STATE]
proof (prove)
using this:
?a \<preceq> ?a + ?b \<longrightarrow> (?a + ?b) \<exclamdown> ?n = ?a \<exclamdown> ?n + ?b \<exclamdown> ?n
?a \<preceq> ?b \<longrightarrow> ?a \<le> ?b

goal (1 subgoal):
 1. a \<preceq> b \<longrightarrow> (\<forall>n. (b - a) \<exclamdown> n = b \<exclamdown> n - a \<exclamdown> n)
[PROOF STEP]
by auto (metis add_diff_cancel_left' le_add_diff_inverse)


[STATEMENT]
lemma ffact_Suc:
  "ffact (Suc n) a = a * ffact n (a - 1)"
    for a :: "'a :: comm_ring_1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ffact (Suc n) a = a * ffact n (a - (1::'a))
[PROOF STEP]
by (simp add: ffact_def pochhammer_prod prod.atLeast0_lessThan_Suc algebra_simps)


[STATEMENT]
lemma cinner_diff_right: "cinner x (y - z) = cinner x y - cinner x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cinner x (y - z) = cinner x y - cinner x z
[PROOF STEP]
using cinner_diff_left [of y z x]
[PROOF STATE]
proof (prove)
using this:
cinner (y - z) x = cinner y x - cinner z x

goal (1 subgoal):
 1. cinner x (y - z) = cinner x y - cinner x z
[PROOF STEP]
by (metis complex_cnj_diff local.cinner_commute)


[STATEMENT]
lemma swap_poly :
  assumes "length L > a"
  assumes "length L > b"
  shows "insertion (nth_default 0 L) p = insertion (nth_default 0 (swap_list a b L)) (swap_poly a b p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion (nth_default (0::'a) L) p = insertion (nth_default (0::'a) (swap_list a b L)) (swap_poly a b p)
[PROOF STEP]
unfolding insertion_code
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>m\<in>monomials (swap_poly a b p). MPoly_Type.coeff (swap_poly a b p) m * (\<Prod>k\<in>keys m. nth_default (0::'a) (swap_list a b L) k ^ lookup m k))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>m\<in>monomials (swap_poly a b p). MPoly_Type.coeff (swap_poly a b p) m * (\<Prod>k\<in>keys m. nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup m k))
[PROOF STEP]
unfolding monomials.abs_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>m\<in>monomials (swap_poly a b p). MPoly_Type.coeff (swap_poly a b p) m * (\<Prod>k\<in>keys m. nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup m k))
[PROOF STEP]
unfolding coeff_swap_poly monomials_swap_poly
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>m\<in>swap0 a b ` monomials p. MPoly_Type.coeff p (swap0 a b m) * (\<Prod>k\<in>keys m. nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup m k))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>m\<in>swap0 a b ` monomials p. MPoly_Type.coeff p (swap0 a b m) * (\<Prod>k\<in>keys m. nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup m k))
[PROOF STEP]
unfolding Groups_Big.comm_monoid_add_class.sum.reindex[OF inj_on]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = sum ((\<lambda>m. MPoly_Type.coeff p (swap0 a b m) * (\<Prod>k\<in>keys m. nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup m k)) \<circ> swap0 a b) (monomials p)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>x\<in>monomials p. MPoly_Type.coeff p (swap0 a b (swap0 a b x)) * (\<Prod>k\<in>keys (swap0 a b x). nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup (swap0 a b x) k))
[PROOF STEP]
unfolding swap0_swap0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>x\<in>monomials p. MPoly_Type.coeff p x * (\<Prod>k\<in>keys (swap0 a b x). nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup (swap0 a b x) k))
[PROOF STEP]
unfolding keys_swap
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>x\<in>monomials p. MPoly_Type.coeff p x * (\<Prod>k\<in>swap a b ` keys x. nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup (swap0 a b x) k))
[PROOF STEP]
unfolding Groups_Big.comm_monoid_mult_class.prod.reindex[OF inj_on']
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>x\<in>monomials p. MPoly_Type.coeff p x * prod ((\<lambda>k. nth_default (0::'a) (L[b := L ! a, a := L ! b]) k ^ lookup (swap0 a b x) k) \<circ> swap a b) (keys x))
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>x\<in>monomials p. MPoly_Type.coeff p x * (\<Prod>xa\<in>keys x. nth_default (0::'a) (L[b := L ! a, a := L ! b]) (swap a b xa) ^ lookup (swap0 a b x) (swap a b xa)))
[PROOF STEP]
unfolding swap0_eq swap_swap swap_list[OF assms]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>m\<in>monomials p. MPoly_Type.coeff p m * (\<Prod>k\<in>keys m. nth_default (0::'a) L k ^ lookup m k)) = (\<Sum>x\<in>monomials p. MPoly_Type.coeff p x * (\<Prod>xa\<in>keys x. nth_default (0::'a) L xa ^ lookup x xa))
[PROOF STEP]
by auto


[STATEMENT]
lemma mset_union_size: "size (A \<union># B) = size (A) + size (B - A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (A \<union># B) = size A + size (B - A)
[PROOF STEP]
by (simp add: union_mset_def)


[STATEMENT]
lemma rel_star_contl: "X O Y^* = (\<Union>n. X O rel_dioid.power Y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X O Y\<^sup>* = (\<Union>n. X O rel_dioid.power Y n)
[PROOF STEP]
by (metis rel_star_def relcomp_UNION_distrib)


[STATEMENT]
lemma integral_component_lbound_real:
  assumes "f integrable_on {a ::real..b}"
    and "\<forall>x\<in>{a..b}. B \<le> f(x)\<bullet>k"
    and "k \<in> Basis"
  shows "B * content {a..b} \<le> (integral {a..b} f)\<bullet>k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * content {a..b} \<le> integral {a..b} f \<bullet> k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f integrable_on {a..b}
\<forall>x\<in>{a..b}. B \<le> f x \<bullet> k
k \<in> Basis

goal (1 subgoal):
 1. B * content {a..b} \<le> integral {a..b} f \<bullet> k
[PROOF STEP]
by (metis box_real(2) integral_component_lbound)


[STATEMENT]
lemma e_less_272: "exp 1 < (272/100::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp 1 < 272 / 100
[PROOF STEP]
using e_approx_32
[PROOF STATE]
proof (prove)
using this:
\<bar>exp 1 - 5837465777 / 2147483648\<bar> \<le> inverse (2 ^ 32)

goal (1 subgoal):
 1. exp 1 < 272 / 100
[PROOF STEP]
by (simp add: abs_if split: if_split_asm)


[STATEMENT]
lemma cosh_ln_real: "x > 0 \<Longrightarrow> cosh (ln x :: real) = (x + inverse x) / 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> cosh (ln x) = (x + inverse x) / 2
[PROOF STEP]
by (simp add: cosh_def exp_minus)


[STATEMENT]
lemma padd_asso:
  "padd (padd a b) c = padd a (padd b c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. padd (padd a b) c = padd a (padd b c)
[PROOF STEP]
by (metis Rep_prat_inverse group_cancel.add1 padd.rep_eq)


[STATEMENT]
lemma inv_integer_group [simp]: "inv\<^bsub>integer_group\<^esub> x = -x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv\<^bsub>integer_group\<^esub> x = - x
[PROOF STEP]
by (rule group.inv_equality [OF group_integer_group]) (auto simp: integer_group_def)


[STATEMENT]
lemma matroid_ax_3_alt:
  assumes "I \<subseteq> X \<inter> Y"
  shows "rk (X \<union> Y) + rk I \<le> rk X + rk Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rk (X \<union> Y) + rk I \<le> rk X + rk Y
[PROOF STEP]
by (metis add.commute add_le_cancel_right assms matroid_ax_2 matroid_ax_3 order_trans)


[STATEMENT]
lemma add_order: "a+^(add_order a) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a +^ add_order a = (0::'a)
[PROOF STEP]
using LeastI_ex[of "\<lambda>n. n>0 \<and> a+^n = 0"] add_order_def
[PROOF STATE]
proof (prove)
using this:
\<exists>x>0. a +^ x = (0::'a) \<Longrightarrow> 0 < (LEAST n. 0 < n \<and> a +^ n = (0::'a)) \<and> a +^ (LEAST n. 0 < n \<and> a +^ n = (0::'a)) = (0::'a)
add_order ?a \<equiv> if \<exists>n>0. ?a +^ n = (0::'a) then LEAST n. 0 < n \<and> ?a +^ n = (0::'a) else 0

goal (1 subgoal):
 1. a +^ add_order a = (0::'a)
[PROOF STEP]
by simp


[STATEMENT]
lemma "P ((2::int) < 3) = P True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (2 < 3) = P True
[PROOF STEP]
by smt


[STATEMENT]
lemma sdim_UNIV: "(UNIV :: sdim set) = {Length, Mass, Time, Current, Temperature, Amount, Intensity}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. UNIV = {Length, Mass, Time, Current, Temperature, Amount, Intensity}
[PROOF STEP]
using sdim.exhaust
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?y = Length \<Longrightarrow> ?P; ?y = Mass \<Longrightarrow> ?P; ?y = Time \<Longrightarrow> ?P; ?y = Current \<Longrightarrow> ?P; ?y = Temperature \<Longrightarrow> ?P; ?y = Amount \<Longrightarrow> ?P; ?y = Intensity \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P

goal (1 subgoal):
 1. UNIV = {Length, Mass, Time, Current, Temperature, Amount, Intensity}
[PROOF STEP]
by blast


[STATEMENT]
lemma size_height_log:
  "log 2 (size_kdt kdt) \<le> height kdt"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log 2 (real (KD_Tree.size_kdt kdt)) \<le> real (height kdt)
[PROOF STEP]
by (simp add: log2_of_power_le size_height)


[STATEMENT]
lemma totient_conv_moebius_mu:
  "int (totient n) = dirichlet_prod moebius_mu int n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (totient n) = dirichlet_prod moebius_mu int n
[PROOF STEP]
proof (cases "n = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n = 0 \<Longrightarrow> int (totient n) = dirichlet_prod moebius_mu int n
 2. n \<noteq> 0 \<Longrightarrow> int (totient n) = dirichlet_prod moebius_mu int n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (2 subgoals):
 1. n = 0 \<Longrightarrow> int (totient n) = dirichlet_prod moebius_mu int n
 2. n \<noteq> 0 \<Longrightarrow> int (totient n) = dirichlet_prod moebius_mu int n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. int (totient n) = dirichlet_prod moebius_mu int n
[PROOF STEP]
by (rule moebius_inversion)
       (insert False, simp_all add: of_nat_sum [symmetric] totient_divisor_sum del: of_nat_sum)
[PROOF STATE]
proof (state)
this:
int (totient n) = dirichlet_prod moebius_mu int n

goal (1 subgoal):
 1. n = 0 \<Longrightarrow> int (totient n) = dirichlet_prod moebius_mu int n
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma sum_list_mult_const_prod :
  fixes f :: "'a \<Rightarrow> 'b \<Rightarrow> 'r::semiring_0"
  shows "(\<Sum>(x,y)\<leftarrow>xys. f x y) * r = (\<Sum>(x,y)\<leftarrow>xys. (f x y) * r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>(x, y)\<leftarrow>xys. f x y) * r = (\<Sum>(x, y)\<leftarrow>xys. f x y * r)
[PROOF STEP]
using sum_list_mult_const[of "case_prod f" r] prod.case_distrib[of "\<lambda>x. x*r" f]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>x\<leftarrow>?xs. (case x of (x, xa) \<Rightarrow> f x xa) * r) = (\<Sum>x\<leftarrow>?xs. case x of (x, xa) \<Rightarrow> f x xa) * r
(case ?prod of (x, xa) \<Rightarrow> f x xa) * r = (case ?prod of (x1, x2) \<Rightarrow> f x1 x2 * r)

goal (1 subgoal):
 1. (\<Sum>(x, y)\<leftarrow>xys. f x y) * r = (\<Sum>(x, y)\<leftarrow>xys. f x y * r)
[PROOF STEP]
by    simp


[STATEMENT]
lemma (in fin_digraph) no_neg_cyc_imp_no_neg_inf:
  assumes no_neg_cyc: "\<And>p. awalk u p v
    \<Longrightarrow> \<not>(\<exists>w c. awalk w c w \<and> w \<in> set (awalk_verts u p) \<and> awalk_cost f c < 0)"
  shows "- \<infinity> < \<mu> f u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<infinity> < \<mu> f u v
[PROOF STEP]
proof (intro ereal_MInfty_lessI notI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<mu> f u v = - \<infinity> \<Longrightarrow> False
[PROOF STEP]
assume "\<mu> f u v = - \<infinity>"
[PROOF STATE]
proof (state)
this:
\<mu> f u v = - \<infinity>

goal (1 subgoal):
 1. \<mu> f u v = - \<infinity> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<mu> f u v = - \<infinity>
[PROOF STEP]
obtain p where p_props: "awalk u p v"
    and ex_cyc: "\<exists>w c. awalk w c w \<and> w \<in> set (awalk_verts u p) \<and> awalk_cost f c < 0"
[PROOF STATE]
proof (prove)
using this:
\<mu> f u v = - \<infinity>

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>awalk u p v; \<exists>w c. awalk w c w \<and> w \<in> set (awalk_verts u p) \<and> awalk_cost f c < 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by atomize_elim (rule neg_inf_imp_neg_cyc)
[PROOF STATE]
proof (state)
this:
awalk u p v
\<exists>w c. awalk w c w \<and> w \<in> set (awalk_verts u p) \<and> awalk_cost f c < 0

goal (1 subgoal):
 1. \<mu> f u v = - \<infinity> \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
awalk u p v
\<exists>w c. awalk w c w \<and> w \<in> set (awalk_verts u p) \<and> awalk_cost f c < 0
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
awalk u p v
\<exists>w c. awalk w c w \<and> w \<in> set (awalk_verts u p) \<and> awalk_cost f c < 0

goal (1 subgoal):
 1. False
[PROOF STEP]
using no_neg_cyc
[PROOF STATE]
proof (prove)
using this:
awalk u p v
\<exists>w c. awalk w c w \<and> w \<in> set (awalk_verts u p) \<and> awalk_cost f c < 0
awalk u ?p v \<Longrightarrow> \<nexists>w c. awalk w c w \<and> w \<in> set (awalk_verts u ?p) \<and> awalk_cost f c < 0

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma span_closed[simp]: "U \<subseteq> carrier V \<Longrightarrow> v : span U \<Longrightarrow> v : carrier V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>U \<subseteq> carrier V; v \<in> span U\<rbrakk> \<Longrightarrow> v \<in> carrier V
[PROOF STEP]
unfolding span_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>U \<subseteq> carrier V; v \<in> {lincomb a A |a A. finite A \<and> A \<subseteq> U \<and> a \<in> A \<rightarrow> carrier K}\<rbrakk> \<Longrightarrow> v \<in> carrier V
[PROOF STEP]
by auto


[STATEMENT]
lemma integer_composition_enum_length:
  "length (integer_composition_enum n) = 2^(n-1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (integer_composition_enum n) = 2 ^ (n - 1)
[PROOF STEP]
proof(induct n rule: integer_composition_enum.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length (integer_composition_enum 0) = 2 ^ (0 - 1)
 2. \<And>n. (\<And>x. x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - x)) = 2 ^ (n - x - 1)) \<Longrightarrow> length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)
[PROOF STEP]
case 1
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. length (integer_composition_enum 0) = 2 ^ (0 - 1)
 2. \<And>n. (\<And>x. x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - x)) = 2 ^ (n - x - 1)) \<Longrightarrow> length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (integer_composition_enum 0) = 2 ^ (0 - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (integer_composition_enum 0) = 2 ^ (0 - 1)

goal (1 subgoal):
 1. \<And>n. (\<And>x. x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - x)) = 2 ^ (n - x - 1)) \<Longrightarrow> length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. (\<And>x. x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - x)) = 2 ^ (n - x - 1)) \<Longrightarrow> length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)
[PROOF STEP]
case (2 n)
[PROOF STATE]
proof (state)
this:
?x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - ?x)) = 2 ^ (n - ?x - 1)

goal (1 subgoal):
 1. \<And>n. (\<And>x. x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - x)) = 2 ^ (n - x - 1)) \<Longrightarrow> length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - ?x)) = 2 ^ (n - ?x - 1)
[PROOF STEP]
have "length [Suc m #xs. m \<leftarrow> [0..< n], xs \<leftarrow> integer_composition_enum (n-m)]
        = (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x - 1))"
[PROOF STATE]
proof (prove)
using this:
?x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - ?x)) = 2 ^ (n - ?x - 1)

goal (1 subgoal):
 1. length (concat (map (\<lambda>m. map ((#) (Suc m)) (integer_composition_enum (n - m))) [0..<n])) = (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x - 1))
[PROOF STEP]
using length_concat_map_function_sum_list [of
        "[0..< n]"
        "\<lambda> x. integer_composition_enum (n - x)"
        "\<lambda> x. 2 ^ (n - x - 1)"
        "\<lambda> m xs. Suc m #xs"]
[PROOF STATE]
proof (prove)
using this:
?x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - ?x)) = 2 ^ (n - ?x - 1)
(\<And>x. x \<in> set [0..<n] \<Longrightarrow> length (integer_composition_enum (n - x)) = 2 ^ (n - x - 1)) \<Longrightarrow> length (concat (map (\<lambda>x. map ((#) (Suc x)) (integer_composition_enum (n - x))) [0..<n])) = (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x - 1))

goal (1 subgoal):
 1. length (concat (map (\<lambda>m. map ((#) (Suc m)) (integer_composition_enum (n - m))) [0..<n])) = (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x - 1))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
length (concat (map (\<lambda>m. map ((#) (Suc m)) (integer_composition_enum (n - m))) [0..<n])) = (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x - 1))

goal (1 subgoal):
 1. \<And>n. (\<And>x. x \<in> set [0..<Suc n] \<Longrightarrow> length (integer_composition_enum (n - x)) = 2 ^ (n - x - 1)) \<Longrightarrow> length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length (concat (map (\<lambda>m. map ((#) (Suc m)) (integer_composition_enum (n - m))) [0..<n])) = (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x - 1))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length (concat (map (\<lambda>m. map ((#) (Suc m)) (integer_composition_enum (n - m))) [0..<n])) = (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x - 1))

goal (1 subgoal):
 1. length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)
[PROOF STEP]
using sum_list_two_pow
[PROOF STATE]
proof (prove)
using this:
length (concat (map (\<lambda>m. map ((#) (Suc m)) (integer_composition_enum (n - m))) [0..<n])) = (\<Sum>x\<leftarrow>[0..<n]. 2 ^ (n - x - 1))
Suc (\<Sum>x\<leftarrow>[0..<?n]. 2 ^ (?n - Suc x)) = 2 ^ ?n

goal (1 subgoal):
 1. length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (integer_composition_enum (Suc n)) = 2 ^ (Suc n - 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma verticesFrom_eq_if_vertices_cong:
  "\<lbrakk>distinct(vertices f); distinct(vertices f');
    vertices f \<cong> vertices f'; x \<in> \<V> f \<rbrakk> \<Longrightarrow>
   verticesFrom f x = verticesFrom f' x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>distinct (vertices f); distinct (vertices f'); vertices f \<cong> vertices f'; x \<in> \<V> f\<rbrakk> \<Longrightarrow> verticesFrom f x = verticesFrom f' x
[PROOF STEP]
by(clarsimp simp:congs_def verticesFrom_Def splitAt_rotate_pair_conv)