[STATEMENT]
lemma (in field) univ_poly_carrier_subfield_of_consts:
  "subfield (poly_of_const ` (carrier R)) ((carrier R)[X])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subfield (poly_of_const ` carrier R) (carrier R [X])
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. subfield (poly_of_const ` carrier R) (carrier R [X])
[PROOF STEP]
have ring_hom: "ring_hom_ring R ((carrier R)[X]) poly_of_const"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ring_hom_ring R (carrier R [X]) poly_of_const
[PROOF STEP]
using canonical_embedding_ring_hom[OF carrier_is_subring]
[PROOF STATE]
proof (prove)
using this:
ring_hom_ring (R\<lparr>carrier := carrier R\<rparr>) (carrier R [X]) poly_of_const

goal (1 subgoal):
 1. ring_hom_ring R (carrier R [X]) poly_of_const
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ring_hom_ring R (carrier R [X]) poly_of_const

goal (1 subgoal):
 1. subfield (poly_of_const ` carrier R) (carrier R [X])
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
ring_hom_ring R (carrier R [X]) poly_of_const

goal (1 subgoal):
 1. subfield (poly_of_const ` carrier R) (carrier R [X])
[PROOF STEP]
using ring_hom_ring.img_is_subfield(2)[OF ring_hom carrier_is_subfield]
[PROOF STATE]
proof (prove)
using this:
ring_hom_ring R (carrier R [X]) poly_of_const
\<one>\<^bsub>carrier R [X]\<^esub> \<noteq> \<zero>\<^bsub>carrier R [X]\<^esub> \<Longrightarrow> subfield (poly_of_const ` carrier R) (carrier R [X])

goal (1 subgoal):
 1. subfield (poly_of_const ` carrier R) (carrier R [X])
[PROOF STEP]
unfolding univ_poly_def
[PROOF STATE]
proof (prove)
using this:
ring_hom_ring R \<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr> poly_of_const
\<one>\<^bsub>\<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>\<^esub> \<noteq> \<zero>\<^bsub>\<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>\<^esub> \<Longrightarrow> subfield (poly_of_const ` carrier R) \<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>

goal (1 subgoal):
 1. subfield (poly_of_const ` carrier R) \<lparr>carrier = Collect (polynomial (carrier R)), monoid.mult = poly_mult, one = [\<one>], zero = [], add = poly_add\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
subfield (poly_of_const ` carrier R) (carrier R [X])

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma reals_Archimedean2: "\<exists>n. x < of_nat n"
  for x :: "'a::archimedean_field"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
obtain z where "x < of_int z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. x < of_int z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using ex_less_of_int
[PROOF STATE]
proof (prove)
using this:
\<exists>z. ?x < of_int z

goal (1 subgoal):
 1. (\<And>z. x < of_int z \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x < of_int z

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x < of_int z

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
have "\<dots> \<le> of_int (int (nat z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int z \<le> of_int (int (nat z))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int (int (nat z))

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int z \<le> of_int (int (nat z))

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
have "\<dots> = of_nat (nat z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (int (nat z)) = of_nat (nat z)
[PROOF STEP]
by (simp only: of_int_of_nat_eq)
[PROOF STATE]
proof (state)
this:
of_int (int (nat z)) = of_nat (nat z)

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x < of_nat (nat z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x < of_nat (nat z)

goal (1 subgoal):
 1. \<exists>n. x < of_nat n
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<exists>n. x < of_nat n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma loc_imps_fw_M_nonneg[simp]:
  assumes "loc_imps_fw c loc1 loc2 M xs"
    and   "inv_implications_nonneg c"
  shows "0 \<le> zcount M t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> zcount M t
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
loc_imps_fw c loc1 loc2 M xs
inv_implications_nonneg c

goal (1 subgoal):
 1. 0 \<le> zcount M t
[PROOF STEP]
by (induct arbitrary: t rule: loc_imps_fw.induct)
    (auto intro!: add_nonneg_nonneg sum_nonneg simp: zcount_image_zmset assms(2)[unfolded inv_implications_nonneg_def])


[STATEMENT]
lemma IJ_iff: "u \<in> IJ k \<longleftrightarrow> (\<exists>j i. u = (j,i) \<and> i<j \<and> j\<le>k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (u \<in> IJ k) = (\<exists>j i. u = (j, i) \<and> i < j \<and> j \<le> k)
[PROOF STEP]
by (auto simp: IJ_def)


[STATEMENT]
lemma bigo_useful_intro: "A <= O(f) \<Longrightarrow> B <= O(f) \<Longrightarrow>
  A + B <= O(f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> A + B \<subseteq> O(f)
[PROOF STEP]
apply (subst bigo_plus_idemp [symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> A + B \<subseteq> O(f) + O(f)
[PROOF STEP]
apply (rule set_plus_mono2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> A \<subseteq> O(f)
 2. \<lbrakk>A \<subseteq> O(f); B \<subseteq> O(f)\<rbrakk> \<Longrightarrow> B \<subseteq> O(f)
[PROOF STEP]
apply assumption+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma abs_Re_le_cmod: "\<bar>Re x\<bar> \<le> cmod x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>Re x\<bar> \<le> cmod x
[PROOF STEP]
by (simp add: norm_complex_def)


[STATEMENT]
lemma interval_extension_floor: "interval_extension1 (\<lambda>ivl. Some (floor_float_interval ivl)) floor"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. interval_extension1 (\<lambda>ivl. Some (floor_float_interval ivl)) (\<lambda>x. real_of_int \<lfloor>x\<rfloor>)
[PROOF STEP]
by (auto simp: interval_extension1_def floor_float_intervalI)


[STATEMENT]
lemma const_to_constant:
  assumes "a \<in> carrier R"
  shows "to_fun (monom P a 0) = constant_function (carrier R) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (monom P a 0) = constant_function (carrier R) a
[PROOF STEP]
apply(rule ring_functions.function_ring_car_eqI[of R _ "carrier R"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. ring_functions R
 2. to_fun (monom P a 0) \<in> carrier (function_ring (carrier R) R)
 3. constant_function (carrier R) a \<in> carrier (function_ring (carrier R) R)
 4. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = constant_function (carrier R) a aa
[PROOF STEP]
unfolding ring_functions_def
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. ring R
 2. to_fun (monom P a 0) \<in> carrier (function_ring (carrier R) R)
 3. constant_function (carrier R) a \<in> carrier (function_ring (carrier R) R)
 4. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = constant_function (carrier R) a aa
[PROOF STEP]
apply(simp add: R.ring_axioms)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. to_fun (monom P a 0) \<in> carrier (function_ring (carrier R) R)
 2. constant_function (carrier R) a \<in> carrier (function_ring (carrier R) R)
 3. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = constant_function (carrier R) a aa
[PROOF STEP]
apply (simp add: assms to_fun_is_Fun)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. constant_function (carrier R) a \<in> carrier (function_ring (carrier R) R)
 2. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = constant_function (carrier R) a aa
[PROOF STEP]
using assms ring_functions.constant_function_closed[of R a "carrier R"]
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
\<lbrakk>ring_functions R; a \<in> carrier R\<rbrakk> \<Longrightarrow> constant_function (carrier R) a \<in> carrier (function_ring (carrier R) R)

goal (2 subgoals):
 1. constant_function (carrier R) a \<in> carrier (function_ring (carrier R) R)
 2. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = constant_function (carrier R) a aa
[PROOF STEP]
unfolding ring_functions_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
\<lbrakk>ring R; a \<in> carrier R\<rbrakk> \<Longrightarrow> constant_function (carrier R) a \<in> carrier (function_ring (carrier R) R)

goal (2 subgoals):
 1. constant_function (carrier R) a \<in> carrier (function_ring (carrier R) R)
 2. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = constant_function (carrier R) a aa
[PROOF STEP]
apply (simp add: R.ring_axioms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = constant_function (carrier R) a aa
[PROOF STEP]
using assms to_fun_const[of a ]
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
\<lbrakk>a \<in> carrier R; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (monom P a 0) ?b = a

goal (1 subgoal):
 1. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = constant_function (carrier R) a aa
[PROOF STEP]
unfolding constant_function_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier R
\<lbrakk>a \<in> carrier R; ?b \<in> carrier R\<rbrakk> \<Longrightarrow> to_fun (monom P a 0) ?b = a

goal (1 subgoal):
 1. \<And>aa. aa \<in> carrier R \<Longrightarrow> to_fun (monom P a 0) aa = (\<lambda>x\<in>carrier R. a) aa
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Group) PrSubg4_2:"\<lbrakk>G \<guillemotright> H; a \<in> carrier G; x \<in> H \<bullet> (\<rho> a)\<rbrakk> \<Longrightarrow>
       x \<in> {z. \<exists>v\<in>(H \<bullet> a). \<exists>h\<in>H. h \<cdot> (\<rho> v) = z}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; x \<in> H \<bullet> \<rho> a\<rbrakk> \<Longrightarrow> x \<in> {z. \<exists>v\<in>H \<bullet> a. \<exists>h\<in>H. h \<cdot> \<rho> v = z}
[PROOF STEP]
apply (simp add:rcs_def[of _ "H" "\<rho> a"], erule bexE,
       frule_tac h = h in sg_subset_elem[of "H"], assumption+,
       frule i_closed[of "a"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>h. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; h \<in> H; h \<cdot> \<rho> a = x; h \<in> carrier G; \<rho> a \<in> carrier G\<rbrakk> \<Longrightarrow> \<exists>v\<in>H \<bullet> a. \<exists>h\<in>H. h \<cdot> \<rho> v = x
[PROOF STEP]
apply (frule a_in_rcs[of "H" "a"], assumption, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_prod_le:
  "norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a :: 'a :: {real_normed_algebra_1,comm_monoid_mult}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
[PROOF STEP]
proof (induct A rule: infinite_finite_induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
 2. norm (prod f {}) \<le> (\<Prod>a\<in>{}. norm (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm (prod f F) \<le> (\<Prod>a\<in>F. norm (f a))\<rbrakk> \<Longrightarrow> norm (prod f (insert x F)) \<le> (\<Prod>a\<in>insert x F. norm (f a))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (3 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
 2. norm (prod f {}) \<le> (\<Prod>a\<in>{}. norm (f a))
 3. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm (prod f F) \<le> (\<Prod>a\<in>F. norm (f a))\<rbrakk> \<Longrightarrow> norm (prod f (insert x F)) \<le> (\<Prod>a\<in>insert x F. norm (f a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (prod f {}) \<le> (\<Prod>a\<in>{}. norm (f a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (prod f {}) \<le> (\<Prod>a\<in>{}. norm (f a))

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm (prod f F) \<le> (\<Prod>a\<in>F. norm (f a))\<rbrakk> \<Longrightarrow> norm (prod f (insert x F)) \<le> (\<Prod>a\<in>insert x F. norm (f a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm (prod f F) \<le> (\<Prod>a\<in>F. norm (f a))\<rbrakk> \<Longrightarrow> norm (prod f (insert x F)) \<le> (\<Prod>a\<in>insert x F. norm (f a))
[PROOF STEP]
case (insert a A)
[PROOF STATE]
proof (state)
this:
finite A
a \<notin> A
norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm (prod f F) \<le> (\<Prod>a\<in>F. norm (f a))\<rbrakk> \<Longrightarrow> norm (prod f (insert x F)) \<le> (\<Prod>a\<in>insert x F. norm (f a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite A
a \<notin> A
norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
[PROOF STEP]
have "norm (prod f (insert a A)) \<le> norm (f a) * norm (prod f A)"
[PROOF STATE]
proof (prove)
using this:
finite A
a \<notin> A
norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))

goal (1 subgoal):
 1. norm (prod f (insert a A)) \<le> norm (f a) * norm (prod f A)
[PROOF STEP]
by (simp add: norm_mult_ineq)
[PROOF STATE]
proof (state)
this:
norm (prod f (insert a A)) \<le> norm (f a) * norm (prod f A)

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm (prod f F) \<le> (\<Prod>a\<in>F. norm (f a))\<rbrakk> \<Longrightarrow> norm (prod f (insert x F)) \<le> (\<Prod>a\<in>insert x F. norm (f a))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (prod f (insert a A)) \<le> norm (f a) * norm (prod f A)

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm (prod f F) \<le> (\<Prod>a\<in>F. norm (f a))\<rbrakk> \<Longrightarrow> norm (prod f (insert x F)) \<le> (\<Prod>a\<in>insert x F. norm (f a))
[PROOF STEP]
have "norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
[PROOF STEP]
by (rule insert)
[PROOF STATE]
proof (state)
this:
norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))

goal (2 subgoals):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; norm (prod f F) \<le> (\<Prod>a\<in>F. norm (f a))\<rbrakk> \<Longrightarrow> norm (prod f (insert x F)) \<le> (\<Prod>a\<in>insert x F. norm (f a))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<And>x y. x \<le> y \<Longrightarrow> norm (f a) * x \<le> norm (f a) * y) \<Longrightarrow> norm (prod f (insert a A)) \<le> norm (f a) * (\<Prod>a\<in>A. norm (f a))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(\<And>x y. x \<le> y \<Longrightarrow> norm (f a) * x \<le> norm (f a) * y) \<Longrightarrow> norm (prod f (insert a A)) \<le> norm (f a) * (\<Prod>a\<in>A. norm (f a))

goal (1 subgoal):
 1. norm (prod f (insert a A)) \<le> (\<Prod>a\<in>insert a A. norm (f a))
[PROOF STEP]
by (simp add: insert mult_left_mono)
[PROOF STATE]
proof (state)
this:
norm (prod f (insert a A)) \<le> (\<Prod>a\<in>insert a A. norm (f a))

goal (1 subgoal):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
[PROOF STEP]
case infinite
[PROOF STATE]
proof (state)
this:
infinite A_

goal (1 subgoal):
 1. \<And>A. infinite A \<Longrightarrow> norm (prod f A) \<le> (\<Prod>a\<in>A. norm (f a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
infinite A_
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
infinite A_

goal (1 subgoal):
 1. norm (prod f A_) \<le> (\<Prod>a\<in>A_. norm (f a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (prod f A_) \<le> (\<Prod>a\<in>A_. norm (f a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inf_prefix_length_take_correct: "
  n \<le> inf_prefix_length xs ys \<Longrightarrow> xs \<down> n = ys \<down> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<le> inf_prefix_length xs ys \<Longrightarrow> xs \<down> n = ys \<down> n
[PROOF STEP]
apply (frule order_trans[OF _ inf_prefix_length_leL])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<le> inf_prefix_length xs ys; n \<le> length xs\<rbrakk> \<Longrightarrow> xs \<down> n = ys \<down> n
[PROOF STEP]
apply (frule order_trans[OF _ inf_prefix_length_leR])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<le> inf_prefix_length xs ys; n \<le> length xs; n \<le> length ys\<rbrakk> \<Longrightarrow> xs \<down> n = ys \<down> n
[PROOF STEP]
apply (simp add: list_eq_iff inf_prefix_length_correct)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma normalize_lcm [simp]: "normalize (lcm a b) = lcm a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize (lcm a b) = lcm a b
[PROOF STEP]
by (simp add: lcm_gcd dvd_normalize_div)


[STATEMENT]
lemma count_subset_le:
  "xs |\<subseteq>| ys \<Longrightarrow> count (\<Sum>x \<in> fset xs. f x) a \<le> count (\<Sum>x \<in> fset ys. f x) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a
[PROOF STEP]
proof(induction ys arbitrary: xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs. xs |\<subseteq>| {||} \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset {||})) a
 2. \<And>x ys xs. \<lbrakk>x |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert x ys\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert x ys))) a
[PROOF STEP]
case (insert y ys)
[PROOF STATE]
proof (state)
this:
y |\<notin>| ys
?xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset ?xs)) a \<le> count (sum f (fset ys)) a
xs |\<subseteq>| finsert y ys

goal (2 subgoals):
 1. \<And>xs. xs |\<subseteq>| {||} \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset {||})) a
 2. \<And>x ys xs. \<lbrakk>x |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert x ys\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert x ys))) a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y |\<notin>| ys
?xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset ?xs)) a \<le> count (sum f (fset ys)) a
xs |\<subseteq>| finsert y ys
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
y |\<notin>| ys
?xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset ?xs)) a \<le> count (sum f (fset ys)) a
xs |\<subseteq>| finsert y ys

goal (1 subgoal):
 1. count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
proof(cases "y |\<in>| xs")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
y |\<in>| xs

goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y |\<in>| xs
[PROOF STEP]
obtain xs' where xs'_def: "finsert y xs' = xs" "y |\<notin>| xs'"
[PROOF STATE]
proof (prove)
using this:
y |\<in>| xs

goal (1 subgoal):
 1. (\<And>xs'. \<lbrakk>finsert y xs' = xs; y |\<notin>| xs'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finsert y xs' = xs
y |\<notin>| xs'

goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finsert y xs' = xs
y |\<notin>| xs'
[PROOF STEP]
have "xs' |\<subseteq>| ys"
[PROOF STATE]
proof (prove)
using this:
finsert y xs' = xs
y |\<notin>| xs'

goal (1 subgoal):
 1. xs' |\<subseteq>| ys
[PROOF STEP]
using insert.prems
[PROOF STATE]
proof (prove)
using this:
finsert y xs' = xs
y |\<notin>| xs'
xs |\<subseteq>| finsert y ys

goal (1 subgoal):
 1. xs' |\<subseteq>| ys
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
xs' |\<subseteq>| ys

goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
have "count (\<Sum>x \<in> fset xs. f x) a = count (\<Sum>x \<in> fset xs'. f x) a + count (f y) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (sum f (fset xs)) a = count (sum f (fset xs')) a + count (f y) a
[PROOF STEP]
using xs'_def
[PROOF STATE]
proof (prove)
using this:
finsert y xs' = xs
y |\<notin>| xs'

goal (1 subgoal):
 1. count (sum f (fset xs)) a = count (sum f (fset xs')) a + count (f y) a
[PROOF STEP]
by (auto simp: notin_fset)
[PROOF STATE]
proof (state)
this:
count (sum f (fset xs)) a = count (sum f (fset xs')) a + count (f y) a

goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count (sum f (fset xs)) a = count (sum f (fset xs')) a + count (f y) a

goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
have "\<dots> \<le> count (\<Sum>x \<in> fset ys. f x) a + count (f y) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (sum f (fset xs')) a + count (f y) a \<le> count (sum f (fset ys)) a + count (f y) a
[PROOF STEP]
using \<open>xs' |\<subseteq>| ys\<close> insert.IH
[PROOF STATE]
proof (prove)
using this:
xs' |\<subseteq>| ys
?xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset ?xs)) a \<le> count (sum f (fset ys)) a

goal (1 subgoal):
 1. count (sum f (fset xs')) a + count (f y) a \<le> count (sum f (fset ys)) a + count (f y) a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
count (sum f (fset xs')) a + count (f y) a \<le> count (sum f (fset ys)) a + count (f y) a

goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
count (sum f (fset xs')) a + count (f y) a \<le> count (sum f (fset ys)) a + count (f y) a

goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
have "\<dots> = count (\<Sum>x \<in> fset (finsert y ys). f x) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. count (sum f (fset ys)) a + count (f y) a = count (sum f (fset (finsert y ys))) a
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
y |\<notin>| ys

goal (1 subgoal):
 1. count (sum f (fset ys)) a + count (f y) a = count (sum f (fset (finsert y ys))) a
[PROOF STEP]
by (auto simp: notin_fset)
[PROOF STATE]
proof (state)
this:
count (sum f (fset ys)) a + count (f y) a = count (sum f (fset (finsert y ys))) a

goal (2 subgoals):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<in>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
 2. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a

goal (1 subgoal):
 1. count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a

goal (1 subgoal):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
y |\<notin>| xs

goal (1 subgoal):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
y |\<notin>| xs
[PROOF STEP]
have "count (\<Sum>x \<in> fset xs. f x) a \<le> count (\<Sum>x \<in> fset ys. f x) a"
[PROOF STATE]
proof (prove)
using this:
y |\<notin>| xs

goal (1 subgoal):
 1. count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a
[PROOF STEP]
using insert.prems insert.IH
[PROOF STATE]
proof (prove)
using this:
y |\<notin>| xs
xs |\<subseteq>| finsert y ys
?xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset ?xs)) a \<le> count (sum f (fset ys)) a

goal (1 subgoal):
 1. count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a

goal (1 subgoal):
 1. \<lbrakk>y |\<notin>| ys; \<And>xs. xs |\<subseteq>| ys \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a; xs |\<subseteq>| finsert y ys; y |\<notin>| xs\<rbrakk> \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a

goal (1 subgoal):
 1. count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
using insert.hyps
[PROOF STATE]
proof (prove)
using this:
count (sum f (fset xs)) a \<le> count (sum f (fset ys)) a
y |\<notin>| ys

goal (1 subgoal):
 1. count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a
[PROOF STEP]
by (auto simp: notin_fset)
[PROOF STATE]
proof (state)
this:
count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
count (sum f (fset xs)) a \<le> count (sum f (fset (finsert y ys))) a

goal (1 subgoal):
 1. \<And>xs. xs |\<subseteq>| {||} \<Longrightarrow> count (sum f (fset xs)) a \<le> count (sum f (fset {||})) a
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma mpoly_map_vars_prod [simp]: "mpoly_map_vars f (prod g A) = (\<Prod>x\<in>A. mpoly_map_vars f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mpoly_map_vars f (prod g A) = (\<Prod>x\<in>A. mpoly_map_vars f (g x))
[PROOF STEP]
by (induction A rule: infinite_finite_induct) auto


[STATEMENT]
lemma inorder_insert:
  "sorted(inorder t) \<Longrightarrow> inorder(insert x t) = ins_list x (inorder t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Sorted_Less.sorted (Tree2.inorder t) \<Longrightarrow> Tree2.inorder (insert x t) = ins_list x (Tree2.inorder t)
[PROOF STEP]
by(induction t) (auto simp: ins_list_simps inorder_split inorder_skew)


[STATEMENT]
lemma if_SE_D1 : "P \<sigma> \<Longrightarrow> (\<sigma> \<Turnstile> (if\<^sub>S\<^sub>E P then B\<^sub>1 else B\<^sub>2 fi)) = (\<sigma> \<Turnstile> B\<^sub>1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<sigma> \<Longrightarrow> (\<sigma> \<Turnstile> _if_SE P B\<^sub>1 B\<^sub>2) = (\<sigma> \<Turnstile> B\<^sub>1)
[PROOF STEP]
by(auto simp: if_SE_def valid_SE_def)


[STATEMENT]
lemma min_height_bal:
  "\<lbrakk> n \<le> length xs; bal n xs = (t,zs) \<rbrakk> \<Longrightarrow> min_height t = nat(\<lfloor>log 2 (n + 1)\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<le> length xs; bal n xs = (t, zs)\<rbrakk> \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
proof(induction n arbitrary: xs t zs rule: less_induct)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs t zs. \<lbrakk>\<And>y xs t zs. \<lbrakk>y < x; y \<le> length xs; bal y xs = (t, zs)\<rbrakk> \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (y + 1))\<rfloor>; x \<le> length xs; bal x xs = (t, zs)\<rbrakk> \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (x + 1))\<rfloor>
[PROOF STEP]
case (less n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?y < n; ?y \<le> length ?xs; bal ?y ?xs = (?t, ?zs)\<rbrakk> \<Longrightarrow> min_height ?t = nat \<lfloor>log 2 (real (?y + 1))\<rfloor>
n \<le> length xs
bal n xs = (t, zs)

goal (1 subgoal):
 1. \<And>x xs t zs. \<lbrakk>\<And>y xs t zs. \<lbrakk>y < x; y \<le> length xs; bal y xs = (t, zs)\<rbrakk> \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (y + 1))\<rfloor>; x \<le> length xs; bal x xs = (t, zs)\<rbrakk> \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (x + 1))\<rfloor>
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
 2. \<not> ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
assume "n = 0"
[PROOF STATE]
proof (state)
this:
n = 0

goal (2 subgoals):
 1. ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
 2. \<not> ?P \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n = 0

goal (1 subgoal):
 1. min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
using less.prems(2)
[PROOF STATE]
proof (prove)
using this:
n = 0
bal n xs = (t, zs)

goal (1 subgoal):
 1. min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
by (simp add: bal_simps)
[PROOF STATE]
proof (state)
this:
min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
assume [arith]: "n \<noteq> 0"
[PROOF STATE]
proof (state)
this:
n \<noteq> 0

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
let ?m = "n div 2"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
let ?m' = "n - 1 - ?m"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
from less.prems
[PROOF STATE]
proof (chain)
picking this:
n \<le> length xs
bal n xs = (t, zs)
[PROOF STEP]
obtain l r ys where
      b1: "bal ?m xs = (l,ys)" and
      b2: "bal ?m' (tl ys) = (r,zs)" and
      t: "t = \<langle>l, hd ys, r\<rangle>"
[PROOF STATE]
proof (prove)
using this:
n \<le> length xs
bal n xs = (t, zs)

goal (1 subgoal):
 1. (\<And>l ys r. \<lbrakk>bal (n div 2) xs = (l, ys); bal (n - 1 - n div 2) (tl ys) = (r, zs); t = \<langle>l, hd ys, r\<rangle>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp: bal_simps split: prod.splits)
[PROOF STATE]
proof (state)
this:
bal (n div 2) xs = (l, ys)
bal (n - 1 - n div 2) (tl ys) = (r, zs)
t = \<langle>l, hd ys, r\<rangle>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
let ?hl = "nat (floor(log 2 (?m + 1)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
let ?hr = "nat (floor(log 2 (?m' + 1)))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have IH1: "min_height l = ?hl"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_height l = nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>
[PROOF STEP]
using less.IH[OF _ _ b1] less.prems(1)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n div 2 < n; n div 2 \<le> length xs\<rbrakk> \<Longrightarrow> min_height l = nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>
n \<le> length xs

goal (1 subgoal):
 1. min_height l = nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
min_height l = nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have IH2: "min_height r = ?hr"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_height r = nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>
[PROOF STEP]
using less.prems(1) bal_length[OF _ b1] b2
[PROOF STATE]
proof (prove)
using this:
n \<le> length xs
n div 2 \<le> length xs \<Longrightarrow> length ys = length xs - n div 2
bal (n - 1 - n div 2) (tl ys) = (r, zs)

goal (1 subgoal):
 1. min_height r = nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>
[PROOF STEP]
by(intro less.IH) auto
[PROOF STATE]
proof (state)
this:
min_height r = nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have "(n+1) div 2 \<ge> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 \<le> (n + 1) div 2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
1 \<le> (n + 1) div 2

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
hence 0: "log 2 ((n+1) div 2) \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
1 \<le> (n + 1) div 2

goal (1 subgoal):
 1. 0 \<le> log 2 (real ((n + 1) div 2))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 \<le> log 2 (real ((n + 1) div 2))

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have "?m' \<le> ?m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n - 1 - n div 2 \<le> n div 2
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
n - 1 - n div 2 \<le> n div 2

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
hence le: "?hr \<le> ?hl"
[PROOF STATE]
proof (prove)
using this:
n - 1 - n div 2 \<le> n div 2

goal (1 subgoal):
 1. nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor> \<le> nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>
[PROOF STEP]
by(simp add: nat_mono floor_mono)
[PROOF STATE]
proof (state)
this:
nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor> \<le> nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have "min_height t = min ?hl ?hr + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min_height t = min (nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>) (nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>) + 1
[PROOF STEP]
by (simp add: t IH1 IH2)
[PROOF STATE]
proof (state)
this:
min_height t = min (nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>) (nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>) + 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
min_height t = min (nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>) (nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>) + 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have "\<dots> = ?hr + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>) (nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>) + 1 = nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor> + 1
[PROOF STEP]
using le
[PROOF STATE]
proof (prove)
using this:
nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor> \<le> nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>

goal (1 subgoal):
 1. min (nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>) (nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>) + 1 = nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor> + 1
[PROOF STEP]
by (simp add: min_absorb2)
[PROOF STATE]
proof (state)
this:
min (nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>) (nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>) + 1 = nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor> + 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
min (nat \<lfloor>log 2 (real (n div 2 + 1))\<rfloor>) (nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor>) + 1 = nat \<lfloor>log 2 (real (n - 1 - n div 2 + 1))\<rfloor> + 1

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have "?m' + 1 = (n+1) div 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n - 1 - n div 2 + 1 = (n + 1) div 2
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
n - 1 - n div 2 + 1 = (n + 1) div 2

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
n - 1 - n div 2 + 1 = (n + 1) div 2

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have "nat (floor(log 2 ((n+1) div 2))) + 1
       = nat (floor(log 2 ((n+1) div 2) + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat \<lfloor>log 2 (real ((n + 1) div 2))\<rfloor> + 1 = nat \<lfloor>log 2 (real ((n + 1) div 2)) + 1\<rfloor>
[PROOF STEP]
using 0
[PROOF STATE]
proof (prove)
using this:
0 \<le> log 2 (real ((n + 1) div 2))

goal (1 subgoal):
 1. nat \<lfloor>log 2 (real ((n + 1) div 2))\<rfloor> + 1 = nat \<lfloor>log 2 (real ((n + 1) div 2)) + 1\<rfloor>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
nat \<lfloor>log 2 (real ((n + 1) div 2))\<rfloor> + 1 = nat \<lfloor>log 2 (real ((n + 1) div 2)) + 1\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nat \<lfloor>log 2 (real ((n + 1) div 2))\<rfloor> + 1 = nat \<lfloor>log 2 (real ((n + 1) div 2)) + 1\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
have "\<dots> = nat (floor(log 2 (n + 1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat \<lfloor>log 2 (real ((n + 1) div 2)) + 1\<rfloor> = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
using floor_log2_div2[of "n+1"]
[PROOF STATE]
proof (prove)
using this:
2 \<le> n + 1 \<Longrightarrow> \<lfloor>log 2 (real (n + 1))\<rfloor> = \<lfloor>log 2 (real ((n + 1) div 2))\<rfloor> + 1

goal (1 subgoal):
 1. nat \<lfloor>log 2 (real ((n + 1) div 2)) + 1\<rfloor> = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
by (simp add: log_mult)
[PROOF STATE]
proof (state)
this:
nat \<lfloor>log 2 (real ((n + 1) div 2)) + 1\<rfloor> = nat \<lfloor>log 2 (real (n + 1))\<rfloor>

goal (1 subgoal):
 1. n \<noteq> 0 \<Longrightarrow> min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>

goal (1 subgoal):
 1. min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
min_height t = nat \<lfloor>log 2 (real (n + 1))\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Cons_in_list_Suc [iff]:
  "(x#xs \<in> list (Suc n) A) = (x\<in> A & xs \<in> list n A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x # xs \<in> list (Suc n) A) = (x \<in> A \<and> xs \<in> list n A)
[PROOF STEP]
apply (simp add: in_list_Suc_iff)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem th2_12:
    assumes "q \<noteq> a"
    shows "\<exists>!x. B q a x \<and> a x \<congruent> b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>!x. B q a x \<and> a x \<equiv> b c
[PROOF STEP]
using \<open>q \<noteq> a\<close> and A4' and A4_unique
[PROOF STATE]
proof (prove)
using this:
q \<noteq> a
\<exists>x. B ?q ?a x \<and> ?a x \<equiv> ?b ?c
\<lbrakk>?q \<noteq> ?a; B ?q ?a ?x; ?a ?x \<equiv> ?b ?c; B ?q ?a ?x'; ?a ?x' \<equiv> ?b ?c\<rbrakk> \<Longrightarrow> ?x = ?x'

goal (1 subgoal):
 1. \<exists>!x. B q a x \<and> a x \<equiv> b c
[PROOF STEP]
by blast


[STATEMENT]
lemma mat_hom_one: "mat\<^sub>h (1\<^sub>m n) = 1\<^sub>m n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat\<^sub>h (1\<^sub>m n) = 1\<^sub>m n
[PROOF STEP]
by (rule eq_matI, auto)


[STATEMENT]
lemma "(\<forall>x. P a \<and> (P x \<longrightarrow> P b)\<longrightarrow>P c)  =
      (\<forall>x. (\<not>P a \<or> P x \<or> P c) \<and> (\<not>P a \<or> \<not>P b \<or> P c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P a \<and> (P x \<longrightarrow> P b) \<longrightarrow> P c) = (\<forall>x. (\<not> P a \<or> P x \<or> P c) \<and> (\<not> P a \<or> \<not> P b \<or> P c))
[PROOF STEP]
by blast


[STATEMENT]
lemma list_all2_approx:
  "list_all2 (approx_val G hp) s (map OK S) = list_all2 (conf G hp) s S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_all2 (approx_val G hp) s (map OK S) = list_all2 (conf G hp) s S
[PROOF STEP]
apply (induct S arbitrary: s)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>s. list_all2 (approx_val G hp) s (map OK []) = list_all2 (conf G hp) s []
 2. \<And>a S s. (\<And>s. list_all2 (approx_val G hp) s (map OK S) = list_all2 (conf G hp) s S) \<Longrightarrow> list_all2 (approx_val G hp) s (map OK (a # S)) = list_all2 (conf G hp) s (a # S)
[PROOF STEP]
apply (auto simp add: list_all2_Cons2 approx_val_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma HNatInfinite_not_Nats_iff: "x \<in> HNatInfinite \<longleftrightarrow> x \<notin> Nats"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> HNatInfinite) = (x \<notin> \<nat>)
[PROOF STEP]
by (simp add: HNatInfinite_def)


[STATEMENT]
lemma reify_ln_chain_pow:
  "\<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))
[PROOF STEP]
have "\<Theta>(eval_primfun (LnChain n, real e)) = \<Theta>(\<lambda>x. (ln ^^ n) x powr (real e))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Theta>(eval_primfun (LnChain n, real e)) = \<Theta>(\<lambda>x. (ln ^^ n) x powr real e)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<Theta>(eval_primfun (LnChain n, real e)) = \<Theta>(\<lambda>x. (ln ^^ n) x powr real e)

goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Theta>(eval_primfun (LnChain n, real e)) = \<Theta>(\<lambda>x. (ln ^^ n) x powr real e)

goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))
[PROOF STEP]
have "eventually (\<lambda>x::real. (ln ^^ n) x > 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < (ln ^^ n) x
[PROOF STEP]
using fun_chain_at_top_at_top[OF ln_at_top]
[PROOF STATE]
proof (prove)
using this:
filterlim (ln ^^ ?n) at_top at_top

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < (ln ^^ n) x
[PROOF STEP]
unfolding filterlim_at_top_dense
[PROOF STATE]
proof (prove)
using this:
\<forall>Z. \<forall>\<^sub>F x in at_top. Z < (ln ^^ ?n) x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. 0 < (ln ^^ n) x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. 0 < (ln ^^ n) x

goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))
[PROOF STEP]
hence "eventually (\<lambda>x. (ln ^^ n) x powr (real e) = (ln ^^ n) x ^ e) at_top"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. 0 < (ln ^^ n) x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. (ln ^^ n) x powr real e = (ln ^^ n) x ^ e
[PROOF STEP]
by eventually_elim (subst powr_realpow, auto)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_top. (ln ^^ n) x powr real e = (ln ^^ n) x ^ e

goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))
[PROOF STEP]
hence "\<Theta>(\<lambda>x. (ln ^^ n) x powr (real e)) = \<Theta>(\<lambda>x. (ln ^^ n) x^e)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. (ln ^^ n) x powr real e = (ln ^^ n) x ^ e

goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x powr real e) = \<Theta>(\<lambda>x. (ln ^^ n) x ^ e)
[PROOF STEP]
by (rule landau_theta.cong)
[PROOF STATE]
proof (state)
this:
\<Theta>(\<lambda>x. (ln ^^ n) x powr real e) = \<Theta>(\<lambda>x. (ln ^^ n) x ^ e)

goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Theta>(eval_primfun (LnChain n, real e)) = \<Theta>(\<lambda>x. (ln ^^ n) x ^ e)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Theta>(eval_primfun (LnChain n, real e)) = \<Theta>(\<lambda>x. (ln ^^ n) x ^ e)

goal (1 subgoal):
 1. \<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
\<Theta>(\<lambda>x. (ln ^^ n) x ^ e) = \<Theta>(eval_primfun (LnChain n, real e))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma det_echelon_form_of_upt_k_det:
  fixes A::"'a::{bezout_domain}^'n::{mod_type}^'n::{mod_type}"
  assumes ib: "is_bezout_ext bezout"
  shows "fst ((echelon_form_of_upt_k_det bezout) (1::'a,A) k) *  det A
  = det (snd ((echelon_form_of_upt_k_det bezout) (1::'a,A) k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k))
[PROOF STEP]
proof (induct k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. fst (echelon_form_of_upt_k_det bezout (1::'a, A) 0) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) 0))
 2. \<And>k. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k)) \<Longrightarrow> fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. fst (echelon_form_of_upt_k_det bezout (1::'a, A) 0) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) 0))
 2. \<And>k. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k)) \<Longrightarrow> fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (echelon_form_of_upt_k_det bezout (1::'a, A) 0) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) 0))
[PROOF STEP]
unfolding echelon_form_of_upt_k_det_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, snd (1::'a, A), 0) [0..<Suc 0]), fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, snd (1::'a, A), 0) [0..<Suc 0]))) * det A = det (snd (fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, snd (1::'a, A), 0) [0..<Suc 0]), fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, snd (1::'a, A), 0) [0..<Suc 0]))))
[PROOF STEP]
by (auto, rule det_echelon_form_of_column_k_det[OF ib], simp)
[PROOF STATE]
proof (state)
this:
fst (echelon_form_of_upt_k_det bezout (1::'a, A) 0) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) 0))

goal (1 subgoal):
 1. \<And>k. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k)) \<Longrightarrow> fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k)) \<Longrightarrow> fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k))

goal (1 subgoal):
 1. \<And>k. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k)) \<Longrightarrow> fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
let ?f = "foldl (echelon_form_of_column_k_det bezout) (1,A,0) [0..<Suc k]"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>k. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k)) \<Longrightarrow> fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
have Suc_rw: "[0..<Suc (Suc k)] = [0..<(Suc k)] @ [Suc k]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. [0..<Suc (Suc k)] = [0..<Suc k] @ [Suc k]
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
[0..<Suc (Suc k)] = [0..<Suc k] @ [Suc k]

goal (1 subgoal):
 1. \<And>k. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k)) \<Longrightarrow> fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
have fold_expand: "?f = (fst ?f, fst (snd ?f), snd (snd ?f))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k] = (fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]), fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k])), snd (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k])))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k] = (fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]), fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k])), snd (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k])))

goal (1 subgoal):
 1. \<And>k. fst (echelon_form_of_upt_k_det bezout (1::'a, A) k) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) k)) \<Longrightarrow> fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))
[PROOF STEP]
unfolding echelon_form_of_upt_k_det_def Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, snd (1::'a, A), 0) [0..<Suc (Suc k)]), fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, snd (1::'a, A), 0) [0..<Suc (Suc k)]))) * det A = det (snd (fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, snd (1::'a, A), 0) [0..<Suc (Suc k)]), fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, snd (1::'a, A), 0) [0..<Suc (Suc k)]))))
[PROOF STEP]
unfolding Suc_rw foldl_append List.foldl.simps fst_conv snd_conv
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (echelon_form_of_column_k_det bezout (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]) (Suc k)) * det A = det (fst (snd (echelon_form_of_column_k_det bezout (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]) (Suc k))))
[PROOF STEP]
apply (subst (1 2) fold_expand)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (echelon_form_of_column_k_det bezout (fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]), fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k])), snd (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]))) (Suc k)) * det A = det (fst (snd (echelon_form_of_column_k_det bezout (fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]), fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k])), snd (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]))) (Suc k))))
[PROOF STEP]
apply (rule det_echelon_form_of_column_k_det)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. is_bezout_ext bezout
 2. fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]) * det A = det (fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k])))
[PROOF STEP]
apply (rule ib)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]) * det A = det (fst (snd (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k])))
[PROOF STEP]
apply (subst (1) snd_foldl_ef_det_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (foldl (echelon_form_of_column_k_det bezout) (1::'a, A, 0) [0..<Suc k]) * det A = det (fst (foldl (echelon_form_of_column_k bezout) (A, 0) [0..<Suc k]))
[PROOF STEP]
by (metis Suc.hyps echelon_form_of_upt_k_det_def fst_conv snd_conv snd_foldl_ef_det_eq)
[PROOF STATE]
proof (state)
this:
fst (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)) * det A = det (snd (echelon_form_of_upt_k_det bezout (1::'a, A) (Suc k)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma left_invertible_inj:
  "(\<forall>x . g (f x) = x) \<Longrightarrow> inj f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. g (f x) = x \<Longrightarrow> inj f
[PROOF STEP]
by (metis injI)


[STATEMENT]
lemma triple_star:
  assumes "is_inj x"
      and "is_p_fun x"
    shows "x\<^sup>\<star>;x\<^sup>T\<^sup>\<star>;x\<^sup>\<star> = x\<^sup>\<star> + x\<^sup>T\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x\<^sup>\<star> ; x\<^sup>T\<^sup>\<star> ; x\<^sup>\<star> = x\<^sup>\<star> + x\<^sup>T\<^sup>\<star>
[PROOF STEP]
by (simp add: assms cancel_separate_inj_converse cancel_separate_p_fun_converse)


[STATEMENT]
lemma dtree_from_list_dverts_subset_wfdverts1':
  assumes "wf_dverts (dtree_from_list v cs)"
      and "is_subtree (Node r ys) (dtree_from_list v cs)"
      and "\<exists>as e bs. as@(r,e)#bs = cs \<and> dverts t1 \<subseteq> fst ` set ((r,e)#bs)"
    shows "dverts t1 \<subseteq> dverts (Node r ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dverts t1 \<subseteq> dverts (Node r ys)
[PROOF STEP]
using dtree_from_list_dverts_subset_wfdverts1 assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>dverts ?t1.0 \<subseteq> fst ` set ((?r, ?e2.0) # ?bs); wf_dverts (dtree_from_list ?v (?as @ (?r, ?e2.0) # ?bs)); is_subtree (Node ?r ?ys) (dtree_from_list ?v (?as @ (?r, ?e2.0) # ?bs))\<rbrakk> \<Longrightarrow> dverts ?t1.0 \<subseteq> dverts (Node ?r ?ys)
wf_dverts (dtree_from_list v cs)
is_subtree (Node r ys) (dtree_from_list v cs)
\<exists>as e bs. as @ (r, e) # bs = cs \<and> dverts t1 \<subseteq> fst ` set ((r, e) # bs)

goal (1 subgoal):
 1. dverts t1 \<subseteq> dverts (Node r ys)
[PROOF STEP]
by fast


[STATEMENT]
lemma fst_mult_sv [simp]:
  shows "fst (k *\<^sub>s\<^sub>v v) = k * fst v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (k *\<^sub>s\<^sub>v v) = k * fst v
[PROOF STEP]
by (cases v) simp


[STATEMENT]
theorem berlekamp_hensel:
  assumes cop: "coprime (lead_coeff f) p"
    and sf: "square_free_m f"
    and res: "berlekamp_hensel p n f = gs"
    and n: "n \<noteq> 0"
  shows "poly_mod.factorization_m (p^n) f (lead_coeff f, mset gs) \<comment> \<open>factorization mod \<open>p^n\<close>\<close>"
    and "\<And> g. g \<in> set gs \<Longrightarrow> poly_mod.Mp (p^n) g = g \<and> poly_mod.irreducible_m p g
      \<comment> \<open>normalized and \<open>irreducible\<close> even mod \<open>p\<close>\<close>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mod.factorization_m (p ^ n) f (lead_coeff f, mset gs) &&& (\<And>g. g \<in> set gs \<Longrightarrow> poly_mod.Mp (p ^ n) g = g \<and> irreducible_m g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. poly_mod.factorization_m (p ^ n) f (lead_coeff f, mset gs)
 2. \<And>g. g \<in> set gs \<Longrightarrow> poly_mod.Mp (p ^ n) g = g \<and> irreducible_m g
[PROOF STEP]
obtain c fs where "finite_field_factorization_int p f = (c,fs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c fs. finite_field_factorization_int p f = (c, fs) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
finite_field_factorization_int p f = (c, fs)

goal (2 subgoals):
 1. poly_mod.factorization_m (p ^ n) f (lead_coeff f, mset gs)
 2. \<And>g. g \<in> set gs \<Longrightarrow> poly_mod.Mp (p ^ n) g = g \<and> irreducible_m g
[PROOF STEP]
from berlekamp_hensel_main[OF n res cop sf this]
[PROOF STATE]
proof (chain)
picking this:
poly_mod.factorization_m (p ^ n) f (lead_coeff f, mset gs)
sort (map degree fs) = sort (map degree gs)
?g \<in> set gs \<Longrightarrow> monic ?g \<and> poly_mod.Mp (p ^ n) ?g = ?g \<and> irreducible_m ?g \<and> degree_m ?g = degree ?g
[PROOF STEP]
show "poly_mod.factorization_m (p^n) f (lead_coeff f, mset gs)"
    "\<And> g. g \<in> set gs \<Longrightarrow> poly_mod.Mp (p^n) g = g \<and> poly_mod.irreducible_m p g"
[PROOF STATE]
proof (prove)
using this:
poly_mod.factorization_m (p ^ n) f (lead_coeff f, mset gs)
sort (map degree fs) = sort (map degree gs)
?g \<in> set gs \<Longrightarrow> monic ?g \<and> poly_mod.Mp (p ^ n) ?g = ?g \<and> irreducible_m ?g \<and> degree_m ?g = degree ?g

goal (1 subgoal):
 1. poly_mod.factorization_m (p ^ n) f (lead_coeff f, mset gs) &&& (\<And>g. g \<in> set gs \<Longrightarrow> poly_mod.Mp (p ^ n) g = g \<and> irreducible_m g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly_mod.factorization_m (p ^ n) f (lead_coeff f, mset gs)
?g \<in> set gs \<Longrightarrow> poly_mod.Mp (p ^ n) ?g = ?g \<and> irreducible_m ?g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Dynkin_systemI:
  assumes "\<And> A. A \<in> M \<Longrightarrow> A \<subseteq> \<Omega>" "\<Omega> \<in> M"
  assumes "\<And> A. A \<in> M \<Longrightarrow> \<Omega> - A \<in> M"
  assumes "\<And> A. disjoint_family A \<Longrightarrow> range A \<subseteq> M
          \<Longrightarrow> (\<Union>i::nat. A i) \<in> M"
  shows "Dynkin_system \<Omega> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dynkin_system \<Omega> M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?A \<in> M \<Longrightarrow> ?A \<subseteq> \<Omega>
\<Omega> \<in> M
?A \<in> M \<Longrightarrow> \<Omega> - ?A \<in> M
\<lbrakk>disjoint_family ?A; range ?A \<subseteq> M\<rbrakk> \<Longrightarrow> \<Union> (range ?A) \<in> M

goal (1 subgoal):
 1. Dynkin_system \<Omega> M
[PROOF STEP]
by (auto simp: Dynkin_system_def Dynkin_system_axioms_def subset_class_def)


[STATEMENT]
lemma max_list_in_set: \<open>finite S \<Longrightarrow> set xs \<subseteq> S \<Longrightarrow> max_list xs \<le> max_set S\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; set xs \<subseteq> S\<rbrakk> \<Longrightarrow> max_list xs \<le> max_set S
[PROOF STEP]
unfolding max_set_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; set xs \<subseteq> S\<rbrakk> \<Longrightarrow> max_list xs \<le> (if S = {} then 0 else Max S)
[PROOF STEP]
using max_list_in_Cons
[PROOF STATE]
proof (prove)
using this:
?xs \<noteq> [] \<Longrightarrow> max_list ?xs \<in> set ?xs

goal (1 subgoal):
 1. \<lbrakk>finite S; set xs \<subseteq> S\<rbrakk> \<Longrightarrow> max_list xs \<le> (if S = {} then 0 else Max S)
[PROOF STEP]
by (metis (mono_tags, lifting) Max_ge bot.extremum_uniqueI bot_nat_0.extremum max_list.simps(1)
      set_empty subsetD)


[STATEMENT]
lemma inj_on_DirProd_carrier:
  shows "inj_on (\<lambda>(g, gs). g # gs) (carrier (G \<times>\<times> (DirProd_list Gs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on (\<lambda>(g, gs). g # gs) (carrier (G \<times>\<times> DirProd_list Gs))
[PROOF STEP]
unfolding DirProd_def inj_on_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>carrier \<lparr>carrier = carrier G \<times> carrier (DirProd_list Gs), mult = \<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>DirProd_list Gs\<^esub> h'), one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>DirProd_list Gs\<^esub>)\<rparr>. \<forall>y\<in>carrier \<lparr>carrier = carrier G \<times> carrier (DirProd_list Gs), mult = \<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>DirProd_list Gs\<^esub> h'), one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>DirProd_list Gs\<^esub>)\<rparr>. (case x of (x, xa) \<Rightarrow> x # xa) = (case y of (x, xa) \<Rightarrow> x # xa) \<longrightarrow> x = y
[PROOF STEP]
by auto


[STATEMENT]
lemma step_push_size_new_small [simp]: "\<lbrakk>
  invar (States dir big small);
  step (States dir big (Small.push x small)) = States dir' big' small'
\<rbrakk> \<Longrightarrow> size_new small' = Suc (size_new small)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); step (States dir big (Small.push x small)) = States dir' big' small'\<rbrakk> \<Longrightarrow> size_new small' = Suc (size_new small)
[PROOF STEP]
using
    invar_push_small[of dir big small x]
    step_size_new_small[of dir big "Small.push x small" dir' big' small']
    size_new_push[of small x]
[PROOF STATE]
proof (prove)
using this:
invar (States dir big small) \<Longrightarrow> invar (States dir big (Small.push x small))
\<lbrakk>invar (States dir big (Small.push x small)); step (States dir big (Small.push x small)) = States dir' big' small'\<rbrakk> \<Longrightarrow> size_new small' = size_new (Small.push x small)
invar small \<Longrightarrow> size_new (Small.push x small) = Suc (size_new small)

goal (1 subgoal):
 1. \<lbrakk>invar (States dir big small); step (States dir big (Small.push x small)) = States dir' big' small'\<rbrakk> \<Longrightarrow> size_new small' = Suc (size_new small)
[PROOF STEP]
by simp


[STATEMENT]
lemma ord_eucl_utility_imp_rpr: "eucl_ordinal_utility s rel u \<longrightarrow> real_vector_rpr s rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eucl_ordinal_utility s rel u \<longrightarrow> real_vector_rpr s rel
[PROOF STEP]
using eucl_ordinal_utility.axioms ordinal_util_imp_rat_prefs real_vector_rpr.intro
[PROOF STATE]
proof (prove)
using this:
eucl_ordinal_utility ?carrier ?relation ?u \<Longrightarrow> ordinal_utility ?carrier ?relation ?u
ordinal_utility ?carrier ?relation ?u \<Longrightarrow> rational_preference ?carrier ?relation
rational_preference ?carrier ?relation \<Longrightarrow> real_vector_rpr ?carrier ?relation

goal (1 subgoal):
 1. eucl_ordinal_utility s rel u \<longrightarrow> real_vector_rpr s rel
[PROOF STEP]
by blast


[STATEMENT]
lemma convergent_liminf_cl:
  fixes X :: "nat \<Rightarrow> 'a::{complete_linorder,linorder_topology}"
  shows "convergent X \<Longrightarrow> liminf X = lim X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent X \<Longrightarrow> liminf X = lim X
[PROOF STEP]
by (auto simp: convergent_def limI lim_imp_Liminf)


[STATEMENT]
lemma dupe_monic_i_int_finite_field_ops32: assumes
      m: "m \<le> 65535"
  and dupe_i: "dupe_monic_i_int (finite_field_ops32 (uint32_of_int m)) D H S T U = (A,B)"
  and 1: "D*S + H*T =m 1"
  and mon: "monic D"
  and norm: "Mp D = D" "Mp H = H" "Mp S = S" "Mp T = T" "Mp U = U"
shows
  "A * D + B * H =m U"
  "B = 0 \<or> degree B < degree D"
  "Mp A = A"
  "Mp B = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A * D + B * H =m U &&& B = 0 \<or> degree B < degree D) &&& Mp A = A &&& Mp B = B
[PROOF STEP]
using m1 mod_ring_gen.dupe_monic_i_int[OF
        mod_ring_locale.mod_ring_finite_field_ops32[unfolded mod_ring_locale_def],
        internalize_sort "'a :: nontriv", OF type_to_set, unfolded remove_duplicate_premise,
        cancel_type_definition, OF _ assms]
[PROOF STATE]
proof (prove)
using this:
1 < m
{0..<m} \<noteq> {} \<Longrightarrow> A * D + B * H =m U
{0..<m} \<noteq> {} \<Longrightarrow> B = 0 \<or> degree B < degree D
{0..<m} \<noteq> {} \<Longrightarrow> Mp A = A
{0..<m} \<noteq> {} \<Longrightarrow> Mp B = B

goal (1 subgoal):
 1. (A * D + B * H =m U &&& B = 0 \<or> degree B < degree D) &&& Mp A = A &&& Mp B = B
[PROOF STEP]
by auto


[STATEMENT]
theorem wls_swapAbs_vsubstAbs:
assumes "wlsAbs (us,s) A"
shows "((A $[y1 // y]_ys) $[z1 \<and> z2]_zs) =
       ((A $[z1 \<and> z2]_zs) $[(y1 @ys[z1 \<and> z2]_zs) // (y @ys[z1 \<and> z2]_zs)]_ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A $[y1 // y]_ys $[z1 \<and> z2]_zs = A $[z1 \<and> z2]_zs $[y1 @ys[z1 \<and> z2]_zs // y @ys[z1 \<and> z2]_zs]_ys
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wlsAbs (us, s) A

goal (1 subgoal):
 1. A $[y1 // y]_ys $[z1 \<and> z2]_zs = A $[z1 \<and> z2]_zs $[y1 @ys[z1 \<and> z2]_zs // y @ys[z1 \<and> z2]_zs]_ys
[PROOF STEP]
by(simp add: swapAbs_vsubstAbs)


[STATEMENT]
lemma ordsetmap_smap: "\<lbrakk> X\<in>\<P>; Y\<in>\<P>; X\<supseteq>Y \<rbrakk> \<Longrightarrow> smap X \<subseteq> smap Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>X \<in> \<P>; Y \<in> \<P>; Y \<subseteq> X\<rbrakk> \<Longrightarrow> dual_order.poset_simplex_map \<P> X \<subseteq> dual_order.poset_simplex_map \<P> Y
[PROOF STEP]
using ComplexLikePoset.ordsetmap_smap[OF ComplexLikePoset_special_cosets]
        smap_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> \<P>; ?b \<in> \<P>; ?b \<subseteq> ?a\<rbrakk> \<Longrightarrow> dual_order.poset_simplex_map \<P> ?a \<subseteq> dual_order.poset_simplex_map \<P> ?b
dual_order.poset_simplex_map \<P> ?x = {y. dual_order.pseudominimal_in (dual_order.below_in \<P> ?x) y}

goal (1 subgoal):
 1. \<lbrakk>X \<in> \<P>; Y \<in> \<P>; Y \<subseteq> X\<rbrakk> \<Longrightarrow> dual_order.poset_simplex_map \<P> X \<subseteq> dual_order.poset_simplex_map \<P> Y
[PROOF STEP]
by    simp


[STATEMENT]
lemma majE: "2 * (E - \<alpha>) \<ge> N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. N \<le> 2 * (E - \<alpha>)
[PROOF STEP]
using TNaE TltN
[PROOF STATE]
proof (prove)
using this:
2 * (N + 2 * \<alpha> - E) \<le> T
T < N

goal (1 subgoal):
 1. N \<le> 2 * (E - \<alpha>)
[PROOF STEP]
by auto


[STATEMENT]
lemma integral_scaleR_right[simp]: "(\<integral> x. c *\<^sub>R f x \<partial>M) = c *\<^sub>R integral\<^sup>L M f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LINT x|M. c *\<^sub>R f x = c *\<^sub>R integral\<^sup>L M f
[PROOF STEP]
by (rule integral_bounded_linear'[OF bounded_linear_scaleR_right bounded_linear_scaleR_right[of "1 / c"]]) simp


[STATEMENT]
lemma sorted_scaled_inl: "ccw.sortedP 0 (map ((*\<^sub>R) 2) (ccw.selsort 0 (inl (snd X))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ccw.sortedP 0 (map ((*\<^sub>R) 2) (ccw.selsort 0 (inl (snd X))))
[PROOF STEP]
using sorted_inl
[PROOF STATE]
proof (prove)
using this:
ccw.sortedP 0 (ccw.selsort 0 (inl (snd ?X)))

goal (1 subgoal):
 1. ccw.sortedP 0 (map ((*\<^sub>R) 2) (ccw.selsort 0 (inl (snd X))))
[PROOF STEP]
by (rule ccw_sorted_scaleR) simp


[STATEMENT]
lemma open_map_compose:
     "\<lbrakk>open_map X X' f; open_map X' X'' g\<rbrakk> \<Longrightarrow> open_map X X'' (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open_map X X' f; open_map X' X'' g\<rbrakk> \<Longrightarrow> open_map X X'' (g \<circ> f)
[PROOF STEP]
by (metis (no_types, lifting) image_comp open_map_def)


[STATEMENT]
lemma twos_complement: "- x = word_succ (not x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - x = word_succ (not x)
[PROOF STEP]
using arg_cong[OF word_add_not[where x=x], where f="\<lambda>a. a - x + 1"]
[PROOF STATE]
proof (prove)
using this:
x + not x - x + 1 = - 1 - x + 1

goal (1 subgoal):
 1. - x = word_succ (not x)
[PROOF STEP]
by (simp add: word_succ_p1 word_sp_01[unfolded word_succ_p1] del: word_add_not)


[STATEMENT]
lemma conj_mono: "c\<^sub>0 \<sqsubseteq> d\<^sub>0 \<Longrightarrow> c\<^sub>1 \<sqsubseteq> d\<^sub>1 \<Longrightarrow> c\<^sub>0 \<iinter> c\<^sub>1 \<sqsubseteq> d\<^sub>0 \<iinter> d\<^sub>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c\<^sub>0 \<sqsubseteq> d\<^sub>0; c\<^sub>1 \<sqsubseteq> d\<^sub>1\<rbrakk> \<Longrightarrow> c\<^sub>0 \<iinter> c\<^sub>1 \<sqsubseteq> d\<^sub>0 \<iinter> d\<^sub>1
variables:
(\<iinter>) :: 'a \<Rightarrow> 'a \<Rightarrow> 'a
c\<^sub>0, c\<^sub>1, d\<^sub>0, d\<^sub>1 :: 'a
type variables:
'a :: refinement_lattice
[PROOF STEP]
by (metis inf.absorb_iff1 inf_conj_product inf_right_idem)


[STATEMENT]
lemma free_tv_ML_scheme:
  fixes sch :: type_scheme
  shows "(n : free_tv sch) = (n: set (free_tv_ML sch))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (n \<in> free_tv sch) = (n \<in> set (free_tv_ML sch))
[PROOF STEP]
by (induct sch) simp_all


[STATEMENT]
theorem not_g_secure_implies_secure:
 "\<not> (g_secure (c_process g_step g_out g_s\<^sub>0) (c_dom g_D) \<longrightarrow>
  secure (c_process g_step g_out g_s\<^sub>0) g_I (c_dom g_D))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> (g_secure (c_process g_step g_out g_s\<^sub>0) (c_dom g_D) \<longrightarrow> secure (c_process g_step g_out g_s\<^sub>0) g_I (c_dom g_D))
[PROOF STEP]
proof (simp, rule conjI, rule g_secure_counterexample)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> secure (c_process g_step g_out g_s\<^sub>0) g_I (c_dom g_D)
[PROOF STEP]
qed (rule notI, drule secure_implies_c_secure, erule contrapos_pp,
 rule not_c_secure_counterexample)


[STATEMENT]
lemma path_connected_UNIV [iff]: "path_connected (UNIV :: 'a::real_normed_vector set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. path_connected UNIV
[PROOF STEP]
by (simp add: convex_imp_path_connected)


[STATEMENT]
lemma Group_Img:"\<lbrakk>Group F; Group G; f \<in> gHom F G \<rbrakk> \<Longrightarrow> Group (Img\<^bsub>F,G\<^esub> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Group F; Group G; f \<in> gHom F G\<rbrakk> \<Longrightarrow> Group (Img\<^bsub>F,G\<^esub> f)
[PROOF STEP]
apply (frule sg_gimg [of "F" "G" "f"], assumption+,
       simp add:Gimage_def Group.Group_Gp[of "G"])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma closed_open_segment_iff [simp]:
    fixes a :: "'a::euclidean_space"  shows "closed(open_segment a b) \<longleftrightarrow> a = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (open_segment a b) = (a = b)
[PROOF STEP]
by (metis open_segment_def DiffE closure_eq closure_open_segment ends_in_segment(1) insert_iff segment_image_interval(2))


[STATEMENT]
lemma separate:
  assumes "(a,b)=chophelper (to_list v p) []"
  shows "insertion f p = sum_list [insertion f term * (f v) ^ i. (term,i)\<leftarrow>a] + sum_list [insertion f term * (f v) ^ i. (term,i)\<leftarrow>b]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>a. insertion f term * f v ^ i) + (\<Sum>(term, i)\<leftarrow>b. insertion f term * f v ^ i)
[PROOF STEP]
using to_list_insertion[of f p v]  preserve[OF assms, symmetric]
[PROOF STATE]
proof (prove)
using this:
insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
[] @ to_list v p = a @ b

goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>a. insertion f term * f v ^ i) + (\<Sum>(term, i)\<leftarrow>b. insertion f term * f v ^ i)
[PROOF STEP]
unfolding List.append.left_neutral
[PROOF STATE]
proof (prove)
using this:
insertion f p = (\<Sum>(term, i)\<leftarrow>to_list v p. insertion f term * f v ^ i)
to_list v p = a @ b

goal (1 subgoal):
 1. insertion f p = (\<Sum>(term, i)\<leftarrow>a. insertion f term * f v ^ i) + (\<Sum>(term, i)\<leftarrow>b. insertion f term * f v ^ i)
[PROOF STEP]
by (simp del: to_list.simps)