[STATEMENT]
lemma finite_set_rel_transfer_back: "\<lbrakk>(s,s')\<in>\<langle>R\<rangle>set_rel; single_valued (R\<inverse>); finite s'\<rbrakk> \<Longrightarrow> finite s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(s, s') \<in> \<langle>R\<rangle>set_rel; single_valued (R\<inverse>); finite s'\<rbrakk> \<Longrightarrow> finite s
[PROOF STEP]
unfolding set_rel_alt
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(s, s') \<in> {(A, B). A \<subseteq> R\<inverse> `` B \<and> B \<subseteq> R `` A}; single_valued (R\<inverse>); finite s'\<rbrakk> \<Longrightarrow> finite s
[PROOF STEP]
by (blast intro: finite_subset[OF _ finite_Image_sv])


[STATEMENT]
lemma onorm_scaleR_lemma:
  assumes f: "bounded_linear f"
  shows "onorm (\<lambda>x. r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (\<lambda>x. r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f
[PROOF STEP]
proof (rule onorm_bound)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> \<bar>r\<bar> * onorm f
 2. \<And>x. norm (r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f * norm x
[PROOF STEP]
show "0 \<le> \<bar>r\<bar> * onorm f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> \<bar>r\<bar> * onorm f
[PROOF STEP]
by (intro mult_nonneg_nonneg onorm_pos_le abs_ge_zero f)
[PROOF STATE]
proof (state)
this:
0 \<le> \<bar>r\<bar> * onorm f

goal (1 subgoal):
 1. \<And>x. norm (r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f * norm x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm (r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f * norm x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. norm (r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f * norm x
[PROOF STEP]
have "\<bar>r\<bar> * norm (f x) \<le> \<bar>r\<bar> * (onorm f * norm x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>r\<bar> * norm (f x) \<le> \<bar>r\<bar> * (onorm f * norm x)
[PROOF STEP]
by (intro mult_left_mono onorm abs_ge_zero f)
[PROOF STATE]
proof (state)
this:
\<bar>r\<bar> * norm (f x) \<le> \<bar>r\<bar> * (onorm f * norm x)

goal (1 subgoal):
 1. \<And>x. norm (r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f * norm x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<bar>r\<bar> * norm (f x) \<le> \<bar>r\<bar> * (onorm f * norm x)
[PROOF STEP]
show "norm (r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f * norm x"
[PROOF STATE]
proof (prove)
using this:
\<bar>r\<bar> * norm (f x) \<le> \<bar>r\<bar> * (onorm f * norm x)

goal (1 subgoal):
 1. norm (r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f * norm x
[PROOF STEP]
by (simp only: norm_scaleR mult.assoc)
[PROOF STATE]
proof (state)
this:
norm (r *\<^sub>R f x) \<le> \<bar>r\<bar> * onorm f * norm x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_inverse_squares_expansion_bigo_simple':
  "(\<lambda>n. (\<Sum>i=1..n. 1 / real i ^ 2)) =o (\<lambda>n. pi ^ 2 / 6 - 1 / n + 1 / (2*n^2)) +o O(\<lambda>n. 1 / n^3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i = 1..n. 1 / (real i)\<^sup>2) \<in> (\<lambda>x. pi\<^sup>2 / 6 - 1 / real x + 1 / (2 * (real x)\<^sup>2)) +o O(\<lambda>x. 1 / real x ^ 3)
[PROOF STEP]
using sum_inverse_squares_expansion_bigo_simple
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. (\<Sum>i = 1..n. 1 / (real i)\<^sup>2) - (pi\<^sup>2 / 6 - 1 / real n + 1 / (2 * (real n)\<^sup>2))) \<in> O(\<lambda>x. 1 / real x ^ 3)

goal (1 subgoal):
 1. (\<lambda>n. \<Sum>i = 1..n. 1 / (real i)\<^sup>2) \<in> (\<lambda>x. pi\<^sup>2 / 6 - 1 / real x + 1 / (2 * (real x)\<^sup>2)) +o O(\<lambda>x. 1 / real x ^ 3)
[PROOF STEP]
by (subst set_minus_plus [symmetric]) (simp_all add: fun_diff_def)


[STATEMENT]
lemma count_0: "(\<forall>x. count_list B x = 0) = (B = [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. count_list B x = 0) = (B = [])
[PROOF STEP]
by (simp add: count_list_0_iff)


[STATEMENT]
lemma bij_conv: "is_bij x  \<longleftrightarrow> is_bij (x\<^sup>\<smile>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_bij x = is_bij (x\<^sup>\<smile>)
[PROOF STEP]
by (metis is_bij_def inj_p_fun is_map_def p_fun_inj sur_total total_sur)


[STATEMENT]
lemma cindex_polyE_inverse_add:
  fixes p q::"real poly"
  assumes cp:"coprime p q"
  shows "cindex_polyE a b q p + cindex_polyE a b p q=cindex_polyE a b 1 (q*p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE a b p q = cindex_polyE a b 1 (q * p)
[PROOF STEP]
unfolding cindex_polyE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyR q p a + real_of_int (cindex_poly a b q p) - jumpF_polyL q p b + (jumpF_polyR p q a + real_of_int (cindex_poly a b p q) - jumpF_polyL p q b) = jumpF_polyR 1 (q * p) a + real_of_int (cindex_poly a b 1 (q * p)) - jumpF_polyL 1 (q * p) b
[PROOF STEP]
using cindex_poly_inverse_add[OF cp,symmetric] jumpF_polyR_inverse_add[OF cp,symmetric]
    jumpF_polyL_inverse_add[OF cp,symmetric]
[PROOF STATE]
proof (prove)
using this:
cindex_poly ?a ?b 1 (q * p) = cindex_poly ?a ?b q p + cindex_poly ?a ?b p q
jumpF_polyR 1 (q * p) ?x = jumpF_polyR q p ?x + jumpF_polyR p q ?x
jumpF_polyL 1 (q * p) ?x = jumpF_polyL q p ?x + jumpF_polyL p q ?x

goal (1 subgoal):
 1. jumpF_polyR q p a + real_of_int (cindex_poly a b q p) - jumpF_polyL q p b + (jumpF_polyR p q a + real_of_int (cindex_poly a b p q) - jumpF_polyL p q b) = jumpF_polyR 1 (q * p) a + real_of_int (cindex_poly a b 1 (q * p)) - jumpF_polyL 1 (q * p) b
[PROOF STEP]
by auto


[STATEMENT]
lemma iterated_singular_subdivision:
   "singular_chain p X c
        \<Longrightarrow> (singular_subdivision p ^^ n) c =
            frag_extend
             (\<lambda>f. chain_map p f
                       ((simplicial_subdivision p ^^ n)
                         (frag_of(restrict id (standard_simplex p))))) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_chain p X c \<Longrightarrow> (singular_subdivision p ^^ n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
proof (induction n arbitrary: c)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>c. singular_chain p X c \<Longrightarrow> (singular_subdivision p ^^ 0) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) c
 2. \<And>n c. \<lbrakk>\<And>c. singular_chain p X c \<Longrightarrow> (singular_subdivision p ^^ n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) c; singular_chain p X c\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
singular_chain p X c

goal (2 subgoals):
 1. \<And>c. singular_chain p X c \<Longrightarrow> (singular_subdivision p ^^ 0) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) c
 2. \<And>n c. \<lbrakk>\<And>c. singular_chain p X c \<Longrightarrow> (singular_subdivision p ^^ n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) c; singular_chain p X c\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
singular_chain p X c
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
singular_chain p X c

goal (1 subgoal):
 1. (singular_subdivision p ^^ 0) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
unfolding singular_chain_def
[PROOF STATE]
proof (prove)
using this:
Poly_Mapping.keys c \<subseteq> singular_simplex_set p X

goal (1 subgoal):
 1. (singular_subdivision p ^^ 0) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
proof (induction c rule: frag_induction)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (singular_subdivision p ^^ 0) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ 0) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ 0) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ 0) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ 0) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
case (one f)
[PROOF STATE]
proof (state)
this:
f \<in> singular_simplex_set p X

goal (3 subgoals):
 1. (singular_subdivision p ^^ 0) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ 0) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ 0) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ 0) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ 0) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> singular_simplex_set p X
[PROOF STEP]
have "restrict f (standard_simplex p) = f"
[PROOF STATE]
proof (prove)
using this:
f \<in> singular_simplex_set p X

goal (1 subgoal):
 1. restrict f (standard_simplex p) = f
[PROOF STEP]
by (simp add: extensional_restrict singular_simplex_def)
[PROOF STATE]
proof (state)
this:
restrict f (standard_simplex p) = f

goal (3 subgoals):
 1. (singular_subdivision p ^^ 0) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ 0) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ 0) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ 0) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ 0) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
restrict f (standard_simplex p) = f
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
restrict f (standard_simplex p) = f

goal (1 subgoal):
 1. (singular_subdivision p ^^ 0) (frag_of f) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (frag_of f)
[PROOF STEP]
by (auto simp: simplex_map_def cong: restrict_cong)
[PROOF STATE]
proof (state)
this:
(singular_subdivision p ^^ 0) (frag_of f) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (frag_of f)

goal (2 subgoals):
 1. (singular_subdivision p ^^ 0) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>a b. \<lbrakk>(singular_subdivision p ^^ 0) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ 0) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ 0) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
qed (auto simp: frag_extend_diff)
[PROOF STATE]
proof (state)
this:
(singular_subdivision p ^^ 0) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))) c

goal (1 subgoal):
 1. \<And>n c. \<lbrakk>\<And>c. singular_chain p X c \<Longrightarrow> (singular_subdivision p ^^ n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) c; singular_chain p X c\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n c. \<lbrakk>\<And>c. singular_chain p X c \<Longrightarrow> (singular_subdivision p ^^ n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) c; singular_chain p X c\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
singular_chain p X ?c \<Longrightarrow> (singular_subdivision p ^^ n) ?c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) ?c
singular_chain p X c

goal (1 subgoal):
 1. \<And>n c. \<lbrakk>\<And>c. singular_chain p X c \<Longrightarrow> (singular_subdivision p ^^ n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) c; singular_chain p X c\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
singular_chain p X c

goal (1 subgoal):
 1. (singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
unfolding singular_chain_def
[PROOF STATE]
proof (prove)
using this:
Poly_Mapping.keys c \<subseteq> singular_simplex_set p X

goal (1 subgoal):
 1. (singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c
[PROOF STEP]
proof (induction c rule: frag_induction)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. (singular_subdivision p ^^ Suc n) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ Suc n) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ Suc n) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ Suc n) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
case (one f)
[PROOF STATE]
proof (state)
this:
f \<in> singular_simplex_set p X

goal (3 subgoals):
 1. (singular_subdivision p ^^ Suc n) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ Suc n) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ Suc n) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ Suc n) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f \<in> singular_simplex_set p X
[PROOF STEP]
have "singular_simplex p X f"
[PROOF STATE]
proof (prove)
using this:
f \<in> singular_simplex_set p X

goal (1 subgoal):
 1. singular_simplex p X f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
singular_simplex p X f

goal (3 subgoals):
 1. (singular_subdivision p ^^ Suc n) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ Suc n) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ Suc n) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ Suc n) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
have scp: "simplicial_chain p (standard_simplex p)
                 ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))
 2. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p)))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))
 2. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p)))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
by (metis funpow_0 order_refl simplicial_chain_of simplicial_simplex_id)
[PROOF STATE]
proof (state)
this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ 0) (frag_of (restrict id (standard_simplex p))))

goal (1 subgoal):
 1. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p)))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p)))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))

goal (1 subgoal):
 1. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p)))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))

goal (1 subgoal):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))
[PROOF STEP]
by (simp add: simplicial_chain_simplicial_subdivision)
[PROOF STATE]
proof (state)
this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))

goal (3 subgoals):
 1. (singular_subdivision p ^^ Suc n) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ Suc n) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ Suc n) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ Suc n) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
have scnp: "simplicial_chain p (standard_simplex p)
                  ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ 0) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
 2. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ 0) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
 2. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ 0) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
by (metis eq_id_iff funpow_0 order_refl simplicial_chain_of simplicial_simplex_id)
[PROOF STATE]
proof (state)
this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ 0) (frag_of (\<lambda>x\<in>standard_simplex p. x)))

goal (1 subgoal):
 1. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))

goal (1 subgoal):
 1. \<And>n. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x))) \<Longrightarrow> simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))

goal (1 subgoal):
 1. simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))
[PROOF STEP]
by (simp add: simplicial_chain_simplicial_subdivision)
[PROOF STATE]
proof (state)
this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ Suc n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
simplicial_chain p (standard_simplex p) ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))

goal (3 subgoals):
 1. (singular_subdivision p ^^ Suc n) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ Suc n) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ Suc n) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ Suc n) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
have sff: "singular_chain p X (frag_of f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singular_chain p X (frag_of f)
[PROOF STEP]
by (simp add: \<open>singular_simplex p X f\<close> singular_chain_of)
[PROOF STATE]
proof (state)
this:
singular_chain p X (frag_of f)

goal (3 subgoals):
 1. (singular_subdivision p ^^ Suc n) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>x. x \<in> singular_simplex_set p X \<Longrightarrow> (singular_subdivision p ^^ Suc n) (frag_of x) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of x)
 3. \<And>a b. \<lbrakk>(singular_subdivision p ^^ Suc n) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ Suc n) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
singular_chain p X (frag_of f)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
singular_chain p X (frag_of f)

goal (1 subgoal):
 1. (singular_subdivision p ^^ Suc n) (frag_of f) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of f)
[PROOF STEP]
using Suc.IH [OF sff] naturality_singular_subdivision [OF simplicial_imp_singular_chain [OF scp], of f] singular_subdivision_simplicial_simplex [OF scnp]
[PROOF STATE]
proof (prove)
using this:
singular_chain p X (frag_of f)
(singular_subdivision p ^^ n) (frag_of f) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) (frag_of f)
singular_subdivision p (chain_map p f ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p))))) = chain_map p f (singular_subdivision p ((simplicial_subdivision p ^^ n) (frag_of (restrict id (standard_simplex p)))))
singular_subdivision p ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x))) = simplicial_subdivision p ((simplicial_subdivision p ^^ n) (frag_of (\<lambda>x\<in>standard_simplex p. x)))

goal (1 subgoal):
 1. (singular_subdivision p ^^ Suc n) (frag_of f) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of f)
[PROOF STEP]
by (simp add: singular_chain_of id_def del: restrict_apply)
[PROOF STATE]
proof (state)
this:
(singular_subdivision p ^^ Suc n) (frag_of f) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (frag_of f)

goal (2 subgoals):
 1. (singular_subdivision p ^^ Suc n) 0 = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) 0
 2. \<And>a b. \<lbrakk>(singular_subdivision p ^^ Suc n) a = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) a; (singular_subdivision p ^^ Suc n) b = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) b\<rbrakk> \<Longrightarrow> (singular_subdivision p ^^ Suc n) (a - b) = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) (a - b)
[PROOF STEP]
qed (auto simp: singular_subdivision_power_diff singular_subdivision_diff frag_extend_diff)
[PROOF STATE]
proof (state)
this:
(singular_subdivision p ^^ Suc n) c = frag_extend (\<lambda>f. chain_map p f ((simplicial_subdivision p ^^ Suc n) (frag_of (restrict id (standard_simplex p))))) c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scalar_prod_smult_distrib[simp]: assumes v: "v\<^sub>1 \<in> carrier_vec n" "v\<^sub>2 \<in> carrier_vec n"
  shows "v\<^sub>1 \<bullet> (a \<cdot>\<^sub>v v\<^sub>2) = (a :: 'a :: comm_ring) * (v\<^sub>1 \<bullet> v\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v\<^sub>1 \<bullet> (a \<cdot>\<^sub>v v\<^sub>2) = a * (v\<^sub>1 \<bullet> v\<^sub>2)
[PROOF STEP]
unfolding scalar_prod_def sum_distrib_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (a \<cdot>\<^sub>v v\<^sub>2). v\<^sub>1 $ i * (a \<cdot>\<^sub>v v\<^sub>2) $ i) = (\<Sum>n = 0..<dim_vec v\<^sub>2. a * (v\<^sub>1 $ n * v\<^sub>2 $ n))
[PROOF STEP]
by (rule sum.cong, insert v, auto simp: ac_simps)


[STATEMENT]
lemma filterlim_pow_at_bot_odd:
  fixes f :: "real \<Rightarrow> real"
  shows "0 < n \<Longrightarrow> LIM x F. f x :> at_bot \<Longrightarrow> odd n \<Longrightarrow> LIM x F. (f x)^n :> at_bot"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < n; filterlim f at_bot F; odd n\<rbrakk> \<Longrightarrow> LIM x F. f x ^ n :> at_bot
[PROOF STEP]
using filterlim_pow_at_top[of n "\<lambda>x. - f x" F]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < n; LIM x F. - f x :> at_top\<rbrakk> \<Longrightarrow> LIM x F. (- f x) ^ n :> at_top

goal (1 subgoal):
 1. \<lbrakk>0 < n; filterlim f at_bot F; odd n\<rbrakk> \<Longrightarrow> LIM x F. f x ^ n :> at_bot
[PROOF STEP]
by (simp add: filterlim_uminus_at_bot)


[STATEMENT]
lemma contour_integrable_on_shiftpath_eq:
  assumes "valid_path g" "pathfinish g = pathstart g" "a \<in> {0..1}"
    shows "f contour_integrable_on (shiftpath a g) \<longleftrightarrow> f contour_integrable_on g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f contour_integrable_on shiftpath a g) = (f contour_integrable_on g)
[PROOF STEP]
using assms contour_integrable_on_def has_contour_integral_shiftpath_eq
[PROOF STATE]
proof (prove)
using this:
valid_path g
pathfinish g = pathstart g
a \<in> {0..1}
?f contour_integrable_on ?g \<equiv> \<exists>i. (?f has_contour_integral i) ?g
\<lbrakk>valid_path ?g; pathfinish ?g = pathstart ?g; ?a \<in> {0..1}\<rbrakk> \<Longrightarrow> (?f has_contour_integral ?i) (shiftpath ?a ?g) = (?f has_contour_integral ?i) ?g

goal (1 subgoal):
 1. (f contour_integrable_on shiftpath a g) = (f contour_integrable_on g)
[PROOF STEP]
by auto


[STATEMENT]
lemma higher_deriv_ln_Gamma_complex_of_real:
  assumes "(x :: real) > 0"
  shows   "(deriv ^^ j) ln_Gamma (complex_of_real x) = of_real ((deriv ^^ j) ln_Gamma x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ j) ln_Gamma (complex_of_real x) = complex_of_real ((deriv ^^ j) ln_Gamma x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < x

goal (1 subgoal):
 1. (deriv ^^ j) ln_Gamma (complex_of_real x) = complex_of_real ((deriv ^^ j) ln_Gamma x)
[PROOF STEP]
by (auto simp: higher_deriv_ln_Gamma_real higher_deriv_ln_Gamma_complex
                   ln_Gamma_complex_of_real Polygamma_of_real)


[STATEMENT]
theorem fw_word: assumes "\<not> p dvd q" "\<not> q dvd p"
  shows "\<^bold>|FW_word p q\<^bold>| = p + q - gcd p q - 1" and "period (FW_word p q) p" and  "period (FW_word p q) q" and "\<not> period (FW_word p q) (gcd p q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>|FW_word p q\<^bold>| = p + q - gcd p q - 1 &&& period (FW_word p q) p) &&& period (FW_word p q) q &&& \<not> period (FW_word p q) (gcd p q)
[PROOF STEP]
using fw_word'[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<^bold>|FW_word p q\<^bold>| = p + q - gcd p q - 1 \<and> period (FW_word p q) p \<and> period (FW_word p q) q \<and> \<not> period (FW_word p q) (gcd p q)

goal (1 subgoal):
 1. (\<^bold>|FW_word p q\<^bold>| = p + q - gcd p q - 1 &&& period (FW_word p q) p) &&& period (FW_word p q) q &&& \<not> period (FW_word p q) (gcd p q)
[PROOF STEP]
by blast+


[STATEMENT]
lemma graph_union_iff:
  shows "graph_union G\<^sub>1 G\<^sub>2 = G\<^sub>2 \<longleftrightarrow> (edges G\<^sub>1 \<subseteq> edges G\<^sub>2 \<and> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (graph_union G\<^sub>1 G\<^sub>2 = G\<^sub>2) = (edges G\<^sub>1 \<subseteq> edges G\<^sub>2 \<and> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2)
[PROOF STEP]
unfolding graph_union_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LG (edges G\<^sub>1 \<union> edges G\<^sub>2) (vertices G\<^sub>1 \<union> vertices G\<^sub>2) = G\<^sub>2) = (edges G\<^sub>1 \<subseteq> edges G\<^sub>2 \<and> vertices G\<^sub>1 \<subseteq> vertices G\<^sub>2)
[PROOF STEP]
by (cases "G\<^sub>2",auto)


[STATEMENT]
lemma index_transpose_mat[simp]:
  "i < dim_col A \<Longrightarrow> j < dim_row A \<Longrightarrow> transpose_mat A $$ (i,j) = A $$ (j,i)"
  "dim_row (transpose_mat A) = dim_col A" "dim_col (transpose_mat A) = dim_row A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_col A; j < dim_row A\<rbrakk> \<Longrightarrow> transpose_mat A $$ (i, j) = A $$ (j, i)) &&& dim_row (transpose_mat A) = dim_col A &&& dim_col (transpose_mat A) = dim_row A
[PROOF STEP]
unfolding transpose_mat_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>i < dim_col A; j < dim_row A\<rbrakk> \<Longrightarrow> mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i)) $$ (i, j) = A $$ (j, i)) &&& dim_row (mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i))) = dim_col A &&& dim_col (mat (dim_col A) (dim_row A) (\<lambda>(i, j). A $$ (j, i))) = dim_row A
[PROOF STEP]
by auto


[STATEMENT]
lemma lm142:
  assumes "trivial X"
  shows "card (Pow X)\<in>{1,2}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Pow X) \<in> {1, 2}
[PROOF STEP]
using trivial_empty_or_singleton card_Pow Pow_empty assms trivial_implies_finite
        cardinalityOneTheElemIdentity power_one_right the_elem_eq
[PROOF STATE]
proof (prove)
using this:
trivial ?X = (?X = {} \<or> ?X = {the_elem ?X})
finite ?A \<Longrightarrow> card (Pow ?A) = 2 ^ card ?A
Pow {} = {{}}
trivial X
trivial ?X \<Longrightarrow> finite ?X
(card ?X = 1) = (?X = {the_elem ?X})
?a ^ 1 = ?a
the_elem {?x} = ?x

goal (1 subgoal):
 1. card (Pow X) \<in> {1, 2}
[PROOF STEP]
by (metis insert_iff)


[STATEMENT]
lemma higher_deriv_ident [simp]:
     "(deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1::'a else (0::'a))
[PROOF STEP]
proof (induction n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (deriv ^^ 0) (\<lambda>w. w) z = (if 0 = 0 then z else if 0 = 1 then 1::'a else (0::'a))
 2. \<And>n. (deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1::'a else (0::'a)) \<Longrightarrow> (deriv ^^ Suc n) (\<lambda>w. w) z = (if Suc n = 0 then z else if Suc n = 1 then 1::'a else (0::'a))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1::'a else (0::'a))

goal (2 subgoals):
 1. (deriv ^^ 0) (\<lambda>w. w) z = (if 0 = 0 then z else if 0 = 1 then 1::'a else (0::'a))
 2. \<And>n. (deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1::'a else (0::'a)) \<Longrightarrow> (deriv ^^ Suc n) (\<lambda>w. w) z = (if Suc n = 0 then z else if Suc n = 1 then 1::'a else (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1::'a else (0::'a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(deriv ^^ n) (\<lambda>w. w) z = (if n = 0 then z else if n = 1 then 1::'a else (0::'a))

goal (1 subgoal):
 1. (deriv ^^ Suc n) (\<lambda>w. w) z = (if Suc n = 0 then z else if Suc n = 1 then 1::'a else (0::'a))
[PROOF STEP]
by (metis higher_deriv_linear lambda_one)
[PROOF STATE]
proof (state)
this:
(deriv ^^ Suc n) (\<lambda>w. w) z = (if Suc n = 0 then z else if Suc n = 1 then 1::'a else (0::'a))

goal (1 subgoal):
 1. (deriv ^^ 0) (\<lambda>w. w) z = (if 0 = 0 then z else if 0 = 1 then 1::'a else (0::'a))
[PROOF STEP]
qed auto


[STATEMENT]
lemma "(-84::real) * 51 = -4284"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - 84 * 51 = - 4284
[PROOF STEP]
by simp


[STATEMENT]
lemma angular_component_nat_pow:
  assumes "a \<in> nonzero Q\<^sub>p"
  shows "angular_component (a [^] (k::nat)) = (angular_component a) [^]\<^bsub>Z\<^sub>p\<^esub> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. angular_component (a [^] k) = angular_component a [^]\<^bsub>Z\<^sub>p\<^esub> k
[PROOF STEP]
apply(induction k)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. angular_component (a [^] 0) = angular_component a [^]\<^bsub>Z\<^sub>p\<^esub> 0
 2. \<And>k. angular_component (a [^] k) = angular_component a [^]\<^bsub>Z\<^sub>p\<^esub> k \<Longrightarrow> angular_component (a [^] Suc k) = angular_component a [^]\<^bsub>Z\<^sub>p\<^esub> Suc k
[PROOF STEP]
apply (simp add: angular_component_one)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. angular_component (a [^] k) = angular_component a [^]\<^bsub>Z\<^sub>p\<^esub> k \<Longrightarrow> angular_component (a [^] Suc k) = angular_component a [^]\<^bsub>Z\<^sub>p\<^esub> Suc k
[PROOF STEP]
by (simp add: Qp_nat_pow_nonzero angular_component_mult assms)


[STATEMENT]
lemma gcd_poly_code_code[code]: "gcd_poly_code p q =
           (if p = 0 then normalize q else if q = 0 then normalize p else let
              c1 = content p;
              c2 = content q;
              p' = map_poly (\<lambda> x. x div c1) p;
              q' = map_poly (\<lambda> x. x div c2) q
              in smult (gcd c1 c2) (gcd_poly_code_aux p' q'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd_poly_code p q = (if p = 0 then normalize q else if q = 0 then normalize p else let c1 = content p; c2 = content q; p' = map_poly (\<lambda>x. x div c1) p; q' = map_poly (\<lambda>x. x div c2) q in smult (gcd c1 c2) (gcd_poly_code_aux p' q'))
[PROOF STEP]
unfolding gcd_poly_code_def Let_def primitive_part_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if p = 0 then normalize q else if q = 0 then normalize p else smult (gcd (content p) (content q)) (gcd_poly_code_aux (map_poly (\<lambda>x. x div content p) p) (map_poly (\<lambda>x. x div content q) q))) = (if p = 0 then normalize q else if q = 0 then normalize p else smult (gcd (content p) (content q)) (gcd_poly_code_aux (map_poly (\<lambda>x. x div content p) p) (map_poly (\<lambda>x. x div content q) q)))
[PROOF STEP]
by simp


[STATEMENT]
lemma expanded_problem_plan_bound_thm_1:
  fixes PROB
  shows "
    (problem_plan_bound PROB) = Sup (
      (\<lambda>(s,as). Inf (PLS s as)) `
      {(s, as). (s \<in> (valid_states PROB)) \<and> (as \<in> valid_plans PROB)}
    )
  "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. problem_plan_bound PROB = (SUP (s, as)\<in>{(s, as). s \<in> valid_states PROB \<and> as \<in> valid_plans PROB}. Inf (PLS s as))
[PROOF STEP]
unfolding problem_plan_bound_def MPLS_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SUP (s, as)\<in>{(s, as). s \<in> valid_states PROB \<and> as \<in> valid_plans PROB}. Inf (PLS s as)) = (SUP (s, as)\<in>{(s, as). s \<in> valid_states PROB \<and> as \<in> valid_plans PROB}. Inf (PLS s as))
[PROOF STEP]
by blast


[STATEMENT]
lemma "(- 3) ^ 7 = (-2187::real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- 3) ^ 7 = - 2187
[PROOF STEP]
by simp


[STATEMENT]
lemma mem_infmal_iff: "x \<in> Infinitesimal \<longleftrightarrow> x \<approx> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> Infinitesimal) = (x \<approx> 0)
[PROOF STEP]
by (simp add: Infinitesimal_def approx_def)


[STATEMENT]
lemma Abel_lemma:
  fixes a :: "nat \<Rightarrow> 'a::real_normed_vector"
  assumes r: "0 \<le> r"
    and r0: "r < r0"
    and M: "\<And>n. norm (a n) * r0^n \<le> M"
  shows "summable (\<lambda>n. norm (a n) * r^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. norm (a n) * r ^ n)
[PROOF STEP]
proof (rule summable_comparison_test')
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. summable ?g
 2. \<And>n. ?N \<le> n \<Longrightarrow> norm (norm (a n) * r ^ n) \<le> ?g n
[PROOF STEP]
show "summable (\<lambda>n. M * (r / r0) ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable (\<lambda>n. M * (r / r0) ^ n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<le> r
r < r0
norm (a ?n) * r0 ^ ?n \<le> M

goal (1 subgoal):
 1. summable (\<lambda>n. M * (r / r0) ^ n)
[PROOF STEP]
by (auto simp add: summable_mult summable_geometric)
[PROOF STATE]
proof (state)
this:
summable (\<lambda>n. M * (r / r0) ^ n)

goal (1 subgoal):
 1. \<And>n. ?N \<le> n \<Longrightarrow> norm (norm (a n) * r ^ n) \<le> M * (r / r0) ^ n
[PROOF STEP]
show "norm (norm (a n) * r ^ n) \<le> M * (r / r0) ^ n" for n
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (norm (a n) * r ^ n) \<le> M * (r / r0) ^ n
[PROOF STEP]
using r r0 M [of n] dual_order.order_iff_strict
[PROOF STATE]
proof (prove)
using this:
0 \<le> r
r < r0
norm (a n) * r0 ^ n \<le> M
(?b \<le> ?a) = (?b < ?a \<or> ?a = ?b)

goal (1 subgoal):
 1. norm (norm (a n) * r ^ n) \<le> M * (r / r0) ^ n
[PROOF STEP]
by (fastforce simp add: abs_mult field_simps)
[PROOF STATE]
proof (state)
this:
norm (norm (a ?n) * r ^ ?n) \<le> M * (r / r0) ^ ?n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_rat_less: "(of_rat r :: 'a::linordered_field) < of_rat s \<longleftrightarrow> r < s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat r < of_rat s) = (r < s)
[PROOF STEP]
proof (induct r, induct s)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>0 < b; 0 < ba\<rbrakk> \<Longrightarrow> (of_rat (Fract aa ba) < of_rat (Fract a b)) = (Fract aa ba < Fract a b)
[PROOF STEP]
fix a b c d :: int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>0 < b; 0 < ba\<rbrakk> \<Longrightarrow> (of_rat (Fract aa ba) < of_rat (Fract a b)) = (Fract aa ba < Fract a b)
[PROOF STEP]
assume not_zero: "b > 0" "d > 0"
[PROOF STATE]
proof (state)
this:
0 < b
0 < d

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>0 < b; 0 < ba\<rbrakk> \<Longrightarrow> (of_rat (Fract aa ba) < of_rat (Fract a b)) = (Fract aa ba < Fract a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < b
0 < d
[PROOF STEP]
have "b * d > 0"
[PROOF STATE]
proof (prove)
using this:
0 < b
0 < d

goal (1 subgoal):
 1. 0 < b * d
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < b * d

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>0 < b; 0 < ba\<rbrakk> \<Longrightarrow> (of_rat (Fract aa ba) < of_rat (Fract a b)) = (Fract aa ba < Fract a b)
[PROOF STEP]
have of_int_divide_less_eq:
    "(of_int a :: 'a) / of_int b < of_int c / of_int d \<longleftrightarrow>
      (of_int a :: 'a) * of_int d < of_int c * of_int b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_int a / of_int b < of_int c / of_int d) = (of_int a * of_int d < of_int c * of_int b)
[PROOF STEP]
using not_zero
[PROOF STATE]
proof (prove)
using this:
0 < b
0 < d

goal (1 subgoal):
 1. (of_int a / of_int b < of_int c / of_int d) = (of_int a * of_int d < of_int c * of_int b)
[PROOF STEP]
by (simp add: pos_less_divide_eq pos_divide_less_eq)
[PROOF STATE]
proof (state)
this:
(of_int a / of_int b < of_int c / of_int d) = (of_int a * of_int d < of_int c * of_int b)

goal (1 subgoal):
 1. \<And>a b aa ba. \<lbrakk>0 < b; 0 < ba\<rbrakk> \<Longrightarrow> (of_rat (Fract aa ba) < of_rat (Fract a b)) = (Fract aa ba < Fract a b)
[PROOF STEP]
show "(of_rat (Fract a b) :: 'a::linordered_field) < of_rat (Fract c d) \<longleftrightarrow>
      Fract a b < Fract c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_rat (Fract a b) < of_rat (Fract c d)) = (Fract a b < Fract c d)
[PROOF STEP]
using not_zero \<open>b * d > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < b
0 < d
0 < b * d

goal (1 subgoal):
 1. (of_rat (Fract a b) < of_rat (Fract c d)) = (Fract a b < Fract c d)
[PROOF STEP]
by (simp add: of_rat_rat of_int_divide_less_eq of_int_mult [symmetric] del: of_int_mult)
[PROOF STATE]
proof (state)
this:
(of_rat (Fract a b) < of_rat (Fract c d)) = (Fract a b < Fract c d)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma of_nat_inject_zhmset[simp]: "(of_nat m :: zhmultiset) = of_nat n \<longleftrightarrow> m = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (of_nat m = of_nat n) = (m = n)
[PROOF STEP]
unfolding of_nat_zhmset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (zhmset_of (of_nat m) = zhmset_of (of_nat n)) = (m = n)
[PROOF STEP]
by simp


[STATEMENT]
lemma state_rank_oldest_token:
  assumes "state_rank p n = Some i"
  assumes "state_rank q n = Some j"
  assumes "oldest_token p n = Some x"
  assumes "oldest_token q n = Some y"
  shows "i < j \<longleftrightarrow> x < y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
have "configuration p n \<noteq> {}" and "configuration q n \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. configuration p n \<noteq> {} &&& configuration q n \<noteq> {}
[PROOF STEP]
using assms(3,4)
[PROOF STATE]
proof (prove)
using this:
oldest_token p n = Some x
oldest_token q n = Some y

goal (1 subgoal):
 1. configuration p n \<noteq> {} &&& configuration q n \<noteq> {}
[PROOF STEP]
by (metis oldest_token.simps option.distinct(1))+
[PROOF STATE]
proof (state)
this:
configuration p n \<noteq> {}
configuration q n \<noteq> {}

goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
configuration p n \<noteq> {}
configuration q n \<noteq> {}

goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
have "\<not>sink p" and "\<not>sink q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> sink p &&& \<not> sink q
[PROOF STEP]
using assms(1,2) state_rank_sink
[PROOF STATE]
proof (prove)
using this:
state_rank p n = Some i
state_rank q n = Some j
sink ?q \<Longrightarrow> state_rank ?q ?n = None

goal (1 subgoal):
 1. \<not> sink p &&& \<not> sink q
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<not> sink p
\<not> sink q

goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
configuration p n \<noteq> {}
configuration q n \<noteq> {}
\<not> sink p
\<not> sink q
[PROOF STEP]
have i_def: "i = card (senior_states p n)" and j_def: "j = card (senior_states q n)"
[PROOF STATE]
proof (prove)
using this:
configuration p n \<noteq> {}
configuration q n \<noteq> {}
\<not> sink p
\<not> sink q

goal (1 subgoal):
 1. i = card (senior_states p n) &&& j = card (senior_states q n)
[PROOF STEP]
using assms(1,2) option.sel
[PROOF STATE]
proof (prove)
using this:
configuration p n \<noteq> {}
configuration q n \<noteq> {}
\<not> sink p
\<not> sink q
state_rank p n = Some i
state_rank q n = Some j
the (Some ?x2.0) = ?x2.0

goal (1 subgoal):
 1. i = card (senior_states p n) &&& j = card (senior_states q n)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
i = card (senior_states p n)
j = card (senior_states q n)

goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
hence "i < j \<longleftrightarrow> senior_states p n \<subset> senior_states q n"
[PROOF STATE]
proof (prove)
using this:
i = card (senior_states p n)
j = card (senior_states q n)

goal (1 subgoal):
 1. (i < j) = (senior_states p n \<subset> senior_states q n)
[PROOF STEP]
using senior_states_card_le
[PROOF STATE]
proof (prove)
using this:
i = card (senior_states p n)
j = card (senior_states q n)
(card (senior_states ?p ?n) < card (senior_states ?q ?n)) = (senior_states ?p ?n \<subset> senior_states ?q ?n)

goal (1 subgoal):
 1. (i < j) = (senior_states p n \<subset> senior_states q n)
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
(i < j) = (senior_states p n \<subset> senior_states q n)

goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(i < j) = (senior_states p n \<subset> senior_states q n)

goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
with assms(3,4)
[PROOF STATE]
proof (chain)
picking this:
oldest_token p n = Some x
oldest_token q n = Some y
(i < j) = (senior_states p n \<subset> senior_states q n)
[PROOF STEP]
have "\<dots> \<longleftrightarrow> x < y"
[PROOF STATE]
proof (prove)
using this:
oldest_token p n = Some x
oldest_token q n = Some y
(i < j) = (senior_states p n \<subset> senior_states q n)

goal (1 subgoal):
 1. (senior_states p n \<subset> senior_states q n) = (x < y)
[PROOF STEP]
proof (cases rule: senior_states_cases_subset[of p n q])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<lbrakk>oldest_token p n = Some x; oldest_token q n = Some y; (i < j) = (senior_states p n \<subset> senior_states q n); senior_states p n \<subset> senior_states q n\<rbrakk> \<Longrightarrow> (senior_states p n \<subset> senior_states q n) = (x < y)
 2. \<lbrakk>oldest_token p n = Some x; oldest_token q n = Some y; (i < j) = (senior_states p n \<subset> senior_states q n); senior_states p n = senior_states q n\<rbrakk> \<Longrightarrow> (senior_states p n \<subset> senior_states q n) = (x < y)
 3. \<lbrakk>oldest_token p n = Some x; oldest_token q n = Some y; (i < j) = (senior_states p n \<subset> senior_states q n); senior_states q n \<subset> senior_states p n\<rbrakk> \<Longrightarrow> (senior_states p n \<subset> senior_states q n) = (x < y)
[PROOF STEP]
case equal
[PROOF STATE]
proof (state)
this:
senior_states p n = senior_states q n

goal (3 subgoals):
 1. \<lbrakk>oldest_token p n = Some x; oldest_token q n = Some y; (i < j) = (senior_states p n \<subset> senior_states q n); senior_states p n \<subset> senior_states q n\<rbrakk> \<Longrightarrow> (senior_states p n \<subset> senior_states q n) = (x < y)
 2. \<lbrakk>oldest_token p n = Some x; oldest_token q n = Some y; (i < j) = (senior_states p n \<subset> senior_states q n); senior_states p n = senior_states q n\<rbrakk> \<Longrightarrow> (senior_states p n \<subset> senior_states q n) = (x < y)
 3. \<lbrakk>oldest_token p n = Some x; oldest_token q n = Some y; (i < j) = (senior_states p n \<subset> senior_states q n); senior_states q n \<subset> senior_states p n\<rbrakk> \<Longrightarrow> (senior_states p n \<subset> senior_states q n) = (x < y)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
senior_states p n = senior_states q n

goal (1 subgoal):
 1. (senior_states p n \<subset> senior_states q n) = (x < y)
[PROOF STEP]
using assms state_rank_distinct i_def j_def
[PROOF STATE]
proof (prove)
using this:
senior_states p n = senior_states q n
state_rank p n = Some i
state_rank q n = Some j
oldest_token p n = Some x
oldest_token q n = Some y
\<lbrakk>?p \<noteq> ?q; state_rank ?p ?n = Some ?i; state_rank ?q ?n = Some ?j\<rbrakk> \<Longrightarrow> ?i \<noteq> ?j
i = card (senior_states p n)
j = card (senior_states q n)

goal (1 subgoal):
 1. (senior_states p n \<subset> senior_states q n) = (x < y)
[PROOF STEP]
by (metis less_irrefl option.sel)
[PROOF STATE]
proof (state)
this:
(senior_states p n \<subset> senior_states q n) = (x < y)

goal (2 subgoals):
 1. \<lbrakk>oldest_token p n = Some x; oldest_token q n = Some y; (i < j) = (senior_states p n \<subset> senior_states q n); senior_states p n \<subset> senior_states q n\<rbrakk> \<Longrightarrow> (senior_states p n \<subset> senior_states q n) = (x < y)
 2. \<lbrakk>oldest_token p n = Some x; oldest_token q n = Some y; (i < j) = (senior_states p n \<subset> senior_states q n); senior_states q n \<subset> senior_states p n\<rbrakk> \<Longrightarrow> (senior_states p n \<subset> senior_states q n) = (x < y)
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(senior_states p n \<subset> senior_states q n) = (x < y)

goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(i < j) = (senior_states p n \<subset> senior_states q n)
(senior_states p n \<subset> senior_states q n) = (x < y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(i < j) = (senior_states p n \<subset> senior_states q n)
(senior_states p n \<subset> senior_states q n) = (x < y)

goal (1 subgoal):
 1. (i < j) = (x < y)
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
(i < j) = (x < y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eq_neg_iff_add_eq_0:
  assumes "x \<in> carrier R" "y \<in> carrier R"
  shows "x = \<ominus> y \<longleftrightarrow> x \<oplus> y = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x = \<ominus> y) = (x \<oplus> y = \<zero>)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x = \<ominus> y \<Longrightarrow> x \<oplus> y = \<zero>
 2. x \<oplus> y = \<zero> \<Longrightarrow> x = \<ominus> y
[PROOF STEP]
assume "x = \<ominus> y"
[PROOF STATE]
proof (state)
this:
x = \<ominus> y

goal (2 subgoals):
 1. x = \<ominus> y \<Longrightarrow> x \<oplus> y = \<zero>
 2. x \<oplus> y = \<zero> \<Longrightarrow> x = \<ominus> y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
x = \<ominus> y
[PROOF STEP]
show "x \<oplus> y = \<zero>"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
x = \<ominus> y

goal (1 subgoal):
 1. x \<oplus> y = \<zero>
[PROOF STEP]
by (simp add: l_neg)
[PROOF STATE]
proof (state)
this:
x \<oplus> y = \<zero>

goal (1 subgoal):
 1. x \<oplus> y = \<zero> \<Longrightarrow> x = \<ominus> y
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<oplus> y = \<zero> \<Longrightarrow> x = \<ominus> y
[PROOF STEP]
assume "x \<oplus> y = \<zero>"
[PROOF STATE]
proof (state)
this:
x \<oplus> y = \<zero>

goal (1 subgoal):
 1. x \<oplus> y = \<zero> \<Longrightarrow> x = \<ominus> y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
x \<oplus> y = \<zero>
[PROOF STEP]
have "x \<oplus> (y \<oplus> \<ominus> y) = \<zero> \<oplus> \<ominus> y"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
x \<oplus> y = \<zero>

goal (1 subgoal):
 1. x \<oplus> (y \<oplus> \<ominus> y) = \<zero> \<oplus> \<ominus> y
[PROOF STEP]
by (simp add: a_assoc [symmetric])
[PROOF STATE]
proof (state)
this:
x \<oplus> (y \<oplus> \<ominus> y) = \<zero> \<oplus> \<ominus> y

goal (1 subgoal):
 1. x \<oplus> y = \<zero> \<Longrightarrow> x = \<ominus> y
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
x \<in> carrier R
y \<in> carrier R
x \<oplus> (y \<oplus> \<ominus> y) = \<zero> \<oplus> \<ominus> y
[PROOF STEP]
show "x = \<ominus> y"
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier R
y \<in> carrier R
x \<oplus> (y \<oplus> \<ominus> y) = \<zero> \<oplus> \<ominus> y

goal (1 subgoal):
 1. x = \<ominus> y
[PROOF STEP]
by (simp add: r_neg)
[PROOF STATE]
proof (state)
this:
x = \<ominus> y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ran_map_of_zip:
  assumes "length xs = length ys" "distinct xs"
  shows "ran (map_of (zip xs ys)) = set ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ran (map_of (zip xs ys)) = set ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
length xs = length ys
distinct xs

goal (1 subgoal):
 1. ran (map_of (zip xs ys)) = set ys
[PROOF STEP]
by (simp add: ran_distinct set_map[symmetric])


[STATEMENT]
lemma cball_times_subset: "cball a (c/2) \<times> cball b (c/2) \<subseteq> cball (a, b) c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
fix a' b'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
have "sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> dist a a' + dist b b'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> dist a a' + dist b b'
[PROOF STEP]
by (rule real_le_lsqrt) (auto simp: power2_eq_square algebra_simps)
[PROOF STATE]
proof (state)
this:
sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> dist a a' + dist b b'

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> dist a a' + dist b b'

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
assume "a' \<in> cball a (c / 2)"
[PROOF STATE]
proof (state)
this:
a' \<in> cball a (c / 2)

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a' \<in> cball a (c / 2)
[PROOF STEP]
have "dist a a' \<le> c / 2"
[PROOF STATE]
proof (prove)
using this:
a' \<in> cball a (c / 2)

goal (1 subgoal):
 1. dist a a' \<le> c / 2
[PROOF STEP]
by (simp add: mem_cball)
[PROOF STATE]
proof (state)
this:
dist a a' \<le> c / 2

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist a a' \<le> c / 2

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
assume "b' \<in> cball b (c / 2)"
[PROOF STATE]
proof (state)
this:
b' \<in> cball b (c / 2)

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b' \<in> cball b (c / 2)
[PROOF STEP]
have "dist b b' \<le> c / 2"
[PROOF STATE]
proof (prove)
using this:
b' \<in> cball b (c / 2)

goal (1 subgoal):
 1. dist b b' \<le> c / 2
[PROOF STEP]
by (simp add: mem_cball)
[PROOF STATE]
proof (state)
this:
dist b b' \<le> c / 2

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + dist b b' \<le> y + dist b b'; \<And>x y. x \<le> y \<Longrightarrow> c / 2 + x \<le> c / 2 + y\<rbrakk> \<Longrightarrow> sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> c / 2 + c / 2
[PROOF STEP]
have "sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> c"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>x y. x \<le> y \<Longrightarrow> x + dist b b' \<le> y + dist b b'; \<And>x y. x \<le> y \<Longrightarrow> c / 2 + x \<le> c / 2 + y\<rbrakk> \<Longrightarrow> sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> c / 2 + c / 2

goal (1 subgoal):
 1. sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt ((dist a a')\<^sup>2 + (dist b b')\<^sup>2) \<le> c

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?a'2 \<in> cball a (c / 2); ?b'2 \<in> cball b (c / 2)\<rbrakk> \<Longrightarrow> sqrt ((dist a ?a'2)\<^sup>2 + (dist b ?b'2)\<^sup>2) \<le> c

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a'2 \<in> cball a (c / 2); ?b'2 \<in> cball b (c / 2)\<rbrakk> \<Longrightarrow> sqrt ((dist a ?a'2)\<^sup>2 + (dist b ?b'2)\<^sup>2) \<le> c

goal (1 subgoal):
 1. cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c
[PROOF STEP]
by (auto simp: dist_prod_def mem_cball)
[PROOF STATE]
proof (state)
this:
cball a (c / 2) \<times> cball b (c / 2) \<subseteq> cball (a, b) c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma surj_fin_dim:
  assumes fd: "V.fin_dim" and surj: "T` (carrier V) = carrier W"
  shows image_fin_dim: "W.fin_dim"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. W.fin_dim
[PROOF STEP]
using rank_nullity_main(2)[OF fd surj]
[PROOF STATE]
proof (prove)
using this:
W.fin_dim

goal (1 subgoal):
 1. W.fin_dim
[PROOF STEP]
.


[STATEMENT]
lemma take_bit_numeral_minus_1_eq:
  \<open>take_bit (numeral k) (- 1) = 2 ^ numeral k - 1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (numeral k) (- (1::'a)) = (2::'a) ^ numeral k - (1::'a)
[PROOF STEP]
by (simp add: mask_eq_exp_minus_1)


[STATEMENT]
lemma N_row_mset_blocks_img: "i < \<v> \<Longrightarrow>
    vec_mset (row N i) = image_mset (\<lambda> x . if ((\<V>s ! i) \<in> x) then 1 else 0) \<B>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < \<v> \<Longrightarrow> vec_mset (row N i) = {#if \<V>s ! i \<in> x then 1 else 0. x \<in># \<B>#}
[PROOF STEP]
using vec_mset_img_map N_row_list_map
[PROOF STATE]
proof (prove)
using this:
image_mset ?f (mset ?xs) = vec_mset (map_vec ?f (vec_of_list ?xs))
?i < \<v> \<Longrightarrow> row N ?i = map_vec (\<lambda>bl. if \<V>s ! ?i \<in> bl then 1 else 0) (vec_of_list \<B>s)

goal (1 subgoal):
 1. i < \<v> \<Longrightarrow> vec_mset (row N i) = {#if \<V>s ! i \<in> x then 1 else 0. x \<in># \<B>#}
[PROOF STEP]
by metis


[STATEMENT]
lemma vec_cnj_mult_vm:
  shows "vec_cnj (v *\<^sub>v\<^sub>m A) = vec_cnj v *\<^sub>v\<^sub>m mat_cnj A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_cnj (v *\<^sub>v\<^sub>m A) = vec_cnj v *\<^sub>v\<^sub>m mat_cnj A
[PROOF STEP]
unfolding vec_cnj_def mat_cnj_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_map cnj (v *\<^sub>v\<^sub>m A) = vec_map cnj v *\<^sub>v\<^sub>m mat_map cnj A
[PROOF STEP]
by (cases A, cases v, auto)


[STATEMENT]
lemma (in Order) ord_isom_less_forall:"\<lbrakk>Order E; ord_isom D E f\<rbrakk> \<Longrightarrow>
      \<forall>a \<in> carrier D. \<forall> b \<in> carrier D. (a \<prec>\<^bsub>D\<^esub> b) = ((f a) \<prec>\<^bsub>E\<^esub> (f b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_isom D E f\<rbrakk> \<Longrightarrow> \<forall>a\<in>carrier D. \<forall>b\<in>carrier D. a \<prec> b = f a \<prec>\<^bsub>E\<^esub> f b
[PROOF STEP]
by ((rule ballI)+,
    simp add:ord_isom_less)


[STATEMENT]
lemma power_le_imp_le_base2:
  "\<lbrakk> (a::'a::linordered_semidom) ^ n \<le> b ^ n; 0 \<le> b; 0 < n \<rbrakk>
   \<Longrightarrow> a \<le> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a ^ n \<le> b ^ n; (0::'a) \<le> b; 0 < n\<rbrakk> \<Longrightarrow> a \<le> b
[PROOF STEP]
by (auto intro: power_le_imp_le_base [of _ "n - 1"])


[STATEMENT]
lemma cos_of_real_pi_half [simp]: "cos ((of_real pi/2) :: 'a) = 0"
  if "SORT_CONSTRAINT('a::{real_field,banach,real_normed_algebra_1})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cos (of_real pi / (2::'a)) = (0::'a)
[PROOF STEP]
by (metis cos_pi_half cos_of_real eq_numeral_simps(4)
      nonzero_of_real_divide of_real_0 of_real_numeral)


[STATEMENT]
lemma matpow_mono: assumes B: "\<And> i j. B $ i $ j \<ge> A $ i $ j"
  shows "matpow B n $ i $ j \<ge> matpow A n $ i $ j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matpow A n $h i $h j \<le> matpow B n $h i $h j
[PROOF STEP]
proof (induct n arbitrary: i j)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i j. matpow A 0 $h i $h j \<le> matpow B 0 $h i $h j
 2. \<And>n i j. (\<And>i j. matpow A n $h i $h j \<le> matpow B n $h i $h j) \<Longrightarrow> matpow A (Suc n) $h i $h j \<le> matpow B (Suc n) $h i $h j
[PROOF STEP]
case (Suc n i j)
[PROOF STATE]
proof (state)
this:
matpow A n $h ?i $h ?j \<le> matpow B n $h ?i $h ?j

goal (2 subgoals):
 1. \<And>i j. matpow A 0 $h i $h j \<le> matpow B 0 $h i $h j
 2. \<And>n i j. (\<And>i j. matpow A n $h i $h j \<le> matpow B n $h i $h j) \<Longrightarrow> matpow A (Suc n) $h i $h j \<le> matpow B (Suc n) $h i $h j
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
matpow A n $h ?i $h ?j \<le> matpow B n $h ?i $h ?j

goal (1 subgoal):
 1. matpow A (Suc n) $h i $h j \<le> matpow B (Suc n) $h i $h j
[PROOF STEP]
using B nonneg_matpow[of n] nonneg
[PROOF STATE]
proof (prove)
using this:
matpow A n $h ?i $h ?j \<le> matpow B n $h ?i $h ?j
A $h ?i $h ?j \<le> B $h ?i $h ?j
(0::'a) \<le> matpow A n $h ?i $h ?j
(0::'a) \<le> A $h ?i $h ?j

goal (1 subgoal):
 1. matpow A (Suc n) $h i $h j \<le> matpow B (Suc n) $h i $h j
[PROOF STEP]
by (auto simp: matrix_matrix_mult_def intro!: sum_mono mult_mono')
[PROOF STATE]
proof (state)
this:
matpow A (Suc n) $h i $h j \<le> matpow B (Suc n) $h i $h j

goal (1 subgoal):
 1. \<And>i j. matpow A 0 $h i $h j \<le> matpow B 0 $h i $h j
[PROOF STEP]
qed simp


[STATEMENT]
lemma openin_prod_topology:
   "openin (prod_topology X Y) = arbitrary union_of (\<lambda>U. U \<in> {S \<times> T |S T. openin X S \<and> openin Y T})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (prod_topology X Y) = arbitrary union_of (\<lambda>U. U \<in> {S \<times> T |S T. openin X S \<and> openin Y T})
[PROOF STEP]
unfolding prod_topology_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (topology (arbitrary union_of (\<lambda>U. U \<in> {S \<times> T |S T. openin X S \<and> openin Y T}))) = arbitrary union_of (\<lambda>U. U \<in> {S \<times> T |S T. openin X S \<and> openin Y T})
[PROOF STEP]
proof (rule topology_inverse')
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. istopology (arbitrary union_of (\<lambda>U. U \<in> {S \<times> T |S T. openin X S \<and> openin Y T}))
[PROOF STEP]
show "istopology (arbitrary union_of (\<lambda>U. U \<in> {S \<times> T |S T. openin X S \<and> openin Y T}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. istopology (arbitrary union_of (\<lambda>U. U \<in> {S \<times> T |S T. openin X S \<and> openin Y T}))
[PROOF STEP]
apply (rule istopology_base, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>S T. \<lbrakk>\<exists>Sa T. S = Sa \<times> T \<and> openin X Sa \<and> openin Y T; \<exists>S Ta. T = S \<times> Ta \<and> openin X S \<and> openin Y Ta\<rbrakk> \<Longrightarrow> \<exists>Sa Ta. S \<inter> T = Sa \<times> Ta \<and> openin X Sa \<and> openin Y Ta
[PROOF STEP]
by (metis openin_Int Times_Int_Times)
[PROOF STATE]
proof (state)
this:
istopology (arbitrary union_of (\<lambda>U. U \<in> {S \<times> T |S T. openin X S \<and> openin Y T}))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Un_card2: "\<lbrakk> finite A; finite B \<rbrakk> \<Longrightarrow> card B \<le> card (A \<union> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; finite B\<rbrakk> \<Longrightarrow> card B \<le> card (A \<union> B)
[PROOF STEP]
by (simp only: Un_commute[of A], rule Un_card1)


[STATEMENT]
lemma (in finite_measure) finite_measure_subadditive:
  assumes m: "A \<in> sets M" "B \<in> sets M"
  shows "measure M (A \<union> B) \<le> measure M A + measure M B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sigma_Algebra.measure M (A \<union> B) \<le> Sigma_Algebra.measure M A + Sigma_Algebra.measure M B
[PROOF STEP]
using measure_subadditive[OF m]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>emeasure M A \<noteq> \<infinity>; emeasure M B \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M (A \<union> B) \<le> Sigma_Algebra.measure M A + Sigma_Algebra.measure M B

goal (1 subgoal):
 1. Sigma_Algebra.measure M (A \<union> B) \<le> Sigma_Algebra.measure M A + Sigma_Algebra.measure M B
[PROOF STEP]
by simp


[STATEMENT]
lemma integral_mono':
  fixes f::"_ \<Rightarrow> real"
  assumes "integrable M f" "\<And>x. x \<in> space M \<Longrightarrow> g x \<le> f x" "\<And>x. x \<in> space M \<Longrightarrow> 0 \<le> f x"
  shows "(\<integral>x. g x \<partial>M) \<le> (\<integral>x. f x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral\<^sup>L M g \<le> integral\<^sup>L M f
[PROOF STEP]
by (rule integral_mono_AE', insert assms, auto)


[STATEMENT]
lemma det_dim_1: assumes A: "A \<in> carrier_mat n n"
  and n: "n = 1"
shows "Determinant.det A = A $$ (0,0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Determinant.det A = A $$ (0, 0)
[PROOF STEP]
by (subst laplace_expansion_column[OF A[unfolded n], of 0], insert A n,
    auto simp: cofactor_def mat_delete_def)


[STATEMENT]
lemma Bij_inv_into_lemma:
  assumes eq: "\<And>x y. \<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> h(g x y) = g (h x) (h y)"
      and hg: "h \<in> Bij S" "g \<in> S \<rightarrow> S \<rightarrow> S" and "x \<in> S" "y \<in> S"
  shows "inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)
[PROOF STEP]
have "h ` S = S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h ` S = S
[PROOF STEP]
by (metis (no_types) Bij_def Int_iff assms(2) bij_betw_def mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
h ` S = S

goal (1 subgoal):
 1. inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)
[PROOF STEP]
with \<open>x \<in> S\<close> \<open>y \<in> S\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<in> S
y \<in> S
h ` S = S
[PROOF STEP]
have "\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' \<and> y = h y'"
[PROOF STATE]
proof (prove)
using this:
x \<in> S
y \<in> S
h ` S = S

goal (1 subgoal):
 1. \<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' \<and> y = h y'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' \<and> y = h y'

goal (1 subgoal):
 1. inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' \<and> y = h y'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' \<and> y = h y'

goal (1 subgoal):
 1. inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>x'\<in>S. \<exists>y'\<in>S. x = h x' \<and> y = h y'
\<lbrakk>?x \<in> S; ?y \<in> S\<rbrakk> \<Longrightarrow> h (g ?x ?y) = g (h ?x) (h ?y)
h \<in> Bij S
g \<in> S \<rightarrow> S \<rightarrow> S
x \<in> S
y \<in> S

goal (1 subgoal):
 1. inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)
[PROOF STEP]
by (auto simp add: Bij_def bij_betw_def eq [symmetric] inv_f_f funcset_mem [THEN funcset_mem])
[PROOF STATE]
proof (state)
this:
inv_into S h (g x y) = g (inv_into S h x) (inv_into S h y)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_on_translation_eq:
  fixes g :: "'a :: real_normed_vector \<Rightarrow> 'b :: real_normed_vector"
  shows "continuous_on A ((+) a \<circ> g) = continuous_on A g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A ((+) a \<circ> g) = continuous_on A g
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. continuous_on A ((+) a \<circ> g) = continuous_on A g
[PROOF STEP]
have g: "g = (\<lambda>x. -a + x) \<circ> ((\<lambda>x. a + x) \<circ> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. g = (+) (- a) \<circ> ((+) a \<circ> g)
[PROOF STEP]
by (rule ext) simp
[PROOF STATE]
proof (state)
this:
g = (+) (- a) \<circ> ((+) a \<circ> g)

goal (1 subgoal):
 1. continuous_on A ((+) a \<circ> g) = continuous_on A g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on A ((+) a \<circ> g) = continuous_on A g
[PROOF STEP]
by (metis (no_types, opaque_lifting) g continuous_on_compose homeomorphism_def homeomorphism_translation)
[PROOF STATE]
proof (state)
this:
continuous_on A ((+) a \<circ> g) = continuous_on A g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subspaceI:
  "0 \<in> S \<Longrightarrow> (\<And>x y. x \<in> S \<Longrightarrow> y \<in> S \<Longrightarrow> x + y \<in> S) \<Longrightarrow> (\<And>c x. x \<in> S \<Longrightarrow> c *s x \<in> S) \<Longrightarrow> subspace S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(0::'b) \<in> S; \<And>x y. \<lbrakk>x \<in> S; y \<in> S\<rbrakk> \<Longrightarrow> x + y \<in> S; \<And>c x. x \<in> S \<Longrightarrow> c *s x \<in> S\<rbrakk> \<Longrightarrow> subspace S
[PROOF STEP]
by (auto simp: subspace_def)


[STATEMENT]
lemma inner_mult_diag_expand':
  fixes B::"complex Matrix.mat"
  assumes "diagonal_mat B"
  and "B \<in> carrier_mat n n"
  and "v \<in> carrier_vec n"
shows "inner_prod v (B *\<^sub>v v) =
  (\<Sum> i \<in> {0 ..< n}. B $$ (i,i) * (vec_index v i *
      (conjugate (vec_index v i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))
[PROOF STEP]
have  idx: "\<And>i. i < n \<Longrightarrow> vec_index (B *\<^sub>v v) i = B $$ (i,i) * (vec_index v i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> (B *\<^sub>v v) $ i = B $$ (i, i) * v $ i
[PROOF STEP]
using assms diagonal_mat_mult_vec
[PROOF STATE]
proof (prove)
using this:
diagonal_mat B
B \<in> carrier_mat n n
v \<in> carrier_vec n
\<lbrakk>diagonal_mat ?B; ?B \<in> carrier_mat ?n ?n; ?v \<in> carrier_vec ?n; ?i < ?n\<rbrakk> \<Longrightarrow> (?B *\<^sub>v ?v) $ ?i = ?B $$ (?i, ?i) * ?v $ ?i

goal (1 subgoal):
 1. \<And>i. i < n \<Longrightarrow> (B *\<^sub>v v) $ i = B $$ (i, i) * v $ i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
?i < n \<Longrightarrow> (B *\<^sub>v v) $ ?i = B $$ (?i, ?i) * v $ ?i

goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))
[PROOF STEP]
have "inner_prod v (B *\<^sub>v v)  =
    (\<Sum> i \<in> {0 ..< n}. vec_index (B *\<^sub>v v) i * vec_index (conjugate v) i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate v $ i)
[PROOF STEP]
unfolding Matrix.scalar_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (conjugate v). (B *\<^sub>v v) $ i * conjugate v $ i) = (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate v $ i)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
diagonal_mat B
B \<in> carrier_mat n n
v \<in> carrier_vec n

goal (1 subgoal):
 1. (\<Sum>i = 0..<dim_vec (conjugate v). (B *\<^sub>v v) $ i * conjugate v $ i) = (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate v $ i)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate v $ i)

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

goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))
[PROOF STEP]
have "... =
    (\<Sum> i \<in> {0 ..< n}. vec_index (B *\<^sub>v v) i * conjugate (vec_index v i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate v $ i) = (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate (v $ i))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
diagonal_mat B
B \<in> carrier_mat n n
v \<in> carrier_vec n

goal (1 subgoal):
 1. (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate v $ i) = (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate (v $ i))
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate v $ i) = (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate (v $ i))

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

goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))
[PROOF STEP]
have "... = (\<Sum> i \<in> {0 ..< n}. (B $$ (i,i)) * (vec_index v i *
      (conjugate (vec_index v i))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate (v $ i)) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))
[PROOF STEP]
proof (rule sum.cong, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. x \<in> {0..<n} \<Longrightarrow> (B *\<^sub>v v) $ x * conjugate (v $ x) = B $$ (x, x) * (v $ x * conjugate (v $ x))
[PROOF STEP]
show "\<And>i. i \<in> {0 ..< n} \<Longrightarrow>
      vec_index (B *\<^sub>v v) i * conjugate (vec_index v i) =
      (B $$ (i,i)) * (vec_index v i * (conjugate (vec_index v i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. i \<in> {0..<n} \<Longrightarrow> (B *\<^sub>v v) $ i * conjugate (v $ i) = B $$ (i, i) * (v $ i * conjugate (v $ i))
[PROOF STEP]
by (simp add:  idx)
[PROOF STATE]
proof (state)
this:
?i \<in> {0..<n} \<Longrightarrow> (B *\<^sub>v v) $ ?i * conjugate (v $ ?i) = B $$ (?i, ?i) * (v $ ?i * conjugate (v $ ?i))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..<n. (B *\<^sub>v v) $ i * conjugate (v $ i)) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))

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

goal (1 subgoal):
 1. Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Complex_Matrix.inner_prod v (B *\<^sub>v v) = (\<Sum>i = 0..<n. B $$ (i, i) * (v $ i * conjugate (v $ i)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem prim_list_impl_correct:
  shows "case prim_list_impl l r of
    None \<Rightarrow> \<not>G.valid_wgraph_repr l \<comment> \<open>Invalid input\<close>
  | Some \<pi>i \<Rightarrow>
        G.valid_wgraph_repr l \<and> (let Gi = G.from_list l in G.invar Gi \<comment> \<open>Valid input\<close>
        \<and> P.invar_MST \<pi>i \<comment> \<open>Output satisfies invariants\<close>
        \<and> is_MST (G.\<alpha>w Gi) (component_of (G.\<alpha>g Gi) r) (P.\<alpha>_MST r \<pi>i)) \<comment> \<open>and represents MST\<close>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. case prim_list_impl l r of None \<Rightarrow> \<not> G_valid_wgraph_repr l | Some \<pi>i \<Rightarrow> G_valid_wgraph_repr l \<and> (let Gi = G.from_list l in G.invar Gi \<and> P.invar_MST \<pi>i \<and> is_MST (G.\<alpha>w Gi) (component_of (G.\<alpha>g Gi) r) (P.\<alpha>_MST r \<pi>i))
[PROOF STEP]
unfolding prim_list_impl_def G_from_list_unfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. case if G_valid_wgraph_repr l then Some (prim_impl (G.from_list l) r) else None of None \<Rightarrow> \<not> G_valid_wgraph_repr l | Some \<pi>i \<Rightarrow> G_valid_wgraph_repr l \<and> (let Gi = G.from_list l in G.invar Gi \<and> P.invar_MST \<pi>i \<and> is_MST (G.\<alpha>w Gi) (component_of (G.\<alpha>g Gi) r) (P.\<alpha>_MST r \<pi>i))
[PROOF STEP]
using prim_impl_correct[of "G.from_list l" r] G.from_list_correct[of l]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>G.invar (G.from_list l); prim_impl (G.from_list l) r = ?\<pi>i\<rbrakk> \<Longrightarrow> P.invar_MST ?\<pi>i
\<lbrakk>G.invar (G.from_list l); prim_impl (G.from_list l) r = ?\<pi>i\<rbrakk> \<Longrightarrow> is_MST (G.\<alpha>w (G.from_list l)) (component_of (G.\<alpha>g (G.from_list l)) r) (P.\<alpha>_MST r ?\<pi>i)
G_valid_wgraph_repr l \<Longrightarrow> G.invar (G.from_list l)
G_valid_wgraph_repr l \<Longrightarrow> nodes (G.\<alpha>g (G.from_list l)) = fst ` fst ` set l \<union> snd ` fst ` set l
G_valid_wgraph_repr l \<Longrightarrow> edges (G.\<alpha>g (G.from_list l)) = fst ` set l \<union> (fst ` set l)\<inverse>
\<lbrakk>G_valid_wgraph_repr l; ((?u, ?v), ?d) \<in> set l\<rbrakk> \<Longrightarrow> G.\<alpha>w (G.from_list l) {?u, ?v} = ?d

goal (1 subgoal):
 1. case if G_valid_wgraph_repr l then Some (prim_impl (G.from_list l) r) else None of None \<Rightarrow> \<not> G_valid_wgraph_repr l | Some \<pi>i \<Rightarrow> G_valid_wgraph_repr l \<and> (let Gi = G.from_list l in G.invar Gi \<and> P.invar_MST \<pi>i \<and> is_MST (G.\<alpha>w Gi) (component_of (G.\<alpha>g Gi) r) (P.\<alpha>_MST r \<pi>i))
[PROOF STEP]
by (auto simp: Let_def)


[STATEMENT]
lemma isDiagonal_imp_0:
  assumes "isDiagonal A"
  and "from_nat a \<noteq> from_nat b"
  and "a < min (nrows A) (ncols A)"
  and "b < min (nrows A) (ncols A)"
  shows "A $ from_nat a $ from_nat b = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $ from_nat a $ from_nat b = (0::'a)
[PROOF STEP]
by (metis assms isDiagonal min.strict_boundedE ncols_def nrows_def to_nat_from_nat_id)


[STATEMENT]
theorem kleene_lfp:
  fixes f:: "'a::complete_lattice \<Rightarrow> 'a"
  assumes CONT: "cont f"
  shows "lfp f = (SUP i. (f^^i) bot)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lfp f = (SUP i. (f ^^ i) bot)
[PROOF STEP]
using gen_kleene_lfp[OF CONT,where m=bot]
[PROOF STATE]
proof (prove)
using this:
lfp (\<lambda>x. sup bot (f x)) = (SUP i. (f ^^ i) bot)

goal (1 subgoal):
 1. lfp f = (SUP i. (f ^^ i) bot)
[PROOF STEP]
by simp


[STATEMENT]
lemma calc_ideal_point1_on_circline:
  assumes "(z1, z2) = calc_ideal_point1_cvec A B" "is_real A" "(cmod B)\<^sup>2 > (cmod A)\<^sup>2"
  shows "A*z1*cnj z1 + B*cnj z1*z2 + cnj B*z1*cnj z2 + A*z2*cnj z2 = 0" (is "?lhs = 0")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 0
[PROOF STEP]
have "?lhs = A * (z1 * cnj z1 + z2 * cnj z2) + (B * cnj z1 * z2 + cnj B * z1 * cnj z2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = A * (z1 * cnj z1 + z2 * cnj z2) + (B * cnj z1 * z2 + cnj B * z1 * cnj z2)
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = A * (z1 * cnj z1 + z2 * cnj z2) + (B * cnj z1 * z2 + cnj B * z1 * cnj z2)

goal (1 subgoal):
 1. A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 0
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = A * (z1 * cnj z1 + z2 * cnj z2) + (B * cnj z1 * z2 + cnj B * z1 * cnj z2)

goal (1 subgoal):
 1. A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 0
[PROOF STEP]
have "... = 2*A*(B*cnj B)\<^sup>2 + (-2*A*(B*cnj B)\<^sup>2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * (z1 * cnj z1 + z2 * cnj z2) + (B * cnj z1 * z2 + cnj B * z1 * cnj z2) = 2 * A * (B * cnj B)\<^sup>2 + - 2 * A * (B * cnj B)\<^sup>2
[PROOF STEP]
using calc_ideal_point1_sq[OF assms]
[PROOF STATE]
proof (prove)
using this:
z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2

goal (1 subgoal):
 1. A * (z1 * cnj z1 + z2 * cnj z2) + (B * cnj z1 * z2 + cnj B * z1 * cnj z2) = 2 * A * (B * cnj B)\<^sup>2 + - 2 * A * (B * cnj B)\<^sup>2
[PROOF STEP]
using calc_ideal_point1_mix[OF assms]
[PROOF STATE]
proof (prove)
using this:
z1 * cnj z1 + z2 * cnj z2 = 2 * (B * cnj B)\<^sup>2
B * cnj z1 * z2 + cnj B * z1 * cnj z2 = - 2 * A * (B * cnj B)\<^sup>2

goal (1 subgoal):
 1. A * (z1 * cnj z1 + z2 * cnj z2) + (B * cnj z1 * z2 + cnj B * z1 * cnj z2) = 2 * A * (B * cnj B)\<^sup>2 + - 2 * A * (B * cnj B)\<^sup>2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A * (z1 * cnj z1 + z2 * cnj z2) + (B * cnj z1 * z2 + cnj B * z1 * cnj z2) = 2 * A * (B * cnj B)\<^sup>2 + - 2 * A * (B * cnj B)\<^sup>2

goal (1 subgoal):
 1. A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 0
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 2 * A * (B * cnj B)\<^sup>2 + - 2 * A * (B * cnj B)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 2 * A * (B * cnj B)\<^sup>2 + - 2 * A * (B * cnj B)\<^sup>2

goal (1 subgoal):
 1. A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A * z1 * cnj z1 + B * cnj z1 * z2 + cnj B * z1 * cnj z2 + A * z2 * cnj z2 = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mult_periodic_arithmetic:
  fixes f g :: "nat \<Rightarrow> complex"
  assumes "periodic_arithmetic f k"
  assumes "periodic_arithmetic g k"
  shows "periodic_arithmetic (\<lambda>n. f n * g n) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>n. f n * g n) k
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
periodic_arithmetic f k
periodic_arithmetic g k

goal (1 subgoal):
 1. periodic_arithmetic (\<lambda>n. f n * g n) k
[PROOF STEP]
unfolding periodic_arithmetic_def
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f (n + k) = f n
\<forall>n. g (n + k) = g n

goal (1 subgoal):
 1. \<forall>n. f (n + k) * g (n + k) = f n * g n
[PROOF STEP]
by simp


[STATEMENT]
theorem inorder_insert:
  "sorted(inorder t) \<Longrightarrow> inorder(insert x t) = ins_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (AVL_Set_Code.insert x t) = ins_list x (Tree2.inorder t)
[PROOF STEP]
by (induct t)
   (auto simp: ins_list_simps inorder_balL inorder_balR)


[STATEMENT]
lemma SUP_eq_and_INF_eq:
  assumes "\<And>i. i \<in> A \<Longrightarrow> \<exists>j\<in>B. f i = g j"
      and "\<And>j. j \<in> B \<Longrightarrow> \<exists>i\<in>A. g j = f i"
    shows "\<Squnion>((f :: _ \<Rightarrow> _ :: complete_lattice) ` A) = \<Squnion>(g ` B) \<and> \<Sqinter>(f ` A) = \<Sqinter>(g ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion> (f ` A) = \<Squnion> (g ` B) \<and> \<Sqinter> (f ` A) = \<Sqinter> (g ` B)
[PROOF STEP]
by (auto 4 3 intro!: INF_eq SUP_eq dest: assms)


[STATEMENT]
lemma all_le_eq: "(\<forall> a::nat. (a < d) = (a < c)) = (d = c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a. (a < d) = (a < c)) = (d = c)
[PROOF STEP]
using all_le_eq_imp_eq
[PROOF STATE]
proof (prove)
using this:
(\<forall>a. (a < ?d) = (a < ?c)) \<longrightarrow> ?d = ?c

goal (1 subgoal):
 1. (\<forall>a. (a < d) = (a < c)) = (d = c)
[PROOF STEP]
by auto


[STATEMENT]
lemma map_poly_gcd[hom_distribs]: "map_poly hom (gcd p q) = gcd (map_poly hom p) (map_poly hom q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_poly hom (gcd p q) = gcd (map_poly hom p) (map_poly hom q)
[PROOF STEP]
by (induct p q rule: eucl_induct)
    (simp_all add: map_poly_normalize ac_simps hom_distribs)


[STATEMENT]
lemma fls_times_fps_to_fls:
  fixes f g :: "'a::{comm_monoid_add,mult_zero} fps"
  shows "fps_to_fls (f * g) = fps_to_fls f * fps_to_fls g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_to_fls (f * g) = fps_to_fls f * fps_to_fls g
[PROOF STEP]
proof (intro fls_eq_conv_fps_eqI, rule fls_subdegree_fls_to_fps_gt0)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
 2. fls_regpart (fps_to_fls (f * g)) = fls_regpart (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
show "fls_subdegree (fps_to_fls f * fps_to_fls g) \<ge> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
proof (cases "fps_to_fls f * fps_to_fls g = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fps_to_fls f * fps_to_fls g = 0 \<Longrightarrow> 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
 2. fps_to_fls f * fps_to_fls g \<noteq> 0 \<Longrightarrow> 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
fps_to_fls f * fps_to_fls g \<noteq> 0

goal (2 subgoals):
 1. fps_to_fls f * fps_to_fls g = 0 \<Longrightarrow> 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
 2. fps_to_fls f * fps_to_fls g \<noteq> 0 \<Longrightarrow> 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
fps_to_fls f * fps_to_fls g \<noteq> 0

goal (1 subgoal):
 1. 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
using fls_mult_subdegree_ge fls_subdegree_fls_to_fps_gt0[of f]
            fls_subdegree_fls_to_fps_gt0[of g]
[PROOF STATE]
proof (prove)
using this:
fps_to_fls f * fps_to_fls g \<noteq> 0
?f * ?g \<noteq> 0 \<Longrightarrow> fls_subdegree ?f + fls_subdegree ?g \<le> fls_subdegree (?f * ?g)
0 \<le> fls_subdegree (fps_to_fls f)
0 \<le> fls_subdegree (fps_to_fls g)

goal (1 subgoal):
 1. 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
by    fastforce
[PROOF STATE]
proof (state)
this:
0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)

goal (1 subgoal):
 1. fps_to_fls f * fps_to_fls g = 0 \<Longrightarrow> 0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
qed simp
[PROOF STATE]
proof (state)
this:
0 \<le> fls_subdegree (fps_to_fls f * fps_to_fls g)

goal (1 subgoal):
 1. fls_regpart (fps_to_fls (f * g)) = fls_regpart (fps_to_fls f * fps_to_fls g)
[PROOF STEP]
qed (simp add: fps_times_conv_fls_times)


[STATEMENT]
lemma Disj_eq_iff [simp]:
  assumes "finite (supp xset1)" and "finite (supp xset2)"
  shows "Disj xset1 = Disj xset2 \<longleftrightarrow> xset1 = xset2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Disj xset1 = Disj xset2) = (xset1 = xset2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (supp xset1)
finite (supp xset2)

goal (1 subgoal):
 1. (Disj xset1 = Disj xset2) = (xset1 = xset2)
[PROOF STEP]
unfolding Disj_def
[PROOF STATE]
proof (prove)
using this:
finite (supp xset1)
finite (supp xset2)

goal (1 subgoal):
 1. (Formula.Not (Conj (map_bset Formula.Not xset1)) = Formula.Not (Conj (map_bset Formula.Not xset2))) = (xset1 = xset2)
[PROOF STEP]
by (metis Conj_eq_iff Not_eq_iff bset.inj_map_strong finite_supp_map_bset_Not)


[STATEMENT]
lemma Fourier_coefficient_const:
   "Fourier_coefficient (\<lambda>x. c) i = (if i = 0 then c * sqrt(2 * pi) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fourier_coefficient (\<lambda>x. c) i = (if i = 0 then c * sqrt (2 * pi) else 0)
[PROOF STEP]
by (auto simp: Fourier_coefficient_def orthonormal_coeff_def l2product_def trigonometric_set_def divide_simps measure_restrict_space)


[STATEMENT]
lemma list_set_rel_Id_on[simp]: "\<langle>Id_on A\<rangle> list_set_rel = \<langle>Id\<rangle> list_set_rel \<inter> UNIV \<times> Pow A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>Id_on A\<rangle>list_set_rel = \<langle>Id\<rangle>list_set_rel \<inter> UNIV \<times> Pow A
[PROOF STEP]
unfolding list_set_rel_def relcomp_unfold in_br_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(x, z). \<exists>y. (x, y) \<in> \<langle>Id_on A\<rangle>list_rel \<and> z = set y \<and> distinct y} = {(x, z). \<exists>y. (x, y) \<in> \<langle>Id\<rangle>list_rel \<and> z = set y \<and> distinct y} \<inter> UNIV \<times> Pow A
[PROOF STEP]
by auto


[STATEMENT]
lemma sigma_sets_sigma_sets_eq:
  "M \<subseteq> Pow S \<Longrightarrow> sigma_sets S (sigma_sets S M) = sigma_sets S M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq> Pow S \<Longrightarrow> sigma_sets S (sigma_sets S M) = sigma_sets S M
[PROOF STEP]
by (rule sigma_algebra.sigma_sets_eq[OF sigma_algebra_sigma_sets, of M S]) auto


[STATEMENT]
lemma varsAppendClauses:
  fixes clause1 :: Clause and clause2 :: Clause
  shows "vars (clause1 @ clause2) = vars clause1 \<union> vars clause2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vars (clause1 @ clause2) = vars clause1 \<union> vars clause2
[PROOF STEP]
by (induct clause1) auto


[STATEMENT]
lemma ty_cases:
  fixes T::ty
  shows "(\<exists>s. T=PR s) \<or> (\<exists>T'. T=NOT T') \<or> (\<exists>S U. T=S OR U) \<or> (\<exists>S U. T=S AND U) \<or> (\<exists>S U. T=S IMP U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>s. T = PR s) \<or> (\<exists>T'. T = NOT T') \<or> (\<exists>S U. T = S OR U) \<or> (\<exists>S U. T = S AND U) \<or> (\<exists>S U. T = S IMP U)
[PROOF STEP]
by (induct T rule:ty.induct) (auto)


[STATEMENT]
lemma tendsto_divide_0:
  fixes f :: "_ \<Rightarrow> 'a::{real_normed_div_algebra, division_ring}"
  assumes f: "(f \<longlongrightarrow> c) F"
    and g: "LIM x F. g x :> at_infinity"
  shows "((\<lambda>x. f x / g x) \<longlongrightarrow> 0) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> (0::'a)) F
[PROOF STEP]
using tendsto_mult[OF f filterlim_compose[OF tendsto_inverse_0 g]]
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x * inverse (g x)) \<longlongrightarrow> c * (0::'a)) F

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> (0::'a)) F
[PROOF STEP]
by (simp add: divide_inverse)


[STATEMENT]
lemma emep1: "even n \<Longrightarrow> even d \<Longrightarrow> 0 \<le> d \<Longrightarrow> (n + 1) mod d = (n mod d) + 1"
  for n d :: int
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>even n; even d; 0 \<le> d\<rbrakk> \<Longrightarrow> (n + 1) mod d = n mod d + 1
[PROOF STEP]
by (auto simp add: pos_zmod_mult_2 add.commute dvd_def)