[STATEMENT]
lemma (in group) int_pow_neg_int: "x \<in> carrier G \<Longrightarrow> x [^] -(int n) = inv (x [^] n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> carrier G \<Longrightarrow> x [^] - int n = inv (x [^] n)
[PROOF STEP]
by (simp add: int_pow_neg int_pow_int)


[STATEMENT]
lemma lcm_proj1_iff_nat [simp]: "lcm m n = m \<longleftrightarrow> n dvd m"
  for m n :: nat
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (lcm m n = m) = (n dvd m)
[PROOF STEP]
by (metis lcm_proj1_if_dvd_nat lcm_unique_nat)


[STATEMENT]
lemma inv_sum_rel_eq[simp]: "(\<langle>P,Q\<rangle>sum_rel)\<inverse> = \<langle>P\<inverse>,Q\<inverse>\<rangle>sum_rel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<langle>P, Q\<rangle>sum_rel)\<inverse> = \<langle>P\<inverse>, Q\<inverse>\<rangle>sum_rel
[PROOF STEP]
by (auto simp: sum_rel_def)


[STATEMENT]
lemma D_Mprefix:
"D(\<box> x \<in> A \<rightarrow> P x) = {d. d \<noteq>  [] \<and>  hd d \<in> (ev ` A) \<and>
                        (\<exists> a. ev a = hd d  \<and> tl d \<in> D(P a))}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. D (Mprefix A P) = {d. d \<noteq> [] \<and> hd d \<in> ev ` A \<and> (\<exists>a. ev a = hd d \<and> tl d \<in> D (P a))}
[PROOF STEP]
by(simp add:Mprefix_def D_def Rep_Abs_Mp'' DIVERGENCES_def)


[STATEMENT]
lemma smod_int_alt_def:
     "(a::int) smod b = sgn (a) * (abs a mod abs b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a smod b = sgn a * (\<bar>a\<bar> mod \<bar>b\<bar>)
[PROOF STEP]
by (fact signed_modulo_int_def)


[STATEMENT]
lemma agree_on_ext:
  assumes "agree_on G f\<^sub>1 f\<^sub>2"
  shows "agree_on G (f\<^sub>1 O g) (f\<^sub>2 O g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. agree_on G (f\<^sub>1 O g) (f\<^sub>2 O g)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
agree_on G f\<^sub>1 f\<^sub>2

goal (1 subgoal):
 1. agree_on G (f\<^sub>1 O g) (f\<^sub>2 O g)
[PROOF STEP]
unfolding agree_on_def
[PROOF STATE]
proof (prove)
using this:
\<forall>v\<in>vertices G. f\<^sub>1 `` {v} = f\<^sub>2 `` {v}

goal (1 subgoal):
 1. \<forall>v\<in>vertices G. (f\<^sub>1 O g) `` {v} = (f\<^sub>2 O g) `` {v}
[PROOF STEP]
by auto


[STATEMENT]
lemma norm_cvec_square:
  shows "\<langle>z\<rangle>\<^sup>2 = Re (\<langle>z,z\<rangle>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>z\<rangle>\<^sup>2 = Re \<langle>z,z\<rangle>
[PROOF STEP]
by (simp del: inprod_cvec_def)


[STATEMENT]
lemma (in Module) linmap_im_linspan:"\<lbrakk>ideal R A; R module N; f \<in> mHom R M N;
       H \<subseteq> carrier M; s \<in> {j. j \<le> (n::nat)} \<rightarrow> A; g \<in> {j. j \<le> n} \<rightarrow> H \<rbrakk> \<Longrightarrow>
            f (l_comb R M n s g) \<in> linear_span R N A (f ` H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; g \<in> {j. j \<le> n} \<rightarrow> H\<rbrakk> \<Longrightarrow> f (l_comb R M n s g) \<in> linear_span R N A (f ` H)
[PROOF STEP]
apply (frule l_comb_mem_linear_span[of A H s n g], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; g \<in> {j. j \<le> n} \<rightarrow> H; l_comb R M n s g \<in> linear_span R M A H\<rbrakk> \<Longrightarrow> f (l_comb R M n s g) \<in> linear_span R N A (f ` H)
[PROOF STEP]
apply (simp add:linmap_im_lincomb)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; g \<in> {j. j \<le> n} \<rightarrow> H; l_comb R M n s g \<in> linear_span R M A H\<rbrakk> \<Longrightarrow> l_comb R N n s (cmp f g) \<in> linear_span R N A (f ` H)
[PROOF STEP]
apply (rule Module.l_comb_mem_linear_span[of N R A "f ` H" s n "cmp f g"],
        assumption+,
        rule subsetI,
        simp add:image_def, erule bexE, simp,
        frule_tac c = xa in subsetD[of H "carrier M"], assumption+,
        simp add:mHom_mem[of N f], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; g \<in> {j. j \<le> n} \<rightarrow> H; l_comb R M n s g \<in> linear_span R M A H\<rbrakk> \<Longrightarrow> cmp f g \<in> {j. j \<le> n} \<rightarrow> f ` H
[PROOF STEP]
apply (rule Pi_I, simp add:cmp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; g \<in> {j. j \<le> n} \<rightarrow> H; l_comb R M n s g \<in> linear_span R M A H; x \<le> n\<rbrakk> \<Longrightarrow> f (g x) \<in> f ` H
[PROOF STEP]
apply (frule_tac f = g and A = "{j. j \<le> n}" and B = H and x = x in
        funcset_mem, simp, simp add:image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>ideal R A; R module N; f \<in> mHom R M N; H \<subseteq> carrier M; s \<in> {j. j \<le> n} \<rightarrow> A; g \<in> {j. j \<le> n} \<rightarrow> H; l_comb R M n s g \<in> linear_span R M A H; x \<le> n; g x \<in> H\<rbrakk> \<Longrightarrow> \<exists>xa\<in>H. f (g x) = f xa
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma three_divs_2:
  fixes nd::nat and D::"nat\<Rightarrow>nat"
  shows "3 dvd ((\<Sum>x<nd. (D x)*(10^x)) - (\<Sum>x<nd. (D x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) - sum D {..<nd}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) - sum D {..<nd}
[PROOF STEP]
from three_divs_1
[PROOF STATE]
proof (chain)
picking this:
3 dvd (\<Sum>x<?nd. ?D x * (10 ^ x - 1))
[PROOF STEP]
have "3 dvd (\<Sum>x<nd. D x * (10 ^ x - 1))"
[PROOF STATE]
proof (prove)
using this:
3 dvd (\<Sum>x<?nd. ?D x * (10 ^ x - 1))

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * (10 ^ x - 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
3 dvd (\<Sum>x<nd. D x * (10 ^ x - 1))

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) - sum D {..<nd}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
3 dvd (\<Sum>x<nd. D x * (10 ^ x - 1))

goal (1 subgoal):
 1. 3 dvd (\<Sum>x<nd. D x * 10 ^ x) - sum D {..<nd}
[PROOF STEP]
by (simp only: digit_diff_split)
[PROOF STATE]
proof (state)
this:
3 dvd (\<Sum>x<nd. D x * 10 ^ x) - sum D {..<nd}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Lindelof_space_alt:
   "Lindelof_space X \<longleftrightarrow>
        (\<forall>\<U>. (\<forall>U \<in> \<U>. openin X U) \<and> topspace X \<subseteq> \<Union>\<U>
             \<longrightarrow> (\<exists>\<V>. countable \<V> \<and> \<V> \<subseteq> \<U> \<and> topspace X \<subseteq> \<Union>\<V>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Lindelof_space X = (\<forall>\<U>. (\<forall>U\<in>\<U>. openin X U) \<and> topspace X \<subseteq> \<Union> \<U> \<longrightarrow> (\<exists>\<V>. countable \<V> \<and> \<V> \<subseteq> \<U> \<and> topspace X \<subseteq> \<Union> \<V>))
[PROOF STEP]
unfolding Lindelof_space_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>\<U>. (\<forall>U\<in>\<U>. openin X U) \<and> \<Union> \<U> = topspace X \<longrightarrow> (\<exists>\<V>. countable \<V> \<and> \<V> \<subseteq> \<U> \<and> \<Union> \<V> = topspace X)) = (\<forall>\<U>. (\<forall>U\<in>\<U>. openin X U) \<and> topspace X \<subseteq> \<Union> \<U> \<longrightarrow> (\<exists>\<V>. countable \<V> \<and> \<V> \<subseteq> \<U> \<and> topspace X \<subseteq> \<Union> \<V>))
[PROOF STEP]
using openin_subset
[PROOF STATE]
proof (prove)
using this:
openin ?U ?S \<Longrightarrow> ?S \<subseteq> topspace ?U

goal (1 subgoal):
 1. (\<forall>\<U>. (\<forall>U\<in>\<U>. openin X U) \<and> \<Union> \<U> = topspace X \<longrightarrow> (\<exists>\<V>. countable \<V> \<and> \<V> \<subseteq> \<U> \<and> \<Union> \<V> = topspace X)) = (\<forall>\<U>. (\<forall>U\<in>\<U>. openin X U) \<and> topspace X \<subseteq> \<Union> \<U> \<longrightarrow> (\<exists>\<V>. countable \<V> \<and> \<V> \<subseteq> \<U> \<and> topspace X \<subseteq> \<Union> \<V>))
[PROOF STEP]
by fastforce


[STATEMENT]
lemma winding_number_nearby_loops_eq:
     "\<lbrakk>path g; path h; pathfinish g = pathstart g; pathfinish h = pathstart h;
      \<And>t. t \<in> {0..1} \<Longrightarrow> norm(h t - g t) < norm(g t - z)\<rbrakk>
      \<Longrightarrow> winding_number h z = winding_number g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>path g; path h; pathfinish g = pathstart g; pathfinish h = pathstart h; \<And>t. t \<in> {0..1} \<Longrightarrow> cmod (h t - g t) < cmod (g t - z)\<rbrakk> \<Longrightarrow> winding_number h z = winding_number g z
[PROOF STEP]
by (metis segment_bound(2) norm_minus_commute not_le winding_number_loops_linear_eq)


[STATEMENT]
lemma infsum_Un_disjoint:
  fixes f :: "'a \<Rightarrow> 'b::{topological_comm_monoid_add, t2_space}"
  assumes "f summable_on A"
  assumes "f summable_on B"
  assumes disj: "A \<inter> B = {}"
  shows \<open>infsum f (A \<union> B) = infsum f A + infsum f B\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsum f (A \<union> B) = infsum f A + infsum f B
[PROOF STEP]
by (intro infsumI has_sum_Un_disjoint has_sum_infsum assms)


[STATEMENT]
lemma norm_power2: "norm q ^ 2 = Ree (cnj q * q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (norm q)\<^sup>2 = Ree (Octonions.cnj q * q)
[PROOF STEP]
by (simp add: octo_mult_components norm_octo_def power2_eq_square)


[STATEMENT]
lemma nrows_eq_card_rows:
  fixes A::"'a^'columns::{mod_type}^'rows::{mod_type}"
  shows "nrows_iarray (matrix_to_iarray A) = CARD('rows)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nrows_iarray (matrix_to_iarray A) = CARD('rows)
[PROOF STEP]
unfolding nrows_iarray_def length_eq_card_rows
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. CARD('rows) = CARD('rows)
[PROOF STEP]
..


[STATEMENT]
lemma vec_of_list_coeffs_nth:
assumes i: "i \<in> {..degree h}" and h_not0: "h \<noteq> 0"
shows "vec_of_list (coeffs h) $ i = coeff h i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_list (coeffs h) $ i = coeff h i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. vec_of_list (coeffs h) $ i = coeff h i
[PROOF STEP]
have "vec_of_list (map (coeff h) [0..<degree h] @ [coeff h (degree h)]) $ i = coeff h i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vec_of_list (map (coeff h) [0..<degree h] @ [lead_coeff h]) $ i = coeff h i
[PROOF STEP]
using i
[PROOF STATE]
proof (prove)
using this:
i \<in> {..degree h}

goal (1 subgoal):
 1. vec_of_list (map (coeff h) [0..<degree h] @ [lead_coeff h]) $ i = coeff h i
[PROOF STEP]
by (transfer', auto simp add: mk_vec_def)
         (metis (no_types, lifting) Cons_eq_append_conv coeffs_def coeffs_nth degree_0
         diff_zero length_upt less_eq_nat.simps(1) list.simps(8) list.simps(9) map_append
         nth_Cons_0 upt_Suc upt_eq_Nil_conv)
[PROOF STATE]
proof (state)
this:
vec_of_list (map (coeff h) [0..<degree h] @ [lead_coeff h]) $ i = coeff h i

goal (1 subgoal):
 1. vec_of_list (coeffs h) $ i = coeff h i
[PROOF STEP]
thus "vec_of_list (coeffs h) $ i = coeff h i"
[PROOF STATE]
proof (prove)
using this:
vec_of_list (map (coeff h) [0..<degree h] @ [lead_coeff h]) $ i = coeff h i

goal (1 subgoal):
 1. vec_of_list (coeffs h) $ i = coeff h i
[PROOF STEP]
using i h_not0
[PROOF STATE]
proof (prove)
using this:
vec_of_list (map (coeff h) [0..<degree h] @ [lead_coeff h]) $ i = coeff h i
i \<in> {..degree h}
h \<noteq> 0

goal (1 subgoal):
 1. vec_of_list (coeffs h) $ i = coeff h i
[PROOF STEP]
unfolding coeffs_def
[PROOF STATE]
proof (prove)
using this:
vec_of_list (map (coeff h) [0..<degree h] @ [lead_coeff h]) $ i = coeff h i
i \<in> {..degree h}
h \<noteq> 0

goal (1 subgoal):
 1. vec_of_list (if h = 0 then [] else map (coeff h) [0..<Suc (degree h)]) $ i = coeff h i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
vec_of_list (coeffs h) $ i = coeff h i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma floor_mono:
  assumes "x \<le> y"
  shows "\<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>
[PROOF STEP]
have "of_int \<lfloor>x\<rfloor> \<le> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int \<lfloor>x\<rfloor> \<le> x
[PROOF STEP]
by (rule of_int_floor_le)
[PROOF STATE]
proof (state)
this:
of_int \<lfloor>x\<rfloor> \<le> x

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
of_int \<lfloor>x\<rfloor> \<le> x

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>
[PROOF STEP]
note \<open>x \<le> y\<close>
[PROOF STATE]
proof (state)
this:
x \<le> y

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
of_int \<lfloor>x\<rfloor> \<le> y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
of_int \<lfloor>x\<rfloor> \<le> y

goal (1 subgoal):
 1. \<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>
[PROOF STEP]
by (simp add: le_floor_iff)
[PROOF STATE]
proof (state)
this:
\<lfloor>x\<rfloor> \<le> \<lfloor>y\<rfloor>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sin_ge_zero_iff:
  assumes "0 \<le> x" "x < 2 * pi"
  shows "0 \<le> sin x \<longleftrightarrow> x \<le> pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 \<le> sin x) = (x \<le> pi)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. 0 \<le> sin x \<Longrightarrow> x \<le> pi
 2. x \<le> pi \<Longrightarrow> 0 \<le> sin x
[PROOF STEP]
assume "0 \<le> sin x"
[PROOF STATE]
proof (state)
this:
0 \<le> sin x

goal (2 subgoals):
 1. 0 \<le> sin x \<Longrightarrow> x \<le> pi
 2. x \<le> pi \<Longrightarrow> 0 \<le> sin x
[PROOF STEP]
show "x \<le> pi"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<le> pi
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> x \<le> pi \<Longrightarrow> False
[PROOF STEP]
assume "\<not> x \<le> pi"
[PROOF STATE]
proof (state)
this:
\<not> x \<le> pi

goal (1 subgoal):
 1. \<not> x \<le> pi \<Longrightarrow> False
[PROOF STEP]
from this \<open>x < 2 * pi\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> x \<le> pi
x < 2 * pi
[PROOF STEP]
have "sin x < 0"
[PROOF STATE]
proof (prove)
using this:
\<not> x \<le> pi
x < 2 * pi

goal (1 subgoal):
 1. sin x < 0
[PROOF STEP]
using sin_lt_zero
[PROOF STATE]
proof (prove)
using this:
\<not> x \<le> pi
x < 2 * pi
\<lbrakk>pi < ?x; ?x < 2 * pi\<rbrakk> \<Longrightarrow> sin ?x < 0

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

goal (1 subgoal):
 1. \<not> x \<le> pi \<Longrightarrow> False
[PROOF STEP]
from this \<open>0 \<le> sin x\<close>
[PROOF STATE]
proof (chain)
picking this:
sin x < 0
0 \<le> sin x
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
sin x < 0
0 \<le> sin x

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x \<le> pi

goal (1 subgoal):
 1. x \<le> pi \<Longrightarrow> 0 \<le> sin x
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<le> pi \<Longrightarrow> 0 \<le> sin x
[PROOF STEP]
assume "x \<le> pi"
[PROOF STATE]
proof (state)
this:
x \<le> pi

goal (1 subgoal):
 1. x \<le> pi \<Longrightarrow> 0 \<le> sin x
[PROOF STEP]
from this \<open>0 \<le> x\<close>
[PROOF STATE]
proof (chain)
picking this:
x \<le> pi
0 \<le> x
[PROOF STEP]
show "0 \<le> sin x"
[PROOF STATE]
proof (prove)
using this:
x \<le> pi
0 \<le> x

goal (1 subgoal):
 1. 0 \<le> sin x
[PROOF STEP]
by (simp add: sin_ge_zero)
[PROOF STATE]
proof (state)
this:
0 \<le> sin x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prod_ge_pointwise_le_imp_pointwise_eq:
  fixes f :: "'a \<Rightarrow> real"
  assumes "finite X"
  assumes ge: "prod f X \<ge> prod g X"
  assumes nonneg: "\<And>x. x \<in> X \<Longrightarrow> f x \<ge> 0"
  assumes pos: "\<And>x. x \<in> X \<Longrightarrow> g x > 0"
  assumes le: "\<And>x. x \<in> X \<Longrightarrow> f x \<le> g x" and x: "x \<in> X"
  shows   "f x = g x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x = g x
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x \<noteq> g x \<Longrightarrow> False
[PROOF STEP]
assume "f x \<noteq> g x"
[PROOF STATE]
proof (state)
this:
f x \<noteq> g x

goal (1 subgoal):
 1. f x \<noteq> g x \<Longrightarrow> False
[PROOF STEP]
with le[of x] and x
[PROOF STATE]
proof (chain)
picking this:
x \<in> X \<Longrightarrow> f x \<le> g x
x \<in> X
f x \<noteq> g x
[PROOF STEP]
have "f x < g x"
[PROOF STATE]
proof (prove)
using this:
x \<in> X \<Longrightarrow> f x \<le> g x
x \<in> X
f x \<noteq> g x

goal (1 subgoal):
 1. f x < g x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f x < g x

goal (1 subgoal):
 1. f x \<noteq> g x \<Longrightarrow> False
[PROOF STEP]
hence "prod f X < prod g X"
[PROOF STATE]
proof (prove)
using this:
f x < g x

goal (1 subgoal):
 1. prod f X < prod g X
[PROOF STEP]
using x and le and nonneg and pos and \<open>finite X\<close>
[PROOF STATE]
proof (prove)
using this:
f x < g x
x \<in> X
?x \<in> X \<Longrightarrow> f ?x \<le> g ?x
?x \<in> X \<Longrightarrow> 0 \<le> f ?x
?x \<in> X \<Longrightarrow> 0 < g ?x
finite X

goal (1 subgoal):
 1. prod f X < prod g X
[PROOF STEP]
by (intro prod_mono_strict') auto
[PROOF STATE]
proof (state)
this:
prod f X < prod g X

goal (1 subgoal):
 1. f x \<noteq> g x \<Longrightarrow> False
[PROOF STEP]
with ge
[PROOF STATE]
proof (chain)
picking this:
prod g X \<le> prod f X
prod f X < prod g X
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
prod g X \<le> prod f X
prod f X < prod g X

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem is_Sup_uniq: "is_Sup A sup \<Longrightarrow> is_Sup A sup' \<Longrightarrow> sup = sup'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_Sup A sup; is_Sup A sup'\<rbrakk> \<Longrightarrow> sup = sup'
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>is_Sup A sup; is_Sup A sup'\<rbrakk> \<Longrightarrow> sup = sup'
[PROOF STEP]
assume sup: "is_Sup A sup" and sup': "is_Sup A sup'"
[PROOF STATE]
proof (state)
this:
is_Sup A sup
is_Sup A sup'

goal (1 subgoal):
 1. \<lbrakk>is_Sup A sup; is_Sup A sup'\<rbrakk> \<Longrightarrow> sup = sup'
[PROOF STEP]
have "dual sup = dual sup'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dual sup = dual sup'
[PROOF STEP]
proof (rule is_Inf_uniq)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_Inf ?A (dual sup)
 2. is_Inf ?A (dual sup')
[PROOF STEP]
from sup
[PROOF STATE]
proof (chain)
picking this:
is_Sup A sup
[PROOF STEP]
show "is_Inf (dual ` A) (dual sup)"
[PROOF STATE]
proof (prove)
using this:
is_Sup A sup

goal (1 subgoal):
 1. is_Inf (dual ` A) (dual sup)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
is_Inf (dual ` A) (dual sup)

goal (1 subgoal):
 1. is_Inf (dual ` A) (dual sup')
[PROOF STEP]
from sup'
[PROOF STATE]
proof (chain)
picking this:
is_Sup A sup'
[PROOF STEP]
show "is_Inf (dual ` A) (dual sup')"
[PROOF STATE]
proof (prove)
using this:
is_Sup A sup'

goal (1 subgoal):
 1. is_Inf (dual ` A) (dual sup')
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
is_Inf (dual ` A) (dual sup')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
dual sup = dual sup'

goal (1 subgoal):
 1. \<lbrakk>is_Sup A sup; is_Sup A sup'\<rbrakk> \<Longrightarrow> sup = sup'
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
dual sup = dual sup'
[PROOF STEP]
show "sup = sup'"
[PROOF STATE]
proof (prove)
using this:
dual sup = dual sup'

goal (1 subgoal):
 1. sup = sup'
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
sup = sup'

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closure_UNIV [simp]: "closure UNIV = UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closure UNIV = UNIV
[PROOF STEP]
using closed_UNIV
[PROOF STATE]
proof (prove)
using this:
closed UNIV

goal (1 subgoal):
 1. closure UNIV = UNIV
[PROOF STEP]
by (rule closure_closed)


[STATEMENT]
lemma finite_union_is_univ_semialgebraic':
  assumes "finite Xs"
  assumes "are_univ_semialgebraic Xs"
  shows "is_univ_semialgebraic (\<Union> Xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_univ_semialgebraic (\<Union> Xs)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_univ_semialgebraic (\<Union> Xs)
[PROOF STEP]
have "is_semialgebraic 1 (Qp_to_R1_set (\<Union> Xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_semialgebraic 1 ((\<lambda>a. [a]) ` \<Union> Xs)
[PROOF STEP]
using assms finite_union_is_semialgebraic'[of "((`) (\<lambda>a. [a]) ` Xs)"] to_R1_set_union[of Xs]
[PROOF STATE]
proof (prove)
using this:
finite Xs
are_univ_semialgebraic Xs
\<lbrakk>finite ((`) (\<lambda>a. [a]) ` Xs); (`) (\<lambda>a. [a]) ` Xs \<subseteq> semialg_sets ?n\<rbrakk> \<Longrightarrow> is_semialgebraic ?n (\<Union> ((`) (\<lambda>a. [a]) ` Xs))
(\<lambda>a. [a]) ` \<Union> Xs = \<Union> ((`) (\<lambda>a. [a]) ` Xs)

goal (1 subgoal):
 1. is_semialgebraic 1 ((\<lambda>a. [a]) ` \<Union> Xs)
[PROOF STEP]
by (metis (no_types, lifting) are_semialgebraicE are_univ_semialgebraic_semialgebraic
        finite_imageI is_semialgebraicE subsetI)
[PROOF STATE]
proof (state)
this:
is_semialgebraic 1 ((\<lambda>a. [a]) ` \<Union> Xs)

goal (1 subgoal):
 1. is_univ_semialgebraic (\<Union> Xs)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_semialgebraic 1 ((\<lambda>a. [a]) ` \<Union> Xs)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_semialgebraic 1 ((\<lambda>a. [a]) ` \<Union> Xs)

goal (1 subgoal):
 1. is_univ_semialgebraic (\<Union> Xs)
[PROOF STEP]
using is_univ_semialgebraicI
[PROOF STATE]
proof (prove)
using this:
is_semialgebraic 1 ((\<lambda>a. [a]) ` \<Union> Xs)
is_semialgebraic 1 ((\<lambda>a. [a]) ` ?S) \<Longrightarrow> is_univ_semialgebraic ?S

goal (1 subgoal):
 1. is_univ_semialgebraic (\<Union> Xs)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
is_univ_semialgebraic (\<Union> Xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_too_small_multisets_covering_set:
  assumes "finite A"
  assumes "k < card A"
  shows "card {M. set_mset M = A \<and> size M = k} = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = 0
[PROOF STEP]
from \<open>k < card A\<close>
[PROOF STATE]
proof (chain)
picking this:
k < card A
[PROOF STEP]
have eq: "{M. set_mset M = A \<and> size M = k} = {}"
[PROOF STATE]
proof (prove)
using this:
k < card A

goal (1 subgoal):
 1. {M. set_mset M = A \<and> size M = k} = {}
[PROOF STEP]
using card_set_mset_leq Collect_empty_eq leD
[PROOF STATE]
proof (prove)
using this:
k < card A
card (set_mset ?M) \<le> size ?M
(Collect ?P = {}) = (\<forall>x. \<not> ?P x)
?y \<le> ?x \<Longrightarrow> \<not> ?x < ?y

goal (1 subgoal):
 1. {M. set_mset M = A \<and> size M = k} = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{M. set_mset M = A \<and> size M = k} = {}

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = 0
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
{M. set_mset M = A \<and> size M = k} = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
{M. set_mset M = A \<and> size M = k} = {}

goal (1 subgoal):
 1. card {M. set_mset M = A \<and> size M = k} = 0
[PROOF STEP]
by (metis card.empty)
[PROOF STATE]
proof (state)
this:
card {M. set_mset M = A \<and> size M = k} = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Maclaurin_minus_cos_expansion:
  assumes "n > 0" "x < 0"
  shows "\<exists>t. x < t \<and> t < 0 \<and>
         cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + ((cos (t + 1/2 * real n * pi) / fact n) * x ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
let ?diff = "\<lambda>n x. cos (x + 1/2 * real n * pi)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
have "\<exists>t. x < t \<and> t < 0 \<and> cos x = (\<Sum>m<n. ?diff m 0 / (fact m) * x ^ m) + ?diff n t / fact n * x ^ n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
proof (rule Maclaurin_minus)
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. x < 0
 2. 0 < n
 3. (\<lambda>a. cos (a + 1 / 2 * real 0 * pi)) = cos
 4. \<forall>m t. m < n \<and> x \<le> t \<and> t \<le> 0 \<longrightarrow> ((\<lambda>a. cos (a + 1 / 2 * real m * pi)) has_real_derivative cos (t + 1 / 2 * real (Suc m) * pi)) (at t)
[PROOF STEP]
show "\<forall>m t. m < n \<and> x \<le> t \<and> t \<le> 0 \<longrightarrow>
              ((\<lambda>u. cos (u + 1 / 2 * real m * pi)) has_real_derivative
               cos (t + 1 / 2 * real (Suc m) * pi)) (at t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>m t. m < n \<and> x \<le> t \<and> t \<le> 0 \<longrightarrow> ((\<lambda>u. cos (u + 1 / 2 * real m * pi)) has_real_derivative cos (t + 1 / 2 * real (Suc m) * pi)) (at t)
[PROOF STEP]
by (simp add: cos_expansion_lemma del: of_nat_Suc)
[PROOF STATE]
proof (state)
this:
\<forall>m t. m < n \<and> x \<le> t \<and> t \<le> 0 \<longrightarrow> ((\<lambda>u. cos (u + 1 / 2 * real m * pi)) has_real_derivative cos (t + 1 / 2 * real (Suc m) * pi)) (at t)

goal (3 subgoals):
 1. x < 0
 2. 0 < n
 3. (\<lambda>a. cos (a + 1 / 2 * real 0 * pi)) = cos
[PROOF STEP]
qed (use assms in auto)
[PROOF STATE]
proof (state)
this:
\<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal (1 subgoal):
 1. \<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos (0 + 1 / 2 * real m * pi) / fact m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal (1 subgoal):
 1. \<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n
[PROOF STEP]
apply (rule ex_forward, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>x < t \<and> t < 0 \<and> cos x = (\<Sum>m<n. cos (real m * pi / 2) * x ^ m / fact m) + cos (t + real n * pi / 2) * x ^ n / fact n; \<exists>ta>x. ta < 0 \<and> cos (t + real n * pi / 2) = cos (ta + real n * pi / 2)\<rbrakk> \<Longrightarrow> (\<Sum>m<n. cos (real m * pi / 2) * x ^ m / fact m) = (\<Sum>m<n. cos_coeff m * x ^ m)
[PROOF STEP]
apply (rule sum.cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t xa. \<lbrakk>x < t \<and> t < 0 \<and> cos x = (\<Sum>m<n. cos (real m * pi / 2) * x ^ m / fact m) + cos (t + real n * pi / 2) * x ^ n / fact n; \<exists>ta>x. ta < 0 \<and> cos (t + real n * pi / 2) = cos (ta + real n * pi / 2); xa \<in> {..<n}\<rbrakk> \<Longrightarrow> cos (real xa * pi / 2) * x ^ xa / fact xa = cos_coeff xa * x ^ xa
[PROOF STEP]
apply (auto simp: cos_coeff_def cos_zero_iff elim: evenE)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<exists>t>x. t < 0 \<and> cos x = (\<Sum>m<n. cos_coeff m * x ^ m) + cos (t + 1 / 2 * real n * pi) / fact n * x ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mem_frontier_diff:
  assumes "t \<in>\<^sub>A frontier M - frontier N"
  shows   "zcount (frontier_changes M N) t = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zcount (frontier_changes M N) t = 1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. zcount (frontier_changes M N) t = 1
[PROOF STEP]
note assms
[PROOF STATE]
proof (state)
this:
t \<in>\<^sub>A frontier M - frontier N

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
t \<in>\<^sub>A frontier M - frontier N
[PROOF STEP]
have t: "t \<in>\<^sub>A frontier M" "t \<notin>\<^sub>A frontier N"
[PROOF STATE]
proof (prove)
using this:
t \<in>\<^sub>A frontier M - frontier N

goal (1 subgoal):
 1. t \<in>\<^sub>A frontier M &&& t \<notin>\<^sub>A frontier N
[PROOF STEP]
using ac_Diff_iff
[PROOF STATE]
proof (prove)
using this:
t \<in>\<^sub>A frontier M - frontier N
(?c \<in>\<^sub>A ?A - ?B) = (?c \<in>\<^sub>A ?A \<and> ?c \<notin>\<^sub>A ?B)

goal (1 subgoal):
 1. t \<in>\<^sub>A frontier M &&& t \<notin>\<^sub>A frontier N
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
t \<in>\<^sub>A frontier M
t \<notin>\<^sub>A frontier N

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = 1
[PROOF STEP]
from t(1)
[PROOF STATE]
proof (chain)
picking this:
t \<in>\<^sub>A frontier M
[PROOF STEP]
have "zcount (zmset_frontier M) t = 1"
[PROOF STATE]
proof (prove)
using this:
t \<in>\<^sub>A frontier M

goal (1 subgoal):
 1. zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 1
[PROOF STEP]
by (simp add: member_antichain.rep_eq)
[PROOF STATE]
proof (state)
this:
zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 1

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = 1
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 1

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = 1
[PROOF STEP]
from t(2)
[PROOF STATE]
proof (chain)
picking this:
t \<notin>\<^sub>A frontier N
[PROOF STEP]
have "zcount (zmset_frontier N) t = 0"
[PROOF STATE]
proof (prove)
using this:
t \<notin>\<^sub>A frontier N

goal (1 subgoal):
 1. zcount (zmset_of (mset_set (set_antichain (frontier N)))) t = 0
[PROOF STEP]
by (simp add: member_antichain.rep_eq)
[PROOF STATE]
proof (state)
this:
zcount (zmset_of (mset_set (set_antichain (frontier N)))) t = 0

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = 1
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 1
zcount (zmset_of (mset_set (set_antichain (frontier N)))) t = 0
[PROOF STEP]
show "zcount (frontier_changes M N) t = 1"
[PROOF STATE]
proof (prove)
using this:
zcount (zmset_of (mset_set (set_antichain (frontier M)))) t = 1
zcount (zmset_of (mset_set (set_antichain (frontier N)))) t = 0

goal (1 subgoal):
 1. zcount (frontier_changes M N) t = 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
zcount (frontier_changes M N) t = 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_fun_Sup_distr: "\<Squnion>G \<star> (f::'a \<Rightarrow> 'b::proto_near_quantale) = \<Squnion>{g \<star> f |g. g \<in> G}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Squnion>G \<star> f = \<Squnion>{g \<star> f |g. g \<in> G}
[PROOF STEP]
apply (clarsimp simp: fun_eq_iff times_rel_fun_def bmod_Sup_fun1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<Squnion>{\<otimes> \<rho> fa f x |fa. fa \<in> G} = (SUP f\<in>{uu_. \<exists>g. (\<forall>x. uu_ x = \<otimes> \<rho> g f x) \<and> g \<in> G}. f x)
[PROOF STEP]
apply (rule antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<Squnion>{\<otimes> \<rho> fa f x |fa. fa \<in> G} \<le> (SUP f\<in>{uu_. \<exists>g. (\<forall>x. uu_ x = \<otimes> \<rho> g f x) \<and> g \<in> G}. f x)
 2. \<And>x. (SUP f\<in>{uu_. \<exists>g. (\<forall>x. uu_ x = \<otimes> \<rho> g f x) \<and> g \<in> G}. f x) \<le> \<Squnion>{\<otimes> \<rho> fa f x |fa. fa \<in> G}
[PROOF STEP]
apply (rule Sup_least, safe)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xa fa. fa \<in> G \<Longrightarrow> \<otimes> \<rho> fa f x \<le> (SUP f\<in>{uu_. \<exists>g. (\<forall>x. uu_ x = \<otimes> \<rho> g f x) \<and> g \<in> G}. f x)
 2. \<And>x. (SUP f\<in>{uu_. \<exists>g. (\<forall>x. uu_ x = \<otimes> \<rho> g f x) \<and> g \<in> G}. f x) \<le> \<Squnion>{\<otimes> \<rho> fa f x |fa. fa \<in> G}
[PROOF STEP]
apply (rule SUP_upper2, force+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (SUP f\<in>{uu_. \<exists>g. (\<forall>x. uu_ x = \<otimes> \<rho> g f x) \<and> g \<in> G}. f x) \<le> \<Squnion>{\<otimes> \<rho> fa f x |fa. fa \<in> G}
[PROOF STEP]
apply (rule SUP_least, safe)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x fa g. \<lbrakk>\<forall>x. fa x = \<otimes> \<rho> g f x; g \<in> G\<rbrakk> \<Longrightarrow> fa x \<le> \<Squnion>{\<otimes> \<rho> fa f x |fa. fa \<in> G}
[PROOF STEP]
by (rule Sup_upper2, force+)


[STATEMENT]
lemma gcd_fib_diff: "gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)" if "m \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)
[PROOF STEP]
have "gcd (fib m) (fib (n - m)) = gcd (fib m) (fib (n - m + m))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd (fib m) (fib (n - m)) = gcd (fib m) (fib (n - m + m))
[PROOF STEP]
by (simp add: gcd_fib_add)
[PROOF STATE]
proof (state)
this:
gcd (fib m) (fib (n - m)) = gcd (fib m) (fib (n - m + m))

goal (1 subgoal):
 1. gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
gcd (fib m) (fib (n - m)) = gcd (fib m) (fib (n - m + m))

goal (1 subgoal):
 1. gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)
[PROOF STEP]
from \<open>m \<le> n\<close>
[PROOF STATE]
proof (chain)
picking this:
m \<le> n
[PROOF STEP]
have "n - m + m = n"
[PROOF STATE]
proof (prove)
using this:
m \<le> n

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

goal (1 subgoal):
 1. gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)

goal (1 subgoal):
 1. gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
gcd (fib m) (fib (n - m)) = gcd (fib m) (fib n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sums_Re_zeta_of_nat_offset:
  fixes r :: nat
  assumes n: "n > 1"
  shows "(\<lambda>k. 1 / (r + k + 1) ^ n) sums (Re (zeta (of_nat n)) - (\<Sum>k=1..r. 1 / k ^ n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. 1 / real ((r + k + 1) ^ n)) sums (Re (zeta (of_nat n)) - (\<Sum>k = 1..r. 1 / real (k ^ n)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>k. 1 / real ((r + k + 1) ^ n)) sums (Re (zeta (of_nat n)) - (\<Sum>k = 1..r. 1 / real (k ^ n)))
[PROOF STEP]
have "(\<lambda>k. Re (1 / (r + k + 1) ^ n)) sums (Re (zeta (of_nat n) - (\<Sum>k=1..r. 1 / k ^ n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>k. Re (complex_of_real (1 / real ((r + k + 1) ^ n)))) sums Re (zeta (of_nat n) - complex_of_real (\<Sum>k = 1..r. 1 / real (k ^ n)))
[PROOF STEP]
by (intro sums_Re sums_zeta_of_nat_offset assms)
[PROOF STATE]
proof (state)
this:
(\<lambda>k. Re (complex_of_real (1 / real ((r + k + 1) ^ n)))) sums Re (zeta (of_nat n) - complex_of_real (\<Sum>k = 1..r. 1 / real (k ^ n)))

goal (1 subgoal):
 1. (\<lambda>k. 1 / real ((r + k + 1) ^ n)) sums (Re (zeta (of_nat n)) - (\<Sum>k = 1..r. 1 / real (k ^ n)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>k. Re (complex_of_real (1 / real ((r + k + 1) ^ n)))) sums Re (zeta (of_nat n) - complex_of_real (\<Sum>k = 1..r. 1 / real (k ^ n)))

goal (1 subgoal):
 1. (\<lambda>k. 1 / real ((r + k + 1) ^ n)) sums (Re (zeta (of_nat n)) - (\<Sum>k = 1..r. 1 / real (k ^ n)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<lambda>k. 1 / real ((r + k + 1) ^ n)) sums (Re (zeta (of_nat n)) - (\<Sum>k = 1..r. 1 / real (k ^ n)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma null_sets_count_space: "null_sets (count_space A) = { {} }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. null_sets (count_space A) = {{}}
[PROOF STEP]
unfolding null_sets_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {N \<in> sets (count_space A). emeasure (count_space A) N = 0} = {{}}
[PROOF STEP]
by (auto simp add: emeasure_count_space_eq_0)


[STATEMENT]
lemma is_aligned_no_wrap''':
  fixes ptr :: "'a::len word"
  shows"\<lbrakk> is_aligned ptr sz; sz < LENGTH('a); off < 2 ^ sz \<rbrakk>
         \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_aligned ptr sz; sz < LENGTH('a); off < 2 ^ sz\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (drule is_aligned_no_wrap[where off="of_nat off"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz\<rbrakk> \<Longrightarrow> word_of_nat off < 2 ^ sz
 2. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz; unat ptr + unat (word_of_nat off) < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (simp add: word_less_nat_alt)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz\<rbrakk> \<Longrightarrow> unat (word_of_nat off) < 2 ^ sz
 2. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz; unat ptr + unat (word_of_nat off) < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (erule order_le_less_trans[rotated])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> unat (word_of_nat off) \<le> off
 2. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz; unat ptr + unat (word_of_nat off) < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (simp add: take_bit_eq_mod unsigned_of_nat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz; unat ptr + unat (word_of_nat off) < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (subst(asm) unat_of_nat_len)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz\<rbrakk> \<Longrightarrow> off < 2 ^ LENGTH('a)
 2. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz; unat ptr + off < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (erule order_less_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. sz < LENGTH('a) \<Longrightarrow> 2 ^ sz < 2 ^ LENGTH('a)
 2. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz; unat ptr + off < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply (erule power_strict_increasing)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. 1 < 2
 2. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz; unat ptr + off < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sz < LENGTH('a); off < 2 ^ sz; unat ptr + off < 2 ^ LENGTH('a)\<rbrakk> \<Longrightarrow> unat ptr + off < 2 ^ LENGTH('a)
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma triangle_num_le: "m \<le> n \<Longrightarrow> triangle_num m \<le> triangle_num n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> triangle_num m \<le> triangle_num n
[PROOF STEP]
using strict_mono_leD[OF strict_mono_triangle_num]
[PROOF STATE]
proof (prove)
using this:
?m \<le> ?n \<Longrightarrow> triangle_num ?m \<le> triangle_num ?n

goal (1 subgoal):
 1. m \<le> n \<Longrightarrow> triangle_num m \<le> triangle_num n
[PROOF STEP]
.


[STATEMENT]
lemma infinite_finite_times_lepoll_self:
  assumes "infinite A" "finite B" shows "A \<times> B \<lesssim> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> B \<lesssim> A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A \<times> B \<lesssim> A
[PROOF STEP]
have "B \<lesssim> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. B \<lesssim> A
[PROOF STEP]
by (simp add: assms finite_lepoll_infinite)
[PROOF STATE]
proof (state)
this:
B \<lesssim> A

goal (1 subgoal):
 1. A \<times> B \<lesssim> A
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
B \<lesssim> A
[PROOF STEP]
have "A \<times> B \<lesssim> A \<times> A"
[PROOF STATE]
proof (prove)
using this:
B \<lesssim> A

goal (1 subgoal):
 1. A \<times> B \<lesssim> A \<times> A
[PROOF STEP]
by (simp add: subset_imp_lepoll times_lepoll_mono)
[PROOF STATE]
proof (state)
this:
A \<times> B \<lesssim> A \<times> A

goal (1 subgoal):
 1. A \<times> B \<lesssim> A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A \<times> B \<lesssim> A \<times> A

goal (1 subgoal):
 1. A \<times> B \<lesssim> A
[PROOF STEP]
have "\<dots> \<approx> A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A \<times> A \<approx> A
[PROOF STEP]
by (simp add: \<open>infinite A\<close> infinite_times_eqpoll_self)
[PROOF STATE]
proof (state)
this:
A \<times> A \<approx> A

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

goal (1 subgoal):
 1. A \<times> B \<lesssim> A
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A \<times> B \<lesssim> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma scott_continuous_imp_mono_refl:
  assumes scott: "scott_continuous f"
    and x: "x \<in> A" and y: "y \<in> A" and xy: "x \<sqsubseteq> y" and yy: "y \<sqsubseteq> y"
  shows "f x \<sqsubseteq> f y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f x \<sqsubseteq> f y
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f x \<sqsubseteq> f y
[PROOF STEP]
define D where "D \<equiv> {x,y}"
[PROOF STATE]
proof (state)
this:
D \<equiv> {x, y}

goal (1 subgoal):
 1. f x \<sqsubseteq> f y
[PROOF STEP]
from x y xy yy
[PROOF STATE]
proof (chain)
picking this:
x \<in> A
y \<in> A
x \<sqsubseteq> y
y \<sqsubseteq> y
[PROOF STEP]
have dir_D: "D \<subseteq> A" "directed D (\<sqsubseteq>)" "D \<noteq> {}"
[PROOF STATE]
proof (prove)
using this:
x \<in> A
y \<in> A
x \<sqsubseteq> y
y \<sqsubseteq> y

goal (1 subgoal):
 1. D \<subseteq> A &&& directed D (\<sqsubseteq>) &&& D \<noteq> {}
[PROOF STEP]
by (auto simp: D_def intro!: bexI[of _ y] directedI)
[PROOF STATE]
proof (state)
this:
D \<subseteq> A
directed D (\<sqsubseteq>)
D \<noteq> {}

goal (1 subgoal):
 1. f x \<sqsubseteq> f y
[PROOF STEP]
have "extreme_bound A (\<sqsubseteq>) D y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. extreme_bound A (\<sqsubseteq>) D y
[PROOF STEP]
using xy yy x y
[PROOF STATE]
proof (prove)
using this:
x \<sqsubseteq> y
y \<sqsubseteq> y
x \<in> A
y \<in> A

goal (1 subgoal):
 1. extreme_bound A (\<sqsubseteq>) D y
[PROOF STEP]
by (auto simp: D_def)
[PROOF STATE]
proof (state)
this:
extreme_bound A (\<sqsubseteq>) D y

goal (1 subgoal):
 1. f x \<sqsubseteq> f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
extreme_bound A (\<sqsubseteq>) D y
[PROOF STEP]
have fboy: "extreme_bound A (\<sqsubseteq>) (f ` D) (f y)"
[PROOF STATE]
proof (prove)
using this:
extreme_bound A (\<sqsubseteq>) D y

goal (1 subgoal):
 1. extreme_bound A (\<sqsubseteq>) (f ` D) (f y)
[PROOF STEP]
using dir_D scott
[PROOF STATE]
proof (prove)
using this:
extreme_bound A (\<sqsubseteq>) D y
D \<subseteq> A
directed D (\<sqsubseteq>)
D \<noteq> {}
local.scott_continuous f

goal (1 subgoal):
 1. extreme_bound A (\<sqsubseteq>) (f ` D) (f y)
[PROOF STEP]
by (auto elim!: scott_continuousE)
[PROOF STATE]
proof (state)
this:
extreme_bound A (\<sqsubseteq>) (f ` D) (f y)

goal (1 subgoal):
 1. f x \<sqsubseteq> f y
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
extreme_bound A (\<sqsubseteq>) (f ` D) (f y)
[PROOF STEP]
show "f x \<sqsubseteq> f y"
[PROOF STATE]
proof (prove)
using this:
extreme_bound A (\<sqsubseteq>) (f ` D) (f y)

goal (1 subgoal):
 1. f x \<sqsubseteq> f y
[PROOF STEP]
by (auto simp: D_def)
[PROOF STATE]
proof (state)
this:
f x \<sqsubseteq> f y

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma aux_lemma: assumes "[(a::nat) = b] (mod c)" "b < c"
  shows "\<exists> k. a = c*k + b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>k. a = c * k + b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>k. a = c * k + b
[PROOF STEP]
have "a mod c = b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a mod c = b
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
[a = b] (mod c)
b < c

goal (1 subgoal):
 1. a mod c = b
[PROOF STEP]
by (simp add: cong_def mod_if)
[PROOF STATE]
proof (state)
this:
a mod c = b

goal (1 subgoal):
 1. \<exists>k. a = c * k + b
[PROOF STEP]
hence "b \<le> a"
[PROOF STATE]
proof (prove)
using this:
a mod c = b

goal (1 subgoal):
 1. b \<le> a
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a mod c = b
[a = b] (mod c)
b < c

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

goal (1 subgoal):
 1. \<exists>k. a = c * k + b
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
b \<le> a

goal (1 subgoal):
 1. \<exists>k. a = c * k + b
[PROOF STEP]
using cong_le_nat assms(1)
[PROOF STATE]
proof (prove)
using this:
b \<le> a
?y \<le> ?x \<Longrightarrow> [?x = ?y] (mod ?n) = (\<exists>q. ?x = q * ?n + ?y)
[a = b] (mod c)

goal (1 subgoal):
 1. \<exists>k. a = c * k + b
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>k. a = c * k + b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma homeomorphism_locally:
  fixes f:: "'a::metric_space \<Rightarrow> 'b::metric_space"
  assumes hom: "homeomorphism S T f g"
      and eq: "\<And>S T. homeomorphism S T f g \<Longrightarrow> (P S \<longleftrightarrow> Q T)"
    shows "locally P S \<longleftrightarrow> locally Q T"
     (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally P S = locally Q T
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. locally P S \<Longrightarrow> locally Q T
 2. locally Q T \<Longrightarrow> locally P S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
locally P S

goal (2 subgoals):
 1. locally P S \<Longrightarrow> locally Q T
 2. locally Q T \<Longrightarrow> locally P S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
locally P S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
locally P S

goal (1 subgoal):
 1. locally Q T
[PROOF STEP]
using eq hom homeomorphism_locally_imp
[PROOF STATE]
proof (prove)
using this:
locally P S
homeomorphism ?S ?T f g \<Longrightarrow> P ?S = Q ?T
homeomorphism S T f g
\<lbrakk>locally ?P ?S; homeomorphism ?S ?T ?f ?g; \<And>S S'. \<lbrakk>?P S; homeomorphism S S' ?f ?g\<rbrakk> \<Longrightarrow> ?Q S'\<rbrakk> \<Longrightarrow> locally ?Q ?T

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

goal (1 subgoal):
 1. locally Q T \<Longrightarrow> locally P S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. locally Q T \<Longrightarrow> locally P S
[PROOF STEP]
assume ?rhs
[PROOF STATE]
proof (state)
this:
locally Q T

goal (1 subgoal):
 1. locally Q T \<Longrightarrow> locally P S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
locally Q T
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
locally Q T

goal (1 subgoal):
 1. locally P S
[PROOF STEP]
using eq homeomorphism_sym homeomorphism_symD [OF hom]
[PROOF STATE]
proof (prove)
using this:
locally Q T
homeomorphism ?S ?T f g \<Longrightarrow> P ?S = Q ?T
homeomorphism ?S ?t ?f ?g = homeomorphism ?t ?S ?g ?f
homeomorphism T S g f

goal (1 subgoal):
 1. locally P S
[PROOF STEP]
by (blast intro: homeomorphism_locally_imp)
[PROOF STATE]
proof (state)
this:
locally P S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem "\<Gamma>\<turnstile> \<lbrace>True\<rbrace>
           \<acute>S :== 0;; \<acute>I :== 1;;
           WHILE \<acute>I \<noteq> n
           DO
             \<acute>S :== \<acute>S + \<acute>I;;
             \<acute>I :== \<acute>I + 1
           OD
           \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>"
  (is "\<Gamma>\<turnstile> _ (_;; ?while) _")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
let ?sum = "\<lambda>k. SUMM j<k. j"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
let ?inv = "\<lambda>s i. s = ?sum i"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
have "\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>?inv \<acute>S \<acute>I\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
have "True \<longrightarrow> 0 = ?sum 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. True \<longrightarrow> 0 = (SUMM j<1. j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
True \<longrightarrow> 0 = (SUMM j<1. j)

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
True \<longrightarrow> 0 = (SUMM j<1. j)

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
have "\<Gamma>\<turnstile> \<lbrace>\<dots>\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>?inv \<acute>S \<acute>I\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>0 = (SUMM j<1. j)\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
by vcg
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>0 = (SUMM j<1. j)\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
have "\<Gamma>\<turnstile> \<lbrace>?inv \<acute>S \<acute>I\<rbrace> ?while \<lbrace>?inv \<acute>S \<acute>I \<and> \<not> \<acute>I \<noteq> n\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace> WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<not> \<acute>I \<noteq> n\<rbrace>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
let ?body = "\<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
have "\<And>s i. ?inv s i \<and> i \<noteq> n \<longrightarrow>  ?inv (s + i) (i + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s i. s = (SUMM j<i. j) \<and> i \<noteq> n \<longrightarrow> s + i = (SUMM j<i + 1. j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?s1 = (SUMM j<?i1. j) \<and> ?i1 \<noteq> n \<longrightarrow> ?s1 + ?i1 = (SUMM j<?i1 + 1. j)

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
?s1 = (SUMM j<?i1. j) \<and> ?i1 \<noteq> n \<longrightarrow> ?s1 + ?i1 = (SUMM j<?i1 + 1. j)

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
have "\<Gamma>\<turnstile> \<lbrace>\<acute>S + \<acute>I = ?sum (\<acute>I + 1)\<rbrace> ?body \<lbrace>?inv \<acute>S \<acute>I\<rbrace>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>S + \<acute>I = (SUMM j<\<acute>I + 1. j)\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
by vcg
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>\<acute>S + \<acute>I = (SUMM j<\<acute>I + 1. j)\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
show "\<Gamma>\<turnstile> \<lbrace>?inv \<acute>S \<acute>I \<and> \<acute>I \<noteq> n\<rbrace> ?body \<lbrace>?inv \<acute>S \<acute>I\<rbrace>"
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<acute>I \<noteq> n\<rbrace> \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace> WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<not> \<acute>I \<noteq> n\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>\<acute>S = (SUMM j<\<acute>I. j)\<rbrace> WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<\<acute>I. j) \<and> \<not> \<acute>I \<noteq> n\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
have "\<And>s i. s = ?sum i \<and> \<not> i \<noteq> n \<longrightarrow> s = ?sum n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>s i. s = (SUMM j<i. j) \<and> \<not> i \<noteq> n \<longrightarrow> s = (SUMM j<n. j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?s = (SUMM j<?i. j) \<and> \<not> ?i \<noteq> n \<longrightarrow> ?s = (SUMM j<n. j)

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>

goal (1 subgoal):
 1. \<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
\<Gamma>\<turnstile> \<lbrace>True\<rbrace> \<acute>S :== 0;; \<acute>I :== 1;; WHILE \<acute>I \<noteq> n DO \<acute>S :== \<acute>S + \<acute>I;; \<acute>I :== \<acute>I + 1 OD \<lbrace>\<acute>S = (SUMM j<n. j)\<rbrace>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Arity_ind:  "P 0 \<Longrightarrow> (\<And> n. P n \<Longrightarrow> P (inc\<cdot>n)) \<Longrightarrow> P n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P 0; \<And>n. P n \<Longrightarrow> P (inc\<cdot>n)\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply (simp add: inc_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>P 0; \<And>n. P n \<Longrightarrow> P (inc_Arity n)\<rbrakk> \<Longrightarrow> P n
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>P x. \<lbrakk>P 0; \<And>n. P n \<Longrightarrow> P (Suc n)\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
by (rule nat.induct)


[STATEMENT]
lemma not_on_path_ball:
  fixes g :: "real \<Rightarrow> 'a::heine_borel"
  assumes "path g"
    and z: "z \<notin> path_image g"
  shows "\<exists>e > 0. ball z e \<inter> path_image g = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>e>0. ball z e \<inter> path_image g = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>e>0. ball z e \<inter> path_image g = {}
[PROOF STEP]
have "closed (path_image g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed (path_image g)
[PROOF STEP]
by (simp add: \<open>path g\<close> closed_path_image)
[PROOF STATE]
proof (state)
this:
closed (path_image g)

goal (1 subgoal):
 1. \<exists>e>0. ball z e \<inter> path_image g = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
closed (path_image g)
[PROOF STEP]
obtain a where "a \<in> path_image g" "\<forall>y \<in> path_image g. dist z a \<le> dist z y"
[PROOF STATE]
proof (prove)
using this:
closed (path_image g)

goal (1 subgoal):
 1. (\<And>a. \<lbrakk>a \<in> path_image g; \<forall>y\<in>path_image g. dist z a \<le> dist z y\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto intro: distance_attains_inf[OF _ path_image_nonempty, of g z])
[PROOF STATE]
proof (state)
this:
a \<in> path_image g
\<forall>y\<in>path_image g. dist z a \<le> dist z y

goal (1 subgoal):
 1. \<exists>e>0. ball z e \<inter> path_image g = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<in> path_image g
\<forall>y\<in>path_image g. dist z a \<le> dist z y
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a \<in> path_image g
\<forall>y\<in>path_image g. dist z a \<le> dist z y

goal (1 subgoal):
 1. \<exists>e>0. ball z e \<inter> path_image g = {}
[PROOF STEP]
by (rule_tac x="dist z a" in exI) (use dist_commute z in auto)
[PROOF STATE]
proof (state)
this:
\<exists>e>0. ball z e \<inter> path_image g = {}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lin_indpt_subset_cols:
  fixes A:: "'a mat"
  fixes B:: "'a vec set"
  assumes "A \<in> carrier_mat n n"
  assumes inv: "invertible_mat A"
  assumes "B \<subseteq> set (cols A)"
  shows "lin_indpt B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lin_indpt B
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lin_indpt B
[PROOF STEP]
have "det A \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. det A \<noteq> (0::'a)
[PROOF STEP]
using assms(1) inv invertible_det
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat n n
invertible_mat A
?A \<in> carrier_mat ?n ?n \<Longrightarrow> invertible_mat ?A = (det ?A \<noteq> (0::?'a))

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

goal (1 subgoal):
 1. lin_indpt B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
det A \<noteq> (0::'a)
[PROOF STEP]
have "lin_indpt (set (rows A\<^sup>T))"
[PROOF STATE]
proof (prove)
using this:
det A \<noteq> (0::'a)

goal (1 subgoal):
 1. lin_indpt (set (rows A\<^sup>T))
[PROOF STEP]
using assms(1) idom_vec.lin_dep_cols_imp_det_0
[PROOF STATE]
proof (prove)
using this:
det A \<noteq> (0::'a)
A \<in> carrier_mat n n
\<lbrakk>?A \<in> carrier_mat ?n ?n; module.lin_dep class_ring (module_vec TYPE(?'a) ?n) (set (cols ?A))\<rbrakk> \<Longrightarrow> det ?A = (0::?'a)

goal (1 subgoal):
 1. lin_indpt (set (rows A\<^sup>T))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lin_indpt (set (rows A\<^sup>T))

goal (1 subgoal):
 1. lin_indpt B
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
lin_indpt (set (rows A\<^sup>T))

goal (1 subgoal):
 1. lin_indpt B
[PROOF STEP]
using subset_li_is_li assms(3)
[PROOF STATE]
proof (prove)
using this:
lin_indpt (set (rows A\<^sup>T))
\<lbrakk>lin_indpt ?A; ?B \<subseteq> ?A\<rbrakk> \<Longrightarrow> lin_indpt ?B
B \<subseteq> set (cols A)

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nlists_appendI [intro?]:
  "\<lbrakk> a \<in> nlists n A; b \<in> nlists m A \<rbrakk> \<Longrightarrow> a @ b \<in> nlists (n+m) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> nlists n A; b \<in> nlists m A\<rbrakk> \<Longrightarrow> a @ b \<in> nlists (n + m) A
[PROOF STEP]
unfolding nlists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<in> {xs. length xs = n \<and> set xs \<subseteq> A}; b \<in> {xs. length xs = m \<and> set xs \<subseteq> A}\<rbrakk> \<Longrightarrow> a @ b \<in> {xs. length xs = n + m \<and> set xs \<subseteq> A}
[PROOF STEP]
by (auto)


[STATEMENT]
lemma NSLIMSEQ_abs_realpow_zero2: "\<bar>c\<bar> < 1 \<Longrightarrow> (\<lambda>n. c ^ n) \<longlonglongrightarrow>\<^sub>N\<^sub>S 0"
  for c :: real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>c\<bar> < 1 \<Longrightarrow> (^) c \<longlonglongrightarrow>\<^sub>N\<^sub>S 0
[PROOF STEP]
by (simp add: LIMSEQ_abs_realpow_zero2 LIMSEQ_NSLIMSEQ_iff [symmetric])


[STATEMENT]
lemma ennreal_times_divide: "a * (b / c) = a * b / (c::ennreal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (b / c) = a * b / c
[PROOF STEP]
unfolding divide_ennreal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a * (b * inverse c) = a * b * inverse c
[PROOF STEP]
by transfer (simp add: divide_ereal_def[symmetric] ereal_times_divide_eq)


[STATEMENT]
lemma derived_set_of_derived_set_subset_gen:
   "t1_space X \<Longrightarrow> X derived_set_of (X derived_set_of S) \<subseteq> X derived_set_of S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1_space X \<Longrightarrow> X derived_set_of (X derived_set_of S) \<subseteq> X derived_set_of S
[PROOF STEP]
by (meson closedin_contains_derived_set closedin_derived_set_of_gen)


[STATEMENT]
lemma has_derivative_iff_Ex:
  "(f has_derivative f') (at x) \<longleftrightarrow>
    bounded_linear f' \<and> (\<exists>e. (\<forall>h. f (x+h) = f x + f' h + e h) \<and> ((\<lambda>h. norm (e h) / norm h) \<longlongrightarrow> 0) (at 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative f') (at x) = (bounded_linear f' \<and> (\<exists>e. (\<forall>h. f (x + h) = f x + f' h + e h) \<and> (\<lambda>h. norm (e h) / norm h) \<midarrow>0::'a\<rightarrow> 0))
[PROOF STEP]
unfolding has_derivative_at
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bounded_linear f' \<and> (\<lambda>h. norm (f (x + h) - f x - f' h) / norm h) \<midarrow>0::'a\<rightarrow> 0) = (bounded_linear f' \<and> (\<exists>e. (\<forall>h. f (x + h) = f x + f' h + e h) \<and> (\<lambda>h. norm (e h) / norm h) \<midarrow>0::'a\<rightarrow> 0))
[PROOF STEP]
by force


[STATEMENT]
lemma inner_prod_with_times_mat [simp]:
  assumes "dim_vec u = dim_vec v"
  shows "\<langle>u|v\<rangle> = (\<langle>u| * |v\<rangle>) $$ (0,0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>u|v\<rangle> = (\<langle>|u\<rangle>| * |v\<rangle>) $$ (0, 0)
[PROOF STEP]
using assms inner_prod_with_row_bra_vec_col_ket_vec
[PROOF STATE]
proof (prove)
using this:
dim_vec u = dim_vec v
dim_vec ?u = dim_vec ?v \<Longrightarrow> \<langle>?u|?v\<rangle> = row \<langle>|?u\<rangle>| 0 \<bullet> col |?v\<rangle> 0

goal (1 subgoal):
 1. \<langle>u|v\<rangle> = (\<langle>|u\<rangle>| * |v\<rangle>) $$ (0, 0)
[PROOF STEP]
by (simp add: inner_prod_def times_mat_def ket_vec_def bra_def)


[STATEMENT]
lemma (in Corps) field_tOp_assoc:"\<lbrakk>x \<in> carrier K; y \<in> carrier K; z \<in> carrier K\<rbrakk>
                                \<Longrightarrow> x \<cdot>\<^sub>r y \<cdot>\<^sub>r z =  x \<cdot>\<^sub>r (y \<cdot>\<^sub>r z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier K; y \<in> carrier K; z \<in> carrier K\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r y \<cdot>\<^sub>r z = x \<cdot>\<^sub>r (y \<cdot>\<^sub>r z)
[PROOF STEP]
apply (cut_tac field_is_ring)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier K; y \<in> carrier K; z \<in> carrier K; Ring K\<rbrakk> \<Longrightarrow> x \<cdot>\<^sub>r y \<cdot>\<^sub>r z = x \<cdot>\<^sub>r (y \<cdot>\<^sub>r z)
[PROOF STEP]
apply (simp add:Ring.ring_tOp_assoc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma pair_o_tensor:
  assumes "compatible A B" and [simp]: \<open>register C\<close> and [simp]: \<open>register D\<close>
  shows "(A; B) o (C \<otimes>\<^sub>r D) = (A o C; B o D)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A;B) \<circ> C \<otimes>\<^sub>r D = (A \<circ> C;B \<circ> D)
[PROOF STEP]
apply (rule tensor_extensionality)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. clinear ((A;B) \<circ> C \<otimes>\<^sub>r D)
 2. clinear (A \<circ> C;B \<circ> D)
 3. \<And>a b. ((A;B) \<circ> C \<otimes>\<^sub>r D) (a \<otimes>\<^sub>u b) = (A \<circ> C;B \<circ> D) (a \<otimes>\<^sub>u b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
compatible A B
register C
register D

goal (3 subgoals):
 1. clinear ((A;B) \<circ> C \<otimes>\<^sub>r D)
 2. clinear (A \<circ> C;B \<circ> D)
 3. \<And>a b. ((A;B) \<circ> C \<otimes>\<^sub>r D) (a \<otimes>\<^sub>u b) = (A \<circ> C;B \<circ> D) (a \<otimes>\<^sub>u b)
[PROOF STEP]
by (simp_all add: register_tensor_is_register register_pair_apply clinear_compose)


[STATEMENT]
lemma nat_le:"((a::nat) - (a + 1)) \<le> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a - (a + 1) \<le> 0
[PROOF STEP]
apply arith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma [code abstract]:
  "integer_of_natural (m mod n) = integer_of_natural m mod integer_of_natural n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integer_of_natural (m mod n) = integer_of_natural m mod integer_of_natural n
[PROOF STEP]
by transfer (simp add: zmod_int)


[STATEMENT]
lemma homeomorphic_t1_space: "X homeomorphic_space Y \<Longrightarrow> (t1_space X \<longleftrightarrow> t1_space Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X homeomorphic_space Y \<Longrightarrow> t1_space X = t1_space Y
[PROOF STEP]
apply (clarsimp simp add: homeomorphic_space_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f g. homeomorphic_maps X Y f g \<Longrightarrow> t1_space X = t1_space Y
[PROOF STEP]
by (meson homeomorphic_eq_everything_map homeomorphic_maps_map t1_space_closed_map_image)


[STATEMENT]
lemma FP_equivalence: "FP F = FP_Orig F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FP F = FP_Orig F
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. FP F \<subseteq> FP_Orig F
 2. FP_Orig F \<subseteq> FP F
[PROOF STEP]
apply (rule stable_FP_Int [THEN FP_Orig_weakest])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. FP_Orig F \<subseteq> FP F
[PROOF STEP]
apply (simp add: FP_Orig_def FP_def, clarify)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x X. \<lbrakk>x \<in> X; \<forall>B. F \<in> UNITY.stable (X \<inter> B)\<rbrakk> \<Longrightarrow> F \<in> UNITY.stable {x}
[PROOF STEP]
apply (drule_tac x = "{x}" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x X. \<lbrakk>x \<in> X; F \<in> UNITY.stable (X \<inter> {x})\<rbrakk> \<Longrightarrow> F \<in> UNITY.stable {x}
[PROOF STEP]
apply (simp add: Int_insert_right)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_map_into_subtopology:
    "\<lbrakk>open_map X X' f; f ` topspace X \<subseteq> S\<rbrakk> \<Longrightarrow> open_map X (subtopology X' S) f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>open_map X X' f; f ` topspace X \<subseteq> S\<rbrakk> \<Longrightarrow> open_map X (subtopology X' S) f
[PROOF STEP]
unfolding open_map_def openin_subtopology
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>U. openin X U \<longrightarrow> openin X' (f ` U); f ` topspace X \<subseteq> S\<rbrakk> \<Longrightarrow> \<forall>U. openin X U \<longrightarrow> (\<exists>T. openin X' T \<and> f ` U = T \<inter> S)
[PROOF STEP]
using openin_subset
[PROOF STATE]
proof (prove)
using this:
openin ?U ?S \<Longrightarrow> ?S \<subseteq> topspace ?U

goal (1 subgoal):
 1. \<lbrakk>\<forall>U. openin X U \<longrightarrow> openin X' (f ` U); f ` topspace X \<subseteq> S\<rbrakk> \<Longrightarrow> \<forall>U. openin X U \<longrightarrow> (\<exists>T. openin X' T \<and> f ` U = T \<inter> S)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma compact_convex_collinear_segment:
  fixes S :: "'a::euclidean_space set"
  assumes "S \<noteq> {}" "compact S" "convex S" "collinear S"
  obtains a b where "S = closed_segment a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a b. S = closed_segment a b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms convex_connected_collinear compact_convex_collinear_segment_alt
[PROOF STATE]
proof (prove)
using this:
S \<noteq> {}
compact S
convex S
collinear S
collinear ?S \<Longrightarrow> convex ?S = connected ?S
\<lbrakk>?S \<noteq> {}; compact ?S; connected ?S; collinear ?S; \<And>a b. ?S = closed_segment a b \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>a b. S = closed_segment a b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma distinct_seteq_sub_set_union:
  "Finite_Set.card xs = Suc n
    \<Longrightarrow> {ys. set ys = xs \<and> distinct ys}
      \<subseteq> {y # ys |y ys. y \<in> xs \<and> ys \<in> {as. \<exists>a \<in> xs. set as = (xs - {a}) \<and> distinct as}}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Set.card xs = Suc n \<Longrightarrow> {ys. set ys = xs \<and> distinct ys} \<subseteq> {y # ys |y ys. y \<in> xs \<and> ys \<in> {as. \<exists>a\<in>xs. set as = xs - {a} \<and> distinct as}}
[PROOF STEP]
using distinct_seteq_set_Cons_in_set'
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Finite_Set.card ?xs = Suc ?n; ?x \<in> {ys. set ys = ?xs \<and> distinct ys}\<rbrakk> \<Longrightarrow> \<exists>y ys. ?x = y # ys \<and> y \<in> ?xs \<and> ys \<in> {ys. set ys = ?xs - {y} \<and> distinct ys}

goal (1 subgoal):
 1. Finite_Set.card xs = Suc n \<Longrightarrow> {ys. set ys = xs \<and> distinct ys} \<subseteq> {y # ys |y ys. y \<in> xs \<and> ys \<in> {as. \<exists>a\<in>xs. set as = xs - {a} \<and> distinct as}}
[PROOF STEP]
by fast


[STATEMENT]
lemma sets_vimage_algebra2:
  "f \<in> X \<rightarrow> space M \<Longrightarrow> sets (vimage_algebra X f M) = {f -` A \<inter> X | A. A \<in> sets M}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> X \<rightarrow> space M \<Longrightarrow> sets (vimage_algebra X f M) = {f -` A \<inter> X |A. A \<in> sets M}
[PROOF STEP]
using sigma_sets_vimage_commute[of f X "space M" "sets M"]
[PROOF STATE]
proof (prove)
using this:
f \<in> X \<rightarrow> space M \<Longrightarrow> {f -` A \<inter> X |A. A \<in> sigma_sets (space M) (sets M)} = sigma_sets X {f -` A \<inter> X |A. A \<in> sets M}

goal (1 subgoal):
 1. f \<in> X \<rightarrow> space M \<Longrightarrow> sets (vimage_algebra X f M) = {f -` A \<inter> X |A. A \<in> sets M}
[PROOF STEP]
unfolding sets_vimage_algebra sets.sigma_sets_eq
[PROOF STATE]
proof (prove)
using this:
f \<in> X \<rightarrow> space M \<Longrightarrow> {f -` A \<inter> X |A. A \<in> sets M} = sigma_sets X {f -` A \<inter> X |A. A \<in> sets M}

goal (1 subgoal):
 1. f \<in> X \<rightarrow> space M \<Longrightarrow> sigma_sets X {f -` A \<inter> X |A. A \<in> sets M} = {f -` A \<inter> X |A. A \<in> sets M}
[PROOF STEP]
by simp


[STATEMENT]
theorem forward_sim_soundness:
  fixes A::"('sA,'a)ioa" and B::"('sB,'a)ioa" and f::"'sB \<Rightarrow> 'sA set"
  assumes "is_forward_sim f B A" and "ext A = ext B"
  shows "traces B \<subseteq> traces A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.traces B \<subseteq> local.traces A
[PROOF STEP]
using assms forward_sim_execs exec_inc_imp_trace_inc
[PROOF STATE]
proof (prove)
using this:
is_forward_sim f B A
externals (ioa.asig A) = externals (ioa.asig B)
\<lbrakk>is_forward_sim ?f ?B ?A; is_exec_of ?B ?e_B\<rbrakk> \<Longrightarrow> \<exists>e_A. is_exec_of ?A e_A \<and> trace (ioa.asig ?A) e_A = trace (ioa.asig ?A) ?e_B
\<lbrakk>externals (ioa.asig ?B) = externals (ioa.asig ?A); \<And>e_B. is_exec_of ?B e_B \<Longrightarrow> \<exists>e_A. is_exec_of ?A e_A \<and> trace (ioa.asig ?A) e_A = trace (ioa.asig ?A) e_B\<rbrakk> \<Longrightarrow> local.traces ?B \<subseteq> local.traces ?A

goal (1 subgoal):
 1. local.traces B \<subseteq> local.traces A
[PROOF STEP]
by metis


[STATEMENT]
lemma zhmset_of_0: "zhmset_of 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. zhmset_of 0 = 0
[PROOF STEP]
by (simp add: zero_zhmultiset_def)


[STATEMENT]
theorem p56: "(\<forall>x. (\<exists>y. F(y) \<and> x = f(y)) \<longrightarrow> F(x)) \<longleftrightarrow> (\<forall>x. F(x) \<longrightarrow> F(f(x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x. (\<exists>y. F y \<and> x = f y) \<longrightarrow> F x) = (\<forall>x. F x \<longrightarrow> F (f x))
[PROOF STEP]
by auto2