[STATEMENT]
lemma has_derivative_inverse':
  fixes x :: "'a::real_normed_div_algebra"
  assumes x: "x \<noteq> 0"
  shows "(inverse has_derivative (\<lambda>h. - (inverse x * h * inverse x))) (at x within S)"
    (is "(_ has_derivative ?f) _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inverse has_derivative (\<lambda>h. - (inverse x * h * inverse x))) (at x within S)
[PROOF STEP]
proof (rule has_derivativeI_sandwich)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. 0 < ?e
 2. bounded_linear (\<lambda>h. - (inverse x * h * inverse x))
 3. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < ?e\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> ?H y
 4. (?H \<longlongrightarrow> 0) (at x within S)
[PROOF STEP]
show "bounded_linear (\<lambda>h. - (inverse x * h * inverse x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear (\<lambda>h. - (inverse x * h * inverse x))
[PROOF STEP]
by (simp add: bounded_linear_minus bounded_linear_mult_const bounded_linear_mult_right)
[PROOF STATE]
proof (state)
this:
bounded_linear (\<lambda>h. - (inverse x * h * inverse x))

goal (3 subgoals):
 1. 0 < ?e
 2. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < ?e\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> ?H y
 3. (?H \<longlongrightarrow> 0) (at x within S)
[PROOF STEP]
show "0 < norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < norm x
[PROOF STEP]
using x
[PROOF STATE]
proof (prove)
using this:
x \<noteq> (0::'a)

goal (1 subgoal):
 1. 0 < norm x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < norm x

goal (2 subgoals):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> ?H y
 2. (?H \<longlongrightarrow> 0) (at x within S)
[PROOF STEP]
have "(inverse \<longlongrightarrow> inverse x) (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inverse \<longlongrightarrow> inverse x) (at x within S)
[PROOF STEP]
using tendsto_inverse tendsto_ident_at x
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(?f \<longlongrightarrow> ?a) ?F; ?a \<noteq> (0::?'a)\<rbrakk> \<Longrightarrow> ((\<lambda>x. inverse (?f x)) \<longlongrightarrow> inverse ?a) ?F
((\<lambda>x. x) \<longlongrightarrow> ?a) (at ?a within ?s)
x \<noteq> (0::'a)

goal (1 subgoal):
 1. (inverse \<longlongrightarrow> inverse x) (at x within S)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(inverse \<longlongrightarrow> inverse x) (at x within S)

goal (2 subgoals):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> ?H y
 2. (?H \<longlongrightarrow> 0) (at x within S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(inverse \<longlongrightarrow> inverse x) (at x within S)
[PROOF STEP]
show "((\<lambda>y. norm (inverse y - inverse x) * norm (inverse x)) \<longlongrightarrow> 0) (at x within S)"
[PROOF STATE]
proof (prove)
using this:
(inverse \<longlongrightarrow> inverse x) (at x within S)

goal (1 subgoal):
 1. ((\<lambda>y. norm (inverse y - inverse x) * norm (inverse x)) \<longlongrightarrow> 0) (at x within S)
[PROOF STEP]
by (simp add: LIM_zero_iff tendsto_mult_left_zero tendsto_norm_zero)
[PROOF STATE]
proof (state)
this:
((\<lambda>y. norm (inverse y - inverse x) * norm (inverse x)) \<longlongrightarrow> 0) (at x within S)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
fix y :: 'a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
assume h: "y \<noteq> x" "dist y x < norm x"
[PROOF STATE]
proof (state)
this:
y \<noteq> x
dist y x < norm x

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<noteq> x
dist y x < norm x
[PROOF STEP]
have "y \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
y \<noteq> x
dist y x < norm x

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

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
have "norm (inverse y - inverse x - ?f (y -x)) / norm (y - x)
        = norm (- (inverse y * (y - x) * inverse x - inverse x * (y - x) * inverse x)) /
                norm (y - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) = norm (- (inverse y * (y - x) * inverse x - inverse x * (y - x) * inverse x)) / norm (y - x)
[PROOF STEP]
by (simp add: \<open>y \<noteq> 0\<close> inverse_diff_inverse x)
[PROOF STATE]
proof (state)
this:
norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) = norm (- (inverse y * (y - x) * inverse x - inverse x * (y - x) * inverse x)) / norm (y - x)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) = norm (- (inverse y * (y - x) * inverse x - inverse x * (y - x) * inverse x)) / norm (y - x)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
have "... = norm ((inverse y - inverse x) * (y - x) * inverse x) / norm (y - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (- (inverse y * (y - x) * inverse x - inverse x * (y - x) * inverse x)) / norm (y - x) = norm ((inverse y - inverse x) * (y - x) * inverse x) / norm (y - x)
[PROOF STEP]
by (simp add: left_diff_distrib norm_minus_commute)
[PROOF STATE]
proof (state)
this:
norm (- (inverse y * (y - x) * inverse x - inverse x * (y - x) * inverse x)) / norm (y - x) = norm ((inverse y - inverse x) * (y - x) * inverse x) / norm (y - x)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (- (inverse y * (y - x) * inverse x - inverse x * (y - x) * inverse x)) / norm (y - x) = norm ((inverse y - inverse x) * (y - x) * inverse x) / norm (y - x)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
have "\<dots> \<le> norm (inverse y - inverse x) * norm (y - x) * norm (inverse x) / norm (y - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm ((inverse y - inverse x) * (y - x) * inverse x) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (y - x) * norm (inverse x) / norm (y - x)
[PROOF STEP]
by (simp add: norm_mult)
[PROOF STATE]
proof (state)
this:
norm ((inverse y - inverse x) * (y - x) * inverse x) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (y - x) * norm (inverse x) / norm (y - x)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm ((inverse y - inverse x) * (y - x) * inverse x) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (y - x) * norm (inverse x) / norm (y - x)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
have "\<dots> = norm (inverse y - inverse x) * norm (inverse x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (inverse y - inverse x) * norm (y - x) * norm (inverse x) / norm (y - x) = norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (inverse y - inverse x) * norm (y - x) * norm (inverse x) / norm (y - x) = norm (inverse y - inverse x) * norm (inverse x)

goal (1 subgoal):
 1. \<And>y. \<lbrakk>y \<in> S; y \<noteq> x; dist y x < norm x\<rbrakk> \<Longrightarrow> norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
show "norm (inverse y - inverse x - ?f (y -x)) / norm (y - x) \<le>
    norm (inverse y - inverse x) * norm (inverse x)"
[PROOF STATE]
proof (prove)
using this:
norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)

goal (1 subgoal):
 1. norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
norm (inverse y - inverse x - - (inverse x * (y - x) * inverse x)) / norm (y - x) \<le> norm (inverse y - inverse x) * norm (inverse x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Order) le_imp_less_or_eq:
    "\<lbrakk>a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow> (a \<preceq> b) = (a \<prec> b \<or> a = b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow> a \<preceq> b = (a \<prec> b \<or> a = b)
[PROOF STEP]
apply (simp add:oless_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow> a \<preceq> b = (a \<preceq> b \<and> a \<noteq> b \<or> a = b)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier D; b \<in> carrier D; a \<preceq> b\<rbrakk> \<Longrightarrow> a \<preceq> b \<and> a \<noteq> b \<or> a = b
 2. \<lbrakk>a \<in> carrier D; b \<in> carrier D; a \<preceq> b \<and> a \<noteq> b \<or> a = b\<rbrakk> \<Longrightarrow> a \<preceq> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; b \<in> carrier D; a \<preceq> b \<and> a \<noteq> b \<or> a = b\<rbrakk> \<Longrightarrow> a \<preceq> b
[PROOF STEP]
apply (erule disjE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<in> carrier D; b \<in> carrier D; a \<preceq> b \<and> a \<noteq> b\<rbrakk> \<Longrightarrow> a \<preceq> b
 2. \<lbrakk>a \<in> carrier D; b \<in> carrier D; a = b\<rbrakk> \<Longrightarrow> a \<preceq> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> carrier D; b \<in> carrier D; a = b\<rbrakk> \<Longrightarrow> a \<preceq> b
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<in> carrier D; a = b\<rbrakk> \<Longrightarrow> b \<preceq> b
[PROOF STEP]
apply (rule le_refl)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b \<in> carrier D; a = b\<rbrakk> \<Longrightarrow> b \<in> carrier D
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma odd_bit_iff_bit_pred:
  \<open>bit a n \<longleftrightarrow> bit (a - 1) n \<or> n = 0\<close> if \<open>odd a\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bit a n = (bit (a - (1::'a)) n \<or> n = 0)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bit a n = (bit (a - (1::'a)) n \<or> n = 0)
[PROOF STEP]
from \<open>odd a\<close>
[PROOF STATE]
proof (chain)
picking this:
odd a
[PROOF STEP]
obtain b where \<open>a = 2 * b + 1\<close>
[PROOF STATE]
proof (prove)
using this:
odd a

goal (1 subgoal):
 1. (\<And>b. a = (2::'a) * b + (1::'a) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
a = (2::'a) * b + (1::'a)

goal (1 subgoal):
 1. bit a n = (bit (a - (1::'a)) n \<or> n = 0)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a = (2::'a) * b + (1::'a)

goal (1 subgoal):
 1. bit a n = (bit (a - (1::'a)) n \<or> n = 0)
[PROOF STEP]
have \<open>bit (2 * b) n \<or> n = 0 \<longleftrightarrow> bit (1 + 2 * b) n\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bit ((2::'a) * b) n \<or> n = 0) = bit ((1::'a) + (2::'a) * b) n
[PROOF STEP]
using even_bit_succ_iff
[PROOF STATE]
proof (prove)
using this:
even ?a \<Longrightarrow> bit ((1::'a) + ?a) ?n = (bit ?a ?n \<or> ?n = 0)

goal (1 subgoal):
 1. (bit ((2::'a) * b) n \<or> n = 0) = bit ((1::'a) + (2::'a) * b) n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(bit ((2::'a) * b) n \<or> n = 0) = bit ((1::'a) + (2::'a) * b) n

goal (1 subgoal):
 1. bit a n = (bit (a - (1::'a)) n \<or> n = 0)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a = (2::'a) * b + (1::'a)
(bit ((2::'a) * b) n \<or> n = 0) = bit ((1::'a) + (2::'a) * b) n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = (2::'a) * b + (1::'a)
(bit ((2::'a) * b) n \<or> n = 0) = bit ((1::'a) + (2::'a) * b) n

goal (1 subgoal):
 1. bit a n = (bit (a - (1::'a)) n \<or> n = 0)
[PROOF STEP]
by (simp add: ac_simps)
[PROOF STATE]
proof (state)
this:
bit a n = (bit (a - (1::'a)) n \<or> n = 0)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma snd_foldl_ef_det_eq: "snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k])
  = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k]
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<0]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<0]
 2. \<And>k. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k] \<Longrightarrow> snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<Suc k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<0]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<0]
 2. \<And>k. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k] \<Longrightarrow> snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<Suc k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<0]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<0]
[PROOF STEP]
by (simp add: echelon_form_of_column_k_det_def Let_def)
[PROOF STATE]
proof (state)
this:
snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<0]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<0]

goal (1 subgoal):
 1. \<And>k. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k] \<Longrightarrow> snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<Suc k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k] \<Longrightarrow> snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<Suc k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k]

goal (1 subgoal):
 1. \<And>k. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k] \<Longrightarrow> snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<Suc k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]
[PROOF STEP]
have Suc_rw: "[0..<(Suc k)] = [0..<k] @ [k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<Suc k] = [0..<k] @ [k]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[0..<Suc k] = [0..<k] @ [k]

goal (1 subgoal):
 1. \<And>k. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k] \<Longrightarrow> snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<Suc k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<Suc k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]
[PROOF STEP]
unfolding Suc_rw foldl_append List.foldl.simps fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd (echelon_form_of_column_k_det bezout (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) k) = echelon_form_of_column_k bezout (foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k]) k
[PROOF STEP]
using Suc.hyps[unfolded echelon_form_of_upt_k_det_def Let_def snd_conv, simplified]
[PROOF STATE]
proof (prove)
using this:
snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k]

goal (1 subgoal):
 1. snd (echelon_form_of_column_k_det bezout (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<k]) k) = echelon_form_of_column_k bezout (foldl (echelon_form_of_column_k bezout) (A, 0) [0..<k]) k
[PROOF STEP]
by (metis prod.collapse snd_echelon_form_of_column_k_det_eq)
[PROOF STATE]
proof (state)
this:
snd (foldl (echelon_form_of_column_k_det bezout) (n, A, 0) [0..<Suc k]) = foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in pre_digraph) arcs_del_vert2:
  "arcs (del_vert v) = arcs G - in_arcs G v - out_arcs G v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. arcs (del_vert v) = arcs G - in_arcs G v - out_arcs G v
[PROOF STEP]
using arcs_del_vert
[PROOF STATE]
proof (prove)
using this:
arcs (del_vert ?u) = {a \<in> arcs G. tail G a \<noteq> ?u \<and> head G a \<noteq> ?u}

goal (1 subgoal):
 1. arcs (del_vert v) = arcs G - in_arcs G v - out_arcs G v
[PROOF STEP]
by force


[STATEMENT]
lemma (in Torder) less_minimum:"\<lbrakk>minimum_elem D {x. x \<in> carrier D \<and> P x} d\<rbrakk>
       \<Longrightarrow> \<forall>a. (((a \<prec> d) \<and> a \<in> carrier D) \<longrightarrow>  \<not> (P a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. minimum_elem D {x \<in> carrier D. P x} d \<Longrightarrow> \<forall>a. a \<prec> d \<and> a \<in> carrier D \<longrightarrow> \<not> P a
[PROOF STEP]
apply (rule allI, rule impI, erule conjE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>minimum_elem D {x \<in> carrier D. P x} d; a \<prec> d; a \<in> carrier D\<rbrakk> \<Longrightarrow> \<not> P a
[PROOF STEP]
apply (rule contrapos_pp, simp+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>minimum_elem D {x \<in> carrier D. P x} d; a \<prec> d; a \<in> carrier D; P a\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add:minimum_elem_def, (erule conjE)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<prec> d; a \<in> carrier D; P a; d \<in> carrier D; P d; \<forall>x. x \<in> carrier D \<and> P x \<longrightarrow> d \<preceq> x\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (frule_tac a = a in forall_spec, simp,
       thin_tac "\<forall>x. x \<in> carrier D \<and> P x \<longrightarrow> d \<preceq> x")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. \<lbrakk>a \<prec> d; a \<in> carrier D; P a; d \<in> carrier D; P d; d \<preceq> a\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
apply (simp add:not_le_less[THEN sym, of "d"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma finitely_many_paths: "finite all_paths"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite all_paths
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite all_paths
[PROOF STEP]
have "all_paths \<subseteq> {xs. set xs \<subseteq> V \<and> length xs \<le> card V}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_paths \<subseteq> {xs. set xs \<subseteq> V \<and> length xs \<le> card V}
[PROOF STEP]
unfolding all_paths_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {xs |xs. path xs} \<subseteq> {xs. set xs \<subseteq> V \<and> length xs \<le> card V}
[PROOF STEP]
using path_length
[PROOF STATE]
proof (prove)
using this:
path ?xs \<Longrightarrow> length ?xs \<le> card V

goal (1 subgoal):
 1. {xs |xs. path xs} \<subseteq> {xs. set xs \<subseteq> V \<and> length xs \<le> card V}
[PROOF STEP]
by (simp add: Collect_mono path_in_V)
[PROOF STATE]
proof (state)
this:
all_paths \<subseteq> {xs. set xs \<subseteq> V \<and> length xs \<le> card V}

goal (1 subgoal):
 1. finite all_paths
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
all_paths \<subseteq> {xs. set xs \<subseteq> V \<and> length xs \<le> card V}

goal (1 subgoal):
 1. finite all_paths
[PROOF STEP]
using finite_lists_length_le[OF finite_vertex_set] walk_in_V infinite_super
[PROOF STATE]
proof (prove)
using this:
all_paths \<subseteq> {xs. set xs \<subseteq> V \<and> length xs \<le> card V}
finite {xs. set xs \<subseteq> V \<and> length xs \<le> ?n}
walk ?xs \<Longrightarrow> set ?xs \<subseteq> V
\<lbrakk>?S \<subseteq> ?T; infinite ?S\<rbrakk> \<Longrightarrow> infinite ?T

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma piecewise_differentiable_affine:
  fixes m::real
  assumes "f piecewise_differentiable_on ((\<lambda>x. m *\<^sub>R x + c) ` S)"
  shows "(f \<circ> (\<lambda>x. m *\<^sub>R x + c)) piecewise_differentiable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
[PROOF STEP]
proof (cases "m = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
 2. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
m = 0

goal (2 subgoals):
 1. m = 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
 2. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
m = 0

goal (1 subgoal):
 1. f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
[PROOF STEP]
unfolding o_def
[PROOF STATE]
proof (prove)
using this:
m = 0

goal (1 subgoal):
 1. (\<lambda>x. f (m *\<^sub>R x + c)) piecewise_differentiable_on S
[PROOF STEP]
by (force intro: differentiable_imp_piecewise_differentiable differentiable_const)
[PROOF STATE]
proof (state)
this:
f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
m \<noteq> 0

goal (1 subgoal):
 1. m \<noteq> 0 \<Longrightarrow> f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S
[PROOF STEP]
apply (rule piecewise_differentiable_compose [OF differentiable_imp_piecewise_differentiable])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. x \<in> S \<Longrightarrow> (\<lambda>x. m *\<^sub>R x + c) differentiable at x within S
 2. f piecewise_differentiable_on (\<lambda>x. m *\<^sub>R x + c) ` S
 3. \<And>x. finite (S \<inter> (\<lambda>x. m *\<^sub>R x + c) -` {x})
[PROOF STEP]
apply (rule assms derivative_intros | simp add: False vimage_def real_vector_affinity_eq)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
f \<circ> (\<lambda>x. m *\<^sub>R x + c) piecewise_differentiable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma steps_imp_chainp':
  assumes "\<forall>i\<ge>n::nat. \<exists>j\<ge>i. P (S i) (S j)" shows "\<exists>T. chainp P T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>T. \<forall>i. P (T i) (T (Suc i))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>T. \<forall>i. P (T i) (T (Suc i))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
\<forall>i\<ge>n. \<exists>j\<ge>i. P (S i) (S j)
[PROOF STEP]
have "\<forall>i\<in>{i. i \<ge> n}. \<exists>j\<ge>i. P (S i) (S j)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i\<ge>n. \<exists>j\<ge>i. P (S i) (S j)

goal (1 subgoal):
 1. \<forall>i\<in>{i. n \<le> i}. \<exists>j\<ge>i. P (S i) (S j)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>{i. n \<le> i}. \<exists>j\<ge>i. P (S i) (S j)

goal (1 subgoal):
 1. \<exists>T. \<forall>i. P (T i) (T (Suc i))
[PROOF STEP]
from bchoice [OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. \<forall>x\<in>{i. n \<le> i}. x \<le> f x \<and> P (S x) (S (f x))
[PROOF STEP]
(*choice could be replaced by an application of Least_Enum.infinitely_many2*)
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. \<forall>x\<in>{i. n \<le> i}. x \<le> f x \<and> P (S x) (S (f x))
[PROOF STEP]
obtain f where "\<forall>i\<ge>n. f i \<ge> i \<and> P (S i) (S (f i))"
[PROOF STATE]
proof (prove)
using this:
\<exists>f. \<forall>x\<in>{i. n \<le> i}. x \<le> f x \<and> P (S x) (S (f x))

goal (1 subgoal):
 1. (\<And>f. \<forall>i\<ge>n. i \<le> f i \<and> P (S i) (S (f i)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i\<ge>n. i \<le> f i \<and> P (S i) (S (f i))

goal (1 subgoal):
 1. \<exists>T. \<forall>i. P (T i) (T (Suc i))
[PROOF STEP]
from stepfun_imp_chainp'[of n f P S, OF this]
[PROOF STATE]
proof (chain)
picking this:
\<forall>i. P (S ((f ^^ i) n)) (S ((f ^^ Suc i) n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>i. P (S ((f ^^ i) n)) (S ((f ^^ Suc i) n))

goal (1 subgoal):
 1. \<exists>T. \<forall>i. P (T i) (T (Suc i))
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<exists>T. \<forall>i. P (T i) (T (Suc i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pos_le_divideR_eq [field_simps]:
  "a \<le> b /\<^sub>R c \<longleftrightarrow> c *\<^sub>R a \<le> b" (is "?P \<longleftrightarrow> ?Q") if "0 < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<le> b /\<^sub>R c) = (c *\<^sub>R a \<le> b)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<le> b /\<^sub>R c \<Longrightarrow> c *\<^sub>R a \<le> b
 2. c *\<^sub>R a \<le> b \<Longrightarrow> a \<le> b /\<^sub>R c
[PROOF STEP]
assume ?P
[PROOF STATE]
proof (state)
this:
a \<le> b /\<^sub>R c

goal (2 subgoals):
 1. a \<le> b /\<^sub>R c \<Longrightarrow> c *\<^sub>R a \<le> b
 2. c *\<^sub>R a \<le> b \<Longrightarrow> a \<le> b /\<^sub>R c
[PROOF STEP]
with scaleR_left_mono that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<le> ?y; 0 \<le> ?a\<rbrakk> \<Longrightarrow> ?a *\<^sub>R ?x \<le> ?a *\<^sub>R ?y
0 < c
a \<le> b /\<^sub>R c
[PROOF STEP]
have "c *\<^sub>R a \<le> c *\<^sub>R (b /\<^sub>R c)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<le> ?y; 0 \<le> ?a\<rbrakk> \<Longrightarrow> ?a *\<^sub>R ?x \<le> ?a *\<^sub>R ?y
0 < c
a \<le> b /\<^sub>R c

goal (1 subgoal):
 1. c *\<^sub>R a \<le> c *\<^sub>R (b /\<^sub>R c)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c *\<^sub>R a \<le> c *\<^sub>R (b /\<^sub>R c)

goal (2 subgoals):
 1. a \<le> b /\<^sub>R c \<Longrightarrow> c *\<^sub>R a \<le> b
 2. c *\<^sub>R a \<le> b \<Longrightarrow> a \<le> b /\<^sub>R c
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
0 < c
c *\<^sub>R a \<le> c *\<^sub>R (b /\<^sub>R c)
[PROOF STEP]
show ?Q
[PROOF STATE]
proof (prove)
using this:
0 < c
c *\<^sub>R a \<le> c *\<^sub>R (b /\<^sub>R c)

goal (1 subgoal):
 1. c *\<^sub>R a \<le> b
[PROOF STEP]
by (simp add: scaleR_one scaleR_scaleR inverse_eq_divide)
[PROOF STATE]
proof (state)
this:
c *\<^sub>R a \<le> b

goal (1 subgoal):
 1. c *\<^sub>R a \<le> b \<Longrightarrow> a \<le> b /\<^sub>R c
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c *\<^sub>R a \<le> b \<Longrightarrow> a \<le> b /\<^sub>R c
[PROOF STEP]
assume ?Q
[PROOF STATE]
proof (state)
this:
c *\<^sub>R a \<le> b

goal (1 subgoal):
 1. c *\<^sub>R a \<le> b \<Longrightarrow> a \<le> b /\<^sub>R c
[PROOF STEP]
with scaleR_left_mono that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?x \<le> ?y; 0 \<le> ?a\<rbrakk> \<Longrightarrow> ?a *\<^sub>R ?x \<le> ?a *\<^sub>R ?y
0 < c
c *\<^sub>R a \<le> b
[PROOF STEP]
have "c *\<^sub>R a /\<^sub>R c \<le> b /\<^sub>R c"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?x \<le> ?y; 0 \<le> ?a\<rbrakk> \<Longrightarrow> ?a *\<^sub>R ?x \<le> ?a *\<^sub>R ?y
0 < c
c *\<^sub>R a \<le> b

goal (1 subgoal):
 1. c *\<^sub>R a /\<^sub>R c \<le> b /\<^sub>R c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c *\<^sub>R a /\<^sub>R c \<le> b /\<^sub>R c

goal (1 subgoal):
 1. c *\<^sub>R a \<le> b \<Longrightarrow> a \<le> b /\<^sub>R c
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
0 < c
c *\<^sub>R a /\<^sub>R c \<le> b /\<^sub>R c
[PROOF STEP]
show ?P
[PROOF STATE]
proof (prove)
using this:
0 < c
c *\<^sub>R a /\<^sub>R c \<le> b /\<^sub>R c

goal (1 subgoal):
 1. a \<le> b /\<^sub>R c
[PROOF STEP]
by (simp add: scaleR_one scaleR_scaleR inverse_eq_divide)
[PROOF STATE]
proof (state)
this:
a \<le> b /\<^sub>R c

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma basic_semialg_pullback':
  assumes "is_poly_tuple n fs"
  assumes "length fs = k"
  assumes "A \<in> basic_semialgs k"
  shows "poly_map n fs  \<inverse>\<^bsub>n\<^esub> A \<in> (basic_semialgs n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_map n fs \<inverse>\<^bsub>n\<^esub> A \<in> {S. is_basic_semialg n S}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_map n fs \<inverse>\<^bsub>n\<^esub> A \<in> {S. is_basic_semialg n S}
[PROOF STEP]
obtain f m where fm_def: "m \<noteq>0 \<and>f \<in> carrier (Q\<^sub>p[\<X>\<^bsub>k\<^esub>]) \<and> A = basic_semialg_set k m f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>m f. m \<noteq> 0 \<and> f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>k\<^esub>]) \<and> A = basic_semialg_set k m f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_poly_tuple n fs
length fs = k
A \<in> {S. is_basic_semialg k S}

goal (1 subgoal):
 1. (\<And>m f. m \<noteq> 0 \<and> f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>k\<^esub>]) \<and> A = basic_semialg_set k m f \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis is_basic_semialg_def mem_Collect_eq)
[PROOF STATE]
proof (state)
this:
m \<noteq> 0 \<and> f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>k\<^esub>]) \<and> A = basic_semialg_set k m f

goal (1 subgoal):
 1. poly_map n fs \<inverse>\<^bsub>n\<^esub> A \<in> {S. is_basic_semialg n S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
m \<noteq> 0 \<and> f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>k\<^esub>]) \<and> A = basic_semialg_set k m f
[PROOF STEP]
have "poly_map n fs  \<inverse>\<^bsub>n\<^esub> A  = basic_semialg_set n m (Qp_poly_comp n fs f)"
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0 \<and> f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>k\<^esub>]) \<and> A = basic_semialg_set k m f

goal (1 subgoal):
 1. poly_map n fs \<inverse>\<^bsub>n\<^esub> A = basic_semialg_set n m (Qp_poly_comp n fs f)
[PROOF STEP]
using assms basic_semialg_pullback[of f k n fs A m]
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0 \<and> f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>k\<^esub>]) \<and> A = basic_semialg_set k m f
is_poly_tuple n fs
length fs = k
A \<in> {S. is_basic_semialg k S}
\<lbrakk>f \<in> carrier (Q\<^sub>p [\<X>\<^bsub>k\<^esub>]); is_poly_tuple n fs; length fs = k; A = basic_semialg_set k m f; m \<noteq> 0\<rbrakk> \<Longrightarrow> poly_map n fs \<inverse>\<^bsub>n\<^esub> A = basic_semialg_set n m (Qp_poly_comp n fs f)

goal (1 subgoal):
 1. poly_map n fs \<inverse>\<^bsub>n\<^esub> A = basic_semialg_set n m (Qp_poly_comp n fs f)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
poly_map n fs \<inverse>\<^bsub>n\<^esub> A = basic_semialg_set n m (Qp_poly_comp n fs f)

goal (1 subgoal):
 1. poly_map n fs \<inverse>\<^bsub>n\<^esub> A \<in> {S. is_basic_semialg n S}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
poly_map n fs \<inverse>\<^bsub>n\<^esub> A = basic_semialg_set n m (Qp_poly_comp n fs f)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
poly_map n fs \<inverse>\<^bsub>n\<^esub> A = basic_semialg_set n m (Qp_poly_comp n fs f)

goal (1 subgoal):
 1. poly_map n fs \<inverse>\<^bsub>n\<^esub> A \<in> {S. is_basic_semialg n S}
[PROOF STEP]
unfolding is_basic_semialg_def
[PROOF STATE]
proof (prove)
using this:
poly_map n fs \<inverse>\<^bsub>n\<^esub> A = basic_semialg_set n m (Qp_poly_comp n fs f)

goal (1 subgoal):
 1. poly_map n fs \<inverse>\<^bsub>n\<^esub> A \<in> {S. \<exists>na. na \<noteq> 0 \<and> (\<exists>P\<in>carrier (Q\<^sub>p [\<X>\<^bsub>n\<^esub>]). S = basic_semialg_set n na P)}
[PROOF STEP]
by (metis (mono_tags, lifting) assms(1) assms(2) fm_def mem_Collect_eq poly_compose_closed)
[PROOF STATE]
proof (state)
this:
poly_map n fs \<inverse>\<^bsub>n\<^esub> A \<in> {S. is_basic_semialg n S}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coplanar_perm_10:
  assumes "Coplanar A B C D"
  shows "Coplanar B D A C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar B D A C
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Coplanar B D A C
[PROOF STEP]
obtain X where P1: "(Col A B X \<and> Col C D X) \<or> (Col A C X \<and> Col B D X) \<or> (Col A D X \<and> Col B C X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Coplanar_def assms
[PROOF STATE]
proof (prove)
using this:
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Coplanar A B C D

goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar B D A C
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar B D A C
[PROOF STEP]
using Coplanar_def col_permutation_4
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Col ?A ?B ?C \<Longrightarrow> Col ?B ?A ?C

goal (1 subgoal):
 1. Coplanar B D A C
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Coplanar B D A C

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Order) ord_equiv_segment_segment:
   "\<lbrakk>Order E; ord_equiv D E; a \<in> carrier D\<rbrakk>
    \<Longrightarrow> \<exists>t\<in>carrier E. ord_equiv (Iod D (segment D a)) (Iod E (segment E t))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_equiv D E; a \<in> carrier D\<rbrakk> \<Longrightarrow> \<exists>t\<in>carrier E. ord_equiv (Iod D (segment D a)) (Iod E (segment E t))
[PROOF STEP]
apply (simp add:ord_equiv_def, erule exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>Order E; a \<in> carrier D; ord_isom D E f\<rbrakk> \<Longrightarrow> \<exists>t\<in>carrier E. \<exists>f. ord_isom (Iod D (segment D a)) (Iod E (segment E t)) f
[PROOF STEP]
apply (frule_tac f = f in ord_isom_segment_segment[of E _ a], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>Order E; a \<in> carrier D; ord_isom D E f; ord_isom (Iod D (segment D a)) (Iod E (segment E (f a))) (restrict f (carrier (Iod D (segment D a))))\<rbrakk> \<Longrightarrow> \<exists>t\<in>carrier E. \<exists>f. ord_isom (Iod D (segment D a)) (Iod E (segment E t)) f
[PROOF STEP]
apply (frule_tac f = f in ord_isom_mem[of E _ a], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f. \<lbrakk>Order E; a \<in> carrier D; ord_isom D E f; ord_isom (Iod D (segment D a)) (Iod E (segment E (f a))) (restrict f (carrier (Iod D (segment D a)))); f a \<in> carrier E\<rbrakk> \<Longrightarrow> \<exists>t\<in>carrier E. \<exists>f. ord_isom (Iod D (segment D a)) (Iod E (segment E t)) f
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma restriction_to_subgroup_is_hom :
  fixes   H  :: "'g set"
  assumes subgrp: "Group.Subgroup G H"
  shows   "FGModuleHom H smult V smult' T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FGModuleHom H (\<cdot>) V (\<star>) T
[PROOF STEP]
proof (rule FGModule.FGModuleHomI_fromaxioms)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. FGModule H (\<cdot>) V
 2. \<And>v v'. \<lbrakk>v \<in> V; v' \<in> V\<rbrakk> \<Longrightarrow> T (v + v') = T v + T v'
 3. supp T \<subseteq> V
 4. \<And>r m. \<lbrakk>r \<in> aezfun_setspan H; m \<in> V\<rbrakk> \<Longrightarrow> T (r \<cdot> m) = r \<star> T m
[PROOF STEP]
have "FGModule G smult V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FGModule G (\<cdot>) V
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
FGModule G (\<cdot>) V

goal (4 subgoals):
 1. FGModule H (\<cdot>) V
 2. \<And>v v'. \<lbrakk>v \<in> V; v' \<in> V\<rbrakk> \<Longrightarrow> T (v + v') = T v + T v'
 3. supp T \<subseteq> V
 4. \<And>r m. \<lbrakk>r \<in> aezfun_setspan H; m \<in> V\<rbrakk> \<Longrightarrow> T (r \<cdot> m) = r \<star> T m
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
ActingGroup.Subgroup H
FGModule G (\<cdot>) V
[PROOF STEP]
show "FGModule H (\<cdot>) V"
[PROOF STATE]
proof (prove)
using this:
ActingGroup.Subgroup H
FGModule G (\<cdot>) V

goal (1 subgoal):
 1. FGModule H (\<cdot>) V
[PROOF STEP]
using FGModule.restriction_to_subgroup_is_module
[PROOF STATE]
proof (prove)
using this:
ActingGroup.Subgroup H
FGModule G (\<cdot>) V
\<lbrakk>FGModule ?G ?smult ?V; Group ?H \<and> ?H \<subseteq> ?G\<rbrakk> \<Longrightarrow> FGModule ?H ?smult ?V

goal (1 subgoal):
 1. FGModule H (\<cdot>) V
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
FGModule H (\<cdot>) V

goal (3 subgoals):
 1. \<And>v v'. \<lbrakk>v \<in> V; v' \<in> V\<rbrakk> \<Longrightarrow> T (v + v') = T v + T v'
 2. supp T \<subseteq> V
 3. \<And>r m. \<lbrakk>r \<in> aezfun_setspan H; m \<in> V\<rbrakk> \<Longrightarrow> T (r \<cdot> m) = r \<star> T m
[PROOF STEP]
from supp
[PROOF STATE]
proof (chain)
picking this:
supp T \<subseteq> V
[PROOF STEP]
show "supp T \<subseteq> V"
[PROOF STATE]
proof (prove)
using this:
supp T \<subseteq> V

goal (1 subgoal):
 1. supp T \<subseteq> V
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
supp T \<subseteq> V

goal (2 subgoals):
 1. \<And>v v'. \<lbrakk>v \<in> V; v' \<in> V\<rbrakk> \<Longrightarrow> T (v + v') = T v + T v'
 2. \<And>r m. \<lbrakk>r \<in> aezfun_setspan H; m \<in> V\<rbrakk> \<Longrightarrow> T (r \<cdot> m) = r \<star> T m
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
ActingGroup.Subgroup H
[PROOF STEP]
show  "\<And>r m. \<lbrakk> r \<in> (Group.group_ring H); m \<in> V \<rbrakk> \<Longrightarrow> T (r \<cdot> m) = r \<star> T m"
[PROOF STATE]
proof (prove)
using this:
ActingGroup.Subgroup H

goal (1 subgoal):
 1. \<And>r m. \<lbrakk>r \<in> aezfun_setspan H; m \<in> V\<rbrakk> \<Longrightarrow> T (r \<cdot> m) = r \<star> T m
[PROOF STEP]
using FG_map ActingGroup.Subgroup_imp_Subring
[PROOF STATE]
proof (prove)
using this:
ActingGroup.Subgroup H
\<lbrakk>?r \<in> FG; ?m \<in> V\<rbrakk> \<Longrightarrow> T (?r \<cdot> ?m) = ?r \<star> T ?m
ActingGroup.Subgroup ?H \<Longrightarrow> Ring1 (aezfun_setspan ?H) \<and> aezfun_setspan ?H \<subseteq> ActingGroup.group_ring

goal (1 subgoal):
 1. \<And>r m. \<lbrakk>r \<in> aezfun_setspan H; m \<in> V\<rbrakk> \<Longrightarrow> T (r \<cdot> m) = r \<star> T m
[PROOF STEP]
by fast
[PROOF STATE]
proof (state)
this:
\<lbrakk>?r2 \<in> aezfun_setspan H; ?m2 \<in> V\<rbrakk> \<Longrightarrow> T (?r2 \<cdot> ?m2) = ?r2 \<star> T ?m2

goal (1 subgoal):
 1. \<And>v v'. \<lbrakk>v \<in> V; v' \<in> V\<rbrakk> \<Longrightarrow> T (v + v') = T v + T v'
[PROOF STEP]
qed (rule hom)


[STATEMENT]
lemma fincomp_insert [simp]:
  assumes F: "finite F" "a \<notin> F" and f: "f \<in> F \<rightarrow> M" "f a \<in> M"
  shows "fincomp f (insert a F) = f a \<cdot> fincomp f F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fincomp f (insert a F) = f a \<cdot> fincomp f F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fincomp f (insert a F) = f a \<cdot> fincomp f F
[PROOF STEP]
interpret comp_fun_commute_on "insert a F" "\<lambda>x y. f x \<cdot> M_ify y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_commute_on (insert a F) (\<lambda>x y. f x \<cdot> M_ify y)
[PROOF STEP]
by (simp add: comp_fun_commute_onI f)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fincomp f (insert a F) = f a \<cdot> fincomp f F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fincomp f (insert a F) = f a \<cdot> fincomp f F
[PROOF STEP]
using assms fincomp_closed commutative_monoid.M_ify_def commutative_monoid_axioms
[PROOF STATE]
proof (prove)
using this:
finite F
a \<notin> F
f \<in> F \<rightarrow> M
f a \<in> M
?f \<in> ?F \<rightarrow> M \<Longrightarrow> fincomp ?f ?F \<in> M
commutative_monoid ?M ?composition ?unit \<Longrightarrow> commutative_monoid.M_ify ?M ?unit ?x \<equiv> if ?x \<in> ?M then ?x else ?unit
commutative_monoid M (\<cdot>) \<one>

goal (1 subgoal):
 1. fincomp f (insert a F) = f a \<cdot> fincomp f F
[PROOF STEP]
by (fastforce simp add: fincomp_def)
[PROOF STATE]
proof (state)
this:
fincomp f (insert a F) = f a \<cdot> fincomp f F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LIMSEQ_powrat_inverse_of_nat_ge_one:
  assumes "a \<ge> 1" shows "(\<lambda>n. a pow\<^sub>\<rat> (inverse (of_nat n))) \<longlonglongrightarrow> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
have "convergent(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n))
[PROOF STEP]
using convergent_powrat_inverse_of_nat_ge_one assms
[PROOF STATE]
proof (prove)
using this:
1 \<le> ?a \<Longrightarrow> convergent (\<lambda>n. ?a pow\<^sub>\<rat> inverse (rat_of_nat n))
1 \<le> a

goal (1 subgoal):
 1. convergent (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
convergent (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n))

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
convergent (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n))
[PROOF STEP]
have "\<exists>L. L \<noteq> 0 \<and> (\<lambda>n. a pow\<^sub>\<rat> (inverse (of_nat n))) \<longlonglongrightarrow> L"
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n))

goal (1 subgoal):
 1. \<exists>L. L \<noteq> 0 \<and> (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L
[PROOF STEP]
using assms convergent_def powrat_inverse_of_nat_ge_one
          LIMSEQ_le_const not_one_le_zero
[PROOF STATE]
proof (prove)
using this:
convergent (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n))
1 \<le> a
convergent ?X = (\<exists>L. ?X \<longlonglongrightarrow> L)
1 \<le> ?a \<Longrightarrow> 1 \<le> ?a pow\<^sub>\<rat> inverse (rat_of_nat ?n)
\<lbrakk>?X \<longlonglongrightarrow> ?x; \<exists>N. \<forall>n\<ge>N. ?a \<le> ?X n\<rbrakk> \<Longrightarrow> ?a \<le> ?x
\<not> (1::?'a) \<le> (0::?'a)

goal (1 subgoal):
 1. \<exists>L. L \<noteq> 0 \<and> (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<exists>L. L \<noteq> 0 \<and> (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>L. L \<noteq> 0 \<and> (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L
[PROOF STEP]
obtain L
       where l0: "L \<noteq> 0"
       and liml: "(\<lambda>n. a pow\<^sub>\<rat> (inverse (of_nat n))) \<longlonglongrightarrow> L"
[PROOF STATE]
proof (prove)
using this:
\<exists>L. L \<noteq> 0 \<and> (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. (\<And>L. \<lbrakk>L \<noteq> 0; (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
L \<noteq> 0
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
L \<noteq> 0
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L
[PROOF STEP]
have "(\<lambda>n. a pow\<^sub>\<rat> (inverse (of_nat n)) *
                   a pow\<^sub>\<rat> (inverse (of_nat n))) \<longlonglongrightarrow> L * L"
[PROOF STATE]
proof (prove)
using this:
L \<noteq> 0
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n) * a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L
[PROOF STEP]
by (simp add:  tendsto_mult)
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n) * a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n) * a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L
[PROOF STEP]
have "(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (of_nat n))) \<longlonglongrightarrow>  L * L"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n) * a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat n))) \<longlonglongrightarrow> L * L
[PROOF STEP]
using powrat_add [symmetric] assms
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n) * a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L
0 < ?x \<Longrightarrow> ?x pow\<^sub>\<rat> ?r * ?x pow\<^sub>\<rat> ?s = ?x pow\<^sub>\<rat> (?r + ?s)
1 \<le> a

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat n))) \<longlonglongrightarrow> L * L
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat n))) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat n))) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
have "(2::nat) > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < 2

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat n))) \<longlonglongrightarrow> L * L
0 < 2
[PROOF STEP]
have "(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (of_nat (n * 2)))) \<longlonglongrightarrow>  L * L"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat n))) \<longlonglongrightarrow> L * L
0 < 2

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat (n * 2)))) \<longlonglongrightarrow> L * L
[PROOF STEP]
using LIMSEQ_linear [of _ "L * L" 2]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat n))) \<longlonglongrightarrow> L * L
0 < 2
\<lbrakk>?X \<longlonglongrightarrow> L * L; 0 < 2\<rbrakk> \<Longrightarrow> (\<lambda>n. ?X (n * 2)) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat (n * 2)))) \<longlonglongrightarrow> L * L
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat (n * 2)))) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat (n * 2)))) \<longlonglongrightarrow> L * L
[PROOF STEP]
have "(\<lambda>n. a pow\<^sub>\<rat> (inverse (of_nat n))) \<longlonglongrightarrow>  L * L"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> (2 * inverse (rat_of_nat (n * 2)))) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
using liml
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
using LIMSEQ_unique l0
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L * L
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> L
\<lbrakk>?X \<longlonglongrightarrow> ?a; ?X \<longlonglongrightarrow> ?b\<rbrakk> \<Longrightarrow> ?a = ?b
L \<noteq> 0

goal (1 subgoal):
 1. (\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
(\<lambda>n. a pow\<^sub>\<rat> inverse (rat_of_nat n)) \<longlonglongrightarrow> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coplanar_perm_21:
  assumes "Coplanar A B C D"
  shows "Coplanar D B C A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Coplanar D B C A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Coplanar D B C A
[PROOF STEP]
obtain X where P1: "(Col A B X \<and> Col C D X) \<or> (Col A C X \<and> Col B D X) \<or> (Col A D X \<and> Col B C X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using Coplanar_def assms
[PROOF STATE]
proof (prove)
using this:
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Coplanar A B C D

goal (1 subgoal):
 1. (\<And>X. Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar D B C A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X

goal (1 subgoal):
 1. Coplanar D B C A
[PROOF STEP]
using Coplanar_def col_permutation_4
[PROOF STATE]
proof (prove)
using this:
Col A B X \<and> Col C D X \<or> Col A C X \<and> Col B D X \<or> Col A D X \<and> Col B C X
Coplanar ?A ?B ?C ?D \<equiv> \<exists>X. Col ?A ?B X \<and> Col ?C ?D X \<or> Col ?A ?C X \<and> Col ?B ?D X \<or> Col ?A ?D X \<and> Col ?B ?C X
Col ?A ?B ?C \<Longrightarrow> Col ?B ?A ?C

goal (1 subgoal):
 1. Coplanar D B C A
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
Coplanar D B C A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mod_base:  assumes "\<And>i. i<n \<Longrightarrow> d i < base" "n>0"
  shows "from_digits n d mod base = d 0 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. from_digits n d mod base = d 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. from_digits n d mod base = d 0
[PROOF STEP]
have "(\<Sum>i<n. d i * base ^ i) mod base =
          (\<Sum>i<n. d i * base ^ i mod base) mod base"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. d i * base ^ i) mod base = (\<Sum>i<n. d i * base ^ i mod base) mod base
[PROOF STEP]
by (subst mod_sum_eq[symmetric]) simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i<n. d i * base ^ i) mod base = (\<Sum>i<n. d i * base ^ i mod base) mod base

goal (1 subgoal):
 1. from_digits n d mod base = d 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i<n. d i * base ^ i) mod base = (\<Sum>i<n. d i * base ^ i mod base) mod base
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. d i * base ^ i) mod base = (\<Sum>i<n. d i * base ^ i mod base) mod base

goal (1 subgoal):
 1. from_digits n d mod base = d 0
[PROOF STEP]
using assms
      sum.lessThan_Suc_shift[of "(\<lambda>i. d i * base ^ i mod base)" "n-1"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. d i * base ^ i) mod base = (\<Sum>i<n. d i * base ^ i mod base) mod base
?i < n \<Longrightarrow> d ?i < base
0 < n
(\<Sum>i<Suc (n - 1). d i * base ^ i mod base) = d 0 * base ^ 0 mod base + (\<Sum>i<n - 1. d (Suc i) * base ^ Suc i mod base)

goal (1 subgoal):
 1. from_digits n d mod base = d 0
[PROOF STEP]
unfolding from_digits_altdef
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i<n. d i * base ^ i) mod base = (\<Sum>i<n. d i * base ^ i mod base) mod base
?i < n \<Longrightarrow> d ?i < base
0 < n
(\<Sum>i<Suc (n - 1). d i * base ^ i mod base) = d 0 * base ^ 0 mod base + (\<Sum>i<n - 1. d (Suc i) * base ^ Suc i mod base)

goal (1 subgoal):
 1. (\<Sum>i<n. d i * base ^ i) mod base = d 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
from_digits n d mod base = d 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma complex_rotations_comp:
  "r \<in> complex_rotations \<Longrightarrow> s \<in> complex_rotations \<Longrightarrow> (r \<circ> s) \<in> complex_rotations"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>r \<in> complex_rotations; s \<in> complex_rotations\<rbrakk> \<Longrightarrow> r \<circ> s \<in> complex_rotations
[PROOF STEP]
apply(induction arbitrary: s rule: complex_rotations.induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>r s. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations\<rbrakk> \<Longrightarrow> r \<circ> s \<in> complex_rotations
 2. \<And>r s sa. \<lbrakk>r \<in> simple_rotations; s \<in> complex_rotations; \<And>sa. sa \<in> complex_rotations \<Longrightarrow> s \<circ> sa \<in> complex_rotations; sa \<in> complex_rotations\<rbrakk> \<Longrightarrow> r \<circ> s \<circ> sa \<in> complex_rotations
[PROOF STEP]
apply(auto simp add: comp_assoc complex_rotations.comp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nil_inA: "[] \<in> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [] \<in> A
[PROOF STEP]
apply (unfold A_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [] \<in> (rev \<circ> sorted_list_of_set) ` Pow (set nodes)
[PROOF STEP]
apply (subgoal_tac "{} \<in> Pow (set nodes)")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {} \<in> Pow (set nodes) \<Longrightarrow> [] \<in> (rev \<circ> sorted_list_of_set) ` Pow (set nodes)
 2. {} \<in> Pow (set nodes)
[PROOF STEP]
apply (subgoal_tac "[] = (\<lambda>x. rev (sorted_list_of_set x)) {}")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>{} \<in> Pow (set nodes); [] = rev (sorted_list_of_set {})\<rbrakk> \<Longrightarrow> [] \<in> (rev \<circ> sorted_list_of_set) ` Pow (set nodes)
 2. {} \<in> Pow (set nodes) \<Longrightarrow> [] = rev (sorted_list_of_set {})
 3. {} \<in> Pow (set nodes)
[PROOF STEP]
apply (fastforce intro:rev_image_eqI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {} \<in> Pow (set nodes) \<Longrightarrow> [] = rev (sorted_list_of_set {})
 2. {} \<in> Pow (set nodes)
[PROOF STEP]
by auto


[STATEMENT]
lemma unital_quantale_homset_iff: "f \<in> unital_quantale_homset = (comp_pres f \<and> Sup_pres f \<and> un_pres f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> unital_quantale_homset) = (comp_pres f \<and> Sup_pres f \<and> un_pres f)
[PROOF STEP]
unfolding unital_quantale_homset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<in> {f. comp_pres f \<and> Sup_pres f \<and> un_pres f}) = (comp_pres f \<and> Sup_pres f \<and> un_pres f)
[PROOF STEP]
by clarsimp


[STATEMENT]
lemma (in group_hom) group_hom_isoI:
  assumes inj1: "\<forall>x\<in>carrier G. h x = \<one>\<^bsub>H\<^esub> \<longrightarrow> x = \<one>\<^bsub>G\<^esub>"
      and surj: "h ` (carrier G) = carrier H"
  shows "h \<in> iso G H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. h \<in> Group.iso G H
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. h \<in> Group.iso G H
[PROOF STEP]
from inj1
[PROOF STATE]
proof (chain)
picking this:
\<forall>x\<in>carrier G. h x = \<one>\<^bsub>H\<^esub> \<longrightarrow> x = \<one>
[PROOF STEP]
have "inj_on h (carrier G)"
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>carrier G. h x = \<one>\<^bsub>H\<^esub> \<longrightarrow> x = \<one>

goal (1 subgoal):
 1. inj_on h (carrier G)
[PROOF STEP]
by(auto intro: hom_injI)
[PROOF STATE]
proof (state)
this:
inj_on h (carrier G)

goal (1 subgoal):
 1. h \<in> Group.iso G H
[PROOF STEP]
hence bij: "bij_betw h (carrier G) (carrier H)"
[PROOF STATE]
proof (prove)
using this:
inj_on h (carrier G)

goal (1 subgoal):
 1. bij_betw h (carrier G) (carrier H)
[PROOF STEP]
using surj
[PROOF STATE]
proof (prove)
using this:
inj_on h (carrier G)
h ` carrier G = carrier H

goal (1 subgoal):
 1. bij_betw h (carrier G) (carrier H)
[PROOF STEP]
unfolding bij_betw_def
[PROOF STATE]
proof (prove)
using this:
inj_on h (carrier G)
h ` carrier G = carrier H

goal (1 subgoal):
 1. inj_on h (carrier G) \<and> h ` carrier G = carrier H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bij_betw h (carrier G) (carrier H)

goal (1 subgoal):
 1. h \<in> Group.iso G H
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
bij_betw h (carrier G) (carrier H)

goal (1 subgoal):
 1. h \<in> Group.iso G H
[PROOF STEP]
unfolding iso_def
[PROOF STATE]
proof (prove)
using this:
bij_betw h (carrier G) (carrier H)

goal (1 subgoal):
 1. h \<in> {h \<in> hom G H. bij_betw h (carrier G) (carrier H)}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
h \<in> Group.iso G H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in prime_number_theorem) prime_fractions_dense:
  fixes \<alpha> \<epsilon> :: real
  assumes "\<alpha> > 0" and "\<epsilon> > 0"
  obtains p q :: nat where "prime p" and "prime q" and "dist (real p / real q) \<alpha> < \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
define \<epsilon>' where "\<epsilon>' = \<epsilon> / 2"
[PROOF STATE]
proof (state)
this:
\<epsilon>' = \<epsilon> / 2

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
0 < \<alpha>
0 < \<epsilon>
[PROOF STEP]
have "\<epsilon>' > 0"
[PROOF STATE]
proof (prove)
using this:
0 < \<alpha>
0 < \<epsilon>

goal (1 subgoal):
 1. 0 < \<epsilon>'
[PROOF STEP]
by (simp add: \<epsilon>'_def)
[PROOF STATE]
proof (state)
this:
0 < \<epsilon>'

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "eventually (\<lambda>x. \<exists>p. prime p \<and> real p \<in> {x<..(1 + \<epsilon>' / \<alpha>) * x}) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..(1 + \<epsilon>' / \<alpha>) * x}
[PROOF STEP]
using assms \<open>\<epsilon>' > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<alpha>
0 < \<epsilon>
0 < \<epsilon>'

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..(1 + \<epsilon>' / \<alpha>) * x}
[PROOF STEP]
by (intro prime_in_interval_exists) (auto simp: field_simps)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..(1 + \<epsilon>' / \<alpha>) * x}

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..(1 + \<epsilon>' / \<alpha>) * x}
[PROOF STEP]
obtain x0 where x0: "\<And>x. x \<ge> x0 \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..(1 + \<epsilon>' / \<alpha>) * x}"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. \<exists>p. prime p \<and> real p \<in> {x<..(1 + \<epsilon>' / \<alpha>) * x}

goal (1 subgoal):
 1. (\<And>x0. (\<And>x. x0 \<le> x \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {x<..(1 + \<epsilon>' / \<alpha>) * x}) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: eventually_at_top_linorder)
[PROOF STATE]
proof (state)
this:
x0 \<le> ?x \<Longrightarrow> \<exists>p. prime p \<and> real p \<in> {?x<..(1 + \<epsilon>' / \<alpha>) * ?x}

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<exists>q. prime q \<and> q > nat \<lfloor>x0 / \<alpha>\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>q. prime q \<and> nat \<lfloor>x0 / \<alpha>\<rfloor> < q
[PROOF STEP]
by (rule bigger_prime)
[PROOF STATE]
proof (state)
this:
\<exists>q. prime q \<and> nat \<lfloor>x0 / \<alpha>\<rfloor> < q

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>q. prime q \<and> nat \<lfloor>x0 / \<alpha>\<rfloor> < q
[PROOF STEP]
obtain q where "prime q" "q > nat \<lfloor>x0 / \<alpha>\<rfloor>"
[PROOF STATE]
proof (prove)
using this:
\<exists>q. prime q \<and> nat \<lfloor>x0 / \<alpha>\<rfloor> < q

goal (1 subgoal):
 1. (\<And>q. \<lbrakk>prime q; nat \<lfloor>x0 / \<alpha>\<rfloor> < q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
prime q
nat \<lfloor>x0 / \<alpha>\<rfloor> < q

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
hence "real q \<ge> x0 / \<alpha>"
[PROOF STATE]
proof (prove)
using this:
prime q
nat \<lfloor>x0 / \<alpha>\<rfloor> < q

goal (1 subgoal):
 1. x0 / \<alpha> \<le> real q
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
x0 / \<alpha> \<le> real q

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with \<open>\<alpha> > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < \<alpha>
x0 / \<alpha> \<le> real q
[PROOF STEP]
have "\<alpha> * real q \<ge> x0"
[PROOF STATE]
proof (prove)
using this:
0 < \<alpha>
x0 / \<alpha> \<le> real q

goal (1 subgoal):
 1. x0 \<le> \<alpha> * real q
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
x0 \<le> \<alpha> * real q

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
hence "\<exists>p. prime p \<and> real p \<in> {\<alpha> * real q<..(1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)}"
[PROOF STATE]
proof (prove)
using this:
x0 \<le> \<alpha> * real q

goal (1 subgoal):
 1. \<exists>p. prime p \<and> real p \<in> {\<alpha> * real q<..(1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)}
[PROOF STEP]
by (intro x0)
[PROOF STATE]
proof (state)
this:
\<exists>p. prime p \<and> real p \<in> {\<alpha> * real q<..(1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)}

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>p. prime p \<and> real p \<in> {\<alpha> * real q<..(1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)}
[PROOF STEP]
obtain p where p: "prime p" "real p > \<alpha> * real q" "real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)"
[PROOF STATE]
proof (prove)
using this:
\<exists>p. prime p \<and> real p \<in> {\<alpha> * real q<..(1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)}

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; \<alpha> * real q < real p; real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<exists>p. prime p \<and> real p \<in> {\<alpha> * real q<..(1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)}
0 < \<alpha>
0 < \<epsilon>

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>prime p; \<alpha> * real q < real p; real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prime p
\<alpha> * real q < real p
real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from p \<open>prime q\<close>
[PROOF STATE]
proof (chain)
picking this:
prime p
\<alpha> * real q < real p
real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)
prime q
[PROOF STEP]
have "real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>"
[PROOF STATE]
proof (prove)
using this:
prime p
\<alpha> * real q < real p
real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)
prime q

goal (1 subgoal):
 1. real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
\<alpha> * real q < real p
real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)
prime q
0 < \<alpha>
0 < \<epsilon>

goal (1 subgoal):
 1. real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>
[PROOF STEP]
by (auto simp: field_simps dest: prime_gt_0_nat)
[PROOF STATE]
proof (state)
this:
real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<dots> = \<alpha> + \<epsilon>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 + \<epsilon>' / \<alpha>) * \<alpha> = \<alpha> + \<epsilon>'
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 < \<alpha>
0 < \<epsilon>

goal (1 subgoal):
 1. (1 + \<epsilon>' / \<alpha>) * \<alpha> = \<alpha> + \<epsilon>'
[PROOF STEP]
by (simp add: field_simps)
[PROOF STATE]
proof (state)
this:
(1 + \<epsilon>' / \<alpha>) * \<alpha> = \<alpha> + \<epsilon>'

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real p / real q \<le> \<alpha> + \<epsilon>'
[PROOF STEP]
have "real p / real q \<le> \<alpha> + \<epsilon>'"
[PROOF STATE]
proof (prove)
using this:
real p / real q \<le> \<alpha> + \<epsilon>'

goal (1 subgoal):
 1. real p / real q \<le> \<alpha> + \<epsilon>'
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real p / real q \<le> \<alpha> + \<epsilon>'

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real p / real q \<le> \<alpha> + \<epsilon>'

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
from p \<open>prime q\<close>
[PROOF STATE]
proof (chain)
picking this:
prime p
\<alpha> * real q < real p
real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)
prime q
[PROOF STEP]
have "real p / real q > \<alpha>" "real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>"
[PROOF STATE]
proof (prove)
using this:
prime p
\<alpha> * real q < real p
real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)
prime q

goal (1 subgoal):
 1. \<alpha> < real p / real q &&& real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
prime p
\<alpha> * real q < real p
real p \<le> (1 + \<epsilon>' / \<alpha>) * (\<alpha> * real q)
prime q
0 < \<alpha>
0 < \<epsilon>

goal (1 subgoal):
 1. \<alpha> < real p / real q &&& real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>
[PROOF STEP]
by (auto simp: field_simps dest: prime_gt_0_nat)
[PROOF STATE]
proof (state)
this:
\<alpha> < real p / real q
real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real p / real q \<le> \<alpha> + \<epsilon>'
\<alpha> < real p / real q
real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>
[PROOF STEP]
have "dist (real p / real q) \<alpha> \<le> \<epsilon>'"
[PROOF STATE]
proof (prove)
using this:
real p / real q \<le> \<alpha> + \<epsilon>'
\<alpha> < real p / real q
real p / real q \<le> (1 + \<epsilon>' / \<alpha>) * \<alpha>

goal (1 subgoal):
 1. dist (real p / real q) \<alpha> \<le> \<epsilon>'
[PROOF STEP]
by (simp add: dist_norm)
[PROOF STATE]
proof (state)
this:
dist (real p / real q) \<alpha> \<le> \<epsilon>'

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
dist (real p / real q) \<alpha> \<le> \<epsilon>'

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<dots> < \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<epsilon>' < \<epsilon>
[PROOF STEP]
using \<open>\<epsilon> > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < \<epsilon>

goal (1 subgoal):
 1. \<epsilon>' < \<epsilon>
[PROOF STEP]
by (simp add: \<epsilon>'_def)
[PROOF STATE]
proof (state)
this:
\<epsilon>' < \<epsilon>

goal (1 subgoal):
 1. (\<And>p q. \<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
dist (real p / real q) \<alpha> < \<epsilon>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dist (real p / real q) \<alpha> < \<epsilon>

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using \<open>prime p\<close> \<open>prime q\<close> that[of p q]
[PROOF STATE]
proof (prove)
using this:
dist (real p / real q) \<alpha> < \<epsilon>
prime p
prime q
\<lbrakk>prime p; prime q; dist (real p / real q) \<alpha> < \<epsilon>\<rbrakk> \<Longrightarrow> thesis

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in group) generate_minimal:
  assumes "H \<subseteq> carrier G" shows "generate G H = \<Inter> { H'. subgroup H' G \<and> H \<subseteq> H' }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. generate G H = \<Inter> {H'. subgroup H' G \<and> H \<subseteq> H'}
[PROOF STEP]
using generate_subgroup_incl generate_is_subgroup[OF assms] incl[of _ H]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?K \<subseteq> ?H; subgroup ?H G\<rbrakk> \<Longrightarrow> generate G ?K \<subseteq> ?H
subgroup (generate G H) G
?h \<in> H \<Longrightarrow> ?h \<in> generate ?G H

goal (1 subgoal):
 1. generate G H = \<Inter> {H'. subgroup H' G \<and> H \<subseteq> H'}
[PROOF STEP]
by blast


[STATEMENT]
lemma mod_factor_div_mod:"
  \<lbrakk> (x::nat) mod (m * k) = y * k mod (m * k); 0 < k \<rbrakk>
  \<Longrightarrow> x div k mod m = y mod m"
  (is "\<lbrakk> ?P1; ?P2 \<rbrakk> \<Longrightarrow> ?L = ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
assume as1: ?P1
[PROOF STATE]
proof (state)
this:
x mod (m * k) = y * k mod (m * k)

goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
assume as2: ?P2
[PROOF STATE]
proof (state)
this:
0 < k

goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
have x_mod_k_0: "x mod k = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x mod k = 0
[PROOF STEP]
using as1
[PROOF STATE]
proof (prove)
using this:
x mod (m * k) = y * k mod (m * k)

goal (1 subgoal):
 1. x mod k = 0
[PROOF STEP]
by (blast intro: mod_factor_imp_mod_0)
[PROOF STATE]
proof (state)
this:
x mod k = 0

goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
have "?L * k + x mod k = x mod (k * m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x div k mod m * k + x mod k = x mod (k * m)
[PROOF STEP]
by (simp only: mod_mult2_eq mult.commute[of _ k])
[PROOF STATE]
proof (state)
this:
x div k mod m * k + x mod k = x mod (k * m)

goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
hence "?L * k = x mod (k * m)"
[PROOF STATE]
proof (prove)
using this:
x div k mod m * k + x mod k = x mod (k * m)

goal (1 subgoal):
 1. x div k mod m * k = x mod (k * m)
[PROOF STEP]
using x_mod_k_0
[PROOF STATE]
proof (prove)
using this:
x div k mod m * k + x mod k = x mod (k * m)
x mod k = 0

goal (1 subgoal):
 1. x div k mod m * k = x mod (k * m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
x div k mod m * k = x mod (k * m)

goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
hence "?L * k = y * k mod (m * k)"
[PROOF STATE]
proof (prove)
using this:
x div k mod m * k = x mod (k * m)

goal (1 subgoal):
 1. x div k mod m * k = y * k mod (m * k)
[PROOF STEP]
using as1
[PROOF STATE]
proof (prove)
using this:
x div k mod m * k = x mod (k * m)
x mod (m * k) = y * k mod (m * k)

goal (1 subgoal):
 1. x div k mod m * k = y * k mod (m * k)
[PROOF STEP]
by (simp only: ac_simps)
[PROOF STATE]
proof (state)
this:
x div k mod m * k = y * k mod (m * k)

goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
hence "?L * k = y mod m * k"
[PROOF STATE]
proof (prove)
using this:
x div k mod m * k = y * k mod (m * k)

goal (1 subgoal):
 1. x div k mod m * k = y mod m * k
[PROOF STEP]
by (simp only: mult_mod_left)
[PROOF STATE]
proof (state)
this:
x div k mod m * k = y mod m * k

goal (1 subgoal):
 1. \<lbrakk>x mod (m * k) = y * k mod (m * k); 0 < k\<rbrakk> \<Longrightarrow> x div k mod m = y mod m
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
x div k mod m * k = y mod m * k

goal (1 subgoal):
 1. x div k mod m = y mod m
[PROOF STEP]
using as2
[PROOF STATE]
proof (prove)
using this:
x div k mod m * k = y mod m * k
0 < k

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma in_sort_edge: "sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L
         \<Longrightarrow> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) (in_sort_edge x L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) L \<Longrightarrow> sorted_wrt (\<lambda>e1 e2. weight e1 \<le> weight e2) (in_sort_edge x L)
[PROOF STEP]
by (induct L, auto)


[STATEMENT]
lemma listset_map_imageI: "ys' \<in> listset xs \<Longrightarrow> ys = map f ys' \<Longrightarrow> ys \<in> listset (map ((`) f) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ys' \<in> listset xs; ys = map f ys'\<rbrakk> \<Longrightarrow> ys \<in> listset (map ((`) f) xs)
[PROOF STEP]
by (induct xs arbitrary: ys ys')
    (simp, auto simp del: listset.simps elim!: listset_ConsE intro!: listset_ConsI)


[STATEMENT]
lemma finite_interleavings:
  "finite {zs. interleavings xs ys zs}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {zs. interleavings xs ys zs}
[PROOF STEP]
proof (induct xs ys rule: two_mutual_lists_induction)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>ys. finite {zs. interleavings [] ys zs}
 2. \<And>xs. finite {zs. interleavings xs [] zs}
 3. \<And>x xs y ys. \<lbrakk>finite {zs. interleavings xs (y # ys) zs}; finite {zs. interleavings (x # xs) ys zs}\<rbrakk> \<Longrightarrow> finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
case (1 ys)
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>ys. finite {zs. interleavings [] ys zs}
 2. \<And>xs. finite {zs. interleavings xs [] zs}
 3. \<And>x xs y ys. \<lbrakk>finite {zs. interleavings xs (y # ys) zs}; finite {zs. interleavings (x # xs) ys zs}\<rbrakk> \<Longrightarrow> finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {zs. interleavings [] ys zs}
[PROOF STEP]
by (simp add: interleaving_Nil_iff1)
[PROOF STATE]
proof (state)
this:
finite {zs. interleavings [] ys zs}

goal (2 subgoals):
 1. \<And>xs. finite {zs. interleavings xs [] zs}
 2. \<And>x xs y ys. \<lbrakk>finite {zs. interleavings xs (y # ys) zs}; finite {zs. interleavings (x # xs) ys zs}\<rbrakk> \<Longrightarrow> finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. finite {zs. interleavings xs [] zs}
 2. \<And>x xs y ys. \<lbrakk>finite {zs. interleavings xs (y # ys) zs}; finite {zs. interleavings (x # xs) ys zs}\<rbrakk> \<Longrightarrow> finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
case (2 xs)
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>xs. finite {zs. interleavings xs [] zs}
 2. \<And>x xs y ys. \<lbrakk>finite {zs. interleavings xs (y # ys) zs}; finite {zs. interleavings (x # xs) ys zs}\<rbrakk> \<Longrightarrow> finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {zs. interleavings xs [] zs}
[PROOF STEP]
by (simp add: interleaving_Nil_iff2)
[PROOF STATE]
proof (state)
this:
finite {zs. interleavings xs [] zs}

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>finite {zs. interleavings xs (y # ys) zs}; finite {zs. interleavings (x # xs) ys zs}\<rbrakk> \<Longrightarrow> finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>finite {zs. interleavings xs (y # ys) zs}; finite {zs. interleavings (x # xs) ys zs}\<rbrakk> \<Longrightarrow> finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
case (3 x xs y ys)
[PROOF STATE]
proof (state)
this:
finite {zs. interleavings xs (y # ys) zs}
finite {zs. interleavings (x # xs) ys zs}

goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>finite {zs. interleavings xs (y # ys) zs}; finite {zs. interleavings (x # xs) ys zs}\<rbrakk> \<Longrightarrow> finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite {zs. interleavings xs (y # ys) zs}
finite {zs. interleavings (x # xs) ys zs}
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite {zs. interleavings xs (y # ys) zs}
finite {zs. interleavings (x # xs) ys zs}

goal (1 subgoal):
 1. finite {zs. interleavings (x # xs) (y # ys) zs}
[PROOF STEP]
by (simp add: interleavings_Cons)
[PROOF STATE]
proof (state)
this:
finite {zs. interleavings (x # xs) (y # ys) zs}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma graph_level_finite:
    assumes "finite (nodes A)"
    shows "finite (level A w k l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (level A w k l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (level A w k l)
[PROOF STEP]
have "level A w k l \<subseteq> {v \<in> gunodes A w. fst v = l}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. level A w k l \<subseteq> {v \<in> gunodes A w. fst v = l}
[PROOF STEP]
by (simp add: graph_nodes subset_CollectI)
[PROOF STATE]
proof (state)
this:
level A w k l \<subseteq> {v \<in> gunodes A w. fst v = l}

goal (1 subgoal):
 1. finite (level A w k l)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
level A w k l \<subseteq> {v \<in> gunodes A w. fst v = l}

goal (1 subgoal):
 1. finite (level A w k l)
[PROOF STEP]
have "{v \<in> gunodes A w. fst v = l} \<subseteq> {l} \<times> nodes A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {v \<in> gunodes A w. fst v = l} \<subseteq> {l} \<times> nodes A
[PROOF STEP]
using gnodes_nodes
[PROOF STATE]
proof (prove)
using this:
gnodes ?A ?w ?V \<subseteq> UNIV \<times> nodes ?A

goal (1 subgoal):
 1. {v \<in> gunodes A w. fst v = l} \<subseteq> {l} \<times> nodes A
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
{v \<in> gunodes A w. fst v = l} \<subseteq> {l} \<times> nodes A

goal (1 subgoal):
 1. finite (level A w k l)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
{v \<in> gunodes A w. fst v = l} \<subseteq> {l} \<times> nodes A

goal (1 subgoal):
 1. finite (level A w k l)
[PROOF STEP]
have "finite ({l} \<times> nodes A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ({l} \<times> nodes A)
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
finite (nodes A)

goal (1 subgoal):
 1. finite ({l} \<times> nodes A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite ({l} \<times> nodes A)

goal (1 subgoal):
 1. finite (level A w k l)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
finite (level A w k l)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite (level A w k l)

goal (1 subgoal):
 1. finite (level A w k l)
[PROOF STEP]
by this
[PROOF STATE]
proof (state)
this:
finite (level A w k l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ht_size_update2:
  assumes size: "ht_size l n"
  assumes i: "i < length l"
  assumes snd: "\<not> snd (ls_update k v (l ! i))"
  shows "ht_size (l[i := fst (ls_update k v (l!i))]) (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) (Suc n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) (Suc n)
[PROOF STEP]
have "(map length (l[i := fst (ls_update k v (l ! i))]))
    = (map length l)[i := length (fst (ls_update k v (l ! i)))]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map length (l[i := fst (ls_update k v (l ! i))]) = (map length l)[i := length (fst (ls_update k v (l ! i)))]
[PROOF STEP]
by (simp add: map_update)
[PROOF STATE]
proof (state)
this:
map length (l[i := fst (ls_update k v (l ! i))]) = (map length l)[i := length (fst (ls_update k v (l ! i)))]

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) (Suc n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
map length (l[i := fst (ls_update k v (l ! i))]) = (map length l)[i := length (fst (ls_update k v (l ! i)))]

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) (Suc n)
[PROOF STEP]
from sum_list_update[of i "map length l", simplified, OF i,
    of "length (fst (ls_update k v (l ! i)))"]
    ls_update_length_snd_False[OF snd]
[PROOF STATE]
proof (chain)
picking this:
sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))]) = sum_list (map length l) + length (fst (ls_update k v (l ! i))) - length (l ! i)
length (fst (ls_update k v (l ! i))) = Suc (length (l ! i))
[PROOF STEP]
have
    "sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))])
    = Suc (sum_list (map length l))"
[PROOF STATE]
proof (prove)
using this:
sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))]) = sum_list (map length l) + length (fst (ls_update k v (l ! i))) - length (l ! i)
length (fst (ls_update k v (l ! i))) = Suc (length (l ! i))

goal (1 subgoal):
 1. sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))]) = Suc (sum_list (map length l))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum_list ((map length l)[i := length (fst (ls_update k v (l ! i)))]) = Suc (sum_list (map length l))

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) (Suc n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum_list (map length (l[i := fst (ls_update k v (l ! i))])) = Suc (sum_list (map length l))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum_list (map length (l[i := fst (ls_update k v (l ! i))])) = Suc (sum_list (map length l))

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) (Suc n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
sum_list (map length (l[i := fst (ls_update k v (l ! i))])) = Suc (sum_list (map length l))
ht_size l n
i < length l
\<not> snd (ls_update k v (l ! i))

goal (1 subgoal):
 1. ht_size (l[i := fst (ls_update k v (l ! i))]) (Suc n)
[PROOF STEP]
by (simp add: ht_size_def assms)
[PROOF STATE]
proof (state)
this:
ht_size (l[i := fst (ls_update k v (l ! i))]) (Suc n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem meet_mono: "x \<sqsubseteq> z \<Longrightarrow> y \<sqsubseteq> w \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
fix a b c :: "'a::lattice"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
assume "a \<sqsubseteq> c"
[PROOF STATE]
proof (state)
this:
a \<sqsubseteq> c

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
have "a \<sqinter> b \<sqsubseteq> c \<sqinter> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sqinter> b \<sqsubseteq> c \<sqinter> b
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a \<sqinter> b \<sqsubseteq> c
 2. a \<sqinter> b \<sqsubseteq> b
[PROOF STEP]
have "a \<sqinter> b \<sqsubseteq> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sqinter> b \<sqsubseteq> a
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
a \<sqinter> b \<sqsubseteq> a

goal (2 subgoals):
 1. a \<sqinter> b \<sqsubseteq> c
 2. a \<sqinter> b \<sqsubseteq> b
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
a \<sqinter> b \<sqsubseteq> a

goal (2 subgoals):
 1. a \<sqinter> b \<sqsubseteq> c
 2. a \<sqinter> b \<sqsubseteq> b
[PROOF STEP]
have "\<dots> \<sqsubseteq> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sqsubseteq> c
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
a \<sqsubseteq> c

goal (2 subgoals):
 1. a \<sqinter> b \<sqsubseteq> c
 2. a \<sqinter> b \<sqsubseteq> b
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
a \<sqinter> b \<sqsubseteq> c
[PROOF STEP]
show "a \<sqinter> b \<sqsubseteq> c"
[PROOF STATE]
proof (prove)
using this:
a \<sqinter> b \<sqsubseteq> c

goal (1 subgoal):
 1. a \<sqinter> b \<sqsubseteq> c
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
a \<sqinter> b \<sqsubseteq> c

goal (1 subgoal):
 1. a \<sqinter> b \<sqsubseteq> b
[PROOF STEP]
show "a \<sqinter> b \<sqsubseteq> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sqinter> b \<sqsubseteq> b
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
a \<sqinter> b \<sqsubseteq> b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<sqinter> b \<sqsubseteq> c \<sqinter> b

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?a2 \<sqsubseteq> ?c2 \<Longrightarrow> ?a2 \<sqinter> ?b2 \<sqsubseteq> ?c2 \<sqinter> ?b2

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
note this [elim?]
[PROOF STATE]
proof (state)
this:
?a2 \<sqsubseteq> ?c2 \<Longrightarrow> ?a2 \<sqinter> ?b2 \<sqsubseteq> ?c2 \<sqinter> ?b2

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
assume "x \<sqsubseteq> z"
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> z

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<sqsubseteq> z
[PROOF STEP]
have "x \<sqinter> y \<sqsubseteq> z \<sqinter> y"
[PROOF STATE]
proof (prove)
using this:
x \<sqsubseteq> z

goal (1 subgoal):
 1. x \<sqinter> y \<sqsubseteq> z \<sqinter> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> z \<sqinter> y

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> z \<sqinter> y

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
have "\<dots> = y \<sqinter> z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<sqinter> y = y \<sqinter> z
[PROOF STEP]
by (rule meet_commute)
[PROOF STATE]
proof (state)
this:
z \<sqinter> y = y \<sqinter> z

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
z \<sqinter> y = y \<sqinter> z

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
assume "y \<sqsubseteq> w"
[PROOF STATE]
proof (state)
this:
y \<sqsubseteq> w

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y \<sqsubseteq> w
[PROOF STEP]
have "y \<sqinter> z \<sqsubseteq> w \<sqinter> z"
[PROOF STATE]
proof (prove)
using this:
y \<sqsubseteq> w

goal (1 subgoal):
 1. y \<sqinter> z \<sqsubseteq> w \<sqinter> z
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
y \<sqinter> z \<sqsubseteq> w \<sqinter> z

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
y \<sqinter> z \<sqsubseteq> w \<sqinter> z

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
have "\<dots> = z \<sqinter> w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w \<sqinter> z = z \<sqinter> w
[PROOF STEP]
by (rule meet_commute)
[PROOF STATE]
proof (state)
this:
w \<sqinter> z = z \<sqinter> w

goal (1 subgoal):
 1. \<lbrakk>x \<sqsubseteq> z; y \<sqsubseteq> w\<rbrakk> \<Longrightarrow> x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x \<sqinter> y \<sqsubseteq> z \<sqinter> w

goal (1 subgoal):
 1. x \<sqinter> y \<sqsubseteq> z \<sqinter> w
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x \<sqinter> y \<sqsubseteq> z \<sqinter> w

goal:
No subgoals!
[PROOF STEP]
qed