[STATEMENT]
lemma tendsto_at_top_withinI:
  fixes f::"'a::linorder_topology \<Rightarrow> 'b::metric_space"
  assumes "s \<noteq> {}"
  assumes "\<And>e. 0 < e \<Longrightarrow> \<exists>x0 \<in> s. \<forall>x \<in> {x0..} \<inter> s. dist (f x) l < e"
  shows  "(f \<longlongrightarrow> l) (at_top_within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<longlongrightarrow> l) (at_top_within s)
[PROOF STEP]
apply(intro tendstoI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F x in at_top_within s. dist (f x) l < e
[PROOF STEP]
unfolding at_top_within_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> \<forall>\<^sub>F x in INF k\<in>s. principal ({k..} \<inter> s). dist (f x) l < e
[PROOF STEP]
apply (subst eventually_INF_base)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>e. 0 < e \<Longrightarrow> s \<noteq> {}
 2. \<And>e a b. \<lbrakk>0 < e; a \<in> s; b \<in> s\<rbrakk> \<Longrightarrow> \<exists>x\<in>s. principal ({x..} \<inter> s) \<le> inf (principal ({a..} \<inter> s)) (principal ({b..} \<inter> s))
 3. \<And>e. 0 < e \<Longrightarrow> \<exists>b\<in>s. \<forall>\<^sub>F x in principal ({b..} \<inter> s). dist (f x) l < e
[PROOF STEP]
apply (auto simp:eventually_principal assms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>e a b. \<lbrakk>0 < e; a \<in> s; b \<in> s\<rbrakk> \<Longrightarrow> \<exists>x\<in>s. {x..} \<inter> s \<subseteq> {a..} \<and> {x..} \<inter> s \<subseteq> {b..}
[PROOF STEP]
by (metis atLeast_subset_iff inf.coboundedI2 inf_commute linear)


[STATEMENT]
lemma mset_subset_eq_exists_conv: "(A::'a multiset) \<subseteq># B \<longleftrightarrow> (\<exists>C. B = A + C)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<subseteq># B) = (\<exists>C. B = A + C)
[PROOF STEP]
unfolding subseteq_mset_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a. count A a \<le> count B a) = (\<exists>C. B = A + C)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>a. count A a \<le> count B a \<Longrightarrow> \<exists>C. B = A + C
 2. \<exists>C. B = A + C \<Longrightarrow> \<forall>a. count A a \<le> count B a
[PROOF STEP]
apply (rule exI [where x = "B - A"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>a. count A a \<le> count B a \<Longrightarrow> B = A + (B - A)
 2. \<exists>C. B = A + C \<Longrightarrow> \<forall>a. count A a \<le> count B a
[PROOF STEP]
apply (auto intro: multiset_eq_iff [THEN iffD2])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma square_part_le_sqrt: "square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
have "1 * square_part n ^ 2 \<le> \<Prod>(squarefree_part n) * square_part n ^ 2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 1 * (square_part n)\<^sup>2 \<le> \<Prod>(squarefree_part n) * (square_part n)\<^sup>2
[PROOF STEP]
by (intro mult_right_mono) simp_all
[PROOF STATE]
proof (state)
this:
1 * (square_part n)\<^sup>2 \<le> \<Prod>(squarefree_part n) * (square_part n)\<^sup>2

goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
1 * (square_part n)\<^sup>2 \<le> \<Prod>(squarefree_part n) * (square_part n)\<^sup>2

goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
have "\<dots> = n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Prod>(squarefree_part n) * (square_part n)\<^sup>2 = n
[PROOF STEP]
by (rule squarefree_decompose)
[PROOF STATE]
proof (state)
this:
\<Prod>(squarefree_part n) * (square_part n)\<^sup>2 = n

goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
1 * (square_part n)\<^sup>2 \<le> n
[PROOF STEP]
have "real (square_part n ^ 2) \<le> real n"
[PROOF STATE]
proof (prove)
using this:
1 * (square_part n)\<^sup>2 \<le> n

goal (1 subgoal):
 1. real ((square_part n)\<^sup>2) \<le> real n
[PROOF STEP]
by (subst of_nat_le_iff) simp
[PROOF STATE]
proof (state)
this:
real ((square_part n)\<^sup>2) \<le> real n

goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
hence "sqrt (real (square_part n ^ 2)) \<le> sqrt (real n)"
[PROOF STATE]
proof (prove)
using this:
real ((square_part n)\<^sup>2) \<le> real n

goal (1 subgoal):
 1. sqrt (real ((square_part n)\<^sup>2)) \<le> sqrt (real n)
[PROOF STEP]
by (subst real_sqrt_le_iff) simp_all
[PROOF STATE]
proof (state)
this:
sqrt (real ((square_part n)\<^sup>2)) \<le> sqrt (real n)

goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt (real ((square_part n)\<^sup>2)) \<le> sqrt (real n)

goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
have "sqrt (real (square_part n ^ 2)) = real (square_part n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (real ((square_part n)\<^sup>2)) = real (square_part n)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sqrt (real ((square_part n)\<^sup>2)) = real (square_part n)

goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real (square_part n) \<le> sqrt (real n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real (square_part n) \<le> sqrt (real n)

goal (1 subgoal):
 1. square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
square_part n \<le> nat \<lfloor>sqrt (real n)\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma pre_zeta_aux_eq':
  assumes "a > 0" "Re s > -2 * real m" "Re s > -2 * real n"
  shows   "pre_zeta_aux m a s = pre_zeta_aux n a s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
proof (cases m n rule: linorder_cases)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. m < n \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
 2. m = n \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
 3. n < m \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
case less
[PROOF STATE]
proof (state)
this:
m < n

goal (3 subgoals):
 1. m < n \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
 2. m = n \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
 3. n < m \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < a
- 2 * real m < Re s
- 2 * real n < Re s
m < n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < a
- 2 * real m < Re s
- 2 * real n < Re s
m < n

goal (1 subgoal):
 1. pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
by (intro pre_zeta_aux_eq) auto
[PROOF STATE]
proof (state)
this:
pre_zeta_aux m a s = pre_zeta_aux n a s

goal (2 subgoals):
 1. m = n \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
 2. n < m \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. m = n \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
 2. n < m \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
case greater
[PROOF STATE]
proof (state)
this:
n < m

goal (2 subgoals):
 1. m = n \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
 2. n < m \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
0 < a
- 2 * real m < Re s
- 2 * real n < Re s
n < m
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < a
- 2 * real m < Re s
- 2 * real n < Re s
n < m

goal (1 subgoal):
 1. pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
by (subst eq_commute, intro pre_zeta_aux_eq) auto
[PROOF STATE]
proof (state)
this:
pre_zeta_aux m a s = pre_zeta_aux n a s

goal (1 subgoal):
 1. m = n \<Longrightarrow> pre_zeta_aux m a s = pre_zeta_aux n a s
[PROOF STEP]
qed auto


[STATEMENT]
lemma llength_ldropWhile:
  "llength (ldropWhile P xs) =
  (if \<exists>x\<in>lset xs. \<not> P x then llength xs - llength (ltakeWhile P xs) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. llength (ldropWhile P xs) = (if \<exists>x\<in>lset xs. \<not> P x then llength xs - llength (ltakeWhile P xs) else 0)
[PROOF STEP]
by(auto simp add: ldropWhile_eq_ldrop llength_ldrop llength_ltakeWhile_all ltakeWhile_all_conv llength_ltakeWhile_eq_infinity zero_enat_def dest!: lfinite_llength_enat)


[STATEMENT]
lemma lift_01_distinct_cols_N: "distinct (cols (lift_01_mat N))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (cols (lift_01_mat N))
[PROOF STEP]
using  lift_01_mat_distinct_cols distinct_cols_N
[PROOF STATE]
proof (prove)
using this:
distinct (cols N) \<Longrightarrow> distinct (cols (lift_01_mat N))
distinct (cols N)

goal (1 subgoal):
 1. distinct (cols (lift_01_mat N))
[PROOF STEP]
by simp


[STATEMENT]
lemma distinct_idx:
  assumes "distinct (map f l)"
  assumes "i<length l"
  assumes "j<length l"
  assumes "f (l!i) = f (l!j)"
  shows "i=j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i = j
[PROOF STEP]
by (metis assms distinct_conv_nth length_map nth_map)


[STATEMENT]
lemma fds_ln_completely_multiplicative:
  fixes f :: "'a :: dirichlet_series fds"
  assumes "completely_multiplicative_function (fds_nth f)"
  assumes "fds_nth f 1 \<noteq> 0"
  shows   "fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
have "fds_ln l f = fds_integral l (fds_deriv f / f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_ln l f = fds_integral l (fds_deriv f / f)
[PROOF STEP]
by (simp add: fds_ln_def)
[PROOF STATE]
proof (state)
this:
fds_ln l f = fds_integral l (fds_deriv f / f)

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_ln l f = fds_integral l (fds_deriv f / f)

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
have "fds_deriv f = -fds (\<lambda>n. fds_nth f n * mangoldt n) * f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_deriv f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * f
[PROOF STEP]
by (intro completely_multiplicative_fds_deriv' assms)
[PROOF STATE]
proof (state)
this:
fds_deriv f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * f

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_deriv f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * f

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
have "\<dots> / f = -fds (\<lambda>n. fds_nth f n * mangoldt n) * (f * inverse f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * (f * inverse f)
[PROOF STEP]
by (simp add: divide_fds_def)
[PROOF STATE]
proof (state)
this:
- fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * (f * inverse f)

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
- fds (\<lambda>n. fds_nth f n * mangoldt n) * f / f = - fds (\<lambda>n. fds_nth f n * mangoldt n) * (f * inverse f)

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
completely_multiplicative_function (fds_nth f)
fds_nth f 1 \<noteq> (0::'a)
[PROOF STEP]
have "f * inverse f = 1"
[PROOF STATE]
proof (prove)
using this:
completely_multiplicative_function (fds_nth f)
fds_nth f 1 \<noteq> (0::'a)

goal (1 subgoal):
 1. f * inverse f = 1
[PROOF STEP]
by (simp add: fds_right_inverse)
[PROOF STATE]
proof (state)
this:
f * inverse f = 1

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
f * inverse f = 1

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
have "fds_integral l (- fds (\<lambda>n. fds_nth f n * mangoldt n) * 1) =
               fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_integral l (- fds (\<lambda>n. fds_nth f n * mangoldt n) * 1) = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
by (simp add: fds_integral_def cong: if_cong)
[PROOF STATE]
proof (state)
this:
fds_integral l (- fds (\<lambda>n. fds_nth f n * mangoldt n) * 1) = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))

goal (1 subgoal):
 1. fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
fds_ln l f = fds (\<lambda>n. if n = 1 then l else fds_nth f n * mangoldt n /\<^sub>R ln (real n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma drlex_pm_plus_monotone: "drlex_pm s t \<Longrightarrow> drlex_pm (s + u) (t + u)"
  for s t::"_ \<Rightarrow>\<^sub>0 _::{ordered_ab_semigroup_add_imp_le, ordered_cancel_comm_monoid_add}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. drlex_pm s t \<Longrightarrow> drlex_pm (s + u) (t + u)
[PROOF STEP]
unfolding drlex_pm_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dord_pm (\<lambda>s t. lex_pm t s) s t \<Longrightarrow> dord_pm (\<lambda>s t. lex_pm t s) (s + u) (t + u)
[PROOF STEP]
using lex_pm_plus_monotone
[PROOF STATE]
proof (prove)
using this:
lex_pm ?s ?t \<Longrightarrow> lex_pm (?s + ?u) (?t + ?u)

goal (1 subgoal):
 1. dord_pm (\<lambda>s t. lex_pm t s) s t \<Longrightarrow> dord_pm (\<lambda>s t. lex_pm t s) (s + u) (t + u)
[PROOF STEP]
by (rule dord_pm_plus_monotone)


[STATEMENT]
lemma neg_numeral_le_floor [simp]: "- numeral v \<le> \<lfloor>x\<rfloor> \<longleftrightarrow> - numeral v \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- numeral v \<le> \<lfloor>x\<rfloor>) = (- numeral v \<le> x)
[PROOF STEP]
by (simp add: le_floor_iff)


[STATEMENT]
lemma card_shift_image[simp]:
  shows "card ((\<lambda>x :: 'a :: group_add. x + d) ` X) = card X"
    and "card ((\<lambda>x. x - d) ` X) = card X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card ((\<lambda>x. x + d) ` X) = card X &&& card ((\<lambda>x. x - d) ` X) = card X
[PROOF STEP]
by (auto simp: bij_imp_card_image[OF bij_add] bij_imp_card_image[OF bij_minus])


[STATEMENT]
lemma "s\<^sub>0 ''n'' 0 \<ge> 0 \<Longrightarrow> wlp \<pi> exp_count_up1 (\<lambda>s. s ''a'' 0 = 2^nat (s\<^sub>0 ''n'' 0)) s\<^sub>0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> s\<^sub>0 ''n'' 0 \<Longrightarrow> wlp \<pi> exp_count_up1 (\<lambda>s. s ''a'' 0 = 2 ^ nat (s\<^sub>0 ''n'' 0)) s\<^sub>0
[PROOF STEP]
unfolding exp_count_up1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> s\<^sub>0 ''n'' 0 \<Longrightarrow> wlp \<pi> (''a'' ::= N 1;; ''c'' ::= N 0;; WHILE Cmpop (<) (V ''c'') (V ''n'') DO (''a'' ::= Binop (*) (N 2) (V ''a'');; ''c'' ::= Binop (+) (V ''c'') (N 1))) (\<lambda>s. s ''a'' 0 = 2 ^ nat (s\<^sub>0 ''n'' 0)) s\<^sub>0
[PROOF STEP]
apply (subst annotate_whileI[where
          I="\<lambda>s. s ''n'' 0 = s\<^sub>0 ''n'' 0 \<and>  s ''a'' 0 = 2 ^ nat (s ''c'' 0) \<and> 0 \<le> s ''c'' 0 \<and> s ''c'' 0 \<le> s\<^sub>0 ''n'' 0"
        ])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> s\<^sub>0 ''n'' 0 \<Longrightarrow> wlp \<pi> (''a'' ::= N 1;; ''c'' ::= N 0;; WHILE {\<lambda>s. s ''n'' 0 = s\<^sub>0 ''n'' 0 \<and> s ''a'' 0 = 2 ^ nat (s ''c'' 0) \<and> 0 \<le> s ''c'' 0 \<and> s ''c'' 0 \<le> s\<^sub>0 ''n'' 0} Cmpop (<) (V ''c'') (V ''n'') DO (''a'' ::= Binop (*) (N 2) (V ''a'');; ''c'' ::= Binop (+) (V ''c'') (N 1))) (\<lambda>s. s ''a'' 0 = 2 ^ nat (s\<^sub>0 ''n'' 0)) s\<^sub>0
[PROOF STEP]
apply (i_vcg_preprocess; i_vcg_gen; clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>\<paragraph>''invar-pres''; modifies {''a'', ''c''} s (s\<^sub>0(''c'' := (s\<^sub>0 ''c'')(0 := 0), ''a'' := (s\<^sub>0 ''a'')(0 := 1))); s ''c'' 0 < s\<^sub>0 ''n'' 0; s ''n'' 0 = s\<^sub>0 ''n'' 0; s ''a'' 0 = 2 ^ nat (s ''c'' 0); 0 \<le> s ''c'' 0\<rbrakk> \<Longrightarrow> 2 * 2 ^ nat (s ''c'' 0) = 2 ^ nat (s ''c'' 0 + 1)
[PROOF STEP]
text \<open>The postprocessor converts from states applied to string names to actual variables\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s. \<lbrakk>\<paragraph>''invar-pres''; modifies {''a'', ''c''} s (s\<^sub>0(''c'' := (s\<^sub>0 ''c'')(0 := 0), ''a'' := (s\<^sub>0 ''a'')(0 := 1))); s ''c'' 0 < s\<^sub>0 ''n'' 0; s ''n'' 0 = s\<^sub>0 ''n'' 0; s ''a'' 0 = 2 ^ nat (s ''c'' 0); 0 \<le> s ''c'' 0\<rbrakk> \<Longrightarrow> 2 * 2 ^ nat (s ''c'' 0) = 2 ^ nat (s ''c'' 0 + 1)
[PROOF STEP]
apply i_vcg_postprocess
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c a n\<^sub>0. \<lbrakk>\<paragraph>''invar-pres''; c < n\<^sub>0; n\<^sub>0 = n\<^sub>0; a = 2 ^ nat c; 0 \<le> c\<rbrakk> \<Longrightarrow> 2 * 2 ^ nat c = 2 ^ nat (c + 1)
[PROOF STEP]
by (auto simp: algebra_simps nat_distribs)


[STATEMENT]
lemma onorm_zero: "onorm (\<lambda>x. 0) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (\<lambda>x. 0::'b) = 0
[PROOF STEP]
proof (rule order_antisym)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. onorm (\<lambda>x. 0::'b) \<le> 0
 2. 0 \<le> onorm (\<lambda>x. 0::'b)
[PROOF STEP]
show "onorm (\<lambda>x. 0) \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. onorm (\<lambda>x. 0::'d) \<le> 0
[PROOF STEP]
by (simp add: onorm_bound)
[PROOF STATE]
proof (state)
this:
onorm (\<lambda>x. 0::?'d1) \<le> 0

goal (1 subgoal):
 1. 0 \<le> onorm (\<lambda>x. 0::'b)
[PROOF STEP]
show "0 \<le> onorm (\<lambda>x. 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> onorm (\<lambda>x. 0::'d)
[PROOF STEP]
using bounded_linear_zero
[PROOF STATE]
proof (prove)
using this:
bounded_linear (\<lambda>x. 0::?'b)

goal (1 subgoal):
 1. 0 \<le> onorm (\<lambda>x. 0::'d)
[PROOF STEP]
by (rule onorm_pos_le)
[PROOF STATE]
proof (state)
this:
0 \<le> onorm (\<lambda>x. 0::?'d2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma numeral_not_Infinitesimal [simp]:
  "numeral w \<noteq> (0::hypreal) \<Longrightarrow> (numeral w :: hypreal) \<notin> Infinitesimal"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numeral w \<noteq> 0 \<Longrightarrow> numeral w \<notin> Infinitesimal
[PROOF STEP]
by (fast dest: Reals_numeral [THEN SReal_Infinitesimal_zero])


[STATEMENT]
lemma part_equiv_trans: "part_equiv R \<Longrightarrow> (x,y)\<in>R \<Longrightarrow> (y,z)\<in>R \<Longrightarrow> (x,z)\<in>R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>part_equiv R; (x, y) \<in> R; (y, z) \<in> R\<rbrakk> \<Longrightarrow> (x, z) \<in> R
[PROOF STEP]
by (metis part_equiv_def transD)


[STATEMENT]
lemma isUCont_def: "isUCont f \<longleftrightarrow> (\<forall>r>0. \<exists>s>0. \<forall>x y. dist x y < s \<longrightarrow> dist (f x) (f y) < r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isUCont f = (\<forall>r>0. \<exists>s>0. \<forall>x y. dist x y < s \<longrightarrow> dist (f x) (f y) < r)
[PROOF STEP]
by (auto simp: uniformly_continuous_on_def dist_commute)


[STATEMENT]
lemma e_0 [simp]: "e 0 = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e 0 = 1
[PROOF STEP]
by (simp add: e_altdef)


[STATEMENT]
lemma insertion_Sum_any:
  assumes "finite {x. g x \<noteq> 0}"
  shows   "insertion f (Sum_any g) = Sum_any (\<lambda>x. insertion f (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. insertion f (Sum_any g) = (\<Sum>x. insertion f (g x))
[PROOF STEP]
unfolding Sum_any.expand_set insertion_sum
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<in>{a. g a \<noteq> 0}. insertion f (g x)) = (\<Sum>x\<in>{a. insertion f (g a) \<noteq> (0::'b)}. insertion f (g x))
[PROOF STEP]
by (intro sum.mono_neutral_right) (auto intro!: finite_subset[OF _ assms])


[STATEMENT]
lemma echelon_form_upt_k_condition1':
  assumes "echelon_form_upt_k A k" "is_zero_row_upt_k i k A" and "i<j"
  shows "is_zero_row_upt_k j k A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_zero_row_upt_k j k A
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
echelon_form_upt_k A k
is_zero_row_upt_k i k A
i < j

goal (1 subgoal):
 1. is_zero_row_upt_k j k A
[PROOF STEP]
unfolding echelon_form_upt_k_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>i. is_zero_row_upt_k i k A \<longrightarrow> \<not> (\<exists>j>i. \<not> is_zero_row_upt_k j k A)) \<and> (\<forall>i j. i < j \<and> \<not> is_zero_row_upt_k i k A \<and> \<not> is_zero_row_upt_k j k A \<longrightarrow> (LEAST n. A $ i $ n \<noteq> (0::'a)) < (LEAST n. A $ j $ n \<noteq> (0::'a)))
is_zero_row_upt_k i k A
i < j

goal (1 subgoal):
 1. is_zero_row_upt_k j k A
[PROOF STEP]
by auto


[STATEMENT]
lemma square_part_0 [simp]: "square_part 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_part 0 = 0
[PROOF STEP]
by (simp add: square_part_def)


[STATEMENT]
lemma kernel_of_eq:
  "(kernel_of x = kernel_of y) \<longleftrightarrow>
  (length x = length y \<and> (\<forall>j < length x. \<forall>i < j. (x ! i = x ! j) = (y ! i = y ! j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
proof (cases "length x = length y")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. length x = length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
 2. length x \<noteq> length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
length x = length y

goal (2 subgoals):
 1. length x = length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
 2. length x \<noteq> length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
have "(kernel_of x = kernel_of y)  \<longleftrightarrow>
    (\<forall>j < length x. \<forall>i < length x. (x ! i = x ! j) = (y ! i = y ! j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (kernel_of x = kernel_of y) = (\<forall>j<length x. \<forall>i<length x. (x ! i = x ! j) = (y ! i = y ! j))
[PROOF STEP]
unfolding set_eq_iff kernel_of_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>xa. (xa \<in> {(i, j). i < length x \<and> j < length x \<and> x ! i = x ! j}) = (xa \<in> {(i, j). i < length y \<and> j < length y \<and> y ! i = y ! j})) = (\<forall>j<length x. \<forall>i<length x. (x ! i = x ! j) = (y ! i = y ! j))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
length x = length y

goal (1 subgoal):
 1. (\<forall>xa. (xa \<in> {(i, j). i < length x \<and> j < length x \<and> x ! i = x ! j}) = (xa \<in> {(i, j). i < length y \<and> j < length y \<and> y ! i = y ! j})) = (\<forall>j<length x. \<forall>i<length x. (x ! i = x ! j) = (y ! i = y ! j))
[PROOF STEP]
by (simp, blast)
[PROOF STATE]
proof (state)
this:
(kernel_of x = kernel_of y) = (\<forall>j<length x. \<forall>i<length x. (x ! i = x ! j) = (y ! i = y ! j))

goal (2 subgoals):
 1. length x = length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
 2. length x \<noteq> length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(kernel_of x = kernel_of y) = (\<forall>j<length x. \<forall>i<length x. (x ! i = x ! j) = (y ! i = y ! j))

goal (2 subgoals):
 1. length x = length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
 2. length x \<noteq> length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
have "... \<longleftrightarrow> (\<forall>j < length x. \<forall>i < j. (x ! i = x ! j) = (y ! i = y ! j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>j<length x. \<forall>i<length x. (x ! i = x ! j) = (y ! i = y ! j)) = (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j))
[PROOF STEP]
by (metis (no_types, lifting) linorder_cases order.strict_trans)
[PROOF STATE]
proof (state)
this:
(\<forall>j<length x. \<forall>i<length x. (x ! i = x ! j) = (y ! i = y ! j)) = (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j))

goal (2 subgoals):
 1. length x = length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
 2. length x \<noteq> length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(kernel_of x = kernel_of y) = (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(kernel_of x = kernel_of y) = (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j))

goal (1 subgoal):
 1. (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
using True
[PROOF STATE]
proof (prove)
using this:
(kernel_of x = kernel_of y) = (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j))
length x = length y

goal (1 subgoal):
 1. (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))

goal (1 subgoal):
 1. length x \<noteq> length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. length x \<noteq> length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
length x \<noteq> length y

goal (1 subgoal):
 1. length x \<noteq> length y \<Longrightarrow> (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
length x \<noteq> length y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
length x \<noteq> length y

goal (1 subgoal):
 1. (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
using kernel_of_eq_len
[PROOF STATE]
proof (prove)
using this:
length x \<noteq> length y
kernel_of ?x = kernel_of ?y \<Longrightarrow> length ?x = length ?y

goal (1 subgoal):
 1. (kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(kernel_of x = kernel_of y) = (length x = length y \<and> (\<forall>j<length x. \<forall>i<j. (x ! i = x ! j) = (y ! i = y ! j)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma contour_integrable_continuous_linepath:
  assumes "continuous_on (closed_segment a b) f"
  shows "f contour_integrable_on (linepath a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f contour_integrable_on linepath a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f contour_integrable_on linepath a b
[PROOF STEP]
have "continuous_on (closed_segment a b) (\<lambda>x. f x * (b - a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (closed_segment a b) (\<lambda>x. f x * (b - a))
[PROOF STEP]
by (rule continuous_intros | simp add: assms)+
[PROOF STATE]
proof (state)
this:
continuous_on (closed_segment a b) (\<lambda>x. f x * (b - a))

goal (1 subgoal):
 1. f contour_integrable_on linepath a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on (closed_segment a b) (\<lambda>x. f x * (b - a))
[PROOF STEP]
have "continuous_on {0..1} (\<lambda>x. f (linepath a b x) * (b - a))"
[PROOF STATE]
proof (prove)
using this:
continuous_on (closed_segment a b) (\<lambda>x. f x * (b - a))

goal (1 subgoal):
 1. continuous_on {0..1} (\<lambda>x. f (linepath a b x) * (b - a))
[PROOF STEP]
by (metis (no_types, lifting) continuous_on_compose continuous_on_cong continuous_on_linepath linepath_image_01 o_apply)
[PROOF STATE]
proof (state)
this:
continuous_on {0..1} (\<lambda>x. f (linepath a b x) * (b - a))

goal (1 subgoal):
 1. f contour_integrable_on linepath a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
continuous_on {0..1} (\<lambda>x. f (linepath a b x) * (b - a))
[PROOF STEP]
have "(\<lambda>x. f (linepath a b x) *
         vector_derivative (linepath a b)
          (at x within {0..1})) integrable_on
    {0..1}"
[PROOF STATE]
proof (prove)
using this:
continuous_on {0..1} (\<lambda>x. f (linepath a b x) * (b - a))

goal (1 subgoal):
 1. (\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) integrable_on {0..1}
[PROOF STEP]
by (metis (no_types, lifting) continuous_on_cong integrable_continuous_real vector_derivative_linepath_within)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) integrable_on {0..1}

goal (1 subgoal):
 1. f contour_integrable_on linepath a b
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) integrable_on {0..1}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. f (linepath a b x) * vector_derivative (linepath a b) (at x within {0..1})) integrable_on {0..1}

goal (1 subgoal):
 1. f contour_integrable_on linepath a b
[PROOF STEP]
by (simp add: contour_integrable_on_def has_contour_integral_def integrable_on_def [symmetric])
[PROOF STATE]
proof (state)
this:
f contour_integrable_on linepath a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma concat_vpath_exists:
  assumes p_props: "vwalk p G" "hd p = u" "last p = v"
  assumes q_props: "vwalk q G" "hd q = v" "last q = w"
  obtains r where "vpath r G" "hd r = u" "last r = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. \<lbrakk>vpath r G; hd r = u; last r = w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using concat_vpath_is_vpath[OF assms]
[PROOF STATE]
proof (prove)
using this:
vpath (concat_vpath p q) G \<and> hd (concat_vpath p q) = u \<and> last (concat_vpath p q) = w

goal (1 subgoal):
 1. (\<And>r. \<lbrakk>vpath r G; hd r = u; last r = w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma fps_mult_nth_conv_upto_subdegree_right:
  fixes f g :: "('a :: {mult_zero,comm_monoid_add}) fps"
  shows "(f * g) $ n = (\<Sum>i=0..n - subdegree g. f $ i * g $ (n - i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))
[PROOF STEP]
have "{0..n} = {0..n - subdegree g} \<union> {n - subdegree g<..n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..n} = {0..n - subdegree g} \<union> {n - subdegree g<..n}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..n} = {0..n - subdegree g} \<union> {n - subdegree g<..n}

goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{0..n} = {0..n - subdegree g} \<union> {n - subdegree g<..n}

goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))
[PROOF STEP]
have "{0..n - subdegree g} \<inter> {n - subdegree g<..n} = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {0..n - subdegree g} \<inter> {n - subdegree g<..n} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..n - subdegree g} \<inter> {n - subdegree g<..n} = {}

goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
{0..n - subdegree g} \<inter> {n - subdegree g<..n} = {}

goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))
[PROOF STEP]
have "\<forall>i\<in>{n - subdegree g<..n}. g $ (n - i) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i\<in>{n - subdegree g<..n}. g $ (n - i) = (0::'a)
[PROOF STEP]
using nth_less_subdegree_zero[of _ g]
[PROOF STATE]
proof (prove)
using this:
?n < subdegree g \<Longrightarrow> g $ ?n = (0::'a)

goal (1 subgoal):
 1. \<forall>i\<in>{n - subdegree g<..n}. g $ (n - i) = (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i\<in>{n - subdegree g<..n}. g $ (n - i) = (0::'a)

goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
{0..n} = {0..n - subdegree g} \<union> {n - subdegree g<..n}
{0..n - subdegree g} \<inter> {n - subdegree g<..n} = {}
\<forall>i\<in>{n - subdegree g<..n}. g $ (n - i) = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{0..n} = {0..n - subdegree g} \<union> {n - subdegree g<..n}
{0..n - subdegree g} \<inter> {n - subdegree g<..n} = {}
\<forall>i\<in>{n - subdegree g<..n}. g $ (n - i) = (0::'a)

goal (1 subgoal):
 1. (f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))
[PROOF STEP]
by (simp add: fps_mult_nth sum.union_disjoint)
[PROOF STATE]
proof (state)
this:
(f * g) $ n = (\<Sum>i = 0..n - subdegree g. f $ i * g $ (n - i))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma eventually_at_left_linorder:\<comment> \<open>TODO: generalize @{thm eventually_at_left_real}\<close>
  "a > (b :: 'a :: linorder_topology) \<Longrightarrow> eventually (\<lambda>x. x \<in> {b<..<a}) (at_left a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b < a \<Longrightarrow> \<forall>\<^sub>F x in at_left a. x \<in> {b<..<a}
[PROOF STEP]
unfolding eventually_at_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b < a \<Longrightarrow> \<exists>ba<a. \<forall>y>ba. y < a \<longrightarrow> y \<in> {b<..<a}
[PROOF STEP]
by auto


[STATEMENT]
lemma add_right_cancel:
    "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V \<Longrightarrow> (y + x = z + x) = (y = z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> (y + x = z + x) = (y = z)
[PROOF STEP]
by (simp only: add_commute add_left_cancel)


[STATEMENT]
lemma (in prob_space) sum_measure_le_measure_inter:
  assumes "A \<in> sets M" "B \<in> sets M"
  shows "prob A + prob B \<le> 1 + prob (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob A + prob B \<le> 1 + prob (A \<inter> B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob A + prob B \<le> 1 + prob (A \<inter> B)
[PROOF STEP]
have "prob A + prob B = prob (A \<union> B) + prob (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob A + prob B = prob (A \<union> B) + prob (A \<inter> B)
[PROOF STEP]
by (simp add: assms fmeasurable_eq_sets measure_Un3)
[PROOF STATE]
proof (state)
this:
prob A + prob B = prob (A \<union> B) + prob (A \<inter> B)

goal (1 subgoal):
 1. prob A + prob B \<le> 1 + prob (A \<inter> B)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prob A + prob B = prob (A \<union> B) + prob (A \<inter> B)

goal (1 subgoal):
 1. prob A + prob B \<le> 1 + prob (A \<inter> B)
[PROOF STEP]
have "... \<le> 1 + prob (A \<inter> B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob (A \<union> B) + prob (A \<inter> B) \<le> 1 + prob (A \<inter> B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prob (A \<union> B) + prob (A \<inter> B) \<le> 1 + prob (A \<inter> B)

goal (1 subgoal):
 1. prob A + prob B \<le> 1 + prob (A \<inter> B)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prob A + prob B \<le> 1 + prob (A \<inter> B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prob A + prob B \<le> 1 + prob (A \<inter> B)

goal (1 subgoal):
 1. prob A + prob B \<le> 1 + prob (A \<inter> B)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prob A + prob B \<le> 1 + prob (A \<inter> B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homotopy_equivalent_space_imp_isomorphic_reduced_homology_groups:
   "X homotopy_equivalent_space Y
        \<Longrightarrow> reduced_homology_group p X \<cong> reduced_homology_group p Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X homotopy_equivalent_space Y \<Longrightarrow> reduced_homology_group p X \<cong> reduced_homology_group p Y
[PROOF STEP]
unfolding homotopy_equivalent_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f g. continuous_map X Y f \<and> continuous_map Y X g \<and> homotopic_with (\<lambda>x. True) X X (g \<circ> f) id \<and> homotopic_with (\<lambda>x. True) Y Y (f \<circ> g) id \<Longrightarrow> reduced_homology_group p X \<cong> reduced_homology_group p Y
[PROOF STEP]
using homotopy_equivalence_reduced_homology_group_isomorphism is_isoI
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>continuous_map ?X ?Y ?f; continuous_map ?Y ?X ?g; homotopic_with (\<lambda>h. True) ?X ?X (?g \<circ> ?f) id; homotopic_with (\<lambda>k. True) ?Y ?Y (?f \<circ> ?g) id\<rbrakk> \<Longrightarrow> hom_induced ?p ?X {} ?Y {} ?f \<in> Group.iso (reduced_homology_group ?p ?X) (reduced_homology_group ?p ?Y)
?h \<in> Group.iso ?G ?H \<Longrightarrow> ?G \<cong> ?H

goal (1 subgoal):
 1. \<exists>f g. continuous_map X Y f \<and> continuous_map Y X g \<and> homotopic_with (\<lambda>x. True) X X (g \<circ> f) id \<and> homotopic_with (\<lambda>x. True) Y Y (f \<circ> g) id \<Longrightarrow> reduced_homology_group p X \<cong> reduced_homology_group p Y
[PROOF STEP]
by blast


[STATEMENT]
lemma scalar_left_zero: "scalar_prod (vec0 nn) v = zero"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. scalar_prod (vec0 nn) v = (0::'a)
[PROOF STEP]
unfolding vec0I_def scalar_prodI_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. foldr (\<lambda>(x, y). (+) (x * y)) (zip (replicate nn (0::'a)) v) (0::'a) = (0::'a)
[PROOF STEP]
proof (induct nn arbitrary: v)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>v. foldr (\<lambda>(x, y). (+) (x * y)) (zip (replicate 0 (0::'a)) v) (0::'a) = (0::'a)
 2. \<And>nn v. (\<And>v. foldr (\<lambda>(x, y). (+) (x * y)) (zip (replicate nn (0::'a)) v) (0::'a) = (0::'a)) \<Longrightarrow> foldr (\<lambda>(x, y). (+) (x * y)) (zip (replicate (Suc nn) (0::'a)) v) (0::'a) = (0::'a)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
foldr (\<lambda>a. case a of (x, y) \<Rightarrow> (+) (x * y)) (zip (replicate m (0::'a)) ?v1) (0::'a) = (0::'a)

goal (2 subgoals):
 1. \<And>v. foldr (\<lambda>(x, y). (+) (x * y)) (zip (replicate 0 (0::'a)) v) (0::'a) = (0::'a)
 2. \<And>nn v. (\<And>v. foldr (\<lambda>(x, y). (+) (x * y)) (zip (replicate nn (0::'a)) v) (0::'a) = (0::'a)) \<Longrightarrow> foldr (\<lambda>(x, y). (+) (x * y)) (zip (replicate (Suc nn) (0::'a)) v) (0::'a) = (0::'a)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
foldr (\<lambda>a. case a of (x, y) \<Rightarrow> (+) (x * y)) (zip (replicate m (0::'a)) ?v1) (0::'a) = (0::'a)

goal (1 subgoal):
 1. foldr (\<lambda>a. case a of (x, y) \<Rightarrow> (+) (x * y)) (zip (replicate (Suc m) (0::'a)) v) (0::'a) = (0::'a)
[PROOF STEP]
by (cases v, auto)
[PROOF STATE]
proof (state)
this:
foldr (\<lambda>a. case a of (x, y) \<Rightarrow> (+) (x * y)) (zip (replicate (Suc m) (0::'a)) v) (0::'a) = (0::'a)

goal (1 subgoal):
 1. \<And>v. foldr (\<lambda>(x, y). (+) (x * y)) (zip (replicate 0 (0::'a)) v) (0::'a) = (0::'a)
[PROOF STEP]
qed simp


[STATEMENT]
theorem connected_complement_homeomorphic_convex_compact:
  fixes S :: "'a::euclidean_space set" and T :: "'b::euclidean_space set"
  assumes hom: "S homeomorphic T" and T: "convex T" "compact T" and 2: "2 \<le> DIM('a)"
    shows "connected(- S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (- S)
[PROOF STEP]
proof (cases "S = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S = {} \<Longrightarrow> connected (- S)
 2. S \<noteq> {} \<Longrightarrow> connected (- S)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {}

goal (2 subgoals):
 1. S = {} \<Longrightarrow> connected (- S)
 2. S \<noteq> {} \<Longrightarrow> connected (- S)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S = {}

goal (1 subgoal):
 1. connected (- S)
[PROOF STEP]
by (simp add: connected_UNIV)
[PROOF STATE]
proof (state)
this:
connected (- S)

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> connected (- S)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> connected (- S)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
S \<noteq> {}

goal (1 subgoal):
 1. S \<noteq> {} \<Longrightarrow> connected (- S)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected (- S)
[PROOF STEP]
proof (rule connected_complement_absolute_retract)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. compact S
 2. AR S
 3. 2 \<le> DIM('a)
[PROOF STEP]
show "compact S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. compact S
[PROOF STEP]
using \<open>compact T\<close> hom homeomorphic_compactness
[PROOF STATE]
proof (prove)
using this:
compact T
S homeomorphic T
?s homeomorphic ?t \<Longrightarrow> compact ?s = compact ?t

goal (1 subgoal):
 1. compact S
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
compact S

goal (2 subgoals):
 1. AR S
 2. 2 \<le> DIM('a)
[PROOF STEP]
show "AR S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AR S
[PROOF STEP]
by (meson AR_ANR False \<open>convex T\<close> convex_imp_ANR convex_imp_contractible hom homeomorphic_ANR_iff_ANR homeomorphic_contractible_eq)
[PROOF STATE]
proof (state)
this:
AR S

goal (1 subgoal):
 1. 2 \<le> DIM('a)
[PROOF STEP]
qed (rule 2)
[PROOF STATE]
proof (state)
this:
connected (- S)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma higher_differentiable_on_real_Suc:
  "higher_differentiable_on S f (Suc n) \<longleftrightarrow>
     (\<forall>x\<in>S. f differentiable (at x)) \<and>
      (higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) 1) n)"
  if "open S"
  for S::"real set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. higher_differentiable_on S f (Suc n) = ((\<forall>x\<in>S. f differentiable at x) \<and> higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) 1) n)
[PROOF STEP]
using \<open>open S\<close>
[PROOF STATE]
proof (prove)
using this:
open S

goal (1 subgoal):
 1. higher_differentiable_on S f (Suc n) = ((\<forall>x\<in>S. f differentiable at x) \<and> higher_differentiable_on S (\<lambda>x. frechet_derivative f (at x) 1) n)
[PROOF STEP]
by (auto simp: higher_differentiable_on.simps frechet_derivative_at_real_eq_scaleR
      intro!: higher_differentiable_on_scaleR higher_differentiable_on_const
      cong: higher_differentiable_on_cong)


[STATEMENT]
lemma minusset_iterated_minusset: "sumset_iterated (minusset A) k = minusset (sumset_iterated A k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sumset_iterated (minusset A) k = minusset (sumset_iterated A k)
[PROOF STEP]
by (induction k) (auto simp: diff_minus_set)


[STATEMENT]
lemma mem_interior: "x \<in> interior S \<longleftrightarrow> (\<exists>e>0. ball x e \<subseteq> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> interior S) = (\<exists>e>0. ball x e \<subseteq> S)
[PROOF STEP]
using open_contains_ball_eq [where S="interior S"]
[PROOF STATE]
proof (prove)
using this:
open (interior S) \<Longrightarrow> (?x \<in> interior S) = (\<exists>e>0. ball ?x e \<subseteq> interior S)

goal (1 subgoal):
 1. (x \<in> interior S) = (\<exists>e>0. ball x e \<subseteq> S)
[PROOF STEP]
by (simp add: open_subset_interior)


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

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

goal (1 subgoal):
 1. (\<Sum>j = i..<n. d j * base ^ (j - i)) mod base = d i
[PROOF STEP]
using assms split_sum_first_elt_less[where
        f = "(\<lambda>j. d j * base ^ (j-i) mod base)"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>j = i..<n. d j * base ^ (j - i)) mod base = (\<Sum>j = i..<n. d j * base ^ (j - i) mod base) mod base
?i < n \<Longrightarrow> d ?i < base
0 < n
i < n
?n < ?m \<Longrightarrow> (\<Sum>ia = ?n..<?m. d ia * base ^ (ia - i) mod base) = d ?n * base ^ (?n - i) mod base + (\<Sum>ia = Suc ?n..<?m. d ia * base ^ (ia - i) mod base)

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

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in conditionally_complete_linorder) cInf_le_iff:
  assumes "A \<noteq> {}" "bdd_below A"
  shows "Inf A \<le> x \<longleftrightarrow> (\<forall>y>x. \<exists>a\<in>A. y > a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Inf A \<le> x) = (\<forall>y>x. \<exists>a\<in>A. a < y)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. \<lbrakk>Inf A \<le> x; x < y\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. a < y
 2. \<forall>y>x. \<exists>a\<in>A. a < y \<Longrightarrow> Inf A \<le> x
[PROOF STEP]
fix y
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>y. \<lbrakk>Inf A \<le> x; x < y\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. a < y
 2. \<forall>y>x. \<exists>a\<in>A. a < y \<Longrightarrow> Inf A \<le> x
[PROOF STEP]
assume "x \<ge> Inf A" "y > x"
[PROOF STATE]
proof (state)
this:
Inf A \<le> x
x < y

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Inf A \<le> x; x < y\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. a < y
 2. \<forall>y>x. \<exists>a\<in>A. a < y \<Longrightarrow> Inf A \<le> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Inf A \<le> x
x < y
[PROOF STEP]
have "y > Inf A"
[PROOF STATE]
proof (prove)
using this:
Inf A \<le> x
x < y

goal (1 subgoal):
 1. Inf A < y
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
Inf A < y

goal (2 subgoals):
 1. \<And>y. \<lbrakk>Inf A \<le> x; x < y\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. a < y
 2. \<forall>y>x. \<exists>a\<in>A. a < y \<Longrightarrow> Inf A \<le> x
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
Inf A < y
[PROOF STEP]
show "\<exists>a\<in>A. y > a"
[PROOF STATE]
proof (prove)
using this:
Inf A < y

goal (1 subgoal):
 1. \<exists>a\<in>A. a < y
[PROOF STEP]
unfolding cInf_less_iff[OF assms]
[PROOF STATE]
proof (prove)
using this:
\<exists>x\<in>A. x < y

goal (1 subgoal):
 1. \<exists>a\<in>A. a < y
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<exists>a\<in>A. a < y

goal (1 subgoal):
 1. \<forall>y>x. \<exists>a\<in>A. a < y \<Longrightarrow> Inf A \<le> x
[PROOF STEP]
qed (auto elim!: allE[of _ "Inf A"] simp add: not_le[symmetric] cInf_lower assms)


[STATEMENT]
lemma graph_homo_union[intro]:
  assumes
   "graph_homomorphism A G f_a"
   "graph_homomorphism B G f_b"
   "Domain f_a \<inter> Domain f_b = Domain (f_a \<inter> f_b)"
  shows "graph_homomorphism (graph_union A B) G (f_a \<union> f_b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. graph_homomorphism (graph_union A B) G (f_a \<union> f_b)
[PROOF STEP]
proof(rule graph_homomorphismI)
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. (f_a \<union> f_b) `` vertices (graph_union A B) \<subseteq> vertices G
 3. univalent (f_a \<union> f_b)
 4. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 5. graph (graph_union A B)
 6. graph G
[PROOF STEP]
have v0:"f_a `` vertices A \<subseteq> vertices G" "f_b `` vertices B \<subseteq> vertices G"
          "vertices A = Domain f_a" "vertices B = Domain f_b"
          "graph A" "graph B"
          "univalent f_a" "univalent f_b"
          "edge_preserving f_a (edges A) (edges G)"
          "edge_preserving f_b (edges B) (edges G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((f_a `` vertices A \<subseteq> vertices G &&& f_b `` vertices B \<subseteq> vertices G) &&& vertices A = Domain f_a &&& vertices B = Domain f_b &&& graph A) &&& (graph B &&& univalent f_a) &&& univalent f_b &&& edge_preserving f_a (edges A) (edges G) &&& edge_preserving f_b (edges B) (edges G)
[PROOF STEP]
using assms(1,2)
[PROOF STATE]
proof (prove)
using this:
graph_homomorphism A G f_a
graph_homomorphism B G f_b

goal (1 subgoal):
 1. ((f_a `` vertices A \<subseteq> vertices G &&& f_b `` vertices B \<subseteq> vertices G) &&& vertices A = Domain f_a &&& vertices B = Domain f_b &&& graph A) &&& (graph B &&& univalent f_a) &&& univalent f_b &&& edge_preserving f_a (edges A) (edges G) &&& edge_preserving f_b (edges B) (edges G)
[PROOF STEP]
unfolding graph_homomorphism_def
[PROOF STATE]
proof (prove)
using this:
vertices A = Domain f_a \<and> graph A \<and> graph G \<and> f_a `` vertices A \<subseteq> vertices G \<and> univalent f_a \<and> edge_preserving f_a (edges A) (edges G)
vertices B = Domain f_b \<and> graph B \<and> graph G \<and> f_b `` vertices B \<subseteq> vertices G \<and> univalent f_b \<and> edge_preserving f_b (edges B) (edges G)

goal (1 subgoal):
 1. ((f_a `` vertices A \<subseteq> vertices G &&& f_b `` vertices B \<subseteq> vertices G) &&& vertices A = Domain f_a &&& vertices B = Domain f_b &&& graph A) &&& (graph B &&& univalent f_a) &&& univalent f_b &&& edge_preserving f_a (edges A) (edges G) &&& edge_preserving f_b (edges B) (edges G)
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
f_a `` vertices A \<subseteq> vertices G
f_b `` vertices B \<subseteq> vertices G
vertices A = Domain f_a
vertices B = Domain f_b
graph A
graph B
univalent f_a
univalent f_b
edge_preserving f_a (edges A) (edges G)
edge_preserving f_b (edges B) (edges G)

goal (6 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. (f_a \<union> f_b) `` vertices (graph_union A B) \<subseteq> vertices G
 3. univalent (f_a \<union> f_b)
 4. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 5. graph (graph_union A B)
 6. graph G
[PROOF STEP]
hence v: "f_a `` vertices (graph_union A B) \<subseteq> vertices G"
           "f_b `` vertices (graph_union A B) \<subseteq> vertices G"
[PROOF STATE]
proof (prove)
using this:
f_a `` vertices A \<subseteq> vertices G
f_b `` vertices B \<subseteq> vertices G
vertices A = Domain f_a
vertices B = Domain f_b
graph A
graph B
univalent f_a
univalent f_b
edge_preserving f_a (edges A) (edges G)
edge_preserving f_b (edges B) (edges G)

goal (1 subgoal):
 1. f_a `` vertices (graph_union A B) \<subseteq> vertices G &&& f_b `` vertices (graph_union A B) \<subseteq> vertices G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f_a `` vertices (graph_union A B) \<subseteq> vertices G
f_b `` vertices (graph_union A B) \<subseteq> vertices G

goal (6 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. (f_a \<union> f_b) `` vertices (graph_union A B) \<subseteq> vertices G
 3. univalent (f_a \<union> f_b)
 4. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 5. graph (graph_union A B)
 6. graph G
[PROOF STEP]
show uni:"univalent (f_a \<union> f_b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. univalent (f_a \<union> f_b)
[PROOF STEP]
using assms(3) v0
[PROOF STATE]
proof (prove)
using this:
Domain f_a \<inter> Domain f_b = Domain (f_a \<inter> f_b)
f_a `` vertices A \<subseteq> vertices G
f_b `` vertices B \<subseteq> vertices G
vertices A = Domain f_a
vertices B = Domain f_b
graph A
graph B
univalent f_a
univalent f_b
edge_preserving f_a (edges A) (edges G)
edge_preserving f_b (edges B) (edges G)

goal (1 subgoal):
 1. univalent (f_a \<union> f_b)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
univalent (f_a \<union> f_b)

goal (5 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. (f_a \<union> f_b) `` vertices (graph_union A B) \<subseteq> vertices G
 3. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 4. graph (graph_union A B)
 5. graph G
[PROOF STEP]
show "(f_a \<union> f_b) `` vertices (graph_union A B) \<subseteq> vertices G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f_a \<union> f_b) `` vertices (graph_union A B) \<subseteq> vertices G
[PROOF STEP]
using v
[PROOF STATE]
proof (prove)
using this:
f_a `` vertices (graph_union A B) \<subseteq> vertices G
f_b `` vertices (graph_union A B) \<subseteq> vertices G

goal (1 subgoal):
 1. (f_a \<union> f_b) `` vertices (graph_union A B) \<subseteq> vertices G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(f_a \<union> f_b) `` vertices (graph_union A B) \<subseteq> vertices G

goal (4 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 3. graph (graph_union A B)
 4. graph G
[PROOF STEP]
have f_a:"Id_on (vertices A) O (f_a \<union> f_b) = f_a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Id_on (vertices A) O (f_a \<union> f_b) = f_a
[PROOF STEP]
using uni v0(3)
[PROOF STATE]
proof (prove)
using this:
univalent (f_a \<union> f_b)
vertices A = Domain f_a

goal (1 subgoal):
 1. Id_on (vertices A) O (f_a \<union> f_b) = f_a
[PROOF STEP]
by (cases A,auto simp:univalent_def on_triple_def Image_def)
[PROOF STATE]
proof (state)
this:
Id_on (vertices A) O (f_a \<union> f_b) = f_a

goal (4 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 3. graph (graph_union A B)
 4. graph G
[PROOF STEP]
have onA:"on_triple (f_a \<union> f_b) `` edges A = on_triple (Id_on (vertices A) O (f_a \<union> f_b)) `` edges A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_triple (f_a \<union> f_b) `` edges A = on_triple (Id_on (vertices A) O (f_a \<union> f_b)) `` edges A
[PROOF STEP]
unfolding relcomp_on_triple relcomp_Image on_triple_ID_restrict v0(5)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_triple (f_a \<union> f_b) `` edges A = on_triple (f_a \<union> f_b) `` edges A
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
on_triple (f_a \<union> f_b) `` edges A = on_triple (Id_on (vertices A) O (f_a \<union> f_b)) `` edges A

goal (4 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 3. graph (graph_union A B)
 4. graph G
[PROOF STEP]
have f_b:"Id_on (vertices B) O (f_a \<union> f_b) = f_b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Id_on (vertices B) O (f_a \<union> f_b) = f_b
[PROOF STEP]
using uni v0(4)
[PROOF STATE]
proof (prove)
using this:
univalent (f_a \<union> f_b)
vertices B = Domain f_b

goal (1 subgoal):
 1. Id_on (vertices B) O (f_a \<union> f_b) = f_b
[PROOF STEP]
unfolding Un_commute[of f_a _]
[PROOF STATE]
proof (prove)
using this:
univalent (f_b \<union> f_a)
vertices B = Domain f_b

goal (1 subgoal):
 1. Id_on (vertices B) O (f_b \<union> f_a) = f_b
[PROOF STEP]
by (cases B,auto simp:univalent_def on_triple_def Image_def)
[PROOF STATE]
proof (state)
this:
Id_on (vertices B) O (f_a \<union> f_b) = f_b

goal (4 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 3. graph (graph_union A B)
 4. graph G
[PROOF STEP]
have onB:"on_triple (f_a \<union> f_b) `` edges B = on_triple (Id_on (vertices B) O (f_a \<union> f_b)) `` edges B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_triple (f_a \<union> f_b) `` edges B = on_triple (Id_on (vertices B) O (f_a \<union> f_b)) `` edges B
[PROOF STEP]
unfolding relcomp_on_triple relcomp_Image on_triple_ID_restrict v0(6)[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. on_triple (f_a \<union> f_b) `` edges B = on_triple (f_a \<union> f_b) `` edges B
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
on_triple (f_a \<union> f_b) `` edges B = on_triple (Id_on (vertices B) O (f_a \<union> f_b)) `` edges B

goal (4 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 3. graph (graph_union A B)
 4. graph G
[PROOF STEP]
have "edge_preserving (f_a \<union> f_b) (edges A) (edges G)"
       "edge_preserving (f_a \<union> f_b) (edges B) (edges G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. edge_preserving (f_a \<union> f_b) (edges A) (edges G) &&& edge_preserving (f_a \<union> f_b) (edges B) (edges G)
[PROOF STEP]
using v0(9,10)
[PROOF STATE]
proof (prove)
using this:
edge_preserving f_a (edges A) (edges G)
edge_preserving f_b (edges B) (edges G)

goal (1 subgoal):
 1. edge_preserving (f_a \<union> f_b) (edges A) (edges G) &&& edge_preserving (f_a \<union> f_b) (edges B) (edges G)
[PROOF STEP]
unfolding edge_preserving onA[unfolded f_a] onB[unfolded f_b]
[PROOF STATE]
proof (prove)
using this:
on_triple f_a `` edges A \<subseteq> edges G
on_triple f_b `` edges B \<subseteq> edges G

goal (1 subgoal):
 1. on_triple f_a `` edges A \<subseteq> edges G &&& on_triple f_b `` edges B \<subseteq> edges G
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
edge_preserving (f_a \<union> f_b) (edges A) (edges G)
edge_preserving (f_a \<union> f_b) (edges B) (edges G)

goal (4 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
 3. graph (graph_union A B)
 4. graph G
[PROOF STEP]
thus "edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)"
[PROOF STATE]
proof (prove)
using this:
edge_preserving (f_a \<union> f_b) (edges A) (edges G)
edge_preserving (f_a \<union> f_b) (edges B) (edges G)

goal (1 subgoal):
 1. edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
edge_preserving (f_a \<union> f_b) (edges (graph_union A B)) (edges G)

goal (3 subgoals):
 1. vertices (graph_union A B) = Domain (f_a \<union> f_b)
 2. graph (graph_union A B)
 3. graph G
[PROOF STEP]
qed (insert assms[unfolded graph_homomorphism_def],auto)


[STATEMENT]
lemma row_rank_eq_col_rank:
  fixes A::"'a::{field}^'n::{mod_type}^'m::{mod_type}"
  shows "row_rank A = col_rank A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
obtain P where inv_P: "invertible P" and G_PA: "(Gauss_Jordan A) = P**A"
  and rref_G: "reduced_row_echelon_form (Gauss_Jordan A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; Gauss_Jordan A = P ** A; reduced_row_echelon_form (Gauss_Jordan A)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using invertible_Gauss_Jordan rref_Gauss_Jordan
[PROOF STATE]
proof (prove)
using this:
\<exists>P. invertible P \<and> Gauss_Jordan ?A = P ** ?A
reduced_row_echelon_form (Gauss_Jordan ?A)

goal (1 subgoal):
 1. (\<And>P. \<lbrakk>invertible P; Gauss_Jordan A = P ** A; reduced_row_echelon_form (Gauss_Jordan A)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
invertible P
Gauss_Jordan A = P ** A
reduced_row_echelon_form (Gauss_Jordan A)

goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
have "row_rank A = row_rank (Gauss_Jordan A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_rank A = row_rank (Gauss_Jordan A)
[PROOF STEP]
by (metis row_space_is_preserved invertible_Gauss_Jordan row_rank_def)
[PROOF STATE]
proof (state)
this:
row_rank A = row_rank (Gauss_Jordan A)

goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
row_rank A = row_rank (Gauss_Jordan A)

goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
have "col_rank A = col_rank (Gauss_Jordan A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col_rank A = col_rank (Gauss_Jordan A)
[PROOF STEP]
by (metis invertible_Gauss_Jordan crk_is_preserved)
[PROOF STATE]
proof (state)
this:
col_rank A = col_rank (Gauss_Jordan A)

goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
col_rank A = col_rank (Gauss_Jordan A)

goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
have "col_rank (Gauss_Jordan A) = row_rank (Gauss_Jordan A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col_rank (Gauss_Jordan A) = row_rank (Gauss_Jordan A)
[PROOF STEP]
using row_rank_eq_col_rank_rref[OF rref_G]
[PROOF STATE]
proof (prove)
using this:
row_rank (Gauss_Jordan A) = col_rank (Gauss_Jordan A)

goal (1 subgoal):
 1. col_rank (Gauss_Jordan A) = row_rank (Gauss_Jordan A)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
col_rank (Gauss_Jordan A) = row_rank (Gauss_Jordan A)

goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
row_rank A = row_rank (Gauss_Jordan A)
col_rank A = col_rank (Gauss_Jordan A)
col_rank (Gauss_Jordan A) = row_rank (Gauss_Jordan A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
row_rank A = row_rank (Gauss_Jordan A)
col_rank A = col_rank (Gauss_Jordan A)
col_rank (Gauss_Jordan A) = row_rank (Gauss_Jordan A)

goal (1 subgoal):
 1. row_rank A = col_rank A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
row_rank A = col_rank A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_at_within_powr[continuous_intros]:
  fixes f g :: "_ \<Rightarrow> real"
  assumes "continuous (at a within s) f"
    and "continuous (at a within s) g"
    and "f a \<noteq> 0"
  shows "continuous (at a within s) (\<lambda>x. (f x) powr (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (at a within s) (\<lambda>x. f x powr g x)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous (at a within s) f
continuous (at a within s) g
f a \<noteq> 0

goal (1 subgoal):
 1. continuous (at a within s) (\<lambda>x. f x powr g x)
[PROOF STEP]
unfolding continuous_within
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> f a) (at a within s)
(g \<longlongrightarrow> g a) (at a within s)
f a \<noteq> 0

goal (1 subgoal):
 1. ((\<lambda>x. f x powr g x) \<longlongrightarrow> f a powr g a) (at a within s)
[PROOF STEP]
by (rule tendsto_powr)


[STATEMENT]
lemma squarefree_decomposition_unique2':
  assumes decomp: "(\<Prod>A1 * s1^2) = (\<Prod>A2 * s2^2 :: nat)"
  assumes fin: "finite A1" "finite A2"
  assumes subset: "\<And>x. x \<in> A1 \<Longrightarrow> prime x" "\<And>x. x \<in> A2 \<Longrightarrow> prime x"
  assumes pos: "s1 > 0" "s2 > 0"
  defines "n \<equiv> \<Prod>A1 * s1^2"
  shows "A1 = A2" "s1 = s2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A1 = A2 &&& s1 = s2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A1 = A2
 2. s1 = s2
[PROOF STEP]
from pos
[PROOF STATE]
proof (chain)
picking this:
0 < s1
0 < s2
[PROOF STEP]
have n: "n > 0"
[PROOF STATE]
proof (prove)
using this:
0 < s1
0 < s2

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
using prime_gt_0_nat
[PROOF STATE]
proof (prove)
using this:
0 < s1
0 < s2
prime ?p \<Longrightarrow> 0 < ?p

goal (1 subgoal):
 1. 0 < n
[PROOF STEP]
by (auto simp: n_def intro!: prod_pos dest: subset)
[PROOF STATE]
proof (state)
this:
0 < n

goal (2 subgoals):
 1. A1 = A2
 2. s1 = s2
[PROOF STEP]
have "A1 = squarefree_part n" "s1 = square_part n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A1 = squarefree_part n &&& s1 = square_part n
[PROOF STEP]
by ((rule squarefree_decomposition_unique2[of n A1 s1], insert assms n, simp_all)[])+
[PROOF STATE]
proof (state)
this:
A1 = squarefree_part n
s1 = square_part n

goal (2 subgoals):
 1. A1 = A2
 2. s1 = s2
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
A1 = squarefree_part n
s1 = square_part n

goal (2 subgoals):
 1. A1 = A2
 2. s1 = s2
[PROOF STEP]
have "A2 = squarefree_part n" "s2 = square_part n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A2 = squarefree_part n &&& s2 = square_part n
[PROOF STEP]
by ((rule squarefree_decomposition_unique2[of n A2 s2], insert assms n, simp_all)[])+
[PROOF STATE]
proof (state)
this:
A2 = squarefree_part n
s2 = square_part n

goal (2 subgoals):
 1. A1 = A2
 2. s1 = s2
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
A1 = squarefree_part n
s1 = square_part n
A2 = squarefree_part n
s2 = square_part n
[PROOF STEP]
show "A1 = A2" "s1 = s2"
[PROOF STATE]
proof (prove)
using this:
A1 = squarefree_part n
s1 = square_part n
A2 = squarefree_part n
s2 = square_part n

goal (1 subgoal):
 1. A1 = A2 &&& s1 = s2
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
A1 = A2
s1 = s2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma R45 [simp]: "pmf (sds R45) a = 1/4" "pmf (sds R45) b = 1/4"
           "pmf (sds R45) c = 1/4" "pmf (sds R45) d = 1/4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (pmf (sds R45) a = 1 / 4 &&& pmf (sds R45) b = 1 / 4) &&& pmf (sds R45) c = 1 / 4 &&& pmf (sds R45) d = 1 / 4
[PROOF STEP]
using R45.orbits lottery_conditions[OF R45.wf]
[PROOF STATE]
proof (prove)
using this:
pmf (sds R45) c = pmf (sds R45) a
pmf (sds R45) d = pmf (sds R45) a
pmf (sds R45) b = pmf (sds R45) a
0 \<le> pmf (sds R45) a
0 \<le> pmf (sds R45) b
0 \<le> pmf (sds R45) c
0 \<le> pmf (sds R45) d
pmf (sds R45) a + pmf (sds R45) b + pmf (sds R45) c + pmf (sds R45) d = 1

goal (1 subgoal):
 1. (pmf (sds R45) a = 1 / 4 &&& pmf (sds R45) b = 1 / 4) &&& pmf (sds R45) c = 1 / 4 &&& pmf (sds R45) d = 1 / 4
[PROOF STEP]
by simp_all


[STATEMENT]
lemma sigma1[simp]: "sigma(Suc 0) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma (Suc 0) = 1
[PROOF STEP]
by (simp add: sum_eq_Suc0_iff)


[STATEMENT]
lemma [simp]:
      assumes "invar_vebt t n" "\<forall>x\<in>set xs. x<2^n"
      shows "set_vebt (foldl vebt_insert t xs) = set_vebt t \<union> set xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_vebt (foldl vebt_insert t xs) = set_vebt t \<union> set xs
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
invar_vebt t n
\<forall>x\<in>set xs. x < 2 ^ n

goal (1 subgoal):
 1. set_vebt (foldl vebt_insert t xs) = set_vebt t \<union> set xs
[PROOF STEP]
apply (induction xs arbitrary: t)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>t. \<lbrakk>invar_vebt t n; \<forall>x\<in>set []. x < 2 ^ n\<rbrakk> \<Longrightarrow> set_vebt (foldl vebt_insert t []) = set_vebt t \<union> set []
 2. \<And>a xs t. \<lbrakk>\<And>t. \<lbrakk>invar_vebt t n; \<forall>x\<in>set xs. x < 2 ^ n\<rbrakk> \<Longrightarrow> set_vebt (foldl vebt_insert t xs) = set_vebt t \<union> set xs; invar_vebt t n; \<forall>x\<in>set (a # xs). x < 2 ^ n\<rbrakk> \<Longrightarrow> set_vebt (foldl vebt_insert t (a # xs)) = set_vebt t \<union> set (a # xs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma powhr_add: "\<And>a b x. x powhr (a + b) = (x powhr a) * (x powhr b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b x. x powhr (a + b) = x powhr a * x powhr b
[PROOF STEP]
by transfer (rule powr_add)


[STATEMENT]
lemma integer_of_nat_0: "integer_of_nat 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_nat 0 = 0
[PROOF STEP]
by transfer simp


[STATEMENT]
lemma mersenne_prime_code [code]:
  "mersenne_prime p \<longleftrightarrow> prime p \<and> lucas_lehmer_test p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mersenne_prime p = (prime p \<and> lucas_lehmer_test p)
[PROOF STEP]
unfolding mersenne_prime_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (2 < p \<and> prime (2 ^ p - 1)) = (prime p \<and> lucas_lehmer_test p)
[PROOF STEP]
using lucas_lehmer_correct'[of p]
[PROOF STATE]
proof (prove)
using this:
prime (2 ^ p - 1) = (prime p \<and> (p = 2 \<or> lucas_lehmer_test p))

goal (1 subgoal):
 1. (2 < p \<and> prime (2 ^ p - 1)) = (prime p \<and> lucas_lehmer_test p)
[PROOF STEP]
by (auto simp: lucas_lehmer_test_def)


[STATEMENT]
lemma rel_interior_UNIV [simp]: "rel_interior (UNIV :: ('n::euclidean_space) set) = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rel_interior UNIV = UNIV
[PROOF STEP]
by (metis open_UNIV rel_interior_open)


[STATEMENT]
lemma nat_cadd_eq_add: "ord_of_nat m \<oplus> ord_of_nat n = ord_of_nat (m + n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ord_of_nat m \<oplus> ord_of_nat n = ord_of_nat (m + n)
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ord_of_nat 0 \<oplus> ord_of_nat n = ord_of_nat (0 + n)
 2. \<And>m. ord_of_nat m \<oplus> ord_of_nat n = ord_of_nat (m + n) \<Longrightarrow> ord_of_nat (Suc m) \<oplus> ord_of_nat n = ord_of_nat (Suc m + n)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
ord_of_nat m \<oplus> ord_of_nat n = ord_of_nat (m + n)

goal (2 subgoals):
 1. ord_of_nat 0 \<oplus> ord_of_nat n = ord_of_nat (0 + n)
 2. \<And>m. ord_of_nat m \<oplus> ord_of_nat n = ord_of_nat (m + n) \<Longrightarrow> ord_of_nat (Suc m) \<oplus> ord_of_nat n = ord_of_nat (Suc m + n)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
ord_of_nat m \<oplus> ord_of_nat n = ord_of_nat (m + n)

goal (1 subgoal):
 1. ord_of_nat (Suc m) \<oplus> ord_of_nat n = ord_of_nat (Suc m + n)
[PROOF STEP]
by (metis Card_def Card_ord_of_nat add_Suc cadd_succ ord_of_nat.simps(2))
[PROOF STATE]
proof (state)
this:
ord_of_nat (Suc m) \<oplus> ord_of_nat n = ord_of_nat (Suc m + n)

goal (1 subgoal):
 1. ord_of_nat 0 \<oplus> ord_of_nat n = ord_of_nat (0 + n)
[PROOF STEP]
qed auto


[STATEMENT]
lemma powr_one_eq_one [simp]: "1 powr a = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1::'a) powr a = (1::'a)
[PROOF STEP]
by (simp add: powr_def)


[STATEMENT]
lemma fls_integral_fps_to_fls:
  "fls_integral (fps_to_fls f) = fps_to_fls (fps_integral0 f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (fps_to_fls f) = fps_to_fls (fps_integral0 f)
[PROOF STEP]
proof (intro fls_eqI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. fls_integral (fps_to_fls f) $$ x = fps_to_fls (fps_integral0 f) $$ x
[PROOF STEP]
fix n :: int
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x. fls_integral (fps_to_fls f) $$ x = fps_to_fls (fps_integral0 f) $$ x
[PROOF STEP]
show "fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
proof (cases "n<1")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. n < 1 \<Longrightarrow> fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
 2. \<not> n < 1 \<Longrightarrow> fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
n < 1

goal (2 subgoals):
 1. n < 1 \<Longrightarrow> fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
 2. \<not> n < 1 \<Longrightarrow> fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
n < 1

goal (1 subgoal):
 1. fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n

goal (1 subgoal):
 1. \<not> n < 1 \<Longrightarrow> fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> n < 1 \<Longrightarrow> fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> n < 1

goal (1 subgoal):
 1. \<not> n < 1 \<Longrightarrow> fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
hence "nat (n-1) = nat n - 1"
[PROOF STATE]
proof (prove)
using this:
\<not> n < 1

goal (1 subgoal):
 1. nat (n - 1) = nat n - 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
nat (n - 1) = nat n - 1

goal (1 subgoal):
 1. \<not> n < 1 \<Longrightarrow> fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
\<not> n < 1
nat (n - 1) = nat n - 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> n < 1
nat (n - 1) = nat n - 1

goal (1 subgoal):
 1. fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n
[PROOF STEP]
by (cases "nat n") auto
[PROOF STATE]
proof (state)
this:
fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
fls_integral (fps_to_fls f) $$ n = fps_to_fls (fps_integral0 f) $$ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mset_subset_eq_multiset_union_diff_commute:
  fixes A B C D :: "'a multiset"
  shows "B \<subseteq># A \<Longrightarrow> A - B + C = A + C - B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<subseteq># A \<Longrightarrow> A - B + C = A + C - B
[PROOF STEP]
by (fact subset_mset.add_diff_assoc2)


[STATEMENT]
lemma trans_impl:"(\<forall> i j.(P i j \<longrightarrow> Q i j))\<and>(\<forall> i j. (Q i j \<longrightarrow> R i j))
        \<Longrightarrow> (\<forall> i j. (P i j \<longrightarrow> R i j))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>i j. P i j \<longrightarrow> Q i j) \<and> (\<forall>i j. Q i j \<longrightarrow> R i j) \<Longrightarrow> \<forall>i j. P i j \<longrightarrow> R i j
[PROOF STEP]
by auto


[STATEMENT]
lemma continuous_on_open_UN:
  "(\<And>s. s \<in> S \<Longrightarrow> open (A s)) \<Longrightarrow> (\<And>s. s \<in> S \<Longrightarrow> continuous_on (A s) f) \<Longrightarrow>
    continuous_on (\<Union>s\<in>S. A s) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>s. s \<in> S \<Longrightarrow> open (A s); \<And>s. s \<in> S \<Longrightarrow> continuous_on (A s) f\<rbrakk> \<Longrightarrow> continuous_on (\<Union> (A ` S)) f
[PROOF STEP]
by (rule continuous_on_open_Union) auto


[STATEMENT]
lemma del_edge_undirected_degree_plus': "finite (edges g) \<Longrightarrow> (v,e,v') \<in> edges g
    \<Longrightarrow> (v',e,v) \<in> edges g \<Longrightarrow> degree v' (del_unEdge v e v' g) + 1=degree v' g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite (edges g); (v, e, v') \<in> edges g; (v', e, v) \<in> edges g\<rbrakk> \<Longrightarrow> degree v' (del_unEdge v e v' g) + 1 = degree v' g
[PROOF STEP]
by (metis del_edge_undirected_degree_plus delete_edge_sym)


[STATEMENT]
lemma is_balanced_inter:
  fixes A B:: "nat set"
  assumes "\<forall>x \<in> A. f x = 0" and "\<forall>x \<in> B. f x = 1"
  shows "A \<inter> B = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>A. f x = 0
\<forall>x\<in>B. f x = 1

goal (1 subgoal):
 1. A \<inter> B = {}
[PROOF STEP]
by auto


[STATEMENT]
lemma cball_eq_closed_segment_real:
  fixes x e::real
  shows "cball x e = (if e \<ge> 0 then {x - e -- x + e} else {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cball x e = (if 0 \<le> e then {x - e--x + e} else {})
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl dist_real_def mem_cball)


[STATEMENT]
lemma [simp, code]: "mat_of_cblinfun hadamard = matrix_hadamard"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun hadamard = matrix_hadamard
[PROOF STEP]
apply (auto simp add: hadamard_def matrix_hadamard_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_of_cblinfun (cblinfun_of_mat (mat_of_rows_list 2 [[1 / complex_of_real (sqrt 2), 1 / complex_of_real (sqrt 2)], [1 / complex_of_real (sqrt 2), - (1 / complex_of_real (sqrt 2))]])) = mat_of_rows_list 2 [[1 / complex_of_real (sqrt 2), 1 / complex_of_real (sqrt 2)], [1 / complex_of_real (sqrt 2), - (1 / complex_of_real (sqrt 2))]]
[PROOF STEP]
apply (subst cblinfun_of_mat_inverse)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. mat_of_rows_list 2 [[1 / complex_of_real (sqrt 2), 1 / complex_of_real (sqrt 2)], [1 / complex_of_real (sqrt 2), - (1 / complex_of_real (sqrt 2))]] \<in> carrier_mat (length canonical_basis) (length canonical_basis)
 2. mat_of_rows_list 2 [[1 / complex_of_real (sqrt 2), 1 / complex_of_real (sqrt 2)], [1 / complex_of_real (sqrt 2), - (1 / complex_of_real (sqrt 2))]] = mat_of_rows_list 2 [[1 / complex_of_real (sqrt 2), 1 / complex_of_real (sqrt 2)], [1 / complex_of_real (sqrt 2), - (1 / complex_of_real (sqrt 2))]]
[PROOF STEP]
by (auto)


[STATEMENT]
theorem c_out_asi_hlist:
  assumes "sel_reasonable sf"
      and "\<forall>x. cf x > 0"
      and "c = c_list f cf h r"
      and "f = (ldeep_s sf xs)"
      and "h = create_h_list (\<lambda>xs x. (list_sel_aux' sf xs x) * cf x) xs"
    shows "asi (\<lambda>l. (ldeep_T f cf l - 1) / c l) r (c_list f cf h r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. asi (\<lambda>l. (ldeep_T f cf l - 1) / c l) r (c_list f cf h r)
[PROOF STEP]
unfolding asi_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>A U V B. distinct (A @ U @ V @ B) \<and> U \<noteq> [] \<and> V \<noteq> [] \<and> (r \<notin> set (A @ U @ V @ B) \<or> take 1 (A @ U @ V @ B) = [r] \<and> take 1 (A @ V @ U @ B) = [r]) \<longrightarrow> (c_list f cf h r (rev (A @ U @ V @ B)) \<le> c_list f cf h r (rev (A @ V @ U @ B))) = ((ldeep_T f cf (rev U) - 1) / c (rev U) \<le> (ldeep_T f cf (rev V) - 1) / c (rev V))
[PROOF STEP]
using c_out_asi_aux_hlist[OF assms] assms(3)
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>distinct (?A @ ?U @ ?V @ ?B); ?U \<noteq> []; ?V \<noteq> []; ?rank = (\<lambda>l. (ldeep_T f cf l - 1) / c l); r \<notin> set (?A @ ?U @ ?V @ ?B) \<or> take 1 (?A @ ?U @ ?V @ ?B) = [r] \<and> take 1 (?A @ ?V @ ?U @ ?B) = [r]\<rbrakk> \<Longrightarrow> (c (rev (?A @ ?U @ ?V @ ?B)) \<le> c (rev (?A @ ?V @ ?U @ ?B))) = (?rank (rev ?U) \<le> ?rank (rev ?V))
c = c_list f cf h r

goal (1 subgoal):
 1. \<forall>A U V B. distinct (A @ U @ V @ B) \<and> U \<noteq> [] \<and> V \<noteq> [] \<and> (r \<notin> set (A @ U @ V @ B) \<or> take 1 (A @ U @ V @ B) = [r] \<and> take 1 (A @ V @ U @ B) = [r]) \<longrightarrow> (c_list f cf h r (rev (A @ U @ V @ B)) \<le> c_list f cf h r (rev (A @ V @ U @ B))) = ((ldeep_T f cf (rev U) - 1) / c (rev U) \<le> (ldeep_T f cf (rev V) - 1) / c (rev V))
[PROOF STEP]
by blast


[STATEMENT]
lemma all2_less_lemma [simp]:
  "rec_eval (rec_all2_less f) [x, y1, y2] = (if (\<forall>z < x. 0 < rec_eval f [z, y1, y2]) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (rec_all2_less f) [x, y1, y2] = (if \<forall>z<x. 0 < rec_eval f [z, y1, y2] then 1 else 0)
[PROOF STEP]
apply(auto simp add: Let_def rec_all2_less_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>z. \<lbrakk>\<forall>z\<le>x. z = x \<or> 0 < rec_eval f [z, y1, y2]; z < x; rec_eval f [z, y1, y2] = 0\<rbrakk> \<Longrightarrow> \<exists>z\<le>x. z \<noteq> x \<and> rec_eval f [z, y1, y2] = 0
 2. \<And>z. \<lbrakk>z \<le> x; z \<noteq> x; rec_eval f [z, y1, y2] = 0\<rbrakk> \<Longrightarrow> \<exists>z<x. rec_eval f [z, y1, y2] = 0
[PROOF STEP]
apply(metis nat_less_le)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "y + (x + -x) = (0::int) + y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y + (x + - x) = 0 + y
[PROOF STEP]
by simp


[STATEMENT]
lemma sparse_row_vector_minus:
  "sparse_row_vector (minus_spvec v) = - (sparse_row_vector v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sparse_row_vector (minus_spvec v) = - sparse_row_vector v
[PROOF STEP]
apply (induct v)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sparse_row_vector (minus_spvec []) = - sparse_row_vector []
 2. \<And>a v. sparse_row_vector (minus_spvec v) = - sparse_row_vector v \<Longrightarrow> sparse_row_vector (minus_spvec (a # v)) = - sparse_row_vector (a # v)
[PROOF STEP]
apply (simp_all add: sparse_row_vector_cons)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a v. sparse_row_vector (minus_spvec v) = - sparse_row_vector v \<Longrightarrow> singleton_matrix 0 (fst a) (- snd a) = - singleton_matrix 0 (fst a) (snd a)
[PROOF STEP]
apply (simp add: Rep_matrix_inject[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a v. Rep_matrix (sparse_row_vector (minus_spvec v)) = Rep_matrix (- sparse_row_vector v) \<Longrightarrow> Rep_matrix (singleton_matrix 0 (fst a) (- snd a)) = Rep_matrix (- singleton_matrix 0 (fst a) (snd a))
[PROOF STEP]
apply (rule ext)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a v x xa. Rep_matrix (sparse_row_vector (minus_spvec v)) = Rep_matrix (- sparse_row_vector v) \<Longrightarrow> Rep_matrix (singleton_matrix 0 (fst a) (- snd a)) x xa = Rep_matrix (- singleton_matrix 0 (fst a) (snd a)) x xa
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma oppositeLiteralListNonempty:
  fixes literalList :: "Literal list"
  shows "(literalList \<noteq> []) = ((oppositeLiteralList literalList) \<noteq> [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (literalList \<noteq> []) = (oppositeLiteralList literalList \<noteq> [])
[PROOF STEP]
unfolding oppositeLiteralList_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (literalList \<noteq> []) = (map opposite literalList \<noteq> [])
[PROOF STEP]
by (induct literalList) auto


[STATEMENT]
lemma direct_sum_is_vs:
  fixes K V1 V2
  assumes h1: "vectorspace K V1" and h2: "vectorspace K V2"
  shows "vectorspace K (direct_sum V1 V2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace K (direct_sum V1 V2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vectorspace K (direct_sum V1 V2)
[PROOF STEP]
from h1 h2
[PROOF STATE]
proof (chain)
picking this:
vectorspace K V1
vectorspace K V2
[PROOF STEP]
have mod: "module K (direct_sum V1 V2)"
[PROOF STATE]
proof (prove)
using this:
vectorspace K V1
vectorspace K V2

goal (1 subgoal):
 1. module K (direct_sum V1 V2)
[PROOF STEP]
by (unfold vectorspace_def, intro direct_sum_is_module, auto)
[PROOF STATE]
proof (state)
this:
module K (direct_sum V1 V2)

goal (1 subgoal):
 1. vectorspace K (direct_sum V1 V2)
[PROOF STEP]
from mod h1
[PROOF STATE]
proof (chain)
picking this:
module K (direct_sum V1 V2)
vectorspace K V1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
module K (direct_sum V1 V2)
vectorspace K V1

goal (1 subgoal):
 1. vectorspace K (direct_sum V1 V2)
[PROOF STEP]
by (unfold vectorspace_def, auto)
[PROOF STATE]
proof (state)
this:
vectorspace K (direct_sum V1 V2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subadditive_content_division:
  assumes "\<D> division_of S" "S \<subseteq> cbox a b"
  shows "sum content \<D> \<le> content(cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
have "\<D> division_of \<Union>\<D>" "\<Union>\<D> \<subseteq> cbox a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<D> division_of \<Union> \<D> &&& \<Union> \<D> \<subseteq> cbox a b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<D> division_of S
S \<subseteq> cbox a b

goal (1 subgoal):
 1. \<D> division_of \<Union> \<D> &&& \<Union> \<D> \<subseteq> cbox a b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<D> division_of \<Union> \<D>
\<Union> \<D> \<subseteq> cbox a b

goal (1 subgoal):
 1. sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<D> division_of \<Union> \<D>
\<Union> \<D> \<subseteq> cbox a b
[PROOF STEP]
obtain \<D>' where "\<D> \<subseteq> \<D>'" "\<D>' division_of cbox a b"
[PROOF STATE]
proof (prove)
using this:
\<D> division_of \<Union> \<D>
\<Union> \<D> \<subseteq> cbox a b

goal (1 subgoal):
 1. (\<And>\<D>'. \<lbrakk>\<D> \<subseteq> \<D>'; \<D>' division_of cbox a b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using partial_division_extend_interval
[PROOF STATE]
proof (prove)
using this:
\<D> division_of \<Union> \<D>
\<Union> \<D> \<subseteq> cbox a b
\<lbrakk>?p division_of \<Union> ?p; \<Union> ?p \<subseteq> cbox ?a ?b; \<And>q. \<lbrakk>?p \<subseteq> q; q division_of cbox ?a ?b\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>\<D>'. \<lbrakk>\<D> \<subseteq> \<D>'; \<D>' division_of cbox a b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by metis
[PROOF STATE]
proof (state)
this:
\<D> \<subseteq> \<D>'
\<D>' division_of cbox a b

goal (1 subgoal):
 1. sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<D> \<subseteq> \<D>'
\<D>' division_of cbox a b
[PROOF STEP]
have "sum content \<D> \<le> sum content \<D>'"
[PROOF STATE]
proof (prove)
using this:
\<D> \<subseteq> \<D>'
\<D>' division_of cbox a b

goal (1 subgoal):
 1. sum content \<D> \<le> sum content \<D>'
[PROOF STEP]
using sum_mono2
[PROOF STATE]
proof (prove)
using this:
\<D> \<subseteq> \<D>'
\<D>' division_of cbox a b
\<lbrakk>finite ?B; ?A \<subseteq> ?B; \<And>b. b \<in> ?B - ?A \<Longrightarrow> (0::?'a) \<le> ?f b\<rbrakk> \<Longrightarrow> sum ?f ?A \<le> sum ?f ?B

goal (1 subgoal):
 1. sum content \<D> \<le> sum content \<D>'
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sum content \<D> \<le> sum content \<D>'

goal (1 subgoal):
 1. sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sum content \<D> \<le> sum content \<D>'

goal (1 subgoal):
 1. sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
have "... \<le> content(cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum content \<D>' \<le> content (cbox a b)
[PROOF STEP]
by (simp add: \<open>\<D>' division_of cbox a b\<close> additive_content_division less_eq_real_def)
[PROOF STATE]
proof (state)
this:
sum content \<D>' \<le> content (cbox a b)

goal (1 subgoal):
 1. sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sum content \<D> \<le> content (cbox a b)

goal (1 subgoal):
 1. sum content \<D> \<le> content (cbox a b)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sum content \<D> \<le> content (cbox a b)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma take_zip: "take n (zip xs ys) = zip (take n xs) (take n ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take n (zip xs ys) = zip (take n xs) (take n ys)
[PROOF STEP]
proof (induct n arbitrary: xs ys)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>xs ys. take 0 (zip xs ys) = zip (take 0 xs) (take 0 ys)
 2. \<And>n xs ys. (\<And>xs ys. take n (zip xs ys) = zip (take n xs) (take n ys)) \<Longrightarrow> take (Suc n) (zip xs ys) = zip (take (Suc n) xs) (take (Suc n) ys)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>xs ys. take 0 (zip xs ys) = zip (take 0 xs) (take 0 ys)
 2. \<And>n xs ys. (\<And>xs ys. take n (zip xs ys) = zip (take n xs) (take n ys)) \<Longrightarrow> take (Suc n) (zip xs ys) = zip (take (Suc n) xs) (take (Suc n) ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take 0 (zip xs ys) = zip (take 0 xs) (take 0 ys)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
take 0 (zip xs ys) = zip (take 0 xs) (take 0 ys)

goal (1 subgoal):
 1. \<And>n xs ys. (\<And>xs ys. take n (zip xs ys) = zip (take n xs) (take n ys)) \<Longrightarrow> take (Suc n) (zip xs ys) = zip (take (Suc n) xs) (take (Suc n) ys)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n xs ys. (\<And>xs ys. take n (zip xs ys) = zip (take n xs) (take n ys)) \<Longrightarrow> take (Suc n) (zip xs ys) = zip (take (Suc n) xs) (take (Suc n) ys)
[PROOF STEP]
case Suc
[PROOF STATE]
proof (state)
this:
take n_ (zip ?xs ?ys) = zip (take n_ ?xs) (take n_ ?ys)

goal (1 subgoal):
 1. \<And>n xs ys. (\<And>xs ys. take n (zip xs ys) = zip (take n xs) (take n ys)) \<Longrightarrow> take (Suc n) (zip xs ys) = zip (take (Suc n) xs) (take (Suc n) ys)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take n_ (zip ?xs ?ys) = zip (take n_ ?xs) (take n_ ?ys)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
take n_ (zip ?xs ?ys) = zip (take n_ ?xs) (take n_ ?ys)

goal (1 subgoal):
 1. take (Suc n_) (zip xs ys) = zip (take (Suc n_) xs) (take (Suc n_) ys)
[PROOF STEP]
by (cases xs; cases ys) simp_all
[PROOF STATE]
proof (state)
this:
take (Suc n_) (zip xs ys) = zip (take (Suc n_) xs) (take (Suc n_) ys)

goal:
No subgoals!
[PROOF STEP]
qed