[STATEMENT]
lemma tau_meet_precong: "\<tau> x \<le> \<tau> y \<Longrightarrow> \<tau> (x \<sqinter> z) \<le> \<tau> (y \<sqinter> z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<tau> x \<le> \<tau> y \<Longrightarrow> \<tau> (x \<sqinter> z) \<le> \<tau> (y \<sqinter> z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<tau> x \<le> \<tau> y \<Longrightarrow> \<tau> (x \<sqinter> z) \<le> \<tau> (y \<sqinter> z)
[PROOF STEP]
assume "\<tau> x \<le> \<tau> y"
[PROOF STATE]
proof (state)
this:
\<tau> x \<le> \<tau> y

goal (1 subgoal):
 1. \<tau> x \<le> \<tau> y \<Longrightarrow> \<tau> (x \<sqinter> z) \<le> \<tau> (y \<sqinter> z)
[PROOF STEP]
hence "\<And>z. (x \<sqinter> y \<sqinter> z) \<cdot> 0 = (x \<sqinter> z) \<cdot> 0"
[PROOF STATE]
proof (prove)
using this:
\<tau> x \<le> \<tau> y

goal (1 subgoal):
 1. \<And>z. (x \<sqinter> y \<sqinter> z) \<cdot> (0::'a) = (x \<sqinter> z) \<cdot> (0::'a)
[PROOF STEP]
by (metis local.le_iff_inf tau_def x_zero_meet_closed)
[PROOF STATE]
proof (state)
this:
(x \<sqinter> y \<sqinter> ?z1) \<cdot> (0::'a) = (x \<sqinter> ?z1) \<cdot> (0::'a)

goal (1 subgoal):
 1. \<tau> x \<le> \<tau> y \<Longrightarrow> \<tau> (x \<sqinter> z) \<le> \<tau> (y \<sqinter> z)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(x \<sqinter> y \<sqinter> ?z1) \<cdot> (0::'a) = (x \<sqinter> ?z1) \<cdot> (0::'a)

goal (1 subgoal):
 1. \<tau> (x \<sqinter> z) \<le> \<tau> (y \<sqinter> z)
[PROOF STEP]
using local.inf_left_commute local.le_iff_inf local.meet_comm tau_def x_zero_meet_closed
[PROOF STATE]
proof (prove)
using this:
(x \<sqinter> y \<sqinter> ?z1) \<cdot> (0::'a) = (x \<sqinter> ?z1) \<cdot> (0::'a)
?x \<sqinter> (?y \<sqinter> ?z) = ?y \<sqinter> (?x \<sqinter> ?z)
(?x \<le> ?y) = (?x \<sqinter> ?y = ?x)
?x \<sqinter> ?y = ?y \<sqinter> ?x
\<tau> ?x = ?x \<cdot> (0::'a)
?x \<cdot> (0::'a) \<sqinter> ?y \<cdot> (0::'a) = (?x \<sqinter> ?y) \<cdot> (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_diff_numeral [simp]: "\<lceil>x - numeral v\<rceil> = \<lceil>x\<rceil> - numeral v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>x - numeral v\<rceil> = \<lceil>x\<rceil> - numeral v
[PROOF STEP]
using ceiling_diff_of_int [of x "numeral v"]
[PROOF STATE]
proof (prove)
using this:
\<lceil>x - of_int (numeral v)\<rceil> = \<lceil>x\<rceil> - numeral v

goal (1 subgoal):
 1. \<lceil>x - numeral v\<rceil> = \<lceil>x\<rceil> - numeral v
[PROOF STEP]
by simp


[STATEMENT]
lemma has_field_derivative_cong_eventually:
  assumes "eventually (\<lambda>x. f x = g x) (at x within S)" "f x = g x"
  shows "(f has_field_derivative u) (at x within S) = (g has_field_derivative u) (at x within S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_field_derivative u) (at x within S) = (g has_field_derivative u) (at x within S)
[PROOF STEP]
unfolding has_field_derivative_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>y. (f y - f x) / (y - x)) \<longlongrightarrow> u) (at x within S) = ((\<lambda>y. (g y - g x) / (y - x)) \<longlongrightarrow> u) (at x within S)
[PROOF STEP]
proof (rule tendsto_cong)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>\<^sub>F xa in at x within S. (f xa - f x) / (xa - x) = (g xa - g x) / (xa - x)
[PROOF STEP]
show "\<forall>\<^sub>F y in at x within S. (f y - f x) / (y - x) = (g y - g x) / (y - x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x within S. (f y - f x) / (y - x) = (g y - g x) / (y - x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at x within S. f x = g x
f x = g x

goal (1 subgoal):
 1. \<forall>\<^sub>F y in at x within S. (f y - f x) / (y - x) = (g y - g x) / (y - x)
[PROOF STEP]
by (auto elim: eventually_mono)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F y in at x within S. (f y - f x) / (y - x) = (g y - g x) / (y - x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma multiplicative_function_inverse:
  fixes f :: "nat \<Rightarrow> 'a :: field"
  assumes "multiplicative_function f"
  shows   "multiplicative_function (\<lambda>n. inverse (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function (\<lambda>n. inverse (f n))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. inverse (f 0) = (0::'a)
 2. inverse (f 1) = (1::'a)
 3. \<And>a b. \<lbrakk>1 < a; 1 < b; coprime a b\<rbrakk> \<Longrightarrow> inverse (f (a * b)) = inverse (f a) * inverse (f b)
[PROOF STEP]
interpret f: multiplicative_function f
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. multiplicative_function f
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. inverse (f 0) = (0::'a)
 2. inverse (f 1) = (1::'a)
 3. \<And>a b. \<lbrakk>1 < a; 1 < b; coprime a b\<rbrakk> \<Longrightarrow> inverse (f (a * b)) = inverse (f a) * inverse (f b)
[PROOF STEP]
show "inverse (f 0) = 0" "inverse (f 1) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse (f 0) = (0::'a) &&& inverse (f 1) = (1::'a)
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
inverse (f 0) = (0::'a)
inverse (f 1) = (1::'a)

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>1 < a; 1 < b; coprime a b\<rbrakk> \<Longrightarrow> inverse (f (a * b)) = inverse (f a) * inverse (f b)
[PROOF STEP]
fix a b :: nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>1 < a; 1 < b; coprime a b\<rbrakk> \<Longrightarrow> inverse (f (a * b)) = inverse (f a) * inverse (f b)
[PROOF STEP]
assume "a > 1" "b > 1" "coprime a b"
[PROOF STATE]
proof (state)
this:
1 < a
1 < b
coprime a b

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>1 < a; 1 < b; coprime a b\<rbrakk> \<Longrightarrow> inverse (f (a * b)) = inverse (f a) * inverse (f b)
[PROOF STEP]
thus "inverse (f (a * b)) = inverse (f a) * inverse (f b)"
[PROOF STATE]
proof (prove)
using this:
1 < a
1 < b
coprime a b

goal (1 subgoal):
 1. inverse (f (a * b)) = inverse (f a) * inverse (f b)
[PROOF STEP]
by (simp_all add: f.mult_coprime field_simps)
[PROOF STATE]
proof (state)
this:
inverse (f (a * b)) = inverse (f a) * inverse (f b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma calc_ideal_point1_mix:
  assumes "(z1, z2) = calc_ideal_point1_cvec A B" "is_real A" "(cmod B)\<^sup>2 > (cmod A)\<^sup>2"
  shows "B * cnj z1 * z2 + cnj B * z1 * cnj z2 = - 2 * A * (B * cnj B)\<^sup>2 "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * cnj z1 * z2 + cnj B * z1 * cnj z2 = - 2 * A * (B * cnj B)\<^sup>2
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B * cnj z1 * z2 + cnj B * z1 * cnj z2 = - 2 * A * (B * cnj B)\<^sup>2
[PROOF STEP]
have "B*cnj z1 + cnj B*z1 = -2*A*B*cnj B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B * cnj z1 + cnj B * z1 = - 2 * A * B * cnj B
[PROOF STEP]
using assms eq_cnj_iff_real[of A]
[PROOF STATE]
proof (prove)
using this:
(z1, z2) = calc_ideal_point1_cvec A B
is_real A
(cmod A)\<^sup>2 < (cmod B)\<^sup>2
(cnj A = A) = is_real A

goal (1 subgoal):
 1. B * cnj z1 + cnj B * z1 = - 2 * A * B * cnj B
[PROOF STEP]
by (simp, simp add: field_simps)
[PROOF STATE]
proof (state)
this:
B * cnj z1 + cnj B * z1 = - 2 * A * B * cnj B

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

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

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

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

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

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

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

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

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

goal (1 subgoal):
 1. - 2 * A * (B * cnj B) * z2 = - 2 * A * (B * cnj B)\<^sup>2
[PROOF STEP]
using complex_mult_cnj_cmod[of B]
[PROOF STATE]
proof (prove)
using this:
(z1, z2) = calc_ideal_point1_cvec A B
is_real A
(cmod A)\<^sup>2 < (cmod B)\<^sup>2
B * cnj B = cor ((cmod B)\<^sup>2)

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

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_filter_compl: "mset (filter p xs) + mset (filter (Not \<circ> p) xs) = mset xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset (filter p xs) + mset (filter (Not \<circ> p) xs) = mset xs
[PROOF STEP]
by (induction xs) (auto simp: ac_simps)


[STATEMENT]
lemma aux_comp_with_sqrt2_bis [simp]:
  shows "2^n/(sqrt(2)^n * sqrt(2)^(n+1)) = 1/sqrt 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 ^ n / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)) = 1 / sqrt 2
[PROOF STEP]
using aux_comp_with_sqrt2
[PROOF STATE]
proof (prove)
using this:
sqrt 2 ^ ?n * sqrt 2 ^ ?n = 2 ^ ?n

goal (1 subgoal):
 1. 2 ^ n / (sqrt 2 ^ n * sqrt 2 ^ (n + 1)) = 1 / sqrt 2
[PROOF STEP]
by (simp add: mult.left_commute)


[STATEMENT]
theorem arden_regexp_r:
  assumes "ro(y) = 0\<^sub>r" "x \<sim> x \<cdot>\<^sub>r y +\<^sub>r z"
  shows "x \<sim> z \<cdot>\<^sub>r y\<^sup>\<star>\<^sub>r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sim> z \<cdot>\<^sub>r y\<^sup>\<star>\<^sub>r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
ro y = 0\<^sub>r
x \<sim> x \<cdot>\<^sub>r y +\<^sub>r z

goal (1 subgoal):
 1. x \<sim> z \<cdot>\<^sub>r y\<^sup>\<star>\<^sub>r
[PROOF STEP]
by transfer (metis lan_salomaa_r.Ar lang.simps(4) lang.simps(5) lang.simps(6) rexp.distinct(1) rexp_ewp_l_ewp)


[STATEMENT]
lemma par_one_or_two_sides:
  assumes "A B ParStrict C D"
  shows "(A C TS B D \<and> B D TS A C) \<or> (A C OS B D \<and> B D OS A C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A C TS B D \<and> B D TS A C \<or> A C OS B D \<and> B D OS A C
[PROOF STEP]
by (smt Par_def assms invert_one_side l12_6 l9_31 not_col_permutation_3 os_ts1324__os par_strict_not_col_1 par_strict_not_col_2 par_two_sides_two_sides pars__os3412 two_sides_cases)


[STATEMENT]
lemma singleton_iff_atom:
  "singleton p \<longleftrightarrow> p\<noteq>0 \<and> (\<forall>x . x\<le>p \<longrightarrow> x=0 \<or> x=p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. singleton p = (p \<noteq> 0 \<and> (\<forall>x\<le>p. x = 0 \<or> x = p))
[PROOF STEP]
using singleton_nonsplit singleton_nonzero atom_is_singleton
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>singleton ?p; ?x \<le> ?p\<rbrakk> \<Longrightarrow> ?x = 0 \<or> ?x = ?p
singleton ?p \<Longrightarrow> ?p \<noteq> 0
\<lbrakk>?p \<noteq> 0; \<forall>x\<le>?p. x = 0 \<or> x = ?p\<rbrakk> \<Longrightarrow> singleton ?p

goal (1 subgoal):
 1. singleton p = (p \<noteq> 0 \<and> (\<forall>x\<le>p. x = 0 \<or> x = p))
[PROOF STEP]
by blast


[STATEMENT]
lemma MOST_iff_cofinite: "(MOST x. P x) \<longleftrightarrow> finite {x. \<not> P x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<^sub>\<infinity>x. P x) = finite {x. \<not> P x}
[PROOF STEP]
by (fact eventually_cofinite)


[STATEMENT]
lemma "((\<exists>x. A x | B x) --> ( (\<exists>x. B x) | (\<exists>x. A x)))
  = ( (\<forall>x. ~ A x & ~ B x) | ( (\<exists>x. B x) | (\<exists>x. A x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<exists>x. A x \<or> B x) \<longrightarrow> (\<exists>x. B x) \<or> (\<exists>x. A x)) = ((\<forall>x. \<not> A x \<and> \<not> B x) \<or> (\<exists>x. B x) \<or> (\<exists>x. A x))
[PROOF STEP]
by blast


[STATEMENT]
lemma all_set_conv_all_nth:
  "(\<forall>x \<in> set xs. P x) = (\<forall>i. i < length xs \<longrightarrow> P (xs ! i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<in>set xs. P x) = (\<forall>i<length xs. P (xs ! i))
[PROOF STEP]
by (auto simp add: set_conv_nth)


[STATEMENT]
lemma on_circline_conjugate_circline [simp]:
  shows "on_circline (conjugate_circline H) z \<longleftrightarrow> on_circline H (conjugate z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_circline (conjugate_circline H) z = on_circline H (conjugate z)
[PROOF STEP]
using circline_set_conjugate_circline[of H]
[PROOF STATE]
proof (prove)
using this:
circline_set (conjugate_circline H) = conjugate ` circline_set H

goal (1 subgoal):
 1. on_circline (conjugate_circline H) z = on_circline H (conjugate z)
[PROOF STEP]
unfolding circline_set_def
[PROOF STATE]
proof (prove)
using this:
Collect (on_circline (conjugate_circline H)) = conjugate ` Collect (on_circline H)

goal (1 subgoal):
 1. on_circline (conjugate_circline H) z = on_circline H (conjugate z)
[PROOF STEP]
by force


[STATEMENT]
lemma prime_elem_dvd_multD:
    "prime_elem p \<Longrightarrow> p dvd (a * b) \<Longrightarrow> p dvd a \<or> p dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime_elem p; p dvd a * b\<rbrakk> \<Longrightarrow> p dvd a \<or> p dvd b
[PROOF STEP]
by (simp add: prime_elem_def)


[STATEMENT]
lemma mono_mono_Omega_fun [simp]:
  fixes f :: "'b::order \<Rightarrow> 'a::semilattice_inf" and g :: "'c::semilattice_inf \<Rightarrow> 'a"
  shows "mono f \<Longrightarrow> mono g \<Longrightarrow> mono_mono (Omega_fun f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; mono g\<rbrakk> \<Longrightarrow> mono_mono (Omega_fun f g)
[PROOF STEP]
apply (auto simp add: mono_mono_def Omega_fun_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; mono g\<rbrakk> \<Longrightarrow> mono ((\<sqinter>) g \<circ> (\<circ>) f)
[PROOF STEP]
apply (rule mono_comp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>mono f; mono g\<rbrakk> \<Longrightarrow> mono ((\<sqinter>) g)
 2. \<lbrakk>mono f; mono g\<rbrakk> \<Longrightarrow> mono ((\<circ>) f)
[PROOF STEP]
apply (rule mono_inf_fun)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; mono g\<rbrakk> \<Longrightarrow> mono ((\<circ>) f)
[PROOF STEP]
apply (rule mono_comp_fun)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>mono f; mono g\<rbrakk> \<Longrightarrow> mono f
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma preserve_rtranclp:
  "(\<And>x y. R x y \<Longrightarrow> S (f x) (f y)) \<Longrightarrow>
   R\<^sup>*\<^sup>* x y \<Longrightarrow> S\<^sup>*\<^sup>* (f x) (f y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. R x y \<Longrightarrow> S (f x) (f y); R\<^sup>*\<^sup>* x y\<rbrakk> \<Longrightarrow> S\<^sup>*\<^sup>* (f x) (f y)
[PROOF STEP]
unfolding Nitpick.rtranclp_unfold
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y. R x y \<Longrightarrow> S (f x) (f y); x = y \<or> R\<^sup>+\<^sup>+ x y\<rbrakk> \<Longrightarrow> f x = f y \<or> S\<^sup>+\<^sup>+ (f x) (f y)
[PROOF STEP]
by (metis preserve_tranclp)


[STATEMENT]
lemma stieltjes_gamma_limit_form:
  "(\<lambda>m. of_real ((\<Sum>k=1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)))
     \<longlonglongrightarrow> (stieltjes_gamma n :: 'a :: real_normed_algebra_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
have "(\<lambda>m.  of_real ((\<Sum>k=1..m. ln (real k) ^ n / real k) - ln m ^ (n + 1) / real (n + 1)))
          \<longlonglongrightarrow> (of_real (stieltjes_gamma n) :: 'a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> of_real (stieltjes_gamma n)
[PROOF STEP]
using stieltjes_gamma_real_limit_form[of n]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. (\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1)) \<longlonglongrightarrow> stieltjes_gamma n

goal (1 subgoal):
 1. (\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> of_real (stieltjes_gamma n)
[PROOF STEP]
by (intro tendsto_of_real) (auto simp: add_ac)
[PROOF STATE]
proof (state)
this:
(\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> of_real (stieltjes_gamma n)

goal (1 subgoal):
 1. (\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> of_real (stieltjes_gamma n)

goal (1 subgoal):
 1. (\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> stieltjes_gamma n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>m. of_real ((\<Sum>k = 1..m. ln (real k) ^ n / real k) - ln (real m) ^ (n + 1) / real (n + 1))) \<longlonglongrightarrow> stieltjes_gamma n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma finite_set_ins_swap:
  assumes "finite A"
  shows "max a (Max (Set.insert b A)) = max b (Max (Set.insert a A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. max a (Max (insert b A)) = max b (Max (insert a A))
[PROOF STEP]
using Max_insert assms max.commute max.left_commute
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?A; ?A \<noteq> {}\<rbrakk> \<Longrightarrow> Max (insert ?x ?A) = max ?x (Max ?A)
finite A
max ?a ?b = max ?b ?a
max ?b (max ?a ?c) = max ?a (max ?b ?c)

goal (1 subgoal):
 1. max a (Max (insert b A)) = max b (Max (insert a A))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma ordinal_minus_le_eq [simp]:
"(x - y \<le> z) = (x \<le> y + (z::ordinal))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x - y \<le> z) = (x \<le> y + z)
[PROOF STEP]
apply (rule_tac x=x and y=y in linorder_le_cases)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. x \<le> y \<Longrightarrow> (x - y \<le> z) = (x \<le> y + z)
 2. y \<le> x \<Longrightarrow> (x - y \<le> z) = (x \<le> y + z)
[PROOF STEP]
apply (simp, erule order_trans, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x \<Longrightarrow> (x - y \<le> z) = (x \<le> y + z)
[PROOF STEP]
apply (subgoal_tac "(x - y \<le> z) = (y + (x - y) \<le> y + z)", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y \<le> x \<Longrightarrow> (x - y \<le> z) = (y + (x - y) \<le> y + z)
[PROOF STEP]
apply (simp only: ordinal_plus_left_cancel_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma minus_left: "prod (- a) b = - prod a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - a ** b = - (a ** b)
[PROOF STEP]
by (rule additive.minus [OF additive_left])


[STATEMENT]
lemma decomp_mset:
  "(\<Sum>x\<in>set_mset R. replicate_mset (count R x) x) = R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>set_mset R. replicate_mset (count R x) x) = R
[PROOF STEP]
by (rule multiset_eqI, simp add:count_sum count_eq_zero_iff)


[STATEMENT]
lemma has_integral_unique_cbox:
  fixes f :: "'n::euclidean_space \<Rightarrow> 'a::real_normed_vector"
  shows "(f has_integral k1) (cbox a b) \<Longrightarrow> (f has_integral k2) (cbox a b) \<Longrightarrow> k1 = k2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_integral k1) (cbox a b); (f has_integral k2) (cbox a b)\<rbrakk> \<Longrightarrow> k1 = k2
[PROOF STEP]
by (auto simp: has_integral_cbox intro: tendsto_unique[OF division_filter_not_empty])


[STATEMENT]
lemma size_greater_than_median_of_medians:
  "size {#y \<in># mset xs. y > M#} \<le> nat \<lceil>0.7 * length xs + 3\<rceil>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. size (filter_mset ((<) M) (mset xs)) \<le> nat \<lceil>7 / 10 * real (length xs) + 3\<rceil>
[PROOF STEP]
using size_median_of_medians_aux[of "(>)"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x y. y < x) \<in> {(<), \<lambda>x y. y < x} \<Longrightarrow> size (filter_mset ((<) M) (mset xs)) \<le> nat \<lceil>7 / 10 * real (length xs) + 3\<rceil>

goal (1 subgoal):
 1. size (filter_mset ((<) M) (mset xs)) \<le> nat \<lceil>7 / 10 * real (length xs) + 3\<rceil>
[PROOF STEP]
by simp


[STATEMENT]
lemma tensor_unpack_fstfst: \<open>fst (tensor_unpack A B (fst (tensor_unpack (A * B) C i)))
     = fst (tensor_unpack A (B * C) i)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (tensor_unpack A B (fst (tensor_unpack (A * B) C i))) = fst (tensor_unpack A (B * C) i)
[PROOF STEP]
unfolding tensor_unpack_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fst (fst (i div C, i mod C) div B, fst (i div C, i mod C) mod B) = fst (i div (B * C), i mod (B * C))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i div C div B = i div (B * C)
[PROOF STEP]
by (metis div_mult2_eq mult.commute)


[STATEMENT]
lemma M_M_pow_is_M: "n \<noteq> 0 \<Longrightarrow> p > 1 \<Longrightarrow> poly_mod.M p (poly_mod.M (p^n) f)
  = poly_mod.M p f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>n \<noteq> 0; 1 < p\<rbrakk> \<Longrightarrow> poly_mod.M p (poly_mod.M (p ^ n) f) = poly_mod.M p f
[PROOF STEP]
using Mp_Mp_pow_is_Mp[of n p "[:f:]"]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>n \<noteq> 0; 1 < p\<rbrakk> \<Longrightarrow> poly_mod.Mp p (poly_mod.Mp (p ^ n) [:f:]) = poly_mod.Mp p [:f:]

goal (1 subgoal):
 1. \<lbrakk>n \<noteq> 0; 1 < p\<rbrakk> \<Longrightarrow> poly_mod.M p (poly_mod.M (p ^ n) f) = poly_mod.M p f
[PROOF STEP]
by (metis coeff_pCons_0 poly_mod.Mp_coeff)


[STATEMENT]
lemma vector_derivative_unique_within_closed_interval:
  assumes ab: "a < b" "x \<in> cbox a b"
  assumes D: "(f has_vector_derivative f') (at x within cbox a b)" "(f has_vector_derivative f'') (at x within cbox a b)"
  shows "f' = f''"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f' = f''
[PROOF STEP]
using ab
[PROOF STATE]
proof (prove)
using this:
a < b
x \<in> cbox a b

goal (1 subgoal):
 1. f' = f''
[PROOF STEP]
by (intro vector_derivative_unique_within[OF _ D])
     (auto simp: trivial_limit_within intro!: islimpt_closure_open[where s="{a <..< b}"])


[STATEMENT]
lemma Nset_pre1:"{i. i \<le> (Suc n)} - {Suc n} = {i. i \<le> n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i \<le> Suc n} - {Suc n} = {i. i \<le> n}
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. {i. i \<le> Suc n} - {Suc n} \<subseteq> {i. i \<le> n}
 2. {i. i \<le> n} \<subseteq> {i. i \<le> Suc n} - {Suc n}
[PROOF STEP]
apply (rule subsetI, simp)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma All_Ex_refl_eq2 [simp]: "(\<forall>x. (\<exists>b. x = f b \<and> Q b) \<longrightarrow> P x) = (\<forall>b. Q b \<longrightarrow> P (f b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. (\<exists>b. x = f b \<and> Q b) \<longrightarrow> P x) = (\<forall>b. Q b \<longrightarrow> P (f b))
[PROOF STEP]
by auto


[STATEMENT]
lemma (in Ring) ideals_set_sum:"\<lbrakk>ideal R A; ideal R B; x \<in> A \<minusplus> B\<rbrakk> \<Longrightarrow>
             \<exists>h\<in>A. \<exists>k\<in>B. x = h \<plusminus> k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; ideal R B; x \<in> A \<minusplus> B\<rbrakk> \<Longrightarrow> \<exists>h\<in>A. \<exists>k\<in>B. x = h \<plusminus> k
[PROOF STEP]
apply (frule ideal_subset1[of A],
       frule ideal_subset1[of B])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; ideal R B; x \<in> A \<minusplus> B; A \<subseteq> carrier R; B \<subseteq> carrier R\<rbrakk> \<Longrightarrow> \<exists>h\<in>A. \<exists>k\<in>B. x = h \<plusminus> k
[PROOF STEP]
apply (cut_tac ring_is_ag,
       simp add:aGroup.set_sum)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma product_nodes_card_strong[intro]:
      assumes "alphabet\<^sub>1 A = alphabet\<^sub>2 B"
      shows "card (c.nodes (product A B)) \<le> card (a.nodes A) * card (b.nodes B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
proof (cases "finite (a.nodes A) \<and> finite (b.nodes B)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite (a.nodes' A) \<and> finite (b.nodes' B) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
 2. \<not> (finite (a.nodes' A) \<and> finite (b.nodes' B)) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite (a.nodes' A) \<and> finite (b.nodes' B)

goal (2 subgoals):
 1. finite (a.nodes' A) \<and> finite (b.nodes' B) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
 2. \<not> (finite (a.nodes' A) \<and> finite (b.nodes' B)) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
finite (a.nodes' A) \<and> finite (b.nodes' B)

goal (1 subgoal):
 1. card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)

goal (1 subgoal):
 1. \<not> (finite (a.nodes' A) \<and> finite (b.nodes' B)) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (finite (a.nodes' A) \<and> finite (b.nodes' B)) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (finite (a.nodes' A) \<and> finite (b.nodes' B))

goal (1 subgoal):
 1. \<not> (finite (a.nodes' A) \<and> finite (b.nodes' B)) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
have 1: "card (c.nodes (product A B)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (c.nodes' (product A B)) = 0
[PROOF STEP]
using False assms
[PROOF STATE]
proof (prove)
using this:
\<not> (finite (a.nodes' A) \<and> finite (b.nodes' B))
alphabet\<^sub>1 A = alphabet\<^sub>2 B

goal (1 subgoal):
 1. card (c.nodes' (product A B)) = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (c.nodes' (product A B)) = 0

goal (1 subgoal):
 1. \<not> (finite (a.nodes' A) \<and> finite (b.nodes' B)) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
have 2: "card (a.nodes A) * card (b.nodes B) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (a.nodes' A) * card (b.nodes' B) = 0
[PROOF STEP]
using False
[PROOF STATE]
proof (prove)
using this:
\<not> (finite (a.nodes' A) \<and> finite (b.nodes' B))

goal (1 subgoal):
 1. card (a.nodes' A) * card (b.nodes' B) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card (a.nodes' A) * card (b.nodes' B) = 0

goal (1 subgoal):
 1. \<not> (finite (a.nodes' A) \<and> finite (b.nodes' B)) \<Longrightarrow> card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
using 1 2
[PROOF STATE]
proof (prove)
using this:
card (c.nodes' (product A B)) = 0
card (a.nodes' A) * card (b.nodes' B) = 0

goal (1 subgoal):
 1. card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
card (c.nodes' (product A B)) \<le> card (a.nodes' A) * card (b.nodes' B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integrable_on_exp_minus_to_infinity: "a > 0 \<Longrightarrow> (\<lambda>x. exp (-a*x) :: real) integrable_on {c..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. exp (- a * x)) integrable_on {c..}
[PROOF STEP]
using has_integral_exp_minus_to_infinity[of a c]
[PROOF STATE]
proof (prove)
using this:
0 < a \<Longrightarrow> ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> (\<lambda>x. exp (- a * x)) integrable_on {c..}
[PROOF STEP]
unfolding integrable_on_def
[PROOF STATE]
proof (prove)
using this:
0 < a \<Longrightarrow> ((\<lambda>x. exp (- a * x)) has_integral exp (- a * c) / a) {c..}

goal (1 subgoal):
 1. 0 < a \<Longrightarrow> \<exists>y. ((\<lambda>x. exp (- a * x)) has_integral y) {c..}
[PROOF STEP]
by blast


[STATEMENT]
lemma set_rel_converse[simp]: "(\<langle>A\<rangle> set_rel)\<inverse> = \<langle>A\<inverse>\<rangle> set_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>A\<rangle>set_rel)\<inverse> = \<langle>A\<inverse>\<rangle>set_rel
[PROOF STEP]
unfolding set_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(Aa, B). (\<forall>x\<in>Aa. \<exists>y\<in>B. (x, y) \<in> A) \<and> (\<forall>y\<in>B. \<exists>x\<in>Aa. (x, y) \<in> A)}\<inverse> = {(Aa, B). (\<forall>x\<in>Aa. \<exists>y\<in>B. (x, y) \<in> A\<inverse>) \<and> (\<forall>y\<in>B. \<exists>x\<in>Aa. (x, y) \<in> A\<inverse>)}
[PROOF STEP]
by auto


[STATEMENT]
lemma addfunsetD_add :
  "\<lbrakk> f \<in> addfunset A M; x\<in>A; y\<in>A \<rbrakk> \<Longrightarrow> f (x+y) = f x + f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> addfunset A M; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> f (x + y) = f x + f y
[PROOF STEP]
unfolding addfunset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> {f. supp f \<subseteq> A \<and> range f \<subseteq> M \<and> (\<forall>x\<in>A. \<forall>y\<in>A. f (x + y) = f x + f y)}; x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> f (x + y) = f x + f y
[PROOF STEP]
by fast


[STATEMENT]
lemma finite_set_of_finite_funs2:
  fixes A :: "'a set"
    and B :: "'b set"
    and C :: "'c set"
    and d :: "'c"
  assumes "finite A"
    and "finite B"
    and "finite C"
  shows "finite {f. \<forall>x. \<forall>y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
let ?S = "{f. \<forall>x. \<forall>y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
let ?R = "{g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
let ?Q = "{f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> ?R) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
from finite_set_of_finite_funs[OF assms(2,3)]
[PROOF STATE]
proof (chain)
picking this:
finite {f. \<forall>x. (x \<in> B \<longrightarrow> f x \<in> C) \<and> (x \<notin> B \<longrightarrow> f x = ?d)}
[PROOF STEP]
have "finite ?R"
[PROOF STATE]
proof (prove)
using this:
finite {f. \<forall>x. (x \<in> B \<longrightarrow> f x \<in> C) \<and> (x \<notin> B \<longrightarrow> f x = ?d)}

goal (1 subgoal):
 1. finite {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}

goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
from finite_set_of_finite_funs[OF assms(1) this, of "\<lambda> y. d"]
[PROOF STATE]
proof (chain)
picking this:
finite {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}
[PROOF STEP]
have "finite ?Q"
[PROOF STATE]
proof (prove)
using this:
finite {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}

goal (1 subgoal):
 1. finite {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}

goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}

goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
have "?S = ?Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)} = {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}
[PROOF STEP]
by auto (case_tac "xa \<in> A", auto)
[PROOF STATE]
proof (state)
this:
{f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)} = {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}

goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}
{f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)} = {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}
{f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)} = {f. \<forall>x. (x \<in> A \<longrightarrow> f x \<in> {g. \<forall>x. (x \<in> B \<longrightarrow> g x \<in> C) \<and> (x \<notin> B \<longrightarrow> g x = d)}) \<and> (x \<notin> A \<longrightarrow> f x = (\<lambda>y. d))}

goal (1 subgoal):
 1. finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {f. \<forall>x y. (x \<in> A \<and> y \<in> B \<longrightarrow> f x y \<in> C) \<and> (x \<notin> A \<longrightarrow> f x y = d) \<and> (y \<notin> B \<longrightarrow> f x y = d)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gr0_imp_self_le_mult1: "0 < (k::nat) \<Longrightarrow> m \<le> m * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < k \<Longrightarrow> m \<le> m * k
[PROOF STEP]
by (drule Suc_leI, drule mult_le_mono[OF order_refl], simp)


[STATEMENT]
lemma echelon_form_condition1:
  assumes r: "echelon_form A"
  shows "(\<forall>i. is_zero_row i A \<longrightarrow> \<not> (\<exists>j. j>i \<and> \<not> is_zero_row j A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i. is_zero_row i A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row j A)
[PROOF STEP]
using r
[PROOF STATE]
proof (prove)
using this:
echelon_form A

goal (1 subgoal):
 1. \<forall>i. is_zero_row i A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row j A)
[PROOF STEP]
unfolding echelon_form_def
[PROOF STATE]
proof (prove)
using this:
echelon_form_upt_k A (ncols A)

goal (1 subgoal):
 1. \<forall>i. is_zero_row i A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row j A)
[PROOF STEP]
by (metis echelon_form_upt_k_condition1' is_zero_row_def)


[STATEMENT]
lemma set_plus_elim:
  assumes "x \<in> A + B"
  obtains a b where "x = a + b" and "a \<in> A" and "b \<in> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = a + b; a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> A + B

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = a + b; a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding set_plus_def
[PROOF STATE]
proof (prove)
using this:
x \<in> {c. \<exists>a\<in>A. \<exists>b\<in>B. c = a + b}

goal (1 subgoal):
 1. (\<And>a b. \<lbrakk>x = a + b; a \<in> A; b \<in> B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fast


[STATEMENT]
theorem exp_cf3_upper_bound_pos: "0 \<le> x \<Longrightarrow> numer_cf3 (-x) > 0 \<Longrightarrow> exp x \<le> exp_cf3 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 < numer_cf3 (- x)\<rbrakk> \<Longrightarrow> exp x \<le> exp_cf3 x
[PROOF STEP]
using ln_exp_cf3_upper_bound_nonneg [of x] exp_cf3_pos [of x] numer_cf3_pos [of x]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 \<le> x; 0 < numer_cf3 (- x)\<rbrakk> \<Longrightarrow> x \<le> ln (exp_cf3 x)
\<lbrakk>0 < numer_cf3 x; 0 < numer_cf3 (- x)\<rbrakk> \<Longrightarrow> 0 < exp_cf3 x
- (464 / 10\<^sup>2) \<le> x \<Longrightarrow> 0 < numer_cf3 x

goal (1 subgoal):
 1. \<lbrakk>0 \<le> x; 0 < numer_cf3 (- x)\<rbrakk> \<Longrightarrow> exp x \<le> exp_cf3 x
[PROOF STEP]
by auto (metis exp_le_cancel_iff exp_ln_iff)


[STATEMENT]
lemma reduction_subsets_is_get_subsets_R: "reduction_subsets_R p qs signs subsets m =  get_subsets_R (reduce_system_R p (qs, (m, (subsets, signs))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduction_subsets_R p qs signs subsets m = get_subsets_R (reduce_system_R p (qs, m, subsets, signs))
[PROOF STEP]
unfolding reduction_subsets_R_def get_subsets_R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_indices subsets (rows_to_keep (reduce_mat_cols m (solve_for_lhs_R p qs subsets m))) = fst (snd (reduce_system_R p (qs, m, subsets, signs)))
[PROOF STEP]
using reduce_system.simps reduction_step.elims fst_conv snd_conv
[PROOF STATE]
proof (prove)
using this:
reduce_system ?p (?qs, ?m, ?subs, ?signs) = reduction_step ?m ?signs ?subs (solve_for_lhs ?p ?qs ?subs ?m)
\<lbrakk>reduction_step ?x ?xa ?xb ?xc = ?y; \<And>A signs subsets lhs_vec. \<lbrakk>?x = A; ?xa = signs; ?xb = subsets; ?xc = lhs_vec; ?y = (let reduce_cols_A = reduce_mat_cols A lhs_vec; rows_keep = rows_to_keep reduce_cols_A in (take_rows_from_matrix reduce_cols_A rows_keep, take_indices subsets rows_keep, take_indices signs (find_nonzeros_from_input_vec lhs_vec)))\<rbrakk> \<Longrightarrow> ?P\<rbrakk> \<Longrightarrow> ?P
fst (?x1.0, ?x2.0) = ?x1.0
snd (?x1.0, ?x2.0) = ?x2.0

goal (1 subgoal):
 1. take_indices subsets (rows_to_keep (reduce_mat_cols m (solve_for_lhs_R p qs subsets m))) = fst (snd (reduce_system_R p (qs, m, subsets, signs)))
[PROOF STEP]
by (metis reduce_system_R.simps reduction_step_R.simps)


[STATEMENT]
lemma cindependent_implies_independent:
  assumes "cindependent (S::'a::complex_vector set)"
  shows "independent S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. independent S
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
cindependent S

goal (1 subgoal):
 1. independent S
[PROOF STEP]
unfolding dependent_def complex_vector.dependent_def
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>a\<in>S. a \<in> cspan (S - {a}))

goal (1 subgoal):
 1. \<not> (\<exists>a\<in>S. a \<in> span (S - {a}))
[PROOF STEP]
using span_subset_cspan
[PROOF STATE]
proof (prove)
using this:
\<not> (\<exists>a\<in>S. a \<in> cspan (S - {a}))
span ?A \<subseteq> cspan ?A

goal (1 subgoal):
 1. \<not> (\<exists>a\<in>S. a \<in> span (S - {a}))
[PROOF STEP]
by blast


[STATEMENT]
lemma Basis_list_vec3: "Basis_list = [axis 0 1::real^3, axis 1 1, axis 2 1]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Basis_list = [axis 0 1, axis 1 1, axis 2 1]
[PROOF STEP]
by (auto simp: Basis_list_vec_def Basis_list_real_def)


[STATEMENT]
lemma matrix_scaleR_vector_ac:
  fixes A :: "real^('m::finite)^'n"
  shows "A *v (k *\<^sub>R v) = k *\<^sub>R A *v v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A *v k *\<^sub>R v = k *\<^sub>R A *v v
[PROOF STEP]
by (metis matrix_vector_mult_scaleR transpose_scalar vector_scaleR_matrix_ac vector_transpose_matrix)


[STATEMENT]
lemma set_bubblesort: "set (bubblesort xs) = set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (bubblesort xs) = set xs
[PROOF STEP]
by(rule mset_bubblesort[THEN mset_eq_setD])


[STATEMENT]
lemma inverse_squares_sums': "(\<lambda>n. 1 / real n ^ 2) sums (pi ^ 2 / 6)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. 1 / (real n)\<^sup>2) sums (pi\<^sup>2 / 6)
[PROOF STEP]
using inverse_squares_sums sums_Suc_iff[of "\<lambda>n. 1 / real n ^ 2" "pi^2 / 6"]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>n. 1 / real ((n + 1)\<^sup>2)) sums (pi\<^sup>2 / 6)
(\<lambda>n. 1 / (real (Suc n))\<^sup>2) sums (pi\<^sup>2 / 6) = (\<lambda>n. 1 / (real n)\<^sup>2) sums (pi\<^sup>2 / 6 + 1 / (real 0)\<^sup>2)

goal (1 subgoal):
 1. (\<lambda>n. 1 / (real n)\<^sup>2) sums (pi\<^sup>2 / 6)
[PROOF STEP]
by simp


[STATEMENT]
theorem ln_upper_13: "0<x \<Longrightarrow> ln(x) \<le> ln_upper_13 x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < x \<Longrightarrow> ln x \<le> ln_upper_13 x
[PROOF STEP]
by (metis le_less_linear less_eq_real_def ln_upper_13_neg ln_upper_13_pos)


[STATEMENT]
lemma wens_unfold:
     "wens F act B = (wp act B \<inter> awp F (B \<union> wens F act B)) \<union> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wens F act B = wp act B \<inter> awp F (B \<union> wens F act B) \<union> B
[PROOF STEP]
apply (simp add: wens_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gfp (\<lambda>X. wp act B \<inter> awp F (B \<union> X) \<union> B) = wp act B \<inter> awp F (B \<union> gfp (\<lambda>X. wp act B \<inter> awp F (B \<union> X) \<union> B)) \<union> B
[PROOF STEP]
apply (rule gfp_unfold)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mono (\<lambda>X. wp act B \<inter> awp F (B \<union> X) \<union> B)
[PROOF STEP]
apply (simp add: mono_def wp_def awp_def, blast)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma iter_tensor_of_H_fst_pos:
  fixes n i j:: nat
  assumes "i < 2^n \<or> j < 2^n" and "i < 2^(n+1) \<and> j < 2^(n+1)"
  shows "(H^\<^sub>\<otimes> (Suc n)) $$ (i,j) = 1/sqrt(2) * ((H^\<^sub>\<otimes> n) $$ (i mod 2^n, j mod 2^n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real (1 / sqrt 2) * Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)) $$ (i mod 2 ^ n, j mod 2 ^ n)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real (1 / sqrt 2) * Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)) $$ (i mod 2 ^ n, j mod 2 ^ n)
[PROOF STEP]
have "(H^\<^sub>\<otimes> (Suc n)) $$ (i,j) = (-1)^(bip i (Suc n) j)/(sqrt 2)^(Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real ((- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < 2 ^ n \<or> j < 2 ^ n
i < 2 ^ (n + 1) \<and> j < 2 ^ (n + 1)

goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real ((- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real ((- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)

goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real (1 / sqrt 2) * Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)) $$ (i mod 2 ^ n, j mod 2 ^ n)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real ((- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)

goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real (1 / sqrt 2) * Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)) $$ (i mod 2 ^ n, j mod 2 ^ n)
[PROOF STEP]
have "bip i (Suc n) j = bip (i mod 2^n) n (j mod 2^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
using bitwise_inner_prod_fst_el_0 assms(1)
[PROOF STATE]
proof (prove)
using this:
?i < 2 ^ ?n \<or> ?j < 2 ^ ?n \<Longrightarrow> ?i \<cdot>\<^bsub>Suc ?n\<^esub>  ?j = ?i mod 2 ^ ?n \<cdot>\<^bsub>?n\<^esub>  ?j mod 2 ^ ?n
i < 2 ^ n \<or> j < 2 ^ n

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n

goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real (1 / sqrt 2) * Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)) $$ (i mod 2 ^ n, j mod 2 ^ n)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real ((- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)
i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real ((- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)
i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n

goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real (1 / sqrt 2) * Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)) $$ (i mod 2 ^ n, j mod 2 ^ n)
[PROOF STEP]
using bitwise_inner_prod_def
[PROOF STATE]
proof (prove)
using this:
Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real ((- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)
i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
?i \<cdot>\<^bsub>?n\<^esub>  ?j = (\<Sum>k = 0..<?n. bin_rep ?n ?i ! k * bin_rep ?n ?j ! k)

goal (1 subgoal):
 1. Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real (1 / sqrt 2) * Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)) $$ (i mod 2 ^ n, j mod 2 ^ n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Matrix.mat (2 ^ Suc n) (2 ^ Suc n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>Suc n\<^esub>  j / sqrt 2 ^ Suc n)) $$ (i, j) = complex_of_real (1 / sqrt 2) * Matrix.mat (2 ^ n) (2 ^ n) (\<lambda>x. complex_of_real (case x of (i, j) \<Rightarrow> (- 1) ^ i \<cdot>\<^bsub>n\<^esub>  j / sqrt 2 ^ n)) $$ (i mod 2 ^ n, j mod 2 ^ n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rtrancl_mapI: "(a,b)\<in>E\<^sup>* \<Longrightarrow> (f a, f b)\<in>(pairself f `E)\<^sup>*"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a, b) \<in> E\<^sup>* \<Longrightarrow> (f a, f b) \<in> (pairself f ` E)\<^sup>*
[PROOF STEP]
apply (induction rule: rtrancl_induct)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (f a, f a) \<in> (pairself f ` E)\<^sup>*
 2. \<And>y z. \<lbrakk>(a, y) \<in> E\<^sup>*; (y, z) \<in> E; (f a, f y) \<in> (pairself f ` E)\<^sup>*\<rbrakk> \<Longrightarrow> (f a, f z) \<in> (pairself f ` E)\<^sup>*
[PROOF STEP]
apply (force intro: rtrancl.intros)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma indirect_eq: "(\<And>z. x \<le> z \<longleftrightarrow> y \<le> z) \<Longrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>z. (x \<le> z) = (y \<le> z)) \<Longrightarrow> x = y
[PROOF STEP]
by (metis order.eq_iff)


[STATEMENT]
lemma card_singletons_eq: "card {{a} | a . a \<in> A} = card A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {{a} |a. a \<in> A} = card A
[PROOF STEP]
by (simp add: card_image Setcompr_eq_image)


[STATEMENT]
lemma sets_pre_sigma: "stopping_time F T \<Longrightarrow> sets (pre_sigma T) = {A. \<forall>t. {\<omega>\<in>A. T \<omega> \<le> t} \<in> sets (F t)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stopping_time F T \<Longrightarrow> sets (pre_sigma T) = {A. \<forall>t. {\<omega> \<in> A. T \<omega> \<le> t} \<in> sets (F t)}
[PROOF STEP]
unfolding pre_sigma_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. stopping_time F T \<Longrightarrow> sets (sigma \<Omega> {A. \<forall>t. {\<omega> \<in> A. T \<omega> \<le> t} \<in> sets (F t)}) = {A. \<forall>t. {\<omega> \<in> A. T \<omega> \<le> t} \<in> sets (F t)}
[PROOF STEP]
by (rule sigma_algebra.sets_measure_of_eq[OF sigma_algebra_pre_sigma])


[STATEMENT]
lemma mono_set_mult: "\<lbrakk> H \<subseteq> H'; K \<subseteq> K' \<rbrakk> \<Longrightarrow> H <#>\<^bsub>G\<^esub> K \<subseteq> H' <#>\<^bsub>G\<^esub> K'" \<^marker>\<open>contributor \<open>Paulo Em?lio de Vilhena\<close>\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> H'; K \<subseteq> K'\<rbrakk> \<Longrightarrow> H <#>\<^bsub>G\<^esub> K \<subseteq> H' <#>\<^bsub>G\<^esub> K'
[PROOF STEP]
unfolding set_mult_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> H'; K \<subseteq> K'\<rbrakk> \<Longrightarrow> (\<Union>h\<in>H. \<Union>k\<in>K. {h \<otimes>\<^bsub>G\<^esub> k}) \<subseteq> (\<Union>h\<in>H'. \<Union>k\<in>K'. {h \<otimes>\<^bsub>G\<^esub> k})
[PROOF STEP]
by (simp add: UN_mono)


[STATEMENT]
lemma lower_asymptotic_density_le_upper:
  "lower_asymptotic_density A \<le> upper_asymptotic_density A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lower_asymptotic_density A \<le> upper_asymptotic_density A
[PROOF STEP]
using lower_asymptotic_density_in_01(1) upper_asymptotic_density_in_01(1)
[PROOF STATE]
proof (prove)
using this:
ereal (lower_asymptotic_density ?A) = liminf (\<lambda>x. ereal (real (card (?A \<inter> {..<x})) / real x))
ereal (upper_asymptotic_density ?A) = limsup (\<lambda>x. ereal (real (card (?A \<inter> {..<x})) / real x))

goal (1 subgoal):
 1. lower_asymptotic_density A \<le> upper_asymptotic_density A
[PROOF STEP]
by (metis (mono_tags, lifting) Liminf_le_Limsup ereal_less_eq(3) sequentially_bot)


[STATEMENT]
theorem insert_correct:
  assumes I: "invar q"
  shows
  "invar (insert e a q)"
  "queue_to_multiset (insert e a q) = queue_to_multiset q + {# (e,a) #}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invar (local.insert e a q) &&& queue_to_multiset (local.insert e a q) = queue_to_multiset q + {#(e, a)#}
[PROOF STEP]
using insert_mset[of q] insert_invar[of q] I
[PROOF STATE]
proof (prove)
using this:
queue_invar q \<Longrightarrow> queue_to_multiset (local.insert ?e ?a q) = queue_to_multiset q + {#(?e, ?a)#}
invar q \<Longrightarrow> invar (local.insert ?e ?a q)
invar q

goal (1 subgoal):
 1. invar (local.insert e a q) &&& queue_to_multiset (local.insert e a q) = queue_to_multiset q + {#(e, a)#}
[PROOF STEP]
unfolding invar_def
[PROOF STATE]
proof (prove)
using this:
queue_invar q \<Longrightarrow> queue_to_multiset (local.insert ?e ?a q) = queue_to_multiset q + {#(?e, ?a)#}
queue_invar q \<and> rank_skew_invar q \<Longrightarrow> queue_invar (local.insert ?e ?a q) \<and> rank_skew_invar (local.insert ?e ?a q)
queue_invar q \<and> rank_skew_invar q

goal (1 subgoal):
 1. queue_invar (local.insert e a q) \<and> rank_skew_invar (local.insert e a q) &&& queue_to_multiset (local.insert e a q) = queue_to_multiset q + {#(e, a)#}
[PROOF STEP]
by simp_all


[STATEMENT]
lemma ord_zero_less_diff: "(0 < (b::'a::ordered_ab_group_add) - a) = (a < b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((0::'a) < b - a) = (a < b)
[PROOF STEP]
by (simp add: less_diff_eq)


[STATEMENT]
lemma split_all_conj: "(\<forall>x. P x \<and> Q x) = ((\<forall>x. P x) \<and> (\<forall>x. Q x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. P x \<and> Q x) = ((\<forall>x. P x) \<and> (\<forall>x. Q x))
[PROOF STEP]
by blast


[STATEMENT]
lemma can_merge_by_suffix_code[code] :
  "can_merge_by_suffix x x1 x2 =
    (ts.bex x
      (\<lambda> ys . ts.bex x1
        (\<lambda> ys1 . is_prefix ys ys1 \<and>
                 (let ys'' = (drop (length ys) ys1)
                   in ts.bex x (\<lambda> ys' . ts.memb (ys'@ys'') x2)))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. can_merge_by_suffix x x1 x2 = ts.bex x (\<lambda>ys. ts.bex x1 (\<lambda>ys1. is_prefix ys ys1 \<and> (let ys'' = drop (length ys) ys1 in ts.bex x (\<lambda>ys'. ts.memb (ys' @ ys'') x2))))
[PROOF STEP]
unfolding can_merge_by_suffix.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<alpha> \<beta> \<gamma>. ts.memb \<alpha> x \<and> ts.memb \<beta> x \<and> ts.memb (\<alpha> @ \<gamma>) x1 \<and> ts.memb (\<beta> @ \<gamma>) x2) = ts.bex x (\<lambda>ys. ts.bex x1 (\<lambda>ys1. is_prefix ys ys1 \<and> (let ys'' = drop (length ys) ys1 in ts.bex x (\<lambda>ys'. ts.memb (ys' @ ys'') x2))))
[PROOF STEP]
unfolding ts.memb_correct[OF ts.invar]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<alpha>' \<beta> \<gamma>. \<alpha>' \<in> ts.\<alpha> x \<and> \<beta> \<in> ts.\<alpha> x \<and> \<alpha>' @ \<gamma> \<in> ts.\<alpha> x1 \<and> \<beta> @ \<gamma> \<in> ts.\<alpha> x2) = ts.bex x (\<lambda>ys. ts.bex x1 (\<lambda>ys1. is_prefix ys ys1 \<and> (let ys'' = drop (length ys) ys1 in ts.bex x (\<lambda>ys'. ys' @ ys'' \<in> ts.\<alpha> x2))))
[PROOF STEP]
unfolding ts.bex_correct[OF ts.invar] Let_def is_prefix_prefix
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>\<alpha>' \<beta> \<gamma>. \<alpha>' \<in> ts.\<alpha> x \<and> \<beta> \<in> ts.\<alpha> x \<and> \<alpha>' @ \<gamma> \<in> ts.\<alpha> x1 \<and> \<beta> @ \<gamma> \<in> ts.\<alpha> x2) = (\<exists>ys\<in>ts.\<alpha> x. \<exists>ys1\<in>ts.\<alpha> x1. (\<exists>xs'. ys1 = ys @ xs') \<and> (\<exists>ys'\<in>ts.\<alpha> x. ys' @ drop (length ys) ys1 \<in> ts.\<alpha> x2))
[PROOF STEP]
by force


[STATEMENT]
lemma three_divs_1:
  fixes D :: "nat \<Rightarrow> nat"
  shows "3 dvd (\<Sum>x<nd. D x * (10^x - 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * (10 ^ x - 1))
[PROOF STEP]
by (subst mult.commute, rule div_sum) (simp add: three_divs_0 [simplified])


[STATEMENT]
lemma card_permutations_of_set [simp]:
  "finite A \<Longrightarrow> card (permutations_of_set A) = fact (card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A \<Longrightarrow> card (permutations_of_set A) = fact (card A)
[PROOF STEP]
by (simp add: permutations_of_set_altdef card_permutations_of_multiset del: One_nat_def)


[STATEMENT]
lemma some_neq_not_eq [simp]: "\<not>((SOME x :: nat. x \<noteq> i) = i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (SOME x. x \<noteq> i) \<noteq> i
[PROOF STEP]
by (subst some_eq_ex) (metis zero_neq_numeral)


[STATEMENT]
lemma nn_set_integral_mono:
  assumes [measurable]: "f \<in> borel_measurable M" "g \<in> borel_measurable M"
          "A \<in> sets M"
      and "AE x\<in>A in M. f x \<le> g x"
  shows "(\<integral>\<^sup>+x \<in> A. f x \<partial>M) \<le> (\<integral>\<^sup>+x \<in> A. g x \<partial>M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_nn_integral M A f \<le> set_nn_integral M A g
[PROOF STEP]
by (auto intro!: nn_integral_mono_AE split: split_indicator simp: assms)


[STATEMENT]
lemma rev_sub_mult:
  assumes "g \<in> carrier P"
  assumes "f \<in> carrier P"
  assumes "h \<in>carrier P"
  shows "rev_sub g (f \<otimes>\<^bsub>P\<^esub> h) = (rev_sub g f) \<otimes>\<^bsub>P\<^esub> (rev_sub g h)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rev_compose R g (f \<otimes>\<^bsub>P\<^esub> h) = rev_compose R g f \<otimes>\<^bsub>P\<^esub> rev_compose R g h
[PROOF STEP]
using rev_sub_is_hom assms ring_hom_mult
[PROOF STATE]
proof (prove)
using this:
?g \<in> carrier P \<Longrightarrow> rev_compose R ?g \<in> ring_hom P P
g \<in> carrier P
f \<in> carrier P
h \<in> carrier P
\<lbrakk>?h \<in> ring_hom ?R ?S; ?x \<in> carrier ?R; ?y \<in> carrier ?R\<rbrakk> \<Longrightarrow> ?h (?x \<otimes>\<^bsub>?R\<^esub> ?y) = ?h ?x \<otimes>\<^bsub>?S\<^esub> ?h ?y

goal (1 subgoal):
 1. rev_compose R g (f \<otimes>\<^bsub>P\<^esub> h) = rev_compose R g f \<otimes>\<^bsub>P\<^esub> rev_compose R g h
[PROOF STEP]
by fastforce


[STATEMENT]
lemma sum_list_ge_length_times:
  fixes a :: "'a::{ordered_ab_semigroup_add,semiring_1}"
  assumes "\<forall>i < length xs. xs ! i \<ge> a"
  shows "sum_list xs \<ge> of_nat (length xs) * a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_nat (length xs) * a \<le> sum_list xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length xs. a \<le> xs ! i

goal (1 subgoal):
 1. of_nat (length xs) * a \<le> sum_list xs
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>i<length []. a \<le> [] ! i \<Longrightarrow> of_nat (length []) * a \<le> sum_list []
 2. \<And>aa xs. \<lbrakk>\<forall>i<length xs. a \<le> xs ! i \<Longrightarrow> of_nat (length xs) * a \<le> sum_list xs; \<forall>i<length (aa # xs). a \<le> (aa # xs) ! i\<rbrakk> \<Longrightarrow> of_nat (length (aa # xs)) * a \<le> sum_list (aa # xs)
[PROOF STEP]
case (Cons x xs)
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. a \<le> xs ! i \<Longrightarrow> of_nat (length xs) * a \<le> sum_list xs
\<forall>i<length (x # xs). a \<le> (x # xs) ! i

goal (2 subgoals):
 1. \<forall>i<length []. a \<le> [] ! i \<Longrightarrow> of_nat (length []) * a \<le> sum_list []
 2. \<And>aa xs. \<lbrakk>\<forall>i<length xs. a \<le> xs ! i \<Longrightarrow> of_nat (length xs) * a \<le> sum_list xs; \<forall>i<length (aa # xs). a \<le> (aa # xs) ! i\<rbrakk> \<Longrightarrow> of_nat (length (aa # xs)) * a \<le> sum_list (aa # xs)
[PROOF STEP]
note ih = this(1) and xxs_i_ge_a = this(2)
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. a \<le> xs ! i \<Longrightarrow> of_nat (length xs) * a \<le> sum_list xs
\<forall>i<length (x # xs). a \<le> (x # xs) ! i

goal (2 subgoals):
 1. \<forall>i<length []. a \<le> [] ! i \<Longrightarrow> of_nat (length []) * a \<le> sum_list []
 2. \<And>aa xs. \<lbrakk>\<forall>i<length xs. a \<le> xs ! i \<Longrightarrow> of_nat (length xs) * a \<le> sum_list xs; \<forall>i<length (aa # xs). a \<le> (aa # xs) ! i\<rbrakk> \<Longrightarrow> of_nat (length (aa # xs)) * a \<le> sum_list (aa # xs)
[PROOF STEP]
have xs_i_ge_a: "\<forall>i < length xs. xs ! i \<ge> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length xs. a \<le> xs ! i
[PROOF STEP]
using xxs_i_ge_a
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length (x # xs). a \<le> (x # xs) ! i

goal (1 subgoal):
 1. \<forall>i<length xs. a \<le> xs ! i
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length xs. a \<le> xs ! i

goal (2 subgoals):
 1. \<forall>i<length []. a \<le> [] ! i \<Longrightarrow> of_nat (length []) * a \<le> sum_list []
 2. \<And>aa xs. \<lbrakk>\<forall>i<length xs. a \<le> xs ! i \<Longrightarrow> of_nat (length xs) * a \<le> sum_list xs; \<forall>i<length (aa # xs). a \<le> (aa # xs) ! i\<rbrakk> \<Longrightarrow> of_nat (length (aa # xs)) * a \<le> sum_list (aa # xs)
[PROOF STEP]
have "x \<ge> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> x
[PROOF STEP]
using xxs_i_ge_a
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length (x # xs). a \<le> (x # xs) ! i

goal (1 subgoal):
 1. a \<le> x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a \<le> x

goal (2 subgoals):
 1. \<forall>i<length []. a \<le> [] ! i \<Longrightarrow> of_nat (length []) * a \<le> sum_list []
 2. \<And>aa xs. \<lbrakk>\<forall>i<length xs. a \<le> xs ! i \<Longrightarrow> of_nat (length xs) * a \<le> sum_list xs; \<forall>i<length (aa # xs). a \<le> (aa # xs) ! i\<rbrakk> \<Longrightarrow> of_nat (length (aa # xs)) * a \<le> sum_list (aa # xs)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
a \<le> x

goal (1 subgoal):
 1. of_nat (length (x # xs)) * a \<le> sum_list (x # xs)
[PROOF STEP]
using ih[OF xs_i_ge_a]
[PROOF STATE]
proof (prove)
using this:
a \<le> x
of_nat (length xs) * a \<le> sum_list xs

goal (1 subgoal):
 1. of_nat (length (x # xs)) * a \<le> sum_list (x # xs)
[PROOF STEP]
by (simp add: ring_distribs ordered_ab_semigroup_add_class.add_mono)
[PROOF STATE]
proof (state)
this:
of_nat (length (x # xs)) * a \<le> sum_list (x # xs)

goal (1 subgoal):
 1. \<forall>i<length []. a \<le> [] ! i \<Longrightarrow> of_nat (length []) * a \<le> sum_list []
[PROOF STEP]
qed auto


[STATEMENT]
lemma zmult_zless_mono2_lemma:
  fixes i j::int
  and   k::nat
  shows "i < j \<Longrightarrow> 0 < k \<Longrightarrow> of_nat k * i < of_nat k * j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < j; 0 < k\<rbrakk> \<Longrightarrow> of_nat k * i < of_nat k * j
[PROOF STEP]
apply(induct "k")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>i < j; 0 < 0\<rbrakk> \<Longrightarrow> of_nat 0 * i < of_nat 0 * j
 2. \<And>k. \<lbrakk>\<lbrakk>i < j; 0 < k\<rbrakk> \<Longrightarrow> of_nat k * i < of_nat k * j; i < j; 0 < Suc k\<rbrakk> \<Longrightarrow> of_nat (Suc k) * i < of_nat (Suc k) * j
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>k. \<lbrakk>\<lbrakk>i < j; 0 < k\<rbrakk> \<Longrightarrow> of_nat k * i < of_nat k * j; i < j; 0 < Suc k\<rbrakk> \<Longrightarrow> of_nat (Suc k) * i < of_nat (Suc k) * j
[PROOF STEP]
apply(case_tac "k = 0")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>k. \<lbrakk>\<lbrakk>i < j; 0 < k\<rbrakk> \<Longrightarrow> of_nat k * i < of_nat k * j; i < j; 0 < Suc k; k = 0\<rbrakk> \<Longrightarrow> of_nat (Suc k) * i < of_nat (Suc k) * j
 2. \<And>k. \<lbrakk>\<lbrakk>i < j; 0 < k\<rbrakk> \<Longrightarrow> of_nat k * i < of_nat k * j; i < j; 0 < Suc k; k \<noteq> 0\<rbrakk> \<Longrightarrow> of_nat (Suc k) * i < of_nat (Suc k) * j
[PROOF STEP]
apply(simp_all add: distrib_right add_strict_mono)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mset_subset_eqI:
  "(\<And>a. count A a \<le> count B a) \<Longrightarrow> A \<subseteq># B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. count A a \<le> count B a) \<Longrightarrow> A \<subseteq># B
[PROOF STEP]
by (simp add: subseteq_mset_def)


[STATEMENT]
lemma finite_Units [iff]: "finite (Units R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Units R)
[PROOF STEP]
by (simp add: finite_ring_finite_units)


[STATEMENT]
lemma unat_of_bl_128_16_le_helper: "unat ((of_bl:: bool list \<Rightarrow> 128 word) (to_bl (b::16 word))) \<le> 65535"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (of_bl (to_bl b)) \<le> 65535
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. unat (of_bl (to_bl b)) \<le> 65535
[PROOF STEP]
from unat_of_bl_128_16_less_helper[of b]
[PROOF STATE]
proof (chain)
picking this:
unat (of_bl (to_bl b)) < 2 ^ 16
[PROOF STEP]
have
    "unat ((of_bl:: bool list \<Rightarrow> 128 word) (to_bl b)) < 65536"
[PROOF STATE]
proof (prove)
using this:
unat (of_bl (to_bl b)) < 2 ^ 16

goal (1 subgoal):
 1. unat (of_bl (to_bl b)) < 65536
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unat (of_bl (to_bl b)) < 65536

goal (1 subgoal):
 1. unat (of_bl (to_bl b)) \<le> 65535
[PROOF STEP]
from Suc_leI[OF this]
[PROOF STATE]
proof (chain)
picking this:
Suc (unat (of_bl (to_bl b))) \<le> 65536
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
Suc (unat (of_bl (to_bl b))) \<le> 65536

goal (1 subgoal):
 1. unat (of_bl (to_bl b)) \<le> 65535
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
unat (of_bl (to_bl b)) \<le> 65535

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pcompose_eq_0:
  fixes p q :: "'a::{comm_semiring_0,semiring_no_zero_divisors} poly"
  assumes "pcompose p q = 0" "degree q > 0"
  shows "p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. p = 0
[PROOF STEP]
from assms degree_pcompose [of p q]
[PROOF STATE]
proof (chain)
picking this:
p \<circ>\<^sub>p q = 0
0 < degree q
degree (p \<circ>\<^sub>p q) = degree p * degree q
[PROOF STEP]
have "degree p = 0"
[PROOF STATE]
proof (prove)
using this:
p \<circ>\<^sub>p q = 0
0 < degree q
degree (p \<circ>\<^sub>p q) = degree p * degree q

goal (1 subgoal):
 1. degree p = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
degree p = 0

goal (1 subgoal):
 1. p = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
degree p = 0
[PROOF STEP]
obtain a where "p = [:a:]"
[PROOF STATE]
proof (prove)
using this:
degree p = 0

goal (1 subgoal):
 1. (\<And>a. p = [:a:] \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis degree_pCons_eq_if gr0_conv_Suc neq0_conv pCons_cases)
[PROOF STATE]
proof (state)
this:
p = [:a:]

goal (1 subgoal):
 1. p = 0
[PROOF STEP]
with assms(1)
[PROOF STATE]
proof (chain)
picking this:
p \<circ>\<^sub>p q = 0
p = [:a:]
[PROOF STEP]
have "a = 0"
[PROOF STATE]
proof (prove)
using this:
p \<circ>\<^sub>p q = 0
p = [:a:]

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

goal (1 subgoal):
 1. p = 0
[PROOF STEP]
with \<open>p = [:a:]\<close>
[PROOF STATE]
proof (chain)
picking this:
p = [:a:]
a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
p = [:a:]
a = (0::'a)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem Left_equals_Right_coset_implies_normality:
  assumes [simp]: "\<And>g. g \<in> G \<Longrightarrow> g \<cdot>| H = H |\<cdot> g"
  shows "normal_subgroup H G (\<cdot>) \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normal_subgroup H G (\<cdot>) \<one>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>g k. \<lbrakk>g \<in> G; k \<in> H\<rbrakk> \<Longrightarrow> inverse g \<cdot> k \<cdot> g \<in> H
[PROOF STEP]
fix g k
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>g k. \<lbrakk>g \<in> G; k \<in> H\<rbrakk> \<Longrightarrow> inverse g \<cdot> k \<cdot> g \<in> H
[PROOF STEP]
assume [simp]: "g \<in> G" "k \<in> H"
[PROOF STATE]
proof (state)
this:
g \<in> G
k \<in> H

goal (1 subgoal):
 1. \<And>g k. \<lbrakk>g \<in> G; k \<in> H\<rbrakk> \<Longrightarrow> inverse g \<cdot> k \<cdot> g \<in> H
[PROOF STEP]
have "k \<cdot> g \<in> g \<cdot>| H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<cdot> g \<in> g \<cdot>| H
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k \<cdot> g \<in> g \<cdot>| H

goal (1 subgoal):
 1. \<And>g k. \<lbrakk>g \<in> G; k \<in> H\<rbrakk> \<Longrightarrow> inverse g \<cdot> k \<cdot> g \<in> H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<cdot> g \<in> g \<cdot>| H
[PROOF STEP]
obtain k' where "k \<cdot> g = g \<cdot> k'" and "k' \<in> H"
[PROOF STATE]
proof (prove)
using this:
k \<cdot> g \<in> g \<cdot>| H

goal (1 subgoal):
 1. (\<And>k'. \<lbrakk>k \<cdot> g = g \<cdot> k'; k' \<in> H\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k \<cdot> g = g \<cdot> k'
k' \<in> H

goal (1 subgoal):
 1. \<And>g k. \<lbrakk>g \<in> G; k \<in> H\<rbrakk> \<Longrightarrow> inverse g \<cdot> k \<cdot> g \<in> H
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k \<cdot> g = g \<cdot> k'
k' \<in> H
[PROOF STEP]
show "inverse g \<cdot> k \<cdot> g \<in> H"
[PROOF STATE]
proof (prove)
using this:
k \<cdot> g = g \<cdot> k'
k' \<in> H

goal (1 subgoal):
 1. inverse g \<cdot> k \<cdot> g \<in> H
[PROOF STEP]
by (simp add: associative invertible_left_inverse2)
[PROOF STATE]
proof (state)
this:
inverse g \<cdot> k \<cdot> g \<in> H

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_integrable_Un:
  fixes f g :: "_ \<Rightarrow> _ :: {banach, second_countable_topology}"
  assumes f_A: "set_integrable M A f" and f_B:  "set_integrable M B f"
    and [measurable]: "A \<in> sets M" "B \<in> sets M"
  shows "set_integrable M (A \<union> B) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M (A \<union> B) f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. set_integrable M (A \<union> B) f
[PROOF STEP]
have "set_integrable M (A - B) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_integrable M (A - B) f
[PROOF STEP]
using f_A
[PROOF STATE]
proof (prove)
using this:
set_integrable M A f

goal (1 subgoal):
 1. set_integrable M (A - B) f
[PROOF STEP]
by (rule set_integrable_subset) auto
[PROOF STATE]
proof (state)
this:
set_integrable M (A - B) f

goal (1 subgoal):
 1. set_integrable M (A \<union> B) f
[PROOF STEP]
with f_B
[PROOF STATE]
proof (chain)
picking this:
set_integrable M B f
set_integrable M (A - B) f
[PROOF STEP]
have "integrable M (\<lambda>x. indicator (A - B) x *\<^sub>R f x + indicator B x *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
using this:
set_integrable M B f
set_integrable M (A - B) f

goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x + indicat_real B x *\<^sub>R f x)
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. indicat_real B x *\<^sub>R f x)
integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x + indicat_real B x *\<^sub>R f x)
[PROOF STEP]
using integrable_add
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. indicat_real B x *\<^sub>R f x)
integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x)
\<lbrakk>integrable ?M ?f; integrable ?M ?g\<rbrakk> \<Longrightarrow> integrable ?M (\<lambda>x. ?f x + ?g x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x + indicat_real B x *\<^sub>R f x)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x + indicat_real B x *\<^sub>R f x)

goal (1 subgoal):
 1. set_integrable M (A \<union> B) f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x + indicat_real B x *\<^sub>R f x)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x + indicat_real B x *\<^sub>R f x)

goal (1 subgoal):
 1. set_integrable M (A \<union> B) f
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
using this:
integrable M (\<lambda>x. indicat_real (A - B) x *\<^sub>R f x + indicat_real B x *\<^sub>R f x)

goal (1 subgoal):
 1. integrable M (\<lambda>x. indicat_real (A \<union> B) x *\<^sub>R f x)
[PROOF STEP]
by (rule integrable_cong[THEN iffD1, rotated 2]) (auto split: split_indicator)
[PROOF STATE]
proof (state)
this:
set_integrable M (A \<union> B) f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma length_tp'[simp]:
  "\<lbrakk>ly = layout_of ap; tp = tm_of ap\<rbrakk> \<Longrightarrow>
       length tp = 2 * sum_list (take (length ap) (layout_of ap))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ly = layout_of ap; tp = tm_of ap\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length ap) (layout_of ap))
[PROOF STEP]
proof(induct ap arbitrary: ly tp rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>ly tp. \<lbrakk>ly = layout_of []; tp = tm_of []\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length []) (layout_of []))
 2. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
ly = layout_of []
tp = tm_of []

goal (2 subgoals):
 1. \<And>ly tp. \<lbrakk>ly = layout_of []; tp = tm_of []\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length []) (layout_of []))
 2. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
thus "?case"
[PROOF STATE]
proof (prove)
using this:
ly = layout_of []
tp = tm_of []

goal (1 subgoal):
 1. length tp = 2 * sum_list (take (length []) (layout_of []))
[PROOF STEP]
by(simp add: tms_of.simps tm_of.simps tpairs_of.simps)
[PROOF STATE]
proof (state)
this:
length tp = 2 * sum_list (take (length []) (layout_of []))

goal (1 subgoal):
 1. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
fix x xs ly tp
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
assume ind: "\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow>
    length tp = 2 * sum_list (take (length xs) (layout_of xs))"
    and layout: "ly = layout_of (xs @ [x])"
    and tp: "tp = tm_of (xs @ [x])"
[PROOF STATE]
proof (state)
this:
\<lbrakk>?ly = layout_of xs; ?tp = tm_of xs\<rbrakk> \<Longrightarrow> length ?tp = 2 * sum_list (take (length xs) (layout_of xs))
ly = layout_of (xs @ [x])
tp = tm_of (xs @ [x])

goal (1 subgoal):
 1. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
obtain ly' where a: "ly' = layout_of xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ly'. ly' = layout_of xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
ly' = layout_of xs

goal (1 subgoal):
 1. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
obtain tp' where b: "tp' = tm_of xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>tp'. tp' = tm_of xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
tp' = tm_of xs

goal (1 subgoal):
 1. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
have c: "length tp' = 2 * sum_list (take (length xs) (layout_of xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length tp' = 2 * sum_list (take (length xs) (layout_of xs))
[PROOF STEP]
using a b
[PROOF STATE]
proof (prove)
using this:
ly' = layout_of xs
tp' = tm_of xs

goal (1 subgoal):
 1. length tp' = 2 * sum_list (take (length xs) (layout_of xs))
[PROOF STEP]
by(erule_tac ind, simp)
[PROOF STATE]
proof (state)
this:
length tp' = 2 * sum_list (take (length xs) (layout_of xs))

goal (1 subgoal):
 1. \<And>x xs ly tp. \<lbrakk>\<And>ly tp. \<lbrakk>ly = layout_of xs; tp = tm_of xs\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length xs) (layout_of xs)); ly = layout_of (xs @ [x]); tp = tm_of (xs @ [x])\<rbrakk> \<Longrightarrow> length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
thus "length tp = 2 *
    sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))"
[PROOF STATE]
proof (prove)
using this:
length tp' = 2 * sum_list (take (length xs) (layout_of xs))

goal (1 subgoal):
 1. length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
using tp b
[PROOF STATE]
proof (prove)
using this:
length tp' = 2 * sum_list (take (length xs) (layout_of xs))
tp = tm_of (xs @ [x])
tp' = tm_of xs

goal (1 subgoal):
 1. length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))
[PROOF STEP]
apply(auto simp: layout_id_cons tm_of.simps tms_of.simps length_concat tpairs_id_cons map_length_ci)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sum_list (map (length \<circ> (\<lambda>(x, y). ci (layout_of xs) x y)) (tpairs_of xs)) = 2 * sum_list (layout_of xs); tp = concat (map (\<lambda>(xa, y). ci (layout_of xs @ [length_of x]) xa y) (tpairs_of xs)) @ ci (layout_of xs @ [length_of x]) (start_of (layout_of xs @ [length_of x]) (length xs)) x; tp' = concat (map (\<lambda>(x, y). ci (layout_of xs) x y) (tpairs_of xs))\<rbrakk> \<Longrightarrow> length (ci (layout_of xs @ [length_of x]) (start_of (layout_of xs @ [length_of x]) (length xs)) x) = 2 * length_of x
[PROOF STEP]
apply(cases x)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x1. \<lbrakk>sum_list (map (length \<circ> (\<lambda>(x, y). ci (layout_of xs) x y)) (tpairs_of xs)) = 2 * sum_list (layout_of xs); tp = concat (map (\<lambda>(xa, y). ci (layout_of xs @ [length_of x]) xa y) (tpairs_of xs)) @ ci (layout_of xs @ [length_of x]) (start_of (layout_of xs @ [length_of x]) (length xs)) x; tp' = concat (map (\<lambda>(x, y). ci (layout_of xs) x y) (tpairs_of xs)); x = Inc x1\<rbrakk> \<Longrightarrow> length (ci (layout_of xs @ [length_of x]) (start_of (layout_of xs @ [length_of x]) (length xs)) x) = 2 * length_of x
 2. \<And>x21 x22. \<lbrakk>sum_list (map (length \<circ> (\<lambda>(x, y). ci (layout_of xs) x y)) (tpairs_of xs)) = 2 * sum_list (layout_of xs); tp = concat (map (\<lambda>(xa, y). ci (layout_of xs @ [length_of x]) xa y) (tpairs_of xs)) @ ci (layout_of xs @ [length_of x]) (start_of (layout_of xs @ [length_of x]) (length xs)) x; tp' = concat (map (\<lambda>(x, y). ci (layout_of xs) x y) (tpairs_of xs)); x = Dec x21 x22\<rbrakk> \<Longrightarrow> length (ci (layout_of xs @ [length_of x]) (start_of (layout_of xs @ [length_of x]) (length xs)) x) = 2 * length_of x
 3. \<And>x3. \<lbrakk>sum_list (map (length \<circ> (\<lambda>(x, y). ci (layout_of xs) x y)) (tpairs_of xs)) = 2 * sum_list (layout_of xs); tp = concat (map (\<lambda>(xa, y). ci (layout_of xs @ [length_of x]) xa y) (tpairs_of xs)) @ ci (layout_of xs @ [length_of x]) (start_of (layout_of xs @ [length_of x]) (length xs)) x; tp' = concat (map (\<lambda>(x, y). ci (layout_of xs) x y) (tpairs_of xs)); x = Goto x3\<rbrakk> \<Longrightarrow> length (ci (layout_of xs @ [length_of x]) (start_of (layout_of xs @ [length_of x]) (length xs)) x) = 2 * length_of x
[PROOF STEP]
apply(auto simp: ci.simps tinc_b_def tdec_b_def length_findnth adjust.simps length_of.simps
        split: abc_inst.splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
length tp = 2 * sum_list (take (length (xs @ [x])) (layout_of (xs @ [x])))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma NSCDERIV_inverse: "x \<noteq> 0 \<Longrightarrow> NSDERIV (\<lambda>x. inverse x) x :> - (inverse x)\<^sup>2"
  for x :: complex
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> NSDERIV inverse x :> - (inverse x)\<^sup>2
[PROOF STEP]
unfolding numeral_2_eq_2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> NSDERIV inverse x :> - (inverse x ^ Suc (Suc 0))
[PROOF STEP]
by (rule NSDERIV_inverse)


[STATEMENT]
lemma unat_div_distrib:
  \<open>unat (v div w) = unat v div unat w\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. unat (v div w) = unat v div unat w
[PROOF STEP]
proof transfer
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v w. (nat \<circ> take_bit LENGTH('a)) (take_bit LENGTH('a) v div take_bit LENGTH('a) w) = (nat \<circ> take_bit LENGTH('a)) v div (nat \<circ> take_bit LENGTH('a)) w
[PROOF STEP]
fix k l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>v w. (nat \<circ> take_bit LENGTH('a)) (take_bit LENGTH('a) v div take_bit LENGTH('a) w) = (nat \<circ> take_bit LENGTH('a)) v div (nat \<circ> take_bit LENGTH('a)) w
[PROOF STEP]
have \<open>nat (take_bit LENGTH('a) k) div nat (take_bit LENGTH('a) l) \<le> nat (take_bit LENGTH('a) k)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat (take_bit LENGTH('a) k) div nat (take_bit LENGTH('a) l) \<le> nat (take_bit LENGTH('a) k)
[PROOF STEP]
by (rule div_le_dividend)
[PROOF STATE]
proof (state)
this:
nat (take_bit LENGTH('a) k) div nat (take_bit LENGTH('a) l) \<le> nat (take_bit LENGTH('a) k)

goal (1 subgoal):
 1. \<And>v w. (nat \<circ> take_bit LENGTH('a)) (take_bit LENGTH('a) v div take_bit LENGTH('a) w) = (nat \<circ> take_bit LENGTH('a)) v div (nat \<circ> take_bit LENGTH('a)) w
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
nat (take_bit LENGTH('a) k) div nat (take_bit LENGTH('a) l) \<le> nat (take_bit LENGTH('a) k)

goal (1 subgoal):
 1. \<And>v w. (nat \<circ> take_bit LENGTH('a)) (take_bit LENGTH('a) v div take_bit LENGTH('a) w) = (nat \<circ> take_bit LENGTH('a)) v div (nat \<circ> take_bit LENGTH('a)) w
[PROOF STEP]
have \<open>nat (take_bit LENGTH('a) k) < 2 ^ LENGTH('a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat (take_bit LENGTH('a) k) < 2 ^ LENGTH('a)
[PROOF STEP]
by (simp add: nat_less_iff)
[PROOF STATE]
proof (state)
this:
nat (take_bit LENGTH('a) k) < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. \<And>v w. (nat \<circ> take_bit LENGTH('a)) (take_bit LENGTH('a) v div take_bit LENGTH('a) w) = (nat \<circ> take_bit LENGTH('a)) v div (nat \<circ> take_bit LENGTH('a)) w
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
nat (take_bit LENGTH('a) k) div nat (take_bit LENGTH('a) l) < 2 ^ LENGTH('a)
[PROOF STEP]
show \<open>(nat \<circ> take_bit LENGTH('a)) (take_bit LENGTH('a) k div take_bit LENGTH('a) l) =
    (nat \<circ> take_bit LENGTH('a)) k div (nat \<circ> take_bit LENGTH('a)) l\<close>
[PROOF STATE]
proof (prove)
using this:
nat (take_bit LENGTH('a) k) div nat (take_bit LENGTH('a) l) < 2 ^ LENGTH('a)

goal (1 subgoal):
 1. (nat \<circ> take_bit LENGTH('a)) (take_bit LENGTH('a) k div take_bit LENGTH('a) l) = (nat \<circ> take_bit LENGTH('a)) k div (nat \<circ> take_bit LENGTH('a)) l
[PROOF STEP]
by (simp add: nat_take_bit_eq div_int_pos_iff nat_div_distrib take_bit_nat_eq_self_iff)
[PROOF STATE]
proof (state)
this:
(nat \<circ> take_bit LENGTH('a)) (take_bit LENGTH('a) k div take_bit LENGTH('a) l) = (nat \<circ> take_bit LENGTH('a)) k div (nat \<circ> take_bit LENGTH('a)) l

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ceiling_le_one [simp]: "\<lceil>x\<rceil> \<le> 1 \<longleftrightarrow> x \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lceil>x\<rceil> \<le> 1) = (x \<le> (1::'a))
[PROOF STEP]
by (simp add: ceiling_le_iff)


[STATEMENT]
lemma (in comm_group) iso_DirProds_IDirProds:
  assumes "is_idirprod (carrier G) S I" "finite I"
  shows "(\<lambda>x. \<Otimes>\<^bsub>G\<^esub>i\<in>I. x i) \<in> iso (DirProds (\<lambda>i. G\<lparr>carrier := (S i)\<rparr>) I) G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. finprod G x I) \<in> Group.iso (DirProds (\<lambda>i. G\<lparr>carrier := S i\<rparr>) I) G
[PROOF STEP]
using subgroup_iso_DirProds_IDirProds[OF subgroup_self assms(1, 2)]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. finprod G x I) \<in> Group.iso (DirProds (\<lambda>i. G\<lparr>carrier := S i\<rparr>) I) (G\<lparr>carrier := carrier G\<rparr>)

goal (1 subgoal):
 1. (\<lambda>x. finprod G x I) \<in> Group.iso (DirProds (\<lambda>i. G\<lparr>carrier := S i\<rparr>) I) G
[PROOF STEP]
by auto


[STATEMENT]
lemma icard_mono: "A \<subseteq> B \<Longrightarrow> icard A \<le> icard B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<subseteq> B \<Longrightarrow> icard A \<le> icard B
[PROOF STEP]
apply (case_tac "finite B")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>A \<subseteq> B; finite B\<rbrakk> \<Longrightarrow> icard A \<le> icard B
 2. \<lbrakk>A \<subseteq> B; infinite B\<rbrakk> \<Longrightarrow> icard A \<le> icard B
[PROOF STEP]
apply (frule subset_finite_imp_finite, simp)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>A \<subseteq> B; finite B; finite A\<rbrakk> \<Longrightarrow> icard A \<le> icard B
 2. \<lbrakk>A \<subseteq> B; infinite B\<rbrakk> \<Longrightarrow> icard A \<le> icard B
[PROOF STEP]
apply (simp add: icard_finite card_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>A \<subseteq> B; infinite B\<rbrakk> \<Longrightarrow> icard A \<le> icard B
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bij_betw_swap_iff: "x \<in> A \<Longrightarrow> y \<in> A \<Longrightarrow> bij_betw (Fun.swap x y f) A B \<longleftrightarrow> bij_betw f A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> A; y \<in> A\<rbrakk> \<Longrightarrow> bij_betw (f \<circ> Transposition.transpose x y) A B = bij_betw f A B
[PROOF STEP]
by (meson bij_betw_comp_iff bij_betw_transpose_iff)


[STATEMENT]
lemma HComplex_add [simp]:
  "\<And>x1 y1 x2 y2. HComplex x1 y1 + HComplex x2 y2 = HComplex (x1 + x2) (y1 + y2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 y1 x2 y2. HComplex x1 y1 + HComplex x2 y2 = HComplex (x1 + x2) (y1 + y2)
[PROOF STEP]
by transfer (rule complex_add)


[STATEMENT]
lemma  vec_hom_set_distinct_iff:
  fixes xs :: "'a vec list"
  shows "distinct xs \<longleftrightarrow> distinct (map (map_vec hom) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct xs = distinct (map (map_vec hom) xs)
[PROOF STEP]
using vec_hom_inj
[PROOF STATE]
proof (prove)
using this:
map_vec hom ?v = map_vec hom ?w \<Longrightarrow> ?v = ?w

goal (1 subgoal):
 1. distinct xs = distinct (map (map_vec hom) xs)
[PROOF STEP]
by (induct xs) (auto)


[STATEMENT]
lemma well_order_inductZSL[case_names Zero Suc Lim]:
assumes ZERO: "P zero"
and SUCC: "\<And>i. \<lbrakk>aboveS i \<noteq> {}; P i\<rbrakk> \<Longrightarrow> P (succ i)" and
LIM: "\<And>i. \<lbrakk>isLim i; i \<noteq> zero; \<And>j. j \<in> underS i \<Longrightarrow> P j\<rbrakk> \<Longrightarrow> P i"
shows "P i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P i
[PROOF STEP]
apply(induction rule: well_order_inductSL)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>local.aboveS i \<noteq> {}; P i\<rbrakk> \<Longrightarrow> P (succ i)
 2. \<And>i. \<lbrakk>isLim i; \<And>j. j \<in> local.underS i \<Longrightarrow> P j\<rbrakk> \<Longrightarrow> P i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
P zero
\<lbrakk>local.aboveS ?i6 \<noteq> {}; P ?i6\<rbrakk> \<Longrightarrow> P (succ ?i6)
\<lbrakk>isLim ?i6; ?i6 \<noteq> zero; \<And>j. j \<in> local.underS ?i6 \<Longrightarrow> P j\<rbrakk> \<Longrightarrow> P ?i6

goal (2 subgoals):
 1. \<And>i. \<lbrakk>local.aboveS i \<noteq> {}; P i\<rbrakk> \<Longrightarrow> P (succ i)
 2. \<And>i. \<lbrakk>isLim i; \<And>j. j \<in> local.underS i \<Longrightarrow> P j\<rbrakk> \<Longrightarrow> P i
[PROOF STEP]
by auto


[STATEMENT]
lemma zip_map [rule_format]:
  "\<forall>a. length a = length b \<longrightarrow>
  zip (map f a) (map g b) = map (\<lambda>(x,y). (f x, g y)) (zip a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>a. length a = length b \<longrightarrow> zip (map f a) (map g b) = List.map2 (\<lambda>x y. (f x, g y)) a b
[PROOF STEP]
apply (induct b)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>a. length a = length [] \<longrightarrow> zip (map f a) (map g []) = List.map2 (\<lambda>x y. (f x, g y)) a []
 2. \<And>a b. \<forall>a. length a = length b \<longrightarrow> zip (map f a) (map g b) = List.map2 (\<lambda>x y. (f x, g y)) a b \<Longrightarrow> \<forall>aa. length aa = length (a # b) \<longrightarrow> zip (map f aa) (map g (a # b)) = List.map2 (\<lambda>x y. (f x, g y)) aa (a # b)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<forall>a. length a = length b \<longrightarrow> zip (map f a) (map g b) = List.map2 (\<lambda>x y. (f x, g y)) a b \<Longrightarrow> \<forall>aa. length aa = length (a # b) \<longrightarrow> zip (map f aa) (map g (a # b)) = List.map2 (\<lambda>x y. (f x, g y)) aa (a # b)
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b aa. \<lbrakk>\<forall>a. length a = length b \<longrightarrow> zip (map f a) (map g b) = List.map2 (\<lambda>x y. (f x, g y)) a b; length aa = Suc (length b)\<rbrakk> \<Longrightarrow> zip (map f aa) (g a # map g b) = List.map2 (\<lambda>x y. (f x, g y)) aa (a # b)
[PROOF STEP]
apply (case_tac aa)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b aa. \<lbrakk>\<forall>a. length a = length b \<longrightarrow> zip (map f a) (map g b) = List.map2 (\<lambda>x y. (f x, g y)) a b; length aa = Suc (length b); aa = []\<rbrakk> \<Longrightarrow> zip (map f aa) (g a # map g b) = List.map2 (\<lambda>x y. (f x, g y)) aa (a # b)
 2. \<And>a b aa ab list. \<lbrakk>\<forall>a. length a = length b \<longrightarrow> zip (map f a) (map g b) = List.map2 (\<lambda>x y. (f x, g y)) a b; length aa = Suc (length b); aa = ab # list\<rbrakk> \<Longrightarrow> zip (map f aa) (g a # map g b) = List.map2 (\<lambda>x y. (f x, g y)) aa (a # b)
[PROOF STEP]
apply simp_all
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma bounded_clinear_sum:
  fixes f :: "'i \<Rightarrow> 'a::complex_normed_vector \<Rightarrow> 'b::complex_normed_vector"
  shows "(\<And>i. i \<in> I \<Longrightarrow> bounded_clinear (f i)) \<Longrightarrow> bounded_clinear (\<lambda>x. \<Sum>i\<in>I. f i x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> bounded_clinear (f i)) \<Longrightarrow> bounded_clinear (\<lambda>x. \<Sum>i\<in>I. f i x)
[PROOF STEP]
by (induct I rule: infinite_finite_induct) (auto intro!: bounded_clinear_add)