[STATEMENT]
lemma tensor_mat_matrix_sum2:
  assumes "m1 \<in> carrier_mat d1 d1"
  shows "(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2)
    \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n)
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>k. k < 0 \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) 0 = tensor_mat m1 (matrix_sum d2 f 0)
 2. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
?k2 < 0 \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2

goal (2 subgoals):
 1. (\<And>k. k < 0 \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) 0 = tensor_mat m1 (matrix_sum d2 f 0)
 2. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k2 < 0 \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
?k2 < 0 \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) 0 = tensor_mat m1 (matrix_sum d2 f 0)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0\<^sub>m d d = tensor_mat m1 (0\<^sub>m d2 d2)
[PROOF STEP]
using tensor_mat_zero2[of m1]
[PROOF STATE]
proof (prove)
using this:
tensor_mat m1 (0\<^sub>m d2 d2) = 0\<^sub>m d d

goal (1 subgoal):
 1. 0\<^sub>m d d = tensor_mat m1 (0\<^sub>m d2 d2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) 0 = tensor_mat m1 (matrix_sum d2 f 0)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n)
?k2 < Suc n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n)
?k2 < Suc n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2
[PROOF STEP]
have "k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2" for k
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n)
?k2 < Suc n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2

goal (1 subgoal):
 1. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?k2 < n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?k2 < n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2
[PROOF STEP]
have ds: "matrix_sum d2 f n \<in> carrier_mat d2 d2"
[PROOF STATE]
proof (prove)
using this:
?k2 < n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2

goal (1 subgoal):
 1. matrix_sum d2 f n \<in> carrier_mat d2 d2
[PROOF STEP]
using matrix_sum_dim
[PROOF STATE]
proof (prove)
using this:
?k2 < n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2
(\<And>k. k < ?n \<Longrightarrow> ?f k \<in> carrier_mat ?d ?d) \<Longrightarrow> matrix_sum ?d ?f ?n \<in> carrier_mat ?d ?d

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

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
have dn: "f n \<in> carrier_mat d2 d2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f n \<in> carrier_mat d2 d2
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n)
?k2 < Suc n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2

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

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
have "matrix_sum d2 f (Suc n) = f n + matrix_sum d2 f n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d2 f (Suc n) = f n + matrix_sum d2 f n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
matrix_sum d2 f (Suc n) = f n + matrix_sum d2 f n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
matrix_sum d2 f (Suc n) = f n + matrix_sum d2 f n
[PROOF STEP]
have eq: "tensor_mat m1 (matrix_sum d2 f (Suc n))
    = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)"
[PROOF STATE]
proof (prove)
using this:
matrix_sum d2 f (Suc n) = f n + matrix_sum d2 f n

goal (1 subgoal):
 1. tensor_mat m1 (matrix_sum d2 f (Suc n)) = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)
[PROOF STEP]
using tensor_mat_add2 dn ds assms
[PROOF STATE]
proof (prove)
using this:
matrix_sum d2 f (Suc n) = f n + matrix_sum d2 f n
\<lbrakk>?m1.0 \<in> carrier_mat d1 d1; ?m2.0 \<in> carrier_mat d2 d2; ?m3.0 \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> tensor_mat ?m1.0 (?m2.0 + ?m3.0) = tensor_mat ?m1.0 ?m2.0 + tensor_mat ?m1.0 ?m3.0
f n \<in> carrier_mat d2 d2
matrix_sum d2 f n \<in> carrier_mat d2 d2
m1 \<in> carrier_mat d1 d1

goal (1 subgoal):
 1. tensor_mat m1 (matrix_sum d2 f (Suc n)) = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tensor_mat m1 (matrix_sum d2 f (Suc n)) = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
have "matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n)
    = tensor_mat m1 (f n) + matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (f n) + matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (f n) + matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (f n) + matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
have "\<dots> = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tensor_mat m1 (f n) + matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)
[PROOF STEP]
using Suc
[PROOF STATE]
proof (prove)
using this:
(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n)
?k2 < Suc n \<Longrightarrow> f ?k2 \<in> carrier_mat d2 d2

goal (1 subgoal):
 1. tensor_mat m1 (f n) + matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
tensor_mat m1 (f n) + matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)

goal (1 subgoal):
 1. \<And>n. \<lbrakk>(\<And>k. k < n \<Longrightarrow> f k \<in> carrier_mat d2 d2) \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) n = tensor_mat m1 (matrix_sum d2 f n); \<And>k. k < Suc n \<Longrightarrow> f k \<in> carrier_mat d2 d2\<rbrakk> \<Longrightarrow> matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)
tensor_mat m1 (matrix_sum d2 f (Suc n)) = tensor_mat m1 (f n) + tensor_mat m1 (matrix_sum d2 f n)

goal (1 subgoal):
 1. matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_sum d (\<lambda>k. tensor_mat m1 (f k)) (Suc n) = tensor_mat m1 (matrix_sum d2 f (Suc n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma triangle_num_altdef: "triangle_num n = (\<Sum>k\<le>n. k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. triangle_num n = \<Sum> {..n}
[PROOF STEP]
by (induction n) (auto simp: triangle_num_def)


[STATEMENT]
lemma jordan_matrix_poly_bound: fixes n_as :: "(nat \<times> 'a)list"
  assumes n_as: "\<And> n a. (n,a) \<in> set n_as \<Longrightarrow> n > 0 \<Longrightarrow> norm a \<le> 1"
  and N: "\<And> n a. (n,a) \<in> set n_as \<Longrightarrow> norm a = 1 \<Longrightarrow> n \<le> N"
  shows "\<exists> c1. \<forall> k. norm_bound (jordan_matrix n_as ^\<^sub>m k) (c1 + of_nat k ^ (N - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>c1. \<forall>k. local.norm_bound (jordan_matrix n_as ^\<^sub>m k) (c1 + real k ^ (N - 1))
[PROOF STEP]
using jordan_matrix_poly_bound2 norm_bound_bridge N n_as
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>n a. \<lbrakk>(n, a) \<in> set ?n_as; 0 < n\<rbrakk> \<Longrightarrow> norm a \<le> 1; \<And>n a. \<lbrakk>(n, a) \<in> set ?n_as; norm a = 1\<rbrakk> \<Longrightarrow> n \<le> ?N\<rbrakk> \<Longrightarrow> \<exists>c1. \<forall>k. \<forall>e\<in>elements_mat (jordan_matrix ?n_as ^\<^sub>m k). norm e \<le> c1 + real k ^ (?N - 1)
\<forall>e\<in>elements_mat ?A. norm e \<le> ?b \<Longrightarrow> local.norm_bound ?A ?b
\<lbrakk>(?n, ?a) \<in> set n_as; norm ?a = 1\<rbrakk> \<Longrightarrow> ?n \<le> N
\<lbrakk>(?n, ?a) \<in> set n_as; 0 < ?n\<rbrakk> \<Longrightarrow> norm ?a \<le> 1

goal (1 subgoal):
 1. \<exists>c1. \<forall>k. local.norm_bound (jordan_matrix n_as ^\<^sub>m k) (c1 + real k ^ (N - 1))
[PROOF STEP]
by metis


[STATEMENT]
lemma simple_bochner_integral_norm_bound:
  assumes f: "simple_bochner_integrable M f"
  shows "norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
have "norm (simple_bochner_integral M f) \<le>
    (\<Sum>y\<in>f ` space M. norm (measure M {x \<in> space M. f x = y} *\<^sub>R y))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (simple_bochner_integral M f) \<le> (\<Sum>y\<in>f ` space M. norm (Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R y))
[PROOF STEP]
unfolding simple_bochner_integral_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (\<Sum>y\<in>f ` space M. Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R y) \<le> (\<Sum>y\<in>f ` space M. norm (Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R y))
[PROOF STEP]
by (rule norm_sum)
[PROOF STATE]
proof (state)
this:
norm (simple_bochner_integral M f) \<le> (\<Sum>y\<in>f ` space M. norm (Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R y))

goal (1 subgoal):
 1. norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (simple_bochner_integral M f) \<le> (\<Sum>y\<in>f ` space M. norm (Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R y))

goal (1 subgoal):
 1. norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
have "\<dots> = (\<Sum>y\<in>f ` space M. measure M {x \<in> space M. f x = y} *\<^sub>R norm y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>f ` space M. norm (Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R y)) = (\<Sum>y\<in>f ` space M. Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R norm y)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>f ` space M. norm (Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R y)) = (\<Sum>y\<in>f ` space M. Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R norm y)

goal (1 subgoal):
 1. norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>f ` space M. norm (Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R y)) = (\<Sum>y\<in>f ` space M. Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R norm y)

goal (1 subgoal):
 1. norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
have "\<dots> = simple_bochner_integral M (\<lambda>x. norm (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>y\<in>f ` space M. Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R norm y) = simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
using f
[PROOF STATE]
proof (prove)
using this:
simple_bochner_integrable M f

goal (1 subgoal):
 1. (\<Sum>y\<in>f ` space M. Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R norm y) = simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
by (intro simple_bochner_integral_partition[symmetric])
       (auto intro: f simple_bochner_integrable_compose2 elim: simple_bochner_integrable.cases)
[PROOF STATE]
proof (state)
this:
(\<Sum>y\<in>f ` space M. Sigma_Algebra.measure M {x \<in> space M. f x = y} *\<^sub>R norm y) = simple_bochner_integral M (\<lambda>x. norm (f x))

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

goal (1 subgoal):
 1. norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (simple_bochner_integral M f) \<le> simple_bochner_integral M (\<lambda>x. norm (f x))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma vertical_line_affine:
  fixes x :: "'a::euclidean_space"
  shows "affine {(x,m::real)|m. m:UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. affine {(x, m) |m. m \<in> UNIV}
[PROOF STEP]
unfolding affine_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>xa\<in>{(x, m) |m. m \<in> UNIV}. \<forall>y\<in>{(x, m) |m. m \<in> UNIV}. \<forall>u v. u + v = 1 \<longrightarrow> u *\<^sub>R xa + v *\<^sub>R y \<in> {(x, m) |m. m \<in> UNIV}
[PROOF STEP]
by (auto simp add: pth_8)


[STATEMENT]
lemma CLIM_CRLIM_iff: "f \<midarrow>x\<rightarrow> L \<longleftrightarrow> (\<lambda>y. cmod (f y - L)) \<midarrow>x\<rightarrow> 0"
  for f :: "'a::real_normed_vector \<Rightarrow> complex"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<midarrow>x\<rightarrow> L = (\<lambda>y. cmod (f y - L)) \<midarrow>x\<rightarrow> 0
[PROOF STEP]
by (simp add: LIM_eq)


[STATEMENT]
lemma le_SUP_iff: "\<lbrakk>f ` A \<subseteq> ON; Ord x; small A\<rbrakk> \<Longrightarrow> x \<le> \<Squnion>(f ` A) \<longleftrightarrow> (\<forall>y \<in> ON. y<x \<longrightarrow> (\<exists>i\<in>A. y < f i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f ` A \<subseteq> ON; Ord x; small A\<rbrakk> \<Longrightarrow> (x \<le> \<Squnion> (f ` A)) = (\<forall>y\<in>ON. y < x \<longrightarrow> (\<exists>i\<in>A. y < f i))
[PROOF STEP]
by (simp add: le_Sup_iff)


[STATEMENT]
lemma lcm_poly_code [code]:
  fixes p q :: "'a :: {factorial_ring_gcd,semiring_gcd_mult_normalize} poly"
  shows "lcm p q = normalize (p * q div gcd p q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lcm p q = normalize (p * q div gcd p q)
[PROOF STEP]
by (fact lcm_gcd)


[STATEMENT]
lemma standard_simplex_0: "standard_simplex 0 = {(\<lambda>j. if j = 0 then 1 else 0)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. standard_simplex 0 = {\<lambda>j. if j = 0 then 1 else 0}
[PROOF STEP]
by (auto simp: standard_simplex_def)


[STATEMENT]
lemma bt_map_ident: "bt_map (%x. x) = (%y. y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bt_map (\<lambda>x. x) = (\<lambda>y. y)
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. bt_map (\<lambda>x. x) y = y
[PROOF STEP]
apply (induct_tac y)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>y. bt_map (\<lambda>x. x) Lf = Lf
 2. \<And>y x1 x2 x3. \<lbrakk>bt_map (\<lambda>x. x) x2 = x2; bt_map (\<lambda>x. x) x3 = x3\<rbrakk> \<Longrightarrow> bt_map (\<lambda>x. x) (Br x1 x2 x3) = Br x1 x2 x3
[PROOF STEP]
apply (metis bt_map.simps(1))
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y x1 x2 x3. \<lbrakk>bt_map (\<lambda>x. x) x2 = x2; bt_map (\<lambda>x. x) x3 = x3\<rbrakk> \<Longrightarrow> bt_map (\<lambda>x. x) (Br x1 x2 x3) = Br x1 x2 x3
[PROOF STEP]
by (metis bt_map.simps(2))


[STATEMENT]
lemma showpre7:
  fixes a b ::"nat\<Rightarrow>int " and q p::int
  assumes "q>0" and "p>0"and a: "\<forall>n. a n>0" and "\<forall>n. b n>0" and
    assumerational:"(\<lambda> n. b (n+1) / a (n+1) )  sums (p/q)"
  shows "q*((\<Prod>j=1..n. of_int( a j)))*(suminf (\<lambda>(j::nat). (b (j+n+1)/ a (j+n+1 ))))
        = ((\<Prod>j=1..n. of_int( a j)))*(p -q* (\<Sum>j=1..n. b j / a j))       "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
define aa where "aa=(\<Prod>j = 1..n. real_of_int (a j))"
[PROOF STATE]
proof (state)
this:
aa = (\<Prod>j = 1..n. real_of_int (a j))

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
define ff where "ff=(\<lambda>i. real_of_int (b (i+1)) / real_of_int (a (i+1)))"
[PROOF STATE]
proof (state)
this:
ff = (\<lambda>i. real_of_int (b (i + 1)) / real_of_int (a (i + 1)))

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
have "(\<Sum>j. ff (j+n)) =  (\<Sum>n. ff n) - sum ff {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j. ff (j + n)) = (\<Sum>n. ff n) - sum ff {..<n}
[PROOF STEP]
apply (rule suminf_minus_initial_segment)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. summable ff
[PROOF STEP]
using assumerational
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1))) sums (real_of_int p / real_of_int q)

goal (1 subgoal):
 1. summable ff
[PROOF STEP]
unfolding ff_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1))) sums (real_of_int p / real_of_int q)

goal (1 subgoal):
 1. summable (\<lambda>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1)))
[PROOF STEP]
by (simp add: sums_summable)
[PROOF STATE]
proof (state)
this:
(\<Sum>j. ff (j + n)) = (\<Sum>n. ff n) - sum ff {..<n}

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>j. ff (j + n)) = (\<Sum>n. ff n) - sum ff {..<n}

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
have "... = p/q - sum ff {..<n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. ff n) - sum ff {..<n} = real_of_int p / real_of_int q - sum ff {..<n}
[PROOF STEP]
using assumerational
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1))) sums (real_of_int p / real_of_int q)

goal (1 subgoal):
 1. (\<Sum>n. ff n) - sum ff {..<n} = real_of_int p / real_of_int q - sum ff {..<n}
[PROOF STEP]
unfolding ff_def
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1))) sums (real_of_int p / real_of_int q)

goal (1 subgoal):
 1. (\<Sum>n. real_of_int (b (n + 1)) / real_of_int (a (n + 1))) - (\<Sum>i<n. real_of_int (b (i + 1)) / real_of_int (a (i + 1))) = real_of_int p / real_of_int q - (\<Sum>i<n. real_of_int (b (i + 1)) / real_of_int (a (i + 1)))
[PROOF STEP]
by (simp add: sums_iff)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. ff n) - sum ff {..<n} = real_of_int p / real_of_int q - sum ff {..<n}

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. ff n) - sum ff {..<n} = real_of_int p / real_of_int q - sum ff {..<n}

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
have "... = p/q - (\<Sum>j=1..n. ff (j-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int p / real_of_int q - sum ff {..<n} = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_int p / real_of_int q - sum ff {..<n} = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
have "sum ff {..<n} = (\<Sum>j=1..n. ff (j-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ff {..<n} = (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
apply (subst sum_bounds_lt_plus1[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum ff {..<n} = (\<Sum>k<n. ff (Suc k - 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum ff {..<n} = (\<Sum>j = 1..n. ff (j - 1))

goal (1 subgoal):
 1. real_of_int p / real_of_int q - sum ff {..<n} = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sum ff {..<n} = (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum ff {..<n} = (\<Sum>j = 1..n. ff (j - 1))

goal (1 subgoal):
 1. real_of_int p / real_of_int q - sum ff {..<n} = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
unfolding ff_def
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. real_of_int (b (i + 1)) / real_of_int (a (i + 1))) = (\<Sum>j = 1..n. real_of_int (b (j - 1 + 1)) / real_of_int (a (j - 1 + 1)))

goal (1 subgoal):
 1. real_of_int p / real_of_int q - (\<Sum>i<n. real_of_int (b (i + 1)) / real_of_int (a (i + 1))) = real_of_int p / real_of_int q - (\<Sum>j = 1..n. real_of_int (b (j - 1 + 1)) / real_of_int (a (j - 1 + 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int p / real_of_int q - sum ff {..<n} = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
real_of_int p / real_of_int q - sum ff {..<n} = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j. ff (j + n)) = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
have "(\<Sum>j. ff (j + n)) = p / q - (\<Sum>j = 1..n. ff (j - 1))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j. ff (j + n)) = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))

goal (1 subgoal):
 1. (\<Sum>j. ff (j + n)) = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>j. ff (j + n)) = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>j. ff (j + n)) = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
have "q*(\<Sum>j. ff (j + n)) = p - q*(\<Sum>j = 1..n. ff (j - 1))"
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j. ff (j + n)) = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))

goal (1 subgoal):
 1. real_of_int q * (\<Sum>j. ff (j + n)) = real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
using \<open>q>0\<close>
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j. ff (j + n)) = real_of_int p / real_of_int q - (\<Sum>j = 1..n. ff (j - 1))
0 < q

goal (1 subgoal):
 1. real_of_int q * (\<Sum>j. ff (j + n)) = real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
by (auto simp add:field_simps)
[PROOF STATE]
proof (state)
this:
real_of_int q * (\<Sum>j. ff (j + n)) = real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1))

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
real_of_int q * (\<Sum>j. ff (j + n)) = real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1))
[PROOF STEP]
have "aa*q*(\<Sum>j. ff (j + n)) = aa*(p - q*(\<Sum>j = 1..n. ff (j - 1)))"
[PROOF STATE]
proof (prove)
using this:
real_of_int q * (\<Sum>j. ff (j + n)) = real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1))

goal (1 subgoal):
 1. aa * real_of_int q * (\<Sum>j. ff (j + n)) = aa * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
aa * real_of_int q * (\<Sum>j. ff (j + n)) = aa * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1)))

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
aa * real_of_int q * (\<Sum>j. ff (j + n)) = aa * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
aa * real_of_int q * (\<Sum>j. ff (j + n)) = aa * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. ff (j - 1)))

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
unfolding aa_def ff_def
[PROOF STATE]
proof (prove)
using this:
(\<Prod>j = 1..n. real_of_int (a j)) * real_of_int q * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b (j - 1 + 1)) / real_of_int (a (j - 1 + 1))))

goal (1 subgoal):
 1. real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (q * (\<Prod>j = 1..n. of_int (a j))) * (\<Sum>j. real_of_int (b (j + n + 1)) / real_of_int (a (j + n + 1))) = (\<Prod>j = 1..n. real_of_int (a j)) * (real_of_int p - real_of_int q * (\<Sum>j = 1..n. real_of_int (b j) / real_of_int (a j)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma union_less_iff [simp]: "\<lbrakk>Ord i; Ord j\<rbrakk> \<Longrightarrow> i \<squnion> j < k \<longleftrightarrow> i<k \<and> j<k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord i; Ord j\<rbrakk> \<Longrightarrow> (i \<squnion> j < k) = (i < k \<and> j < k)
[PROOF STEP]
by (metis Ord_linear_le le_iff_sup sup.order_iff sup.strict_boundedE)


[STATEMENT]
lemma compare_expansions_EQ_imp_bigtheta:
  assumes "compare_expansions F G = (EQ, c, c')" "trimmed F" "trimmed G"
          "(f expands_to F) basis" "(g expands_to G) basis" "basis_wf basis"
  shows   "f \<in> \<Theta>(g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> \<Theta>(g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> \<Theta>(g)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
compare_expansions F G = (EQ, c, c')
trimmed F
trimmed G
(f expands_to F) basis
(g expands_to G) basis
basis_wf basis
[PROOF STEP]
have "(\<lambda>x. c' * f x) \<in> \<Theta>(\<lambda>x. c * g x)"
[PROOF STATE]
proof (prove)
using this:
compare_expansions F G = (EQ, c, c')
trimmed F
trimmed G
(f expands_to F) basis
(g expands_to G) basis
basis_wf basis

goal (1 subgoal):
 1. (\<lambda>x. c' * f x) \<in> \<Theta>(\<lambda>x. c * g x)
[PROOF STEP]
by (intro asymp_equiv_imp_bigtheta compare_expansions_EQ)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. c' * f x) \<in> \<Theta>(\<lambda>x. c * g x)

goal (1 subgoal):
 1. f \<in> \<Theta>(g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(\<lambda>x. c' * f x) \<in> \<Theta>(\<lambda>x. c * g x)

goal (1 subgoal):
 1. f \<in> \<Theta>(g)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
compare_expansions F G = (EQ, c, c')
trimmed F
trimmed G
(f expands_to F) basis
(g expands_to G) basis
basis_wf basis
[PROOF STEP]
have "c \<noteq> 0" "c' \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
compare_expansions F G = (EQ, c, c')
trimmed F
trimmed G
(f expands_to F) basis
(g expands_to G) basis
basis_wf basis

goal (1 subgoal):
 1. c \<noteq> 0 &&& c' \<noteq> 0
[PROOF STEP]
by (auto simp: compare_expansions_def trimmed_imp_dominant_term_nz split: cmp_result.splits)
[PROOF STATE]
proof (state)
this:
c \<noteq> 0
c' \<noteq> 0

goal (1 subgoal):
 1. f \<in> \<Theta>(g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. c' * f x) \<in> \<Theta>(\<lambda>x. c * g x)
c \<noteq> 0
c' \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. c' * f x) \<in> \<Theta>(\<lambda>x. c * g x)
c \<noteq> 0
c' \<noteq> 0

goal (1 subgoal):
 1. f \<in> \<Theta>(g)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f \<in> \<Theta>(g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma  det_permute_columns:
  fixes A :: "'a::comm_ring_1^'n^'n"
  assumes p: "p permutes (UNIV :: 'n set)"
  shows "det(\<chi> i j. A$i$ p j :: 'a^'n^'n) = of_int (sign p) * det A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A
[PROOF STEP]
let ?Ap = "\<chi> i j. A$i$ p j :: 'a^'n^'n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A
[PROOF STEP]
let ?At = "transpose A"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A
[PROOF STEP]
have "of_int (sign p) * det A = det (transpose (\<chi> i. transpose A $ p i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (sign p) * det A = det (Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i))
[PROOF STEP]
unfolding det_permute_rows[OF p, of ?At] det_transpose
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (sign p) * det A = of_int (sign p) * det A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
of_int (sign p) * det A = det (Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i))

goal (1 subgoal):
 1. det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
of_int (sign p) * det A = det (Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i))

goal (1 subgoal):
 1. det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A
[PROOF STEP]
have "?Ap = transpose (\<chi> i. transpose A $ p i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<chi>i j. A $ i $ p j) = Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i)
[PROOF STEP]
by (simp add: transpose_def vec_eq_iff)
[PROOF STATE]
proof (state)
this:
(\<chi>i j. A $ i $ p j) = Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i)

goal (1 subgoal):
 1. det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
of_int (sign p) * det A = det (Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i))
(\<chi>i j. A $ i $ p j) = Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
of_int (sign p) * det A = det (Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i))
(\<chi>i j. A $ i $ p j) = Finite_Cartesian_Product.transpose (\<chi>i. Finite_Cartesian_Product.transpose A $ p i)

goal (1 subgoal):
 1. det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
det (\<chi>i j. A $ i $ p j) = of_int (sign p) * det A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fps_of_ratfps_mult [simp]: "fps_of_ratfps (x * y) = fps_of_ratfps x * fps_of_ratfps y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_ratfps (x * y) = fps_of_ratfps x * fps_of_ratfps y
[PROOF STEP]
proof (transfer, goal_cases)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
case (1 x y)
[PROOF STATE]
proof (state)
this:
constant_term (denominator x) \<noteq> (0::'a)
constant_term (denominator y) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
constant_term (denominator x) \<noteq> (0::'a)
constant_term (denominator y) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
define x' y' where "x' = quot_of_fract x" and "y' = quot_of_fract y"
[PROOF STATE]
proof (state)
this:
x' = quot_of_fract x
y' = quot_of_fract y

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
constant_term (denominator x) \<noteq> (0::'a)
constant_term (denominator y) \<noteq> (0::'a)
x' = quot_of_fract x
y' = quot_of_fract y
[PROOF STEP]
have assms: "coeff (snd x') 0 \<noteq> 0" "coeff (snd y') 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
constant_term (denominator x) \<noteq> (0::'a)
constant_term (denominator y) \<noteq> (0::'a)
x' = quot_of_fract x
y' = quot_of_fract y

goal (1 subgoal):
 1. constant_term (snd x') \<noteq> (0::'a) &&& constant_term (snd y') \<noteq> (0::'a)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
constant_term (snd x') \<noteq> (0::'a)
constant_term (snd y') \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
constant_term (snd x') \<noteq> (0::'a)
constant_term (snd y') \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
define w z where "w = normalize_quot (fst x', snd y')" and "z = normalize_quot (fst y', snd x')"
[PROOF STATE]
proof (state)
this:
w = normalize_quot (fst x', snd y')
z = normalize_quot (fst y', snd x')

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
constant_term (snd x') \<noteq> (0::'a)
constant_term (snd y') \<noteq> (0::'a)
w = normalize_quot (fst x', snd y')
z = normalize_quot (fst y', snd x')
[PROOF STEP]
have unit: "coeff (snd x') 0 \<noteq> 0" "coeff (snd y') 0 \<noteq> 0"
    "coeff (snd w) 0 \<noteq> 0" "coeff (snd z) 0 \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
constant_term (snd x') \<noteq> (0::'a)
constant_term (snd y') \<noteq> (0::'a)
w = normalize_quot (fst x', snd y')
z = normalize_quot (fst y', snd x')

goal (1 subgoal):
 1. (constant_term (snd x') \<noteq> (0::'a) &&& constant_term (snd y') \<noteq> (0::'a)) &&& constant_term (snd w) \<noteq> (0::'a) &&& constant_term (snd z) \<noteq> (0::'a)
[PROOF STEP]
by (simp_all add: coeff_0_normalize_quot_nonzero)
[PROOF STATE]
proof (state)
this:
constant_term (snd x') \<noteq> (0::'a)
constant_term (snd y') \<noteq> (0::'a)
constant_term (snd w) \<noteq> (0::'a)
constant_term (snd z) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
have "fps_of_poly (fst w * fst z) / fps_of_poly (snd w * snd z) =
          (fps_of_poly (fst w) / fps_of_poly (snd w)) *
          (fps_of_poly (fst z) / fps_of_poly (snd z))" (is "_ = ?A * ?B")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (fst w * fst z) / fps_of_poly (snd w * snd z) = fps_of_poly (fst w) / fps_of_poly (snd w) * (fps_of_poly (fst z) / fps_of_poly (snd z))
[PROOF STEP]
by (simp add: is_unit_div_mult2_eq fps_of_poly_mult unit_div_mult_swap unit_div_commute unit)
[PROOF STATE]
proof (state)
this:
fps_of_poly (fst w * fst z) / fps_of_poly (snd w * snd z) = fps_of_poly (fst w) / fps_of_poly (snd w) * (fps_of_poly (fst z) / fps_of_poly (snd z))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fps_of_poly (fst w * fst z) / fps_of_poly (snd w * snd z) = fps_of_poly (fst w) / fps_of_poly (snd w) * (fps_of_poly (fst z) / fps_of_poly (snd z))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
have "\<dots> = (fps_of_poly (fst x') / fps_of_poly (snd x')) *
                    (fps_of_poly (fst y') / fps_of_poly (snd y'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fps_of_poly (fst w) / fps_of_poly (snd w) * (fps_of_poly (fst z) / fps_of_poly (snd z)) = fps_of_poly (fst x') / fps_of_poly (snd x') * (fps_of_poly (fst y') / fps_of_poly (snd y'))
[PROOF STEP]
using unit
[PROOF STATE]
proof (prove)
using this:
constant_term (snd x') \<noteq> (0::'a)
constant_term (snd y') \<noteq> (0::'a)
constant_term (snd w) \<noteq> (0::'a)
constant_term (snd z) \<noteq> (0::'a)

goal (1 subgoal):
 1. fps_of_poly (fst w) / fps_of_poly (snd w) * (fps_of_poly (fst z) / fps_of_poly (snd z)) = fps_of_poly (fst x') / fps_of_poly (snd x') * (fps_of_poly (fst y') / fps_of_poly (snd y'))
[PROOF STEP]
by (simp add: w_def z_def unit_div_commute unit_div_mult_swap is_unit_div_div_commute)
[PROOF STATE]
proof (state)
this:
fps_of_poly (fst w) / fps_of_poly (snd w) * (fps_of_poly (fst z) / fps_of_poly (snd z)) = fps_of_poly (fst x') / fps_of_poly (snd x') * (fps_of_poly (fst y') / fps_of_poly (snd y'))

goal (1 subgoal):
 1. \<And>x y. \<lbrakk>constant_term (denominator x) \<noteq> (0::'a); constant_term (denominator y) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fps_of_poly (fst w * fst z) / fps_of_poly (snd w * snd z) = fps_of_poly (fst x') / fps_of_poly (snd x') * (fps_of_poly (fst y') / fps_of_poly (snd y'))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
fps_of_poly (fst w * fst z) / fps_of_poly (snd w * snd z) = fps_of_poly (fst x') / fps_of_poly (snd x') * (fps_of_poly (fst y') / fps_of_poly (snd y'))

goal (1 subgoal):
 1. fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))
[PROOF STEP]
by (simp add: w_def z_def x'_def y'_def Let_def case_prod_unfold quot_of_fract_mult mult_ac)
[PROOF STATE]
proof (state)
this:
fps_of_poly (numerator (x * y)) / fps_of_poly (denominator (x * y)) = fps_of_poly (numerator x) / fps_of_poly (denominator x) * (fps_of_poly (numerator y) / fps_of_poly (denominator y))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma omega_prop':
assumes "\<omega>^m' = 1" "m'\<noteq>0" shows "m' \<ge> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> m'
[PROOF STEP]
using omega_properties(3)  assms
[PROOF STATE]
proof (prove)
using this:
\<forall>m. \<omega> ^ m = 1 \<and> m \<noteq> 0 \<longrightarrow> n \<le> m
\<omega> ^ m' = 1
m' \<noteq> 0

goal (1 subgoal):
 1. n \<le> m'
[PROOF STEP]
by blast


[STATEMENT]
lemma integrable_sum[simp, intro]: "(\<And>i. i \<in> I \<Longrightarrow> integrable M (f i)) \<Longrightarrow> integrable M (\<lambda>x. \<Sum>i\<in>I. f i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> integrable M (f i)) \<Longrightarrow> integrable M (\<lambda>x. \<Sum>i\<in>I. f i x)
[PROOF STEP]
by (metis has_bochner_integral_sum integrable.simps)


[STATEMENT]
lemma fcard_funion_finter:
  "fcard A + fcard B = fcard (A |\<union>| B) + fcard (A |\<inter>| B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fcard A + fcard B = fcard (A |\<union>| B) + fcard (A |\<inter>| B)
[PROOF STEP]
by transfer (rule card_Un_Int)


[STATEMENT]
lemma bitset_2n: "bitset (2 * n) = Suc ` (bitset n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bitset (2 * n) = Suc ` bitset n
[PROOF STEP]
proof (rule set_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> bitset (2 * n)) = (x \<in> Suc ` bitset n)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. (x \<in> bitset (2 * n)) = (x \<in> Suc ` bitset n)
[PROOF STEP]
show "(x \<in> bitset (2 * n)) = (x \<in> Suc ` bitset n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> bitset (2 * n)) = (x \<in> Suc ` bitset n)
[PROOF STEP]
unfolding bitset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> {i. odd (2 * n div 2 ^ i)}) = (x \<in> Suc ` {i. odd (n div 2 ^ i)})
[PROOF STEP]
by (cases x) auto
[PROOF STATE]
proof (state)
this:
(x \<in> bitset (2 * n)) = (x \<in> Suc ` bitset n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dual_disjunctive: "x \<in> disjunctive \<Longrightarrow> x ^ o \<in> conjunctive"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> disjunctive.disjunctive (\<squnion>) (\<squnion>) (*) \<Longrightarrow> x ^ o \<in> conjunctive.conjunctive (\<sqinter>) (\<sqinter>) (*)
[PROOF STEP]
apply (simp add: conjunctive_def disjunctive_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>y z. x * (y \<squnion> z) = x * y \<squnion> x * z \<Longrightarrow> \<forall>y z. x ^ o * (y \<sqinter> z) = x ^ o * y \<sqinter> (x ^ o * z)
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<forall>y z. x * (y \<squnion> z) = x * y \<squnion> x * z \<Longrightarrow> x ^ o * (y \<sqinter> z) = x ^ o * y \<sqinter> (x ^ o * z)
[PROOF STEP]
apply (rule dual_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y z. \<forall>y z. x * (y \<squnion> z) = x * y \<squnion> x * z \<Longrightarrow> (x ^ o * (y \<sqinter> z)) ^ o = (x ^ o * y \<sqinter> (x ^ o * z)) ^ o
[PROOF STEP]
by (simp add: dual_comp dual_inf)


[STATEMENT]
lemma mtf2_forward_beforeq: "q \<in> set xs \<Longrightarrow> distinct xs \<Longrightarrow> i < index xs q
        \<Longrightarrow> index (mtf2 n q xs) (xs!i) \<le> index xs q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>q \<in> set xs; distinct xs; i < index xs q\<rbrakk> \<Longrightarrow> index (mtf2 n q xs) (xs ! i) \<le> index xs q
[PROOF STEP]
apply (cases "i < index xs q - n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>q \<in> set xs; distinct xs; i < index xs q; i < index xs q - n\<rbrakk> \<Longrightarrow> index (mtf2 n q xs) (xs ! i) \<le> index xs q
 2. \<lbrakk>q \<in> set xs; distinct xs; i < index xs q; \<not> i < index xs q - n\<rbrakk> \<Longrightarrow> index (mtf2 n q xs) (xs ! i) \<le> index xs q
[PROOF STEP]
using mtf2_forward_effect4
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?q \<in> set ?xs; distinct ?xs; ?i < index ?xs ?q - ?n\<rbrakk> \<Longrightarrow> index (mtf2 ?n ?q ?xs) (?xs ! ?i) = index ?xs (?xs ! ?i) \<and> index (mtf2 ?n ?q ?xs) (?xs ! ?i) < index ?xs ?q - ?n

goal (2 subgoals):
 1. \<lbrakk>q \<in> set xs; distinct xs; i < index xs q; i < index xs q - n\<rbrakk> \<Longrightarrow> index (mtf2 n q xs) (xs ! i) \<le> index xs q
 2. \<lbrakk>q \<in> set xs; distinct xs; i < index xs q; \<not> i < index xs q - n\<rbrakk> \<Longrightarrow> index (mtf2 n q xs) (xs ! i) \<le> index xs q
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>q \<in> set xs; distinct xs; i < index xs q; \<not> i < index xs q - n\<rbrakk> \<Longrightarrow> index (mtf2 n q xs) (xs ! i) \<le> index xs q
[PROOF STEP]
using mtf2_forward_effect3
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?q \<in> set ?xs; distinct ?xs; index ?xs ?q - ?n \<le> ?i \<and> ?i < index ?xs ?q\<rbrakk> \<Longrightarrow> index (mtf2 ?n ?q ?xs) (?xs ! ?i) = Suc (index ?xs (?xs ! ?i)) \<and> index ?xs ?q - ?n < index (mtf2 ?n ?q ?xs) (?xs ! ?i) \<and> index (mtf2 ?n ?q ?xs) (?xs ! ?i) \<le> index ?xs ?q

goal (1 subgoal):
 1. \<lbrakk>q \<in> set xs; distinct xs; i < index xs q; \<not> i < index xs q - n\<rbrakk> \<Longrightarrow> index (mtf2 n q xs) (xs ! i) \<le> index xs q
[PROOF STEP]
using leI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?q \<in> set ?xs; distinct ?xs; index ?xs ?q - ?n \<le> ?i \<and> ?i < index ?xs ?q\<rbrakk> \<Longrightarrow> index (mtf2 ?n ?q ?xs) (?xs ! ?i) = Suc (index ?xs (?xs ! ?i)) \<and> index ?xs ?q - ?n < index (mtf2 ?n ?q ?xs) (?xs ! ?i) \<and> index (mtf2 ?n ?q ?xs) (?xs ! ?i) \<le> index ?xs ?q
\<not> ?x < ?y \<Longrightarrow> ?y \<le> ?x

goal (1 subgoal):
 1. \<lbrakk>q \<in> set xs; distinct xs; i < index xs q; \<not> i < index xs q - n\<rbrakk> \<Longrightarrow> index (mtf2 n q xs) (xs ! i) \<le> index xs q
[PROOF STEP]
by metis


[STATEMENT]
lemma INF_mono_lfp [partial_function_mono]:
  "(\<And>x. lfp.mono_body (\<lambda>f. F f x)) \<Longrightarrow> lfp.mono_body (\<lambda>f. INF x\<in>M. F f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. monotone lfp.le_fun (\<le>) (\<lambda>f. F f x)) \<Longrightarrow> monotone lfp.le_fun (\<le>) (\<lambda>f. \<Sqinter> (F f ` M))
[PROOF STEP]
by(rule monotoneI)(blast dest: monotoneD intro: INF_mono)


[STATEMENT]
theorem semClosed_nonintDfmla: "semClosed nonintDfmla = nonint"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semClosed nonintDfmla = nonint
[PROOF STEP]
unfolding nonintSfmla_iff_nonint[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semClosed nonintDfmla = nonintSfmla []
[PROOF STEP]
apply(subst sem_nonintDfmla[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. semClosed nonintDfmla = sem nonintDfmla ?env []
[PROOF STEP]
apply(rule semClosed_Nil)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. wff nonintDfmla
 2. FV nonintDfmla = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma split_n_m_x_abbrev_dims:
  assumes "split_n_m_x n m x = (a, b)"
  shows "dim_vec a = n" "dim_vec b = m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec a = n &&& dim_vec b = m
[PROOF STEP]
using split_vec_dims
[PROOF STATE]
proof (prove)
using this:
split_i_j_x ?i ?j ?x = (?a, ?b) \<Longrightarrow> dim_vec ?a = ?i
split_i_j_x ?i ?j ?x = (?a, ?b) \<Longrightarrow> dim_vec ?b = ?j - ?i

goal (1 subgoal):
 1. dim_vec a = n &&& dim_vec b = m
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
split_i_j_x ?i ?j ?x = (?a, ?b) \<Longrightarrow> dim_vec ?a = ?i
split_i_j_x ?i ?j ?x = (?a, ?b) \<Longrightarrow> dim_vec ?b = ?j - ?i
split_n_m_x n m x = (a, b)

goal (1 subgoal):
 1. dim_vec a = n &&& dim_vec b = m
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec b = m
[PROOF STEP]
using assms split_vec_dims(2)
[PROOF STATE]
proof (prove)
using this:
split_n_m_x n m x = (a, b)
split_i_j_x ?i ?j ?x = (?a, ?b) \<Longrightarrow> dim_vec ?b = ?j - ?i

goal (1 subgoal):
 1. dim_vec b = m
[PROOF STEP]
by fastforce


[STATEMENT]
lemma pj_invim_mono1:"\<lbrakk>Ring R; ideal R I; ideal (qring R I) J1;
      ideal (qring R I) J2; J1 \<subseteq> J2 \<rbrakk> \<Longrightarrow>
      (rInvim R (qring R I) (pj R I) J1) \<subseteq> (rInvim R (qring R I) (pj R I) J2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ring R; ideal R I; ideal (R /\<^sub>r I) J1; ideal (R /\<^sub>r I) J2; J1 \<subseteq> J2\<rbrakk> \<Longrightarrow> rInvim R (R /\<^sub>r I) (pj R I) J1 \<subseteq> rInvim R (R /\<^sub>r I) (pj R I) J2
[PROOF STEP]
apply (rule subsetI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Ring R; ideal R I; ideal (R /\<^sub>r I) J1; ideal (R /\<^sub>r I) J2; J1 \<subseteq> J2; x \<in> rInvim R (R /\<^sub>r I) (pj R I) J1\<rbrakk> \<Longrightarrow> x \<in> rInvim R (R /\<^sub>r I) (pj R I) J2
[PROOF STEP]
apply (simp add:rInvim_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>Ring R; ideal R I; ideal (R /\<^sub>r I) J1; ideal (R /\<^sub>r I) J2; J1 \<subseteq> J2; x \<in> carrier R \<and> pj R I x \<in> J1\<rbrakk> \<Longrightarrow> pj R I x \<in> J2
[PROOF STEP]
apply (simp add:subsetD)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma integral_power:
  "a \<le> b \<Longrightarrow> (\<integral>x. x^k * indicator {a..b} x \<partial>lborel) = (b^Suc k - a^Suc k) / Suc k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> LBINT x. x ^ k * indicat_real {a..b} x = (b ^ Suc k - a ^ Suc k) / real (Suc k)
[PROOF STEP]
proof (subst integral_FTC_Icc_real)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. a \<le> b \<Longrightarrow> a \<le> b
 2. \<And>x. \<lbrakk>a \<le> b; a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (?F has_real_derivative x ^ k) (at x)
 3. \<And>x. \<lbrakk>a \<le> b; a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. x ^ k) x
 4. a \<le> b \<Longrightarrow> ?F b - ?F a = (b ^ Suc k - a ^ Suc k) / real (Suc k)
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. a \<le> b \<Longrightarrow> a \<le> b
 2. \<And>x. \<lbrakk>a \<le> b; a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> (?F has_real_derivative x ^ k) (at x)
 3. \<And>x. \<lbrakk>a \<le> b; a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. x ^ k) x
 4. a \<le> b \<Longrightarrow> ?F b - ?F a = (b ^ Suc k - a ^ Suc k) / real (Suc k)
[PROOF STEP]
show "DERIV (\<lambda>x. x^Suc k / Suc k) x :> x^k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x ^ Suc k / real (Suc k)) has_real_derivative x ^ k) (at x)
[PROOF STEP]
by (intro derivative_eq_intros) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x ^ Suc k / real (Suc k)) has_real_derivative x ^ k) (at x)

goal (3 subgoals):
 1. a \<le> b \<Longrightarrow> a \<le> b
 2. \<And>x. \<lbrakk>a \<le> b; a \<le> x; x \<le> b\<rbrakk> \<Longrightarrow> isCont (\<lambda>x. x ^ k) x
 3. a \<le> b \<Longrightarrow> b ^ Suc k / real (Suc k) - a ^ Suc k / real (Suc k) = (b ^ Suc k - a ^ Suc k) / real (Suc k)
[PROOF STEP]
qed (auto simp: field_simps simp del: of_nat_Suc)


[STATEMENT]
lemma real_inverse_le_1_iff: fixes x :: real
  shows "\<lbrakk> 0 \<le> x; x \<le> 1 \<rbrakk> \<Longrightarrow> 1 / x \<le> 1 \<longleftrightarrow> x = 1 \<or> x = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; x \<le> 1\<rbrakk> \<Longrightarrow> (1 / x \<le> 1) = (x = 1 \<or> x = 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma intersect_poincare_circles_x_axis:
  assumes z: "is_real z1" and "is_real z2" and "r1 > 0" and "r2 > 0" and
             "-1 < Re z1" and "Re z1 < 1" and "-1 < Re z2" and "Re z2 < 1" and
             "z1 \<noteq> z2"
  assumes x1: "x1 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2" and
          x2: "x2 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2" and
              "x1 \<noteq> x2"
  shows "x1 = conjugate x2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
have in_disc: "of_complex z1 \<in> unit_disc" "of_complex z2 \<in> unit_disc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_complex z1 \<in> unit_disc &&& of_complex z2 \<in> unit_disc
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_real z1
is_real z2
0 < r1
0 < r2
- 1 < Re z1
Re z1 < 1
- 1 < Re z2
Re z2 < 1
z1 \<noteq> z2
x1 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2
x2 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2
x1 \<noteq> x2

goal (1 subgoal):
 1. of_complex z1 \<in> unit_disc &&& of_complex z2 \<in> unit_disc
[PROOF STEP]
by (auto simp add: cmod_eq_Re)
[PROOF STATE]
proof (state)
this:
of_complex z1 \<in> unit_disc
of_complex z2 \<in> unit_disc

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
obtain x1' x2' where x': "x1 = of_complex x1'" "x2 = of_complex x2'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x1' x2'. \<lbrakk>x1 = of_complex x1'; x2 = of_complex x2'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using x1 x2
[PROOF STATE]
proof (prove)
using this:
x1 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2
x2 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2

goal (1 subgoal):
 1. (\<And>x1' x2'. \<lbrakk>x1 = of_complex x1'; x2 = of_complex x2'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using inf_or_of_complex[of x1] inf_or_of_complex[of x2]
[PROOF STATE]
proof (prove)
using this:
x1 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2
x2 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2
x1 = \<infinity>\<^sub>h \<or> (\<exists>x. x1 = of_complex x)
x2 = \<infinity>\<^sub>h \<or> (\<exists>x. x2 = of_complex x)

goal (1 subgoal):
 1. (\<And>x1' x2'. \<lbrakk>x1 = of_complex x1'; x2 = of_complex x2'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding poincare_circle_def
[PROOF STATE]
proof (prove)
using this:
x1 \<in> {z' \<in> unit_disc. poincare_distance (of_complex z1) z' = r1} \<inter> {z' \<in> unit_disc. poincare_distance (of_complex z2) z' = r2}
x2 \<in> {z' \<in> unit_disc. poincare_distance (of_complex z1) z' = r1} \<inter> {z' \<in> unit_disc. poincare_distance (of_complex z2) z' = r2}
x1 = \<infinity>\<^sub>h \<or> (\<exists>x. x1 = of_complex x)
x2 = \<infinity>\<^sub>h \<or> (\<exists>x. x2 = of_complex x)

goal (1 subgoal):
 1. (\<And>x1' x2'. \<lbrakk>x1 = of_complex x1'; x2 = of_complex x2'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 = of_complex x1'
x2 = of_complex x2'

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
obtain Ze1 Re1 where 1: "(Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Ze1 Re1. (Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis poincare_circle_euclidean_def)
[PROOF STATE]
proof (state)
this:
(Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
obtain Ze2 Re2 where 2: "(Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Ze2 Re2. (Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2 \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis poincare_circle_euclidean_def)
[PROOF STATE]
proof (state)
this:
(Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
have circle: "x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2"  "x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2 &&& x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
[PROOF STEP]
using poincare_circle_is_euclidean_circle[of "of_complex z1" r1]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>of_complex z1 \<in> unit_disc; 0 < r1\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean (of_complex z1) r1 in of_complex ` circle Ze Re = poincare_circle (of_complex z1) r1

goal (1 subgoal):
 1. x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2 &&& x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
[PROOF STEP]
using poincare_circle_is_euclidean_circle[of "of_complex z2" r2]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>of_complex z1 \<in> unit_disc; 0 < r1\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean (of_complex z1) r1 in of_complex ` circle Ze Re = poincare_circle (of_complex z1) r1
\<lbrakk>of_complex z2 \<in> unit_disc; 0 < r2\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean (of_complex z2) r2 in of_complex ` circle Ze Re = poincare_circle (of_complex z2) r2

goal (1 subgoal):
 1. x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2 &&& x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
[PROOF STEP]
using assms 1 2 \<open>of_complex z1 \<in> unit_disc\<close> \<open>of_complex z2 \<in> unit_disc\<close> x'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>of_complex z1 \<in> unit_disc; 0 < r1\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean (of_complex z1) r1 in of_complex ` circle Ze Re = poincare_circle (of_complex z1) r1
\<lbrakk>of_complex z2 \<in> unit_disc; 0 < r2\<rbrakk> \<Longrightarrow> let (Ze, Re) = poincare_circle_euclidean (of_complex z2) r2 in of_complex ` circle Ze Re = poincare_circle (of_complex z2) r2
is_real z1
is_real z2
0 < r1
0 < r2
- 1 < Re z1
Re z1 < 1
- 1 < Re z2
Re z2 < 1
z1 \<noteq> z2
x1 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2
x2 \<in> poincare_circle (of_complex z1) r1 \<inter> poincare_circle (of_complex z2) r2
x1 \<noteq> x2
(Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1
(Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2
of_complex z1 \<in> unit_disc
of_complex z2 \<in> unit_disc
x1 = of_complex x1'
x2 = of_complex x2'

goal (1 subgoal):
 1. x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2 &&& x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
[PROOF STEP]
by auto (metis image_iff of_complex_inj)+
[PROOF STATE]
proof (state)
this:
x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
have "is_real Ze1" "is_real Ze2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_real Ze1 &&& is_real Ze2
[PROOF STEP]
using 1 2 \<open>is_real z1\<close> \<open>is_real z2\<close>
[PROOF STATE]
proof (prove)
using this:
(Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1
(Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2
is_real z1
is_real z2

goal (1 subgoal):
 1. is_real Ze1 &&& is_real Ze2
[PROOF STEP]
by (simp_all add: poincare_circle_euclidean_def Let_def)
[PROOF STATE]
proof (state)
this:
is_real Ze1
is_real Ze2

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
have "Re1 > 0" "Re2 > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < Re1 &&& 0 < Re2
[PROOF STEP]
using 1 2 in_disc \<open>r1 > 0\<close> \<open>r2 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
(Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1
(Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2
of_complex z1 \<in> unit_disc
of_complex z2 \<in> unit_disc
0 < r1
0 < r2

goal (1 subgoal):
 1. 0 < Re1 &&& 0 < Re2
[PROOF STEP]
using poincare_circle_in_disc(2)[of r1 "of_complex z1" Ze1 Re1]
[PROOF STATE]
proof (prove)
using this:
(Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1
(Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2
of_complex z1 \<in> unit_disc
of_complex z2 \<in> unit_disc
0 < r1
0 < r2
\<lbrakk>0 < r1; of_complex z1 \<in> unit_disc; (Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1\<rbrakk> \<Longrightarrow> 0 < Re1

goal (1 subgoal):
 1. 0 < Re1 &&& 0 < Re2
[PROOF STEP]
using poincare_circle_in_disc(2)[of r2 "of_complex z2" Ze2 Re2]
[PROOF STATE]
proof (prove)
using this:
(Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1
(Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2
of_complex z1 \<in> unit_disc
of_complex z2 \<in> unit_disc
0 < r1
0 < r2
\<lbrakk>0 < r1; of_complex z1 \<in> unit_disc; (Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1\<rbrakk> \<Longrightarrow> 0 < Re1
\<lbrakk>0 < r2; of_complex z2 \<in> unit_disc; (Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2\<rbrakk> \<Longrightarrow> 0 < Re2

goal (1 subgoal):
 1. 0 < Re1 &&& 0 < Re2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < Re1
0 < Re2

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
have "Ze1 \<noteq> Ze2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ze1 \<noteq> Ze2
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Ze1 \<noteq> Ze2 \<Longrightarrow> False
[PROOF STEP]
assume "\<not> ?thesis"
[PROOF STATE]
proof (state)
this:
\<not> Ze1 \<noteq> Ze2

goal (1 subgoal):
 1. \<not> Ze1 \<noteq> Ze2 \<Longrightarrow> False
[PROOF STEP]
hence eq: "Ze1 = Ze2" "Re1 = Re2"
[PROOF STATE]
proof (prove)
using this:
\<not> Ze1 \<noteq> Ze2

goal (1 subgoal):
 1. Ze1 = Ze2 &&& Re1 = Re2
[PROOF STEP]
using circle(1)
[PROOF STATE]
proof (prove)
using this:
\<not> Ze1 \<noteq> Ze2
x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2

goal (1 subgoal):
 1. Ze1 = Ze2 &&& Re1 = Re2
[PROOF STEP]
unfolding circle_def
[PROOF STATE]
proof (prove)
using this:
\<not> Ze1 \<noteq> Ze2
x1' \<in> {z. cmod (z - Ze1) = Re1} \<inter> {z. cmod (z - Ze2) = Re2}

goal (1 subgoal):
 1. Ze1 = Ze2 &&& Re1 = Re2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Ze1 = Ze2
Re1 = Re2

goal (1 subgoal):
 1. \<not> Ze1 \<noteq> Ze2 \<Longrightarrow> False
[PROOF STEP]
let ?A = "Ze1 - Re1" and ?B = "Ze1 + Re1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> Ze1 \<noteq> Ze2 \<Longrightarrow> False
[PROOF STEP]
have "?A \<in> circle Ze1 Re1" "?B \<in> circle Ze1 Re1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ze1 - cor Re1 \<in> circle Ze1 Re1 &&& Ze1 + cor Re1 \<in> circle Ze1 Re1
[PROOF STEP]
using \<open>Re1 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < Re1

goal (1 subgoal):
 1. Ze1 - cor Re1 \<in> circle Ze1 Re1 &&& Ze1 + cor Re1 \<in> circle Ze1 Re1
[PROOF STEP]
unfolding circle_def
[PROOF STATE]
proof (prove)
using this:
0 < Re1

goal (1 subgoal):
 1. Ze1 - cor Re1 \<in> {z. cmod (z - Ze1) = Re1} &&& Ze1 + cor Re1 \<in> {z. cmod (z - Ze1) = Re1}
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
Ze1 - cor Re1 \<in> circle Ze1 Re1
Ze1 + cor Re1 \<in> circle Ze1 Re1

goal (1 subgoal):
 1. \<not> Ze1 \<noteq> Ze2 \<Longrightarrow> False
[PROOF STEP]
hence "of_complex ?A \<in> poincare_circle (of_complex z1) r1" "of_complex ?B \<in> poincare_circle (of_complex z1) r1"
          "of_complex ?A \<in> poincare_circle (of_complex z2) r2" "of_complex ?B \<in> poincare_circle (of_complex z2) r2"
[PROOF STATE]
proof (prove)
using this:
Ze1 - cor Re1 \<in> circle Ze1 Re1
Ze1 + cor Re1 \<in> circle Ze1 Re1

goal (1 subgoal):
 1. (of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z1) r1 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z1) r1) &&& of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z2) r2 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z2) r2
[PROOF STEP]
using eq
[PROOF STATE]
proof (prove)
using this:
Ze1 - cor Re1 \<in> circle Ze1 Re1
Ze1 + cor Re1 \<in> circle Ze1 Re1
Ze1 = Ze2
Re1 = Re2

goal (1 subgoal):
 1. (of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z1) r1 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z1) r1) &&& of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z2) r2 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z2) r2
[PROOF STEP]
using poincare_circle_is_euclidean_circle[OF \<open>of_complex z1 \<in> unit_disc\<close> \<open>r1 > 0\<close>]
[PROOF STATE]
proof (prove)
using this:
Ze1 - cor Re1 \<in> circle Ze1 Re1
Ze1 + cor Re1 \<in> circle Ze1 Re1
Ze1 = Ze2
Re1 = Re2
let (Ze, Re) = poincare_circle_euclidean (of_complex z1) r1 in of_complex ` circle Ze Re = poincare_circle (of_complex z1) r1

goal (1 subgoal):
 1. (of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z1) r1 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z1) r1) &&& of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z2) r2 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z2) r2
[PROOF STEP]
using poincare_circle_is_euclidean_circle[OF \<open>of_complex z2 \<in> unit_disc\<close> \<open>r2 > 0\<close>]
[PROOF STATE]
proof (prove)
using this:
Ze1 - cor Re1 \<in> circle Ze1 Re1
Ze1 + cor Re1 \<in> circle Ze1 Re1
Ze1 = Ze2
Re1 = Re2
let (Ze, Re) = poincare_circle_euclidean (of_complex z1) r1 in of_complex ` circle Ze Re = poincare_circle (of_complex z1) r1
let (Ze, Re) = poincare_circle_euclidean (of_complex z2) r2 in of_complex ` circle Ze Re = poincare_circle (of_complex z2) r2

goal (1 subgoal):
 1. (of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z1) r1 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z1) r1) &&& of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z2) r2 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z2) r2
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
Ze1 - cor Re1 \<in> circle Ze1 Re1
Ze1 + cor Re1 \<in> circle Ze1 Re1
Ze1 = Ze2
Re1 = Re2
let (Ze, Re) = poincare_circle_euclidean (of_complex z1) r1 in of_complex ` circle Ze Re = poincare_circle (of_complex z1) r1
let (Ze, Re) = poincare_circle_euclidean (of_complex z2) r2 in of_complex ` circle Ze Re = poincare_circle (of_complex z2) r2
(Ze1, Re1) = poincare_circle_euclidean (of_complex z1) r1
(Ze2, Re2) = poincare_circle_euclidean (of_complex z2) r2

goal (1 subgoal):
 1. (of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z1) r1 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z1) r1) &&& of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z2) r2 &&& of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z2) r2
[PROOF STEP]
by auto blast+
[PROOF STATE]
proof (state)
this:
of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z1) r1
of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z1) r1
of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z2) r2
of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z2) r2

goal (1 subgoal):
 1. \<not> Ze1 \<noteq> Ze2 \<Longrightarrow> False
[PROOF STEP]
hence "poincare_distance (of_complex z1) (of_complex ?A) = poincare_distance (of_complex z1) (of_complex ?B)"
          "poincare_distance (of_complex z2) (of_complex ?A) = poincare_distance (of_complex z2) (of_complex ?B)"
          "-1 < Re (Ze1 - Re1)" "Re (Ze1 - Re1) < 1" "-1 < Re (Ze1 + Re1)" "Re (Ze1 + Re1) < 1"
[PROOF STATE]
proof (prove)
using this:
of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z1) r1
of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z1) r1
of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z2) r2
of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z2) r2

goal (1 subgoal):
 1. (poincare_distance (of_complex z1) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z1) (of_complex (Ze1 + cor Re1)) &&& poincare_distance (of_complex z2) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z2) (of_complex (Ze1 + cor Re1)) &&& - 1 < Re (Ze1 - cor Re1)) &&& Re (Ze1 - cor Re1) < 1 &&& - 1 < Re (Ze1 + cor Re1) &&& Re (Ze1 + cor Re1) < 1
[PROOF STEP]
using \<open>is_real Ze1\<close> \<open>is_real Ze2\<close>
[PROOF STATE]
proof (prove)
using this:
of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z1) r1
of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z1) r1
of_complex (Ze1 - cor Re1) \<in> poincare_circle (of_complex z2) r2
of_complex (Ze1 + cor Re1) \<in> poincare_circle (of_complex z2) r2
is_real Ze1
is_real Ze2

goal (1 subgoal):
 1. (poincare_distance (of_complex z1) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z1) (of_complex (Ze1 + cor Re1)) &&& poincare_distance (of_complex z2) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z2) (of_complex (Ze1 + cor Re1)) &&& - 1 < Re (Ze1 - cor Re1)) &&& Re (Ze1 - cor Re1) < 1 &&& - 1 < Re (Ze1 + cor Re1) &&& Re (Ze1 + cor Re1) < 1
[PROOF STEP]
unfolding poincare_circle_def
[PROOF STATE]
proof (prove)
using this:
of_complex (Ze1 - cor Re1) \<in> {z' \<in> unit_disc. poincare_distance (of_complex z1) z' = r1}
of_complex (Ze1 + cor Re1) \<in> {z' \<in> unit_disc. poincare_distance (of_complex z1) z' = r1}
of_complex (Ze1 - cor Re1) \<in> {z' \<in> unit_disc. poincare_distance (of_complex z2) z' = r2}
of_complex (Ze1 + cor Re1) \<in> {z' \<in> unit_disc. poincare_distance (of_complex z2) z' = r2}
is_real Ze1
is_real Ze2

goal (1 subgoal):
 1. (poincare_distance (of_complex z1) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z1) (of_complex (Ze1 + cor Re1)) &&& poincare_distance (of_complex z2) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z2) (of_complex (Ze1 + cor Re1)) &&& - 1 < Re (Ze1 - cor Re1)) &&& Re (Ze1 - cor Re1) < 1 &&& - 1 < Re (Ze1 + cor Re1) &&& Re (Ze1 + cor Re1) < 1
[PROOF STEP]
by (auto simp add: cmod_eq_Re)
[PROOF STATE]
proof (state)
this:
poincare_distance (of_complex z1) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z1) (of_complex (Ze1 + cor Re1))
poincare_distance (of_complex z2) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z2) (of_complex (Ze1 + cor Re1))
- 1 < Re (Ze1 - cor Re1)
Re (Ze1 - cor Re1) < 1
- 1 < Re (Ze1 + cor Re1)
Re (Ze1 + cor Re1) < 1

goal (1 subgoal):
 1. \<not> Ze1 \<noteq> Ze2 \<Longrightarrow> False
[PROOF STEP]
hence "z1 = z2"
[PROOF STATE]
proof (prove)
using this:
poincare_distance (of_complex z1) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z1) (of_complex (Ze1 + cor Re1))
poincare_distance (of_complex z2) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z2) (of_complex (Ze1 + cor Re1))
- 1 < Re (Ze1 - cor Re1)
Re (Ze1 - cor Re1) < 1
- 1 < Re (Ze1 + cor Re1)
Re (Ze1 + cor Re1) < 1

goal (1 subgoal):
 1. z1 = z2
[PROOF STEP]
using unique_midpoint_x_axis[of "Ze1 - Re1" "Ze1 + Re1"]
[PROOF STATE]
proof (prove)
using this:
poincare_distance (of_complex z1) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z1) (of_complex (Ze1 + cor Re1))
poincare_distance (of_complex z2) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z2) (of_complex (Ze1 + cor Re1))
- 1 < Re (Ze1 - cor Re1)
Re (Ze1 - cor Re1) < 1
- 1 < Re (Ze1 + cor Re1)
Re (Ze1 + cor Re1) < 1
\<lbrakk>is_real (Ze1 - cor Re1); - 1 < Re (Ze1 - cor Re1); Re (Ze1 - cor Re1) < 1; is_real (Ze1 + cor Re1); - 1 < Re (Ze1 + cor Re1); Re (Ze1 + cor Re1) < 1; Ze1 - cor Re1 \<noteq> Ze1 + cor Re1\<rbrakk> \<Longrightarrow> \<exists>!z. - 1 < Re z \<and> Re z < 1 \<and> is_real z \<and> poincare_distance (of_complex z) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z) (of_complex (Ze1 + cor Re1))

goal (1 subgoal):
 1. z1 = z2
[PROOF STEP]
using \<open>is_real Ze1\<close> \<open>is_real z1\<close> \<open>is_real z2\<close> \<open>Re1 > 0\<close> \<open>-1 < Re z1\<close> \<open>Re z1 < 1\<close> \<open>-1 < Re z2\<close> \<open>Re z2 < 1\<close>
[PROOF STATE]
proof (prove)
using this:
poincare_distance (of_complex z1) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z1) (of_complex (Ze1 + cor Re1))
poincare_distance (of_complex z2) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z2) (of_complex (Ze1 + cor Re1))
- 1 < Re (Ze1 - cor Re1)
Re (Ze1 - cor Re1) < 1
- 1 < Re (Ze1 + cor Re1)
Re (Ze1 + cor Re1) < 1
\<lbrakk>is_real (Ze1 - cor Re1); - 1 < Re (Ze1 - cor Re1); Re (Ze1 - cor Re1) < 1; is_real (Ze1 + cor Re1); - 1 < Re (Ze1 + cor Re1); Re (Ze1 + cor Re1) < 1; Ze1 - cor Re1 \<noteq> Ze1 + cor Re1\<rbrakk> \<Longrightarrow> \<exists>!z. - 1 < Re z \<and> Re z < 1 \<and> is_real z \<and> poincare_distance (of_complex z) (of_complex (Ze1 - cor Re1)) = poincare_distance (of_complex z) (of_complex (Ze1 + cor Re1))
is_real Ze1
is_real z1
is_real z2
0 < Re1
- 1 < Re z1
Re z1 < 1
- 1 < Re z2
Re z2 < 1

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

goal (1 subgoal):
 1. \<not> Ze1 \<noteq> Ze2 \<Longrightarrow> False
[PROOF STEP]
thus False
[PROOF STATE]
proof (prove)
using this:
z1 = z2

goal (1 subgoal):
 1. False
[PROOF STEP]
using \<open>z1 \<noteq> z2\<close>
[PROOF STATE]
proof (prove)
using this:
z1 = z2
z1 \<noteq> z2

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Ze1 \<noteq> Ze2

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
hence *: "(Re x1')\<^sup>2 + (Im x1')\<^sup>2 - 2 * Re x1' * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0"
           "(Re x1')\<^sup>2 + (Im x1')\<^sup>2 - 2 * Re x1' * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0"
           "(Re x2')\<^sup>2 + (Im x2')\<^sup>2 - 2 * Re x2' * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0"
           "(Re x2')\<^sup>2 + (Im x2')\<^sup>2 - 2 * Re x2' * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0"
[PROOF STATE]
proof (prove)
using this:
Ze1 \<noteq> Ze2

goal (1 subgoal):
 1. (cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0) &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
[PROOF STEP]
using circle_equation[of Re1 Ze1] circle_equation[of Re2 Ze2] circle
[PROOF STATE]
proof (prove)
using this:
Ze1 \<noteq> Ze2
0 \<le> Re1 \<Longrightarrow> circle Ze1 Re1 = {z. z * cnj z - z * cnj Ze1 - cnj z * Ze1 + Ze1 * cnj Ze1 - cor (Re1 * Re1) = 0}
0 \<le> Re2 \<Longrightarrow> circle Ze2 Re2 = {z. z * cnj z - z * cnj Ze2 - cnj z * Ze2 + Ze2 * cnj Ze2 - cor (Re2 * Re2) = 0}
x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2

goal (1 subgoal):
 1. (cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0) &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
[PROOF STEP]
using eq_cnj_iff_real[of Ze1] \<open>is_real Ze1\<close> \<open>Re1 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
Ze1 \<noteq> Ze2
0 \<le> Re1 \<Longrightarrow> circle Ze1 Re1 = {z. z * cnj z - z * cnj Ze1 - cnj z * Ze1 + Ze1 * cnj Ze1 - cor (Re1 * Re1) = 0}
0 \<le> Re2 \<Longrightarrow> circle Ze2 Re2 = {z. z * cnj z - z * cnj Ze2 - cnj z * Ze2 + Ze2 * cnj Ze2 - cor (Re2 * Re2) = 0}
x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
(cnj Ze1 = Ze1) = is_real Ze1
is_real Ze1
0 < Re1

goal (1 subgoal):
 1. (cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0) &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
[PROOF STEP]
using eq_cnj_iff_real[of Ze2] \<open>is_real Ze2\<close> \<open>Re2 > 0\<close>
[PROOF STATE]
proof (prove)
using this:
Ze1 \<noteq> Ze2
0 \<le> Re1 \<Longrightarrow> circle Ze1 Re1 = {z. z * cnj z - z * cnj Ze1 - cnj z * Ze1 + Ze1 * cnj Ze1 - cor (Re1 * Re1) = 0}
0 \<le> Re2 \<Longrightarrow> circle Ze2 Re2 = {z. z * cnj z - z * cnj Ze2 - cnj z * Ze2 + Ze2 * cnj Ze2 - cor (Re2 * Re2) = 0}
x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
(cnj Ze1 = Ze1) = is_real Ze1
is_real Ze1
0 < Re1
(cnj Ze2 = Ze2) = is_real Ze2
is_real Ze2
0 < Re2

goal (1 subgoal):
 1. (cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0) &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
[PROOF STEP]
using complex_add_cnj[of x1']  complex_add_cnj[of x2']
[PROOF STATE]
proof (prove)
using this:
Ze1 \<noteq> Ze2
0 \<le> Re1 \<Longrightarrow> circle Ze1 Re1 = {z. z * cnj z - z * cnj Ze1 - cnj z * Ze1 + Ze1 * cnj Ze1 - cor (Re1 * Re1) = 0}
0 \<le> Re2 \<Longrightarrow> circle Ze2 Re2 = {z. z * cnj z - z * cnj Ze2 - cnj z * Ze2 + Ze2 * cnj Ze2 - cor (Re2 * Re2) = 0}
x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
(cnj Ze1 = Ze1) = is_real Ze1
is_real Ze1
0 < Re1
(cnj Ze2 = Ze2) = is_real Ze2
is_real Ze2
0 < Re2
x1' + cnj x1' = cor (2 * Re x1')
x2' + cnj x2' = cor (2 * Re x2')

goal (1 subgoal):
 1. (cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0) &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
[PROOF STEP]
using distrib_left[of Ze1 x1' "cnj x1'"] distrib_left[of Ze2 x1' "cnj x1'"]
[PROOF STATE]
proof (prove)
using this:
Ze1 \<noteq> Ze2
0 \<le> Re1 \<Longrightarrow> circle Ze1 Re1 = {z. z * cnj z - z * cnj Ze1 - cnj z * Ze1 + Ze1 * cnj Ze1 - cor (Re1 * Re1) = 0}
0 \<le> Re2 \<Longrightarrow> circle Ze2 Re2 = {z. z * cnj z - z * cnj Ze2 - cnj z * Ze2 + Ze2 * cnj Ze2 - cor (Re2 * Re2) = 0}
x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
(cnj Ze1 = Ze1) = is_real Ze1
is_real Ze1
0 < Re1
(cnj Ze2 = Ze2) = is_real Ze2
is_real Ze2
0 < Re2
x1' + cnj x1' = cor (2 * Re x1')
x2' + cnj x2' = cor (2 * Re x2')
Ze1 * (x1' + cnj x1') = Ze1 * x1' + Ze1 * cnj x1'
Ze2 * (x1' + cnj x1') = Ze2 * x1' + Ze2 * cnj x1'

goal (1 subgoal):
 1. (cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0) &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
[PROOF STEP]
using distrib_left[of Ze1 x2' "cnj x2'"] distrib_left[of Ze2 x2' "cnj x2'"]
[PROOF STATE]
proof (prove)
using this:
Ze1 \<noteq> Ze2
0 \<le> Re1 \<Longrightarrow> circle Ze1 Re1 = {z. z * cnj z - z * cnj Ze1 - cnj z * Ze1 + Ze1 * cnj Ze1 - cor (Re1 * Re1) = 0}
0 \<le> Re2 \<Longrightarrow> circle Ze2 Re2 = {z. z * cnj z - z * cnj Ze2 - cnj z * Ze2 + Ze2 * cnj Ze2 - cor (Re2 * Re2) = 0}
x1' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
x2' \<in> circle Ze1 Re1 \<inter> circle Ze2 Re2
(cnj Ze1 = Ze1) = is_real Ze1
is_real Ze1
0 < Re1
(cnj Ze2 = Ze2) = is_real Ze2
is_real Ze2
0 < Re2
x1' + cnj x1' = cor (2 * Re x1')
x2' + cnj x2' = cor (2 * Re x2')
Ze1 * (x1' + cnj x1') = Ze1 * x1' + Ze1 * cnj x1'
Ze2 * (x1' + cnj x1') = Ze2 * x1' + Ze2 * cnj x1'
Ze1 * (x2' + cnj x2') = Ze1 * x2' + Ze1 * cnj x2'
Ze2 * (x2' + cnj x2') = Ze2 * x2' + Ze2 * cnj x2'

goal (1 subgoal):
 1. (cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0) &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0 &&& cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
[PROOF STEP]
by (auto simp add: complex_mult_cnj power2_eq_square field_simps)
[PROOF STATE]
proof (state)
this:
cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0
cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0
cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
hence "- 2 * Re x1' * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = - 2 * Re x1' * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2)"
        "- 2 * Re x2' * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = - 2 * Re x2' * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2)"
[PROOF STATE]
proof (prove)
using this:
cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0
cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0
cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0
cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) = 0

goal (1 subgoal):
 1. cor (- 2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = cor (- 2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2) &&& cor (- 2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = cor (- 2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2)
[PROOF STEP]
by (smt add_diff_cancel_right' add_diff_eq eq_iff_diff_eq_0 minus_diff_eq mult_minus_left of_real_minus)+
[PROOF STATE]
proof (state)
this:
cor (- 2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = cor (- 2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2)
cor (- 2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = cor (- 2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2)

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
hence "2 * Re x1' * (Ze2 - Ze1) =  (Ze2 * Ze2 - cor (Re2 * Re2)) - (Ze1 * Ze1 - cor (Re1 * Re1))"
        "2 * Re x2' * (Ze2 - Ze1) =  (Ze2 * Ze2 - cor (Re2 * Re2)) - (Ze1 * Ze1 - cor (Re1 * Re1))"
[PROOF STATE]
proof (prove)
using this:
cor (- 2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = cor (- 2 * Re x1') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2)
cor (- 2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = cor (- 2 * Re x2') * Ze2 + Ze2 * Ze2 - cor (Re2 * Re2)

goal (1 subgoal):
 1. cor (2 * Re x1') * (Ze2 - Ze1) = Ze2 * Ze2 - cor (Re2 * Re2) - (Ze1 * Ze1 - cor (Re1 * Re1)) &&& cor (2 * Re x2') * (Ze2 - Ze1) = Ze2 * Ze2 - cor (Re2 * Re2) - (Ze1 * Ze1 - cor (Re1 * Re1))
[PROOF STEP]
by simp_all (simp add: field_simps)+
[PROOF STATE]
proof (state)
this:
cor (2 * Re x1') * (Ze2 - Ze1) = Ze2 * Ze2 - cor (Re2 * Re2) - (Ze1 * Ze1 - cor (Re1 * Re1))
cor (2 * Re x2') * (Ze2 - Ze1) = Ze2 * Ze2 - cor (Re2 * Re2) - (Ze1 * Ze1 - cor (Re1 * Re1))

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
hence "2 * Re x1' * (Ze2 - Ze1) = 2 * Re x2' * (Ze2 - Ze1)"
[PROOF STATE]
proof (prove)
using this:
cor (2 * Re x1') * (Ze2 - Ze1) = Ze2 * Ze2 - cor (Re2 * Re2) - (Ze1 * Ze1 - cor (Re1 * Re1))
cor (2 * Re x2') * (Ze2 - Ze1) = Ze2 * Ze2 - cor (Re2 * Re2) - (Ze1 * Ze1 - cor (Re1 * Re1))

goal (1 subgoal):
 1. cor (2 * Re x1') * (Ze2 - Ze1) = cor (2 * Re x2') * (Ze2 - Ze1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cor (2 * Re x1') * (Ze2 - Ze1) = cor (2 * Re x2') * (Ze2 - Ze1)

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
hence "Re x1' = Re x2'"
[PROOF STATE]
proof (prove)
using this:
cor (2 * Re x1') * (Ze2 - Ze1) = cor (2 * Re x2') * (Ze2 - Ze1)

goal (1 subgoal):
 1. Re x1' = Re x2'
[PROOF STEP]
using \<open>Ze1 \<noteq> Ze2\<close>
[PROOF STATE]
proof (prove)
using this:
cor (2 * Re x1') * (Ze2 - Ze1) = cor (2 * Re x2') * (Ze2 - Ze1)
Ze1 \<noteq> Ze2

goal (1 subgoal):
 1. Re x1' = Re x2'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Re x1' = Re x2'

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Re x1' = Re x2'

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
hence "(Im x1')\<^sup>2 = (Im x2')\<^sup>2"
[PROOF STATE]
proof (prove)
using this:
Re x1' = Re x2'

goal (1 subgoal):
 1. (Im x1')\<^sup>2 = (Im x2')\<^sup>2
[PROOF STEP]
using *(1) *(3)
[PROOF STATE]
proof (prove)
using this:
Re x1' = Re x2'
cor ((Re x1')\<^sup>2 + (Im x1')\<^sup>2) - cor (2 * Re x1') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0
cor ((Re x2')\<^sup>2 + (Im x2')\<^sup>2) - cor (2 * Re x2') * Ze1 + Ze1 * Ze1 - cor (Re1 * Re1) = 0

goal (1 subgoal):
 1. (Im x1')\<^sup>2 = (Im x2')\<^sup>2
[PROOF STEP]
by (simp add: \<open>is_real Ze1\<close> complex_eq_if_Re_eq)
[PROOF STATE]
proof (state)
this:
(Im x1')\<^sup>2 = (Im x2')\<^sup>2

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
hence "Im x1' = Im x2' \<or> Im x1' = -Im x2'"
[PROOF STATE]
proof (prove)
using this:
(Im x1')\<^sup>2 = (Im x2')\<^sup>2

goal (1 subgoal):
 1. Im x1' = Im x2' \<or> Im x1' = - Im x2'
[PROOF STEP]
using power2_eq_iff
[PROOF STATE]
proof (prove)
using this:
(Im x1')\<^sup>2 = (Im x2')\<^sup>2
(?x\<^sup>2 = ?y\<^sup>2) = (?x = ?y \<or> ?x = - ?y)

goal (1 subgoal):
 1. Im x1' = Im x2' \<or> Im x1' = - Im x2'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Im x1' = Im x2' \<or> Im x1' = - Im x2'

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Re x1' = Re x2'
Im x1' = Im x2' \<or> Im x1' = - Im x2'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Re x1' = Re x2'
Im x1' = Im x2' \<or> Im x1' = - Im x2'

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
using x' \<open>x1 \<noteq> x2\<close>
[PROOF STATE]
proof (prove)
using this:
Re x1' = Re x2'
Im x1' = Im x2' \<or> Im x1' = - Im x2'
x1 = of_complex x1'
x2 = of_complex x2'
x1 \<noteq> x2

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
using complex.expand
[PROOF STATE]
proof (prove)
using this:
Re x1' = Re x2'
Im x1' = Im x2' \<or> Im x1' = - Im x2'
x1 = of_complex x1'
x2 = of_complex x2'
x1 \<noteq> x2
Re ?complex = Re ?complex' \<and> Im ?complex = Im ?complex' \<Longrightarrow> ?complex = ?complex'

goal (1 subgoal):
 1. x1 = conjugate x2
[PROOF STEP]
by (metis cnj.code complex_surj conjugate_of_complex)
[PROOF STATE]
proof (state)
this:
x1 = conjugate x2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma croots4: assumes deg: "degree p = 4"
  shows "set (croots4 p) = { x. poly p x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (croots4 p) = {x. poly p x = 0}
[PROOF STEP]
unfolding croots4_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (roots4_generic solve_depressed_quartic_complex p) = {x. poly p x = 0}
[PROOF STEP]
by (rule roots4_generic[OF deg solve_depressed_quartic_complex])


[STATEMENT]
lemma ln_2_64:
  "\<bar>ln 2 - 12786308645202655660 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64 :: real)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>ln 2 - 12786308645202655660 / 2 ^ 64\<bar> \<le> inverse (2 ^ 64)
[PROOF STEP]
by (rule approx_coarsen[OF ln_2_128]) simp_all


[STATEMENT]
lemma "((\<lambda>x::real. exp x * (sin (1/x + exp (-x)) - sin (1/x + exp (-(x^2))))) \<longlongrightarrow> 1) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. exp x * (sin (1 / x + exp (- x)) - sin (1 / x + exp (- x\<^sup>2)))) \<longlongrightarrow> 1) at_top
[PROOF STEP]
by real_asymp


[STATEMENT]
lemma insertion_single[simp]: "insertion f (monom (Poly_Mapping.single (v::nat) (n::nat)) a) = a * f v ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (monom (Poly_Mapping.single v n) a) = a * f v ^ n
[PROOF STEP]
using insertion_fun_single  Sum_any.cong insertion.rep_eq insertion_aux.rep_eq insertion_fun_def
  mapping_of_monom single.rep_eq
[PROOF STATE]
proof (prove)
using this:
insertion_fun ?f (\<lambda>m. ?a when Poly_Mapping.single ?v ?n = m) = ?a * ?f ?v ^ ?n
(\<And>a. ?g a = ?h a) \<Longrightarrow> Sum_any ?g = Sum_any ?h
insertion ?x ?xa = insertion_aux ?x (mapping_of ?xa)
insertion_aux ?x ?xa = insertion_fun ?x (lookup ?xa)
insertion_fun ?f ?p = (\<Sum>m. ?p m * (\<Prod>v. ?f v ^ lookup m v))
mapping_of (monom ?m ?a) = Poly_Mapping.single ?m ?a
lookup (Poly_Mapping.single ?x ?xa) = (\<lambda>k'. ?xa when ?x = k')

goal (1 subgoal):
 1. insertion f (monom (Poly_Mapping.single v n) a) = a * f v ^ n
[PROOF STEP]
by (metis (no_types, lifting))


[STATEMENT]
lemma merge_map': "sorted_distinct (map fst nxs) \<Longrightarrow> sorted_distinct (map fst mys) \<Longrightarrow>
  fst ` set nxs \<inter> fst ` set mys = {} \<Longrightarrow>
  map snd nxs = map \<sigma> (map fst nxs) \<Longrightarrow> map snd mys = map \<sigma> (map fst mys) \<Longrightarrow>
  map snd (merge nxs mys) = map \<sigma> (sort (map fst nxs @ map fst mys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted_distinct (map fst nxs); sorted_distinct (map fst mys); fst ` set nxs \<inter> fst ` set mys = {}; map snd nxs = map \<sigma> (map fst nxs); map snd mys = map \<sigma> (map fst mys)\<rbrakk> \<Longrightarrow> map snd (merge nxs mys) = map \<sigma> (sort (map fst nxs @ map fst mys))
[PROOF STEP]
by (induction nxs mys rule: merge.induct)
     (auto simp: sorted_sort_id insort_is_Cons insort_aux_le insort_aux_gt)