[STATEMENT]
lemma order_prod_list:
  assumes "0 \<notin> set xs"
  shows   "order x (prod_list xs) = sum_list (map (order x) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x (prod_list xs) = sum_list (map (order x) xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0 \<notin> set xs

goal (1 subgoal):
 1. order x (prod_list xs) = sum_list (map (order x) xs)
[PROOF STEP]
by (induction xs) (auto simp: order_mult)


[STATEMENT]
lemma norm1_0[simp]: "norm1 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm1 0 = 0
[PROOF STEP]
unfolding norm1_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>UNIV. norm (0 $h i)) = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma conv_radius_mult_power_right:
  assumes "c \<noteq> (0 :: 'a :: {real_normed_div_algebra,banach})"
  shows   "conv_radius (\<lambda>n. f n * c ^ n) = conv_radius f / ereal (norm c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conv_radius (\<lambda>n. f n * c ^ n) = conv_radius f / ereal (norm c)
[PROOF STEP]
using conv_radius_mult_power[OF assms, of f]
[PROOF STATE]
proof (prove)
using this:
conv_radius (\<lambda>n. c ^ n * f n) = conv_radius f / ereal (norm c)

goal (1 subgoal):
 1. conv_radius (\<lambda>n. f n * c ^ n) = conv_radius f / ereal (norm c)
[PROOF STEP]
unfolding conv_radius_def
[PROOF STATE]
proof (prove)
using this:
inverse (limsup (\<lambda>n. ereal (root n (norm (c ^ n * f n))))) = inverse (limsup (\<lambda>n. ereal (root n (norm (f n))))) / ereal (norm c)

goal (1 subgoal):
 1. inverse (limsup (\<lambda>n. ereal (root n (norm (f n * c ^ n))))) = inverse (limsup (\<lambda>n. ereal (root n (norm (f n))))) / ereal (norm c)
[PROOF STEP]
by (simp add: mult.commute norm_mult)


[STATEMENT]
lemma sum_div:
  assumes "finite A"
  assumes "\<And>a. a \<in> A \<Longrightarrow> (b::'b::euclidean_semiring) dvd f a"
  shows "(\<Sum>a\<in>A. f a) div b = (\<Sum>a\<in>A. (f a) div b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f A div b = (\<Sum>a\<in>A. f a div b)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite A
?a \<in> A \<Longrightarrow> b dvd f ?a

goal (1 subgoal):
 1. sum f A div b = (\<Sum>a\<in>A. f a div b)
[PROOF STEP]
proof (induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<And>a. a \<in> {} \<Longrightarrow> b dvd f a) \<Longrightarrow> sum f {} div b = (\<Sum>a\<in>{}. f a div b)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> b dvd f a) \<Longrightarrow> sum f F div b = (\<Sum>a\<in>F. f a div b); \<And>a. a \<in> insert x F \<Longrightarrow> b dvd f a\<rbrakk> \<Longrightarrow> sum f (insert x F) div b = (\<Sum>a\<in>insert x F. f a div b)
[PROOF STEP]
case insert
[PROOF STATE]
proof (state)
this:
finite F_
x_ \<notin> F_
(\<And>a. a \<in> F_ \<Longrightarrow> b dvd f a) \<Longrightarrow> sum f F_ div b = (\<Sum>a\<in>F_. f a div b)
?a \<in> insert x_ F_ \<Longrightarrow> b dvd f ?a

goal (2 subgoals):
 1. (\<And>a. a \<in> {} \<Longrightarrow> b dvd f a) \<Longrightarrow> sum f {} div b = (\<Sum>a\<in>{}. f a div b)
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<And>a. a \<in> F \<Longrightarrow> b dvd f a) \<Longrightarrow> sum f F div b = (\<Sum>a\<in>F. f a div b); \<And>a. a \<in> insert x F \<Longrightarrow> b dvd f a\<rbrakk> \<Longrightarrow> sum f (insert x F) div b = (\<Sum>a\<in>insert x F. f a div b)
[PROOF STEP]
from this
[PROOF STATE]
proof (chain)
picking this:
finite F_
x_ \<notin> F_
(\<And>a. a \<in> F_ \<Longrightarrow> b dvd f a) \<Longrightarrow> sum f F_ div b = (\<Sum>a\<in>F_. f a div b)
?a \<in> insert x_ F_ \<Longrightarrow> b dvd f ?a
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F_
x_ \<notin> F_
(\<And>a. a \<in> F_ \<Longrightarrow> b dvd f a) \<Longrightarrow> sum f F_ div b = (\<Sum>a\<in>F_. f a div b)
?a \<in> insert x_ F_ \<Longrightarrow> b dvd f ?a

goal (1 subgoal):
 1. sum f (insert x_ F_) div b = (\<Sum>a\<in>insert x_ F_. f a div b)
[PROOF STEP]
by auto (subst div_add; auto intro!: dvd_sum)
[PROOF STATE]
proof (state)
this:
sum f (insert x_ F_) div b = (\<Sum>a\<in>insert x_ F_. f a div b)

goal (1 subgoal):
 1. (\<And>a. a \<in> {} \<Longrightarrow> b dvd f a) \<Longrightarrow> sum f {} div b = (\<Sum>a\<in>{}. f a div b)
[PROOF STEP]
qed (auto)


[STATEMENT]
lemma (in Group) inter_sgsTr1:"\<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk>  \<Longrightarrow> G \<guillemotright> f (i div s) \<inter> g (s - Suc 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk> \<Longrightarrow> G \<guillemotright> f (i div s) \<inter> g (s - Suc 0)
[PROOF STEP]
apply (rule inter_sgs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk> \<Longrightarrow> G \<guillemotright> f (i div s)
 2. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk> \<Longrightarrow> G \<guillemotright> g (s - Suc 0)
[PROOF STEP]
apply (rule compseriesTr0, assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk> \<Longrightarrow> i div s \<le> r
 2. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk> \<Longrightarrow> G \<guillemotright> g (s - Suc 0)
[PROOF STEP]
apply (frule less_imp_le [of "i" "r * s"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s; i \<le> r * s\<rbrakk> \<Longrightarrow> i div s \<le> r
 2. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk> \<Longrightarrow> G \<guillemotright> g (s - Suc 0)
[PROOF STEP]
apply (frule div_Tr1 [of "r" "s" "i"], assumption+)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s; i \<le> r * s\<rbrakk> \<Longrightarrow> i \<le> s * r
 2. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s; i \<le> r * s; i div s \<le> r\<rbrakk> \<Longrightarrow> i div s \<le> r
 3. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk> \<Longrightarrow> G \<guillemotright> g (s - Suc 0)
[PROOF STEP]
apply (simp add:mult.commute, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < r; 0 < s; compseries G r f; compseries G s g; i < r * s\<rbrakk> \<Longrightarrow> G \<guillemotright> g (s - Suc 0)
[PROOF STEP]
apply (rule compseriesTr0, simp+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma to_nat_0: "to_nat 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mod_type_class.to_nat (0::'a) = 0
[PROOF STEP]
unfolding to_nat_def o_def Rep_0 nat_0
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 = 0
[PROOF STEP]
..


[STATEMENT]
lemma simple_closed_path_winding_number_pos:
   "\<lbrakk>simple_path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; z \<notin> path_image \<gamma>; 0 < Re(winding_number \<gamma> z)\<rbrakk>
    \<Longrightarrow> winding_number \<gamma> z = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>simple_path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; z \<notin> path_image \<gamma>; 0 < Re (winding_number \<gamma> z)\<rbrakk> \<Longrightarrow> winding_number \<gamma> z = 1
[PROOF STEP]
using simple_closed_path_winding_number_cases
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>simple_path ?\<gamma>; pathfinish ?\<gamma> = pathstart ?\<gamma>; ?z \<notin> path_image ?\<gamma>\<rbrakk> \<Longrightarrow> winding_number ?\<gamma> ?z \<in> {- 1, 0, 1}

goal (1 subgoal):
 1. \<lbrakk>simple_path \<gamma>; pathfinish \<gamma> = pathstart \<gamma>; z \<notin> path_image \<gamma>; 0 < Re (winding_number \<gamma> z)\<rbrakk> \<Longrightarrow> winding_number \<gamma> z = 1
[PROOF STEP]
by fastforce


[STATEMENT]
lemma (in aGroup) nsum_add:
  "\<lbrakk> \<forall>j \<le> n. f j \<in> carrier A; \<forall>j \<le> n. g j \<in> carrier A\<rbrakk>  \<Longrightarrow>
   nsum A (\<lambda> i. (f i) \<plusminus> (g i)) n = (nsum A f n) \<plusminus> (nsum A g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j\<le>n. f j \<in> carrier A; \<forall>j\<le>n. g j \<in> carrier A\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e A (\<lambda>i. f i \<plusminus> g i) n = \<Sigma>\<^sub>e A f n \<plusminus> \<Sigma>\<^sub>e A g n
[PROOF STEP]
by (cut_tac nsum_addTr[of n f g], simp)


[STATEMENT]
lemma setdist_eq_0_closed:
   "closed S \<Longrightarrow> (setdist {x} S = 0 \<longleftrightarrow> S = {} \<or> x \<in> S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed S \<Longrightarrow> (setdist {x} S = 0) = (S = {} \<or> x \<in> S)
[PROOF STEP]
by (simp add: setdist_eq_0_sing_1)


[STATEMENT]
lemma (in normal) continuous_oVeblen_0:
"continuous (\<lambda>x. oVeblen F x 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous (\<lambda>x. oVeblen F x 0)
[PROOF STEP]
apply (rule continuousI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f. OrdinalInduct.strict_mono f \<Longrightarrow> oVeblen F (oLimit f) 0 = oLimit (\<lambda>n. oVeblen F (f n) 0)
 2. \<And>x. oVeblen F x 0 \<le> oVeblen F (oSuc x) 0
[PROOF STEP]
apply (simp add: oVeblen_def critical_set_oLimit)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f. OrdinalInduct.strict_mono f \<Longrightarrow> OrdinalVeblen.ordering (\<Inter>n. critical_set (range F) (f n)) 0 = oLimit (\<lambda>n. OrdinalVeblen.ordering (critical_set (range F) (f n)) 0)
 2. \<And>x. oVeblen F x 0 \<le> oVeblen F (oSuc x) 0
[PROOF STEP]
apply (rule ordering_INTER_0[rule_format])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>f n. OrdinalInduct.strict_mono f \<Longrightarrow> normal_set (critical_set (range F) (f n))
 2. \<And>f n. OrdinalInduct.strict_mono f \<Longrightarrow> critical_set (range F) (f (Suc n)) \<subseteq> critical_set (range F) (f n)
 3. \<And>x. oVeblen F x 0 \<le> oVeblen F (oSuc x) 0
[PROOF STEP]
apply (rule normal_set_critical_set)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>f n. OrdinalInduct.strict_mono f \<Longrightarrow> normal_set (range F)
 2. \<And>f n. OrdinalInduct.strict_mono f \<Longrightarrow> critical_set (range F) (f (Suc n)) \<subseteq> critical_set (range F) (f n)
 3. \<And>x. oVeblen F x 0 \<le> oVeblen F (oSuc x) 0
[PROOF STEP]
apply (rule normal_set_range)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f n. OrdinalInduct.strict_mono f \<Longrightarrow> critical_set (range F) (f (Suc n)) \<subseteq> critical_set (range F) (f n)
 2. \<And>x. oVeblen F x 0 \<le> oVeblen F (oSuc x) 0
[PROOF STEP]
apply (rule critical_set_mono)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>f n. OrdinalInduct.strict_mono f \<Longrightarrow> f n \<le> f (Suc n)
 2. \<And>x. oVeblen F x 0 \<le> oVeblen F (oSuc x) 0
[PROOF STEP]
apply (simp add: strict_mono_monoD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. oVeblen F x 0 \<le> oVeblen F (oSuc x) 0
[PROOF STEP]
apply (simp only: oVeblen_oSuc)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. oVeblen F x 0 \<le> oDeriv (oVeblen F x) 0
[PROOF STEP]
apply (rule oDeriv_increasing)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. continuous (oVeblen F x)
[PROOF STEP]
apply (rule normal.continuous)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. normal (oVeblen F x)
[PROOF STEP]
apply (rule normal_oVeblen)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma card_nonzero:"\<lbrakk>finite A; card A \<noteq> 0\<rbrakk> \<Longrightarrow> A \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite A; card A \<noteq> 0\<rbrakk> \<Longrightarrow> A \<noteq> {}
[PROOF STEP]
by (rule contrapos_pp, simp+)


[STATEMENT]
lemma suminf_exist_split2:
  fixes f :: "nat \<Rightarrow> 'a::real_normed_vector"
  assumes "summable f"
  shows "(\<lambda>n. (\<Sum>k. f(k+n))) \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>n. \<Sum>k. f (k + n)) \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
by (subst lim_sequentially, auto simp add: dist_norm suminf_exist_split[OF _ assms])


[STATEMENT]
lemma lipschitz_on_cmult_nonneg [lipschitz_intros]:
  fixes f::"'a::metric_space \<Rightarrow> 'b::real_normed_vector"
  assumes "C-lipschitz_on U f"
    "a \<ge> 0"
  shows "(a * C)-lipschitz_on U (\<lambda>x. a *\<^sub>R f x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a * C)-lipschitz_on U (\<lambda>x. a *\<^sub>R f x)
[PROOF STEP]
using lipschitz_on_cmult[OF assms(1), of a] assms(2)
[PROOF STATE]
proof (prove)
using this:
(\<bar>a\<bar> * C)-lipschitz_on U (\<lambda>x. a *\<^sub>R f x)
0 \<le> a

goal (1 subgoal):
 1. (a * C)-lipschitz_on U (\<lambda>x. a *\<^sub>R f x)
[PROOF STEP]
by auto


[STATEMENT]
lemma L_transform_Not [simp]: "L_transform (Not x) = Formula.Not (L_transform x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. L_transform (FL_Formula.Not x) = Formula.Not (L_transform x)
[PROOF STEP]
unfolding L_transform_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Formula.formula.Abs_formula (L_transform_formula (FL_Formula.Not x)) = Formula.Not (Formula.formula.Abs_formula (L_transform_formula x))
[PROOF STEP]
by (simp add: Formula.Not_def)


[STATEMENT]
lemma set_restriction_fun_empty_conv: "
  ((set_restriction_fun P) A = {}) = (\<forall>x\<in>A. \<not> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (set_restriction_fun P A = {}) = (\<forall>x\<in>A. \<not> P x)
[PROOF STEP]
unfolding set_restriction_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({x \<in> A. P x} = {}) = (\<forall>x\<in>A. \<not> P x)
[PROOF STEP]
by blast


[STATEMENT]
lemma length_vec_to_iarray:
  fixes xa::"'a^'n::{mod_type}"
  shows "IArray.length (vec_to_iarray xa) = CARD('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (vec_to_iarray xa) = CARD('n)
[PROOF STEP]
unfolding vec_to_iarray_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. IArray.length (IArray.of_fun (\<lambda>i. xa $ mod_type_class.from_nat i) CARD('n)) = CARD('n)
[PROOF STEP]
by simp


[STATEMENT]
lemma pow_gen_mod_mult:
  shows"(\<^bold>g [^] (a::nat) \<otimes> \<^bold>g [^] (b::nat)) [^] ((c::int)*int (d::nat)) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] ((c*int d) mod (order G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
have "(\<^bold>g [^] (a::nat) \<otimes> \<^bold>g [^] (b::nat)) \<in> carrier G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<^bold>g [^] a \<otimes> \<^bold>g [^] b \<in> carrier G
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] a \<otimes> \<^bold>g [^] b \<in> carrier G

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<^bold>g [^] a \<otimes> \<^bold>g [^] b \<in> carrier G
[PROOF STEP]
obtain n :: nat where n: "\<^bold>g [^] n = (\<^bold>g [^] (a::nat) \<otimes> \<^bold>g [^] (b::nat))"
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] a \<otimes> \<^bold>g [^] b \<in> carrier G

goal (1 subgoal):
 1. (\<And>n. \<^bold>g [^] n = \<^bold>g [^] a \<otimes> \<^bold>g [^] b \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (simp add: monoid.nat_pow_mult)
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] n = \<^bold>g [^] a \<otimes> \<^bold>g [^] b

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<^bold>g [^] n = \<^bold>g [^] a \<otimes> \<^bold>g [^] b

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
obtain r where r: "r = c*int d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>r. r = c * int d \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
r = c * int d

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
have 1: "(\<^bold>g [^] (a::nat) \<otimes> \<^bold>g [^] (b::nat)) [^] ((c::int)*int (d::nat)) = (\<^bold>g [^] n) [^] r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] n) [^] r
[PROOF STEP]
using n r
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] n = \<^bold>g [^] a \<otimes> \<^bold>g [^] b
r = c * int d

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] n) [^] r
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] n) [^] r

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] n) [^] r

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
have 2:"... = (\<^bold>g [^] n) [^] (r mod (order G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>g [^] n) [^] r = (\<^bold>g [^] n) [^] (r mod int (order G))
[PROOF STEP]
using pow_generator_mod_int pow_generator_mod
[PROOF STATE]
proof (prove)
using this:
\<^bold>g [^] (?k mod int (order G)) = \<^bold>g [^] ?k
\<^bold>g [^] (?k mod order G) = \<^bold>g [^] ?k

goal (1 subgoal):
 1. (\<^bold>g [^] n) [^] r = (\<^bold>g [^] n) [^] (r mod int (order G))
[PROOF STEP]
by (metis int_nat_pow int_pow_int mod_mult_right_eq zero_le)
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] n) [^] r = (\<^bold>g [^] n) [^] (r mod int (order G))

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] n) [^] r = (\<^bold>g [^] n) [^] (r mod int (order G))

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
have 3:"... =  (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] ((c*int d) mod (order G))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<^bold>g [^] n) [^] (r mod int (order G)) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
using r n
[PROOF STATE]
proof (prove)
using this:
r = c * int d
\<^bold>g [^] n = \<^bold>g [^] a \<otimes> \<^bold>g [^] b

goal (1 subgoal):
 1. (\<^bold>g [^] n) [^] (r mod int (order G)) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] n) [^] (r mod int (order G)) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(\<^bold>g [^] n) [^] (c * int d) = (\<^bold>g [^] n) [^] (r mod int (order G))
(\<^bold>g [^] n) [^] (r mod int (order G)) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<^bold>g [^] n) [^] (c * int d) = (\<^bold>g [^] n) [^] (r mod int (order G))
(\<^bold>g [^] n) [^] (r mod int (order G)) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
using 1 2 3
[PROOF STATE]
proof (prove)
using this:
(\<^bold>g [^] n) [^] (c * int d) = (\<^bold>g [^] n) [^] (r mod int (order G))
(\<^bold>g [^] n) [^] (r mod int (order G)) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
(\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] n) [^] r
(\<^bold>g [^] n) [^] r = (\<^bold>g [^] n) [^] (r mod int (order G))
(\<^bold>g [^] n) [^] (r mod int (order G)) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))

goal (1 subgoal):
 1. (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d) = (\<^bold>g [^] a \<otimes> \<^bold>g [^] b) [^] (c * int d mod int (order G))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_truncate_divide:
  fixes f g :: "'a :: field fds"
  shows "fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)
[PROOF STEP]
have "fds_truncate m (f / g) = fds_truncate m (fds_truncate m (fds_truncate m f) *
          fds_truncate m (inverse (fds_truncate m g)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_truncate m (f / g) = fds_truncate m (fds_truncate m (fds_truncate m f) * fds_truncate m (inverse (fds_truncate m g)))
[PROOF STEP]
by (simp add: fds_truncate_inverse fds_truncate_mult divide_fds_def)
[PROOF STATE]
proof (state)
this:
fds_truncate m (f / g) = fds_truncate m (fds_truncate m (fds_truncate m f) * fds_truncate m (inverse (fds_truncate m g)))

goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_truncate m (f / g) = fds_truncate m (fds_truncate m (fds_truncate m f) * fds_truncate m (inverse (fds_truncate m g)))

goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)
[PROOF STEP]
have "\<dots> = fds_truncate m (fds_truncate m f * inverse (fds_truncate m g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_truncate m (fds_truncate m (fds_truncate m f) * fds_truncate m (inverse (fds_truncate m g))) = fds_truncate m (fds_truncate m f * inverse (fds_truncate m g))
[PROOF STEP]
by (rule fds_truncate_mult)
[PROOF STATE]
proof (state)
this:
fds_truncate m (fds_truncate m (fds_truncate m f) * fds_truncate m (inverse (fds_truncate m g))) = fds_truncate m (fds_truncate m f * inverse (fds_truncate m g))

goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
fds_truncate m (fds_truncate m (fds_truncate m f) * fds_truncate m (inverse (fds_truncate m g))) = fds_truncate m (fds_truncate m f * inverse (fds_truncate m g))

goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)
[PROOF STEP]
have "\<dots> = fds_truncate m (fds_truncate m f / fds_truncate m g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f * inverse (fds_truncate m g)) = fds_truncate m (fds_truncate m f / fds_truncate m g)
[PROOF STEP]
by (simp add: divide_fds_def)
[PROOF STATE]
proof (state)
this:
fds_truncate m (fds_truncate m f * inverse (fds_truncate m g)) = fds_truncate m (fds_truncate m f / fds_truncate m g)

goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
fds_truncate m (f / g) = fds_truncate m (fds_truncate m f / fds_truncate m g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fds_truncate m (f / g) = fds_truncate m (fds_truncate m f / fds_truncate m g)

goal (1 subgoal):
 1. fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
fds_truncate m (fds_truncate m f / fds_truncate m g) = fds_truncate m (f / g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exp_of_real: "exp (of_real x) = of_real (exp x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. exp (of_real x) = of_real (exp x)
[PROOF STEP]
unfolding exp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. of_real x ^ n /\<^sub>R fact n) = of_real (\<Sum>n. x ^ n /\<^sub>R fact n)
[PROOF STEP]
apply (subst suminf_of_real [OF summable_exp_generic])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. of_real x ^ n /\<^sub>R fact n) = (\<Sum>n. of_real (x ^ n /\<^sub>R fact n))
[PROOF STEP]
apply (simp add: scaleR_conv_of_real)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ceiling_altdef: "\<lceil>x\<rceil> = (if x = of_int \<lfloor>x\<rfloor> then \<lfloor>x\<rfloor> else \<lfloor>x\<rfloor> + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>x\<rceil> = (if x = of_int \<lfloor>x\<rfloor> then \<lfloor>x\<rfloor> else \<lfloor>x\<rfloor> + 1)
[PROOF STEP]
by (intro ceiling_unique; simp, linarith?)


[STATEMENT]
lemma mydiv_mono: "a\<le>b \<Longrightarrow> mydiv a k \<le> mydiv b k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> mydiv a k \<le> mydiv b k
[PROOF STEP]
unfolding mydiv_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<le> b \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
[PROOF STEP]
apply(cases "k dvd a")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; k dvd a\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
 2. \<lbrakk>a \<le> b; \<not> k dvd a\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; k dvd a\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
[PROOF STEP]
apply(cases "k dvd b")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; k dvd a; k dvd b\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
 2. \<lbrakk>a \<le> b; k dvd a; \<not> k dvd b\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; k dvd a; k dvd b\<rbrakk> \<Longrightarrow> a div k \<le> b div k
 2. \<lbrakk>a \<le> b; k dvd a; \<not> k dvd b\<rbrakk> \<Longrightarrow> a div k \<le> Suc (b div k)
[PROOF STEP]
apply (auto simp add: div_le_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; k dvd a; \<not> k dvd b\<rbrakk> \<Longrightarrow> a div k \<le> Suc (b div k)
[PROOF STEP]
using div_le_mono le_Suc_eq
[PROOF STATE]
proof (prove)
using this:
?m \<le> ?n \<Longrightarrow> ?m div ?k \<le> ?n div ?k
(?m \<le> Suc ?n) = (?m \<le> ?n \<or> ?m = Suc ?n)

goal (1 subgoal):
 1. \<lbrakk>a \<le> b; k dvd a; \<not> k dvd b\<rbrakk> \<Longrightarrow> a div k \<le> Suc (b div k)
[PROOF STEP]
by blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<not> k dvd a\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<not> k dvd a\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
[PROOF STEP]
apply(cases "k dvd b")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; \<not> k dvd a; k dvd b\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
 2. \<lbrakk>a \<le> b; \<not> k dvd a; \<not> k dvd b\<rbrakk> \<Longrightarrow> (if k dvd a then a div k else a div k + 1) \<le> (if k dvd b then b div k else b div k + 1)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; \<not> k dvd a; k dvd b\<rbrakk> \<Longrightarrow> Suc (a div k) \<le> b div k
 2. \<lbrakk>a \<le> b; \<not> k dvd a; \<not> k dvd b\<rbrakk> \<Longrightarrow> a div k \<le> b div k
[PROOF STEP]
apply (auto simp add: div_le_mono)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<not> k dvd a; k dvd b\<rbrakk> \<Longrightarrow> Suc (a div k) \<le> b div k
[PROOF STEP]
by (metis Suc_leI add.right_neutral div_le_mono div_mult_mod_eq dvd_imp_mod_0 le_add1 le_antisym less_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma hcmod_triangle_ineq2 [simp]: "\<And>a b. hcmod (b + a) - hcmod b \<le> hcmod a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. hcmod (b + a) - hcmod b \<le> hcmod a
[PROOF STEP]
by transfer (rule complex_mod_triangle_ineq2)


[STATEMENT]
lemma image2_eqI: "\<lbrakk>b = f x; c = g x; x \<in> A\<rbrakk> \<Longrightarrow> (b, c) \<in> image2 A f g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b = f x; c = g x; x \<in> A\<rbrakk> \<Longrightarrow> (b, c) \<in> image2 A f g
[PROOF STEP]
unfolding image2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>b = f x; c = g x; x \<in> A\<rbrakk> \<Longrightarrow> (b, c) \<in> {(f a, g a) |a. a \<in> A}
[PROOF STEP]
by auto


[STATEMENT]
lemma finite_symvars_imp_ex_greatest_symvar :
  fixes SV :: "'a symvar set"
  assumes "finite SV"
  assumes "\<exists> sv \<in> SV. fst sv = v"
  shows   "\<exists> sv  \<in> {sv \<in> SV. fst sv = v}.
           \<forall> sv' \<in> {sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
have "finite (snd ` {sv \<in> SV. fst sv = v})"
  and  "snd ` {sv \<in> SV. fst sv = v} \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (snd ` {sv \<in> SV. fst sv = v}) &&& snd ` {sv \<in> SV. fst sv = v} \<noteq> {}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite SV
\<exists>sv\<in>SV. fst sv = v

goal (1 subgoal):
 1. finite (snd ` {sv \<in> SV. fst sv = v}) &&& snd ` {sv \<in> SV. fst sv = v} \<noteq> {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (snd ` {sv \<in> SV. fst sv = v})
snd ` {sv \<in> SV. fst sv = v} \<noteq> {}

goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (snd ` {sv \<in> SV. fst sv = v})
snd ` {sv \<in> SV. fst sv = v} \<noteq> {}

goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
have "\<forall> (E::nat set). finite E \<and> E \<noteq> {} \<longrightarrow> (\<exists> n \<in> E. \<forall> m \<in> E. m \<le> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>E. finite E \<and> E \<noteq> {} \<longrightarrow> (\<exists>n\<in>E. \<forall>m\<in>E. m \<le> n)
[PROOF STEP]
by (intro allI impI, induct_tac rule : finite_ne_induct)
     (simp+, force)
[PROOF STATE]
proof (state)
this:
\<forall>E. finite E \<and> E \<noteq> {} \<longrightarrow> (\<exists>n\<in>E. \<forall>m\<in>E. m \<le> n)

goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (snd ` {sv \<in> SV. fst sv = v})
snd ` {sv \<in> SV. fst sv = v} \<noteq> {}
\<forall>E. finite E \<and> E \<noteq> {} \<longrightarrow> (\<exists>n\<in>E. \<forall>m\<in>E. m \<le> n)
[PROOF STEP]
obtain n
  where "n \<in> snd ` {sv \<in> SV. fst sv = v}"
  and   "\<forall> m \<in> snd ` {sv \<in> SV. fst sv = v}. m \<le> n"
[PROOF STATE]
proof (prove)
using this:
finite (snd ` {sv \<in> SV. fst sv = v})
snd ` {sv \<in> SV. fst sv = v} \<noteq> {}
\<forall>E. finite E \<and> E \<noteq> {} \<longrightarrow> (\<exists>n\<in>E. \<forall>m\<in>E. m \<le> n)

goal (1 subgoal):
 1. (\<And>n. \<lbrakk>n \<in> snd ` {sv \<in> SV. fst sv = v}; \<forall>m\<in>snd ` {sv \<in> SV. fst sv = v}. m \<le> n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
n \<in> snd ` {sv \<in> SV. fst sv = v}
\<forall>m\<in>snd ` {sv \<in> SV. fst sv = v}. m \<le> n

goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
n \<in> snd ` {sv \<in> SV. fst sv = v}
\<forall>m\<in>snd ` {sv \<in> SV. fst sv = v}. m \<le> n

goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n \<in> snd ` {sv \<in> SV. fst sv = v}
\<forall>m\<in>snd ` {sv \<in> SV. fst sv = v}. m \<le> n
[PROOF STEP]
obtain sv
  where "sv \<in> {sv \<in> SV. fst sv = v}" and "snd sv = n"
[PROOF STATE]
proof (prove)
using this:
n \<in> snd ` {sv \<in> SV. fst sv = v}
\<forall>m\<in>snd ` {sv \<in> SV. fst sv = v}. m \<le> n

goal (1 subgoal):
 1. (\<And>sv. \<lbrakk>sv \<in> {sv \<in> SV. fst sv = v}; snd sv = n\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
sv \<in> {sv \<in> SV. fst sv = v}
snd sv = n

goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
n \<in> snd ` {sv \<in> SV. fst sv = v}
\<forall>m\<in>snd ` {sv \<in> SV. fst sv = v}. m \<le> n
sv \<in> {sv \<in> SV. fst sv = v}
snd sv = n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n \<in> snd ` {sv \<in> SV. fst sv = v}
\<forall>m\<in>snd ` {sv \<in> SV. fst sv = v}. m \<le> n
sv \<in> {sv \<in> SV. fst sv = v}
snd sv = n

goal (1 subgoal):
 1. \<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>sv\<in>{sv \<in> SV. fst sv = v}. \<forall>sv'\<in>{sv \<in> SV. fst sv = v}. snd sv' \<le> snd sv

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem LT14: "\<turnstile> ((F \<or> G) \<leadsto> H) \<longrightarrow> (F \<leadsto> H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> (F \<or> G \<leadsto> H) \<longrightarrow> F \<leadsto> H
[PROOF STEP]
unfolding leadsto_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<turnstile> \<box>(F \<or> G \<longrightarrow> \<diamond>H) \<longrightarrow> \<box>(F \<longrightarrow> \<diamond>H)
[PROOF STEP]
by (rule STL4) auto


[STATEMENT]
lemma cmp_surj: "\<lbrakk>f:A \<rightarrow> B; surj_to f A B; g : B \<rightarrow> C; surj_to g B C \<rbrakk>
                         \<Longrightarrow> surj_to (cmp g f) A C "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; surj_to f A B; g \<in> B \<rightarrow> C; surj_to g B C\<rbrakk> \<Longrightarrow> surj_to (cmp g f) A C
[PROOF STEP]
apply (rule surj_to_test, simp add:cmp_fun)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>f \<in> A \<rightarrow> B; surj_to f A B; g \<in> B \<rightarrow> C; surj_to g B C\<rbrakk> \<Longrightarrow> \<forall>b\<in>C. \<exists>a\<in>A. cmp g f a = b
[PROOF STEP]
apply (rule ballI, simp add:surj_to_def [of "g"], frule sym,
       thin_tac "g ` B = C", simp, simp add:image_def,
       simp add:cmp_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>b. \<lbrakk>f \<in> A \<rightarrow> B; surj_to f A B; \<exists>x\<in>B. b = g x; C = {y. \<exists>x\<in>B. y = g x}\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. g (f a) = b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> A \<rightarrow> B; surj_to f A B; C = {y. \<exists>x\<in>B. y = g x}; x \<in> B\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. g (f a) = g x
[PROOF STEP]
apply (simp add:surj_to_def, frule sym,
       thin_tac " f ` A = B", simp add:image_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>f \<in> A \<rightarrow> {y. \<exists>x\<in>A. y = f x}; C = {y. \<exists>x. (\<exists>xa\<in>A. x = f xa) \<and> y = g x}; \<exists>xa\<in>A. x = f xa; B = {y. \<exists>x\<in>A. y = f x}\<rbrakk> \<Longrightarrow> \<exists>a\<in>A. g (f a) = g x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


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


[STATEMENT]
lemma sinc_at_0: "((\<lambda>x. sin x / x::real) \<longlongrightarrow> 1) (at 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. sin x / x) \<midarrow>0\<rightarrow> 1
[PROOF STEP]
using DERIV_sin [of 0]
[PROOF STATE]
proof (prove)
using this:
(sin has_field_derivative cos (0::?'a1)) (at (0::?'a1))

goal (1 subgoal):
 1. (\<lambda>x. sin x / x) \<midarrow>0\<rightarrow> 1
[PROOF STEP]
by (auto simp add: has_field_derivative_def field_has_derivative_at)


[STATEMENT]
lemma euler_approx_aux_Suc:
  "euler_approx_aux (Suc m) = 1 + Suc m * euler_approx_aux m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. euler_approx_aux (Suc m) = 1 + Suc m * euler_approx_aux m
[PROOF STEP]
unfolding euler_approx_aux_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k\<le>Suc m. \<Prod>{k + 1..Suc m}) = 1 + Suc m * (\<Sum>k\<le>m. \<Prod>{k + 1..m})
[PROOF STEP]
by (subst sum_distrib_left) (simp add: atLeastAtMostSuc_conv mult.commute)


[STATEMENT]
lemma split_le_Suc: "(\<forall>x\<le>Suc k. P x) =  (P (Suc k) \<and> (\<forall>x\<le>k. P x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x\<le>Suc k. P x) = (P (Suc k) \<and> (\<forall>x\<le>k. P x))
[PROOF STEP]
apply rule
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<le>Suc k. P x \<Longrightarrow> P (Suc k) \<and> (\<forall>x\<le>k. P x)
 2. P (Suc k) \<and> (\<forall>x\<le>k. P x) \<Longrightarrow> \<forall>x\<le>Suc k. P x
[PROOF STEP]
apply  clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P (Suc k) \<and> (\<forall>x\<le>k. P x) \<Longrightarrow> \<forall>x\<le>Suc k. P x
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>P (Suc k); \<forall>x\<le>k. P x; x \<le> Suc k\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply (case_tac "x = Suc k")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x. \<lbrakk>P (Suc k); \<forall>x\<le>k. P x; x \<le> Suc k; x = Suc k\<rbrakk> \<Longrightarrow> P x
 2. \<And>x. \<lbrakk>P (Suc k); \<forall>x\<le>k. P x; x \<le> Suc k; x \<noteq> Suc k\<rbrakk> \<Longrightarrow> P x
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma d_states_acyclic_paths :
  fixes M :: "('a::linorder,'b::linorder,'c) fsm"
  assumes "path (filter_transitions M (\<lambda> t . (t_source t, t_input t) \<in> set (d_states M q))) q' p"
          (is "path ?FM q' p")
shows "distinct (visited_states q' p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. distinct (visited_states q' p)
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> distinct (visited_states q' p) \<Longrightarrow> False
[PROOF STEP]
assume "\<not> distinct (visited_states q' p)"
[PROOF STATE]
proof (state)
this:
\<not> distinct (visited_states q' p)

goal (1 subgoal):
 1. \<not> distinct (visited_states q' p) \<Longrightarrow> False
[PROOF STEP]
obtain i j where p1:"take j (drop i p) \<noteq> []"
               and p2:"target (target q' (take i p)) (take j (drop i p)) = (target q' (take i p))"
               and p3:"path ?FM (target q' (take i p)) (take j (drop i p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>j i. \<lbrakk>take j (drop i p) \<noteq> []; target (target q' (take i p)) (take j (drop i p)) = target q' (take i p); path (FSM.filter_transitions M (\<lambda>t. (t_source t, t_input t) \<in> set (d_states M q))) (target q' (take i p)) (take j (drop i p))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using cycle_from_cyclic_path[OF assms \<open>\<not> distinct (visited_states q' p)\<close>]
[PROOF STATE]
proof (prove)
using this:
(\<And>i j. \<lbrakk>take j (drop i p) \<noteq> []; target (target q' (take i p)) (take j (drop i p)) = target q' (take i p); path (FSM.filter_transitions M (\<lambda>t. (t_source t, t_input t) \<in> set (d_states M q))) (target q' (take i p)) (take j (drop i p))\<rbrakk> \<Longrightarrow> ?thesis) \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. (\<And>j i. \<lbrakk>take j (drop i p) \<noteq> []; target (target q' (take i p)) (take j (drop i p)) = target q' (take i p); path (FSM.filter_transitions M (\<lambda>t. (t_source t, t_input t) \<in> set (d_states M q))) (target q' (take i p)) (take j (drop i p))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
take j (drop i p) \<noteq> []
target (target q' (take i p)) (take j (drop i p)) = target q' (take i p)
path (FSM.filter_transitions M (\<lambda>t. (t_source t, t_input t) \<in> set (d_states M q))) (target q' (take i p)) (take j (drop i p))

goal (1 subgoal):
 1. \<not> distinct (visited_states q' p) \<Longrightarrow> False
[PROOF STEP]
show "False"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. False
[PROOF STEP]
using d_states_acyclic_paths'[OF p3 p2 p1]
[PROOF STATE]
proof (prove)
using this:
False

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem descartes_sign_rule:
  fixes p :: "real poly"
  assumes "p \<noteq> 0"
  shows "\<exists>d. even d \<and> coeff_sign_changes p = count_pos_roots p + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>d. even d \<and> sign_changes (coeffs p) = count_roots_with ((<) 0) p + d
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. even ?d \<and> sign_changes (coeffs p) = count_roots_with ((<) 0) p + ?d
[PROOF STEP]
define d where "d = coeff_sign_changes p - count_pos_roots p"
[PROOF STATE]
proof (state)
this:
d = sign_changes (coeffs p) - count_roots_with ((<) 0) p

goal (1 subgoal):
 1. even ?d \<and> sign_changes (coeffs p) = count_roots_with ((<) 0) p + ?d
[PROOF STEP]
show "even d \<and> coeff_sign_changes p = count_pos_roots p + d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even d \<and> sign_changes (coeffs p) = count_roots_with ((<) 0) p + d
[PROOF STEP]
unfolding d_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (sign_changes (coeffs p) - count_roots_with ((<) 0) p) \<and> sign_changes (coeffs p) = count_roots_with ((<) 0) p + (sign_changes (coeffs p) - count_roots_with ((<) 0) p)
[PROOF STEP]
using descartes_sign_rule_aux[OF assms]
[PROOF STATE]
proof (prove)
using this:
count_roots_with ((<) 0) p \<le> sign_changes (coeffs p) \<and> even (sign_changes (coeffs p) - count_roots_with ((<) 0) p)

goal (1 subgoal):
 1. even (sign_changes (coeffs p) - count_roots_with ((<) 0) p) \<and> sign_changes (coeffs p) = count_roots_with ((<) 0) p + (sign_changes (coeffs p) - count_roots_with ((<) 0) p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
even d \<and> sign_changes (coeffs p) = count_roots_with ((<) 0) p + d

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma set_mset_inter [simp]:
  "set_mset (A \<inter># B) = set_mset A \<inter> set_mset B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (A \<inter># B) = set_mset A \<inter> set_mset B
[PROOF STEP]
by (simp only: set_mset_def) auto


[STATEMENT]
lemma prob0_is_prob:
  assumes "state n v"
  shows "prob0 n v i \<ge> 0 \<and> prob0 n v i \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> prob0 n v i \<and> prob0 n v i \<le> 1
[PROOF STEP]
by (simp add: assms prob0_geq_zero prob0_leq_one)


[STATEMENT]
lemma sum_norm_bound:
  "norm (sum f S) \<le> of_nat (card S)*K"
  if "\<And>x. x \<in> S \<Longrightarrow> norm (f x) \<le> K"
  for f :: "'b \<Rightarrow> 'a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (sum f S) \<le> real (card S) * K
[PROOF STEP]
using sum_norm_le[OF that] sum_constant[symmetric]
[PROOF STATE]
proof (prove)
using this:
(\<And>x. x \<in> ?S \<Longrightarrow> ?x2 x \<in> S) \<Longrightarrow> norm (\<Sum>x\<in>?S. f (?x2 x)) \<le> (\<Sum>x\<in>?S. K)
of_nat (card ?A) * ?y = (\<Sum>x\<in>?A. ?y)

goal (1 subgoal):
 1. norm (sum f S) \<le> real (card S) * K
[PROOF STEP]
by simp


[STATEMENT]
lemma remove_Union_finite:
  assumes "finite X"
  shows "remove_Union A X B = Finite_Set.fold (\<lambda>x A. A - B x) A X"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. remove_Union A X B = Finite_Set.fold (\<lambda>x A. A - B x) A X
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. remove_Union A X B = Finite_Set.fold (\<lambda>x A. A - B x) A X
[PROOF STEP]
interpret comp_fun_idem "\<lambda>x A. A - B x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comp_fun_idem (\<lambda>x A. A - B x)
[PROOF STEP]
by unfold_locales auto
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. remove_Union A X B = Finite_Set.fold (\<lambda>x A. A - B x) A X
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
finite X
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite X

goal (1 subgoal):
 1. remove_Union A X B = Finite_Set.fold (\<lambda>x A. A - B x) A X
[PROOF STEP]
by (induct X arbitrary: A rule: finite_induct) (auto simp: remove_Union_def)
[PROOF STATE]
proof (state)
this:
remove_Union A X B = Finite_Set.fold (\<lambda>x A. A - B x) A X

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sigma_algebra_imp_Dynkin_system:
  assumes "sigma_algebra \<Omega> M" shows "Dynkin_system \<Omega> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dynkin_system \<Omega> M
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Dynkin_system \<Omega> M
[PROOF STEP]
interpret sigma_algebra \<Omega> M
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sigma_algebra \<Omega> M
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Dynkin_system \<Omega> M
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Dynkin_system \<Omega> M
[PROOF STEP]
using sets_into_space
[PROOF STATE]
proof (prove)
using this:
?x \<in> M \<Longrightarrow> ?x \<subseteq> \<Omega>

goal (1 subgoal):
 1. Dynkin_system \<Omega> M
[PROOF STEP]
by (fastforce intro!: Dynkin_systemI)
[PROOF STATE]
proof (state)
this:
Dynkin_system \<Omega> M

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fset_size_o_map: "inj f \<Longrightarrow> size_fset g \<circ> fimage f = size_fset (g \<circ> f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f \<Longrightarrow> size_fset g \<circ> (|`|) f = size_fset (g \<circ> f)
[PROOF STEP]
apply (subst fun_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f \<Longrightarrow> \<forall>x. (size_fset g \<circ> (|`|) f) x = size_fset (g \<circ> f) x
[PROOF STEP]
including fset.lifting
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj f \<Longrightarrow> \<forall>x. (size_fset g \<circ> (|`|) f) x = size_fset (g \<circ> f) x
[PROOF STEP]
by transfer (auto intro: sum.reindex_cong subset_inj_on)


[STATEMENT]
lemma einterval_nonempty: "a < b \<Longrightarrow> \<exists>c. c \<in> einterval a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b \<Longrightarrow> \<exists>c. c \<in> einterval a b
[PROOF STEP]
by (cases a b rule: ereal2_cases, auto simp: einterval_def intro!: dense gt_ex lt_ex)


[STATEMENT]
theorem weak_expressive_completeness:
    assumes "finite (supp S)"
    and "\<And>P Q. P \<in> S \<Longrightarrow> P \<approx>\<cdot> Q \<Longrightarrow> Q \<in> S"
    shows "P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) \<longleftrightarrow> P \<in> S"
    and "weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S) &&& weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
let ?B = "characteristic_weak_formula ` S"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
have "?B \<subseteq> characteristic_weak_formula ` UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. characteristic_weak_formula ` S \<subseteq> range characteristic_weak_formula
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
characteristic_weak_formula ` S \<subseteq> range characteristic_weak_formula

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
characteristic_weak_formula ` S \<subseteq> range characteristic_weak_formula
[PROOF STEP]
have "|?B| \<le>o |UNIV :: 'state set|"
[PROOF STATE]
proof (prove)
using this:
characteristic_weak_formula ` S \<subseteq> range characteristic_weak_formula

goal (1 subgoal):
 1. |characteristic_weak_formula ` S| \<le>o |UNIV|
[PROOF STEP]
by (rule surj_imp_ordLeq)
[PROOF STATE]
proof (state)
this:
|characteristic_weak_formula ` S| \<le>o |UNIV|

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
|characteristic_weak_formula ` S| \<le>o |UNIV|

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
have "|UNIV :: 'state set| <o |UNIV :: 'idx set|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |UNIV| <o |UNIV|
[PROOF STEP]
by (metis card_idx_state)
[PROOF STATE]
proof (state)
this:
|UNIV| <o |UNIV|

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
|UNIV| <o |UNIV|

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
have "|UNIV :: 'idx set| \<le>o natLeq +c |UNIV :: 'idx set|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |UNIV| \<le>o natLeq +c |UNIV|
[PROOF STEP]
by (metis Cnotzero_UNIV ordLeq_csum2)
[PROOF STATE]
proof (state)
this:
|UNIV| \<le>o natLeq +c |UNIV|

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|
[PROOF STEP]
have card_B: "|?B| <o natLeq +c |UNIV :: 'idx set|"
[PROOF STATE]
proof (prove)
using this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|

goal (1 subgoal):
 1. |characteristic_weak_formula ` S| <o natLeq +c |UNIV|
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
have "eqvt image" and "eqvt characteristic_weak_formula"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqvt (`) &&& eqvt characteristic_weak_formula
[PROOF STEP]
by (simp add: eqvtI)+
[PROOF STATE]
proof (state)
this:
eqvt (`)
eqvt characteristic_weak_formula

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
eqvt (`)
eqvt characteristic_weak_formula
[PROOF STEP]
have supp_B: "supp ?B \<subseteq> supp S"
[PROOF STATE]
proof (prove)
using this:
eqvt (`)
eqvt characteristic_weak_formula

goal (1 subgoal):
 1. supp (characteristic_weak_formula ` S) \<subseteq> supp S
[PROOF STEP]
using supp_fun_eqvt supp_fun_app supp_fun_app_eqvt
[PROOF STATE]
proof (prove)
using this:
eqvt (`)
eqvt characteristic_weak_formula
eqvt ?f \<Longrightarrow> supp ?f = {}
supp (?f ?x) \<subseteq> supp ?f \<union> supp ?x
eqvt ?f \<Longrightarrow> supp (?f ?x) \<subseteq> supp ?x

goal (1 subgoal):
 1. supp (characteristic_weak_formula ` S) \<subseteq> supp S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
supp (characteristic_weak_formula ` S) \<subseteq> supp S

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
with card_B
[PROOF STATE]
proof (chain)
picking this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|
supp (characteristic_weak_formula ` S) \<subseteq> supp S
[PROOF STEP]
have "supp (Abs_bset ?B :: _ set['idx]) \<subseteq> supp S"
[PROOF STATE]
proof (prove)
using this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|
supp (characteristic_weak_formula ` S) \<subseteq> supp S

goal (1 subgoal):
 1. supp (Abs_bset (characteristic_weak_formula ` S)) \<subseteq> supp S
[PROOF STEP]
using supp_Abs_bset
[PROOF STATE]
proof (prove)
using this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|
supp (characteristic_weak_formula ` S) \<subseteq> supp S
|?A| <o natLeq +c |UNIV| \<Longrightarrow> supp (Abs_bset ?A) = supp ?A

goal (1 subgoal):
 1. supp (Abs_bset (characteristic_weak_formula ` S)) \<subseteq> supp S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
supp (Abs_bset (characteristic_weak_formula ` S)) \<subseteq> supp S

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
with \<open>finite (supp S)\<close>
[PROOF STATE]
proof (chain)
picking this:
finite (supp S)
supp (Abs_bset (characteristic_weak_formula ` S)) \<subseteq> supp S
[PROOF STEP]
have "finite (supp (Abs_bset ?B :: _ set['idx]))"
[PROOF STATE]
proof (prove)
using this:
finite (supp S)
supp (Abs_bset (characteristic_weak_formula ` S)) \<subseteq> supp S

goal (1 subgoal):
 1. finite (supp (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
using finite_supp rev_finite_subset
[PROOF STATE]
proof (prove)
using this:
finite (supp S)
supp (Abs_bset (characteristic_weak_formula ` S)) \<subseteq> supp S
finite (supp ?x)
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (supp (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (supp (Abs_bset (characteristic_weak_formula ` S)))

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
with card_B
[PROOF STATE]
proof (chain)
picking this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|
finite (supp (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
have "P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) \<longleftrightarrow> (\<exists>x\<in>?B. P \<Turnstile> x)"
[PROOF STATE]
proof (prove)
using this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|
finite (supp (Abs_bset (characteristic_weak_formula ` S)))

goal (1 subgoal):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (\<exists>x\<in>characteristic_weak_formula ` S. P \<Turnstile> x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (\<exists>x\<in>characteristic_weak_formula ` S. P \<Turnstile> x)

goal (2 subgoals):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
 2. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
with \<open>\<And>P Q. P \<in> S \<Longrightarrow> P \<approx>\<cdot> Q \<Longrightarrow> Q \<in> S\<close>
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?P \<in> S; ?P \<approx>\<cdot> ?Q\<rbrakk> \<Longrightarrow> ?Q \<in> S
P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (\<exists>x\<in>characteristic_weak_formula ` S. P \<Turnstile> x)
[PROOF STEP]
show "P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) \<longleftrightarrow> P \<in> S"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?P \<in> S; ?P \<approx>\<cdot> ?Q\<rbrakk> \<Longrightarrow> ?Q \<in> S
P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (\<exists>x\<in>characteristic_weak_formula ` S. P \<Turnstile> x)

goal (1 subgoal):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
[PROOF STEP]
using characteristic_weak_formula_is_characteristic characteristic_weak_formula_is_characteristic' weakly_logically_equivalent_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?P \<in> S; ?P \<approx>\<cdot> ?Q\<rbrakk> \<Longrightarrow> ?Q \<in> S
P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (\<exists>x\<in>characteristic_weak_formula ` S. P \<Turnstile> x)
?Q \<Turnstile> characteristic_weak_formula ?P = ?P \<approx>\<cdot> ?Q
?Q \<Turnstile> characteristic_weak_formula ?P = (?P \<equiv>\<cdot> ?Q)
?P \<equiv>\<cdot> ?Q \<equiv> \<forall>x. weak_formula x \<longrightarrow> ?P \<Turnstile> x = ?Q \<Turnstile> x

goal (1 subgoal):
 1. P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)
[PROOF STEP]
by fastforce

    \<comment> \<open>it remains to show that the disjunction is a weak formula\<close>
[PROOF STATE]
proof (state)
this:
P \<Turnstile> Disj (Abs_bset (characteristic_weak_formula ` S)) = (P \<in> S)

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
have "eqvt Formula.Not"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eqvt Formula.Not
[PROOF STEP]
by (simp add: eqvtI)
[PROOF STATE]
proof (state)
this:
eqvt Formula.Not

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
with supp_B and \<open>eqvt image\<close>
[PROOF STATE]
proof (chain)
picking this:
supp (characteristic_weak_formula ` S) \<subseteq> supp S
eqvt (`)
eqvt Formula.Not
[PROOF STEP]
have supp_Not_B: "supp (Formula.Not ` ?B) \<subseteq> supp S"
[PROOF STATE]
proof (prove)
using this:
supp (characteristic_weak_formula ` S) \<subseteq> supp S
eqvt (`)
eqvt Formula.Not

goal (1 subgoal):
 1. supp (Formula.Not ` characteristic_weak_formula ` S) \<subseteq> supp S
[PROOF STEP]
using supp_fun_eqvt supp_fun_app supp_fun_app_eqvt
[PROOF STATE]
proof (prove)
using this:
supp (characteristic_weak_formula ` S) \<subseteq> supp S
eqvt (`)
eqvt Formula.Not
eqvt ?f \<Longrightarrow> supp ?f = {}
supp (?f ?x) \<subseteq> supp ?f \<union> supp ?x
eqvt ?f \<Longrightarrow> supp (?f ?x) \<subseteq> supp ?x

goal (1 subgoal):
 1. supp (Formula.Not ` characteristic_weak_formula ` S) \<subseteq> supp S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
supp (Formula.Not ` characteristic_weak_formula ` S) \<subseteq> supp S

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
have "|Formula.Not ` ?B| \<le>o |?B|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |Formula.Not ` characteristic_weak_formula ` S| \<le>o |characteristic_weak_formula ` S|
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
|Formula.Not ` characteristic_weak_formula ` S| \<le>o |characteristic_weak_formula ` S|

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
|Formula.Not ` characteristic_weak_formula ` S| \<le>o |characteristic_weak_formula ` S|

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
note card_B
[PROOF STATE]
proof (state)
this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
|Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|
[PROOF STEP]
have card_not_B: "|Formula.Not ` ?B| <o natLeq +c |UNIV :: 'idx set|"
[PROOF STATE]
proof (prove)
using this:
|Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|

goal (1 subgoal):
 1. |Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
|Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
with supp_Not_B
[PROOF STATE]
proof (chain)
picking this:
supp (Formula.Not ` characteristic_weak_formula ` S) \<subseteq> supp S
|Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|
[PROOF STEP]
have "supp (Abs_bset (Formula.Not ` ?B) :: _ set['idx]) \<subseteq> supp S"
[PROOF STATE]
proof (prove)
using this:
supp (Formula.Not ` characteristic_weak_formula ` S) \<subseteq> supp S
|Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|

goal (1 subgoal):
 1. supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) \<subseteq> supp S
[PROOF STEP]
using supp_Abs_bset
[PROOF STATE]
proof (prove)
using this:
supp (Formula.Not ` characteristic_weak_formula ` S) \<subseteq> supp S
|Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|
|?A| <o natLeq +c |UNIV| \<Longrightarrow> supp (Abs_bset ?A) = supp ?A

goal (1 subgoal):
 1. supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) \<subseteq> supp S
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) \<subseteq> supp S

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
with \<open>finite (supp S)\<close>
[PROOF STATE]
proof (chain)
picking this:
finite (supp S)
supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) \<subseteq> supp S
[PROOF STEP]
have "finite (supp (Abs_bset (Formula.Not ` ?B) :: _ set['idx]))"
[PROOF STATE]
proof (prove)
using this:
finite (supp S)
supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) \<subseteq> supp S

goal (1 subgoal):
 1. finite (supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)))
[PROOF STEP]
using finite_supp rev_finite_subset
[PROOF STATE]
proof (prove)
using this:
finite (supp S)
supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) \<subseteq> supp S
finite (supp ?x)
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite (supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite (supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)))

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
finite (supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)))

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
have "\<And>x. x \<in> Formula.Not ` ?B \<Longrightarrow> weak_formula x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> Formula.Not ` characteristic_weak_formula ` S \<Longrightarrow> weak_formula x
[PROOF STEP]
using characteristic_weak_formula_is_weak wf_Not
[PROOF STATE]
proof (prove)
using this:
weak_formula (characteristic_weak_formula ?P)
weak_formula ?x \<Longrightarrow> weak_formula (Formula.Not ?x)

goal (1 subgoal):
 1. \<And>x. x \<in> Formula.Not ` characteristic_weak_formula ` S \<Longrightarrow> weak_formula x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?x9 \<in> Formula.Not ` characteristic_weak_formula ` S \<Longrightarrow> weak_formula ?x9

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?x9 \<in> Formula.Not ` characteristic_weak_formula ` S \<Longrightarrow> weak_formula ?x9

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
from card_B
[PROOF STATE]
proof (chain)
picking this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|
[PROOF STEP]
have *: "map_bset Formula.Not (Abs_bset ?B :: _ set['idx]) = (Abs_bset (Formula.Not ` ?B) :: _ set['idx])"
[PROOF STATE]
proof (prove)
using this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|

goal (1 subgoal):
 1. map_bset Formula.Not (Abs_bset (characteristic_weak_formula ` S)) = Abs_bset (Formula.Not ` characteristic_weak_formula ` S)
[PROOF STEP]
using map_bset.abs_eq[unfolded eq_onp_def]
[PROOF STATE]
proof (prove)
using this:
|characteristic_weak_formula ` S| <o natLeq +c |UNIV|
|?x| <o natLeq +c |UNIV| \<and> ?x = ?x \<Longrightarrow> map_bset ?xa (Abs_bset ?x) = Abs_bset (?xa ` ?x)

goal (1 subgoal):
 1. map_bset Formula.Not (Abs_bset (characteristic_weak_formula ` S)) = Abs_bset (Formula.Not ` characteristic_weak_formula ` S)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
map_bset Formula.Not (Abs_bset (characteristic_weak_formula ` S)) = Abs_bset (Formula.Not ` characteristic_weak_formula ` S)

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
map_bset Formula.Not (Abs_bset (characteristic_weak_formula ` S)) = Abs_bset (Formula.Not ` characteristic_weak_formula ` S)

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
from card_not_B
[PROOF STATE]
proof (chain)
picking this:
|Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|
[PROOF STEP]
have "set_bset (Abs_bset (Formula.Not ` ?B) :: _ set['idx]) = Formula.Not ` ?B"
[PROOF STATE]
proof (prove)
using this:
|Formula.Not ` characteristic_weak_formula ` S| <o natLeq +c |UNIV|

goal (1 subgoal):
 1. set_bset (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) = Formula.Not ` characteristic_weak_formula ` S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
set_bset (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) = Formula.Not ` characteristic_weak_formula ` S

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
finite (supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)))
?x9 \<in> Formula.Not ` characteristic_weak_formula ` S \<Longrightarrow> weak_formula ?x9
map_bset Formula.Not (Abs_bset (characteristic_weak_formula ` S)) = Abs_bset (Formula.Not ` characteristic_weak_formula ` S)
set_bset (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) = Formula.Not ` characteristic_weak_formula ` S
[PROOF STEP]
show "weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))"
[PROOF STATE]
proof (prove)
using this:
finite (supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)))
?x9 \<in> Formula.Not ` characteristic_weak_formula ` S \<Longrightarrow> weak_formula ?x9
map_bset Formula.Not (Abs_bset (characteristic_weak_formula ` S)) = Abs_bset (Formula.Not ` characteristic_weak_formula ` S)
set_bset (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) = Formula.Not ` characteristic_weak_formula ` S

goal (1 subgoal):
 1. weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))
[PROOF STEP]
unfolding Disj_def
[PROOF STATE]
proof (prove)
using this:
finite (supp (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)))
?x9 \<in> Formula.Not ` characteristic_weak_formula ` S \<Longrightarrow> weak_formula ?x9
map_bset Formula.Not (Abs_bset (characteristic_weak_formula ` S)) = Abs_bset (Formula.Not ` characteristic_weak_formula ` S)
set_bset (Abs_bset (Formula.Not ` characteristic_weak_formula ` S)) = Formula.Not ` characteristic_weak_formula ` S

goal (1 subgoal):
 1. weak_formula (Formula.Not (Conj (map_bset Formula.Not (Abs_bset (characteristic_weak_formula ` S)))))
[PROOF STEP]
by (metis wf_Conj wf_Not)
[PROOF STATE]
proof (state)
this:
weak_formula (Disj (Abs_bset (characteristic_weak_formula ` S)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma topology_finer_open_id:
     "(\<forall>S. openin X S \<longrightarrow> openin X' S) \<longleftrightarrow> open_map X X' id"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>S. openin X S \<longrightarrow> openin X' S) = open_map X X' id
[PROOF STEP]
unfolding open_map_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>S. openin X S \<longrightarrow> openin X' S) = (\<forall>U. openin X U \<longrightarrow> openin X' (id ` U))
[PROOF STEP]
by auto


[STATEMENT]
lemma nat_mirror_less_conv: "
  a < l + r \<Longrightarrow> (nat_mirror b l r < nat_mirror a l r) = (a < b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < l + r \<Longrightarrow> (nat_mirror b l r < nat_mirror a l r) = (a < b)
[PROOF STEP]
unfolding nat_mirror_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < l + r \<Longrightarrow> (l + r - b < l + r - a) = (a < b)
[PROOF STEP]
by fastforce


[STATEMENT]
lemma add_indexed_Ints_vec:
  "x \<in> carrier_vec n \<Longrightarrow> y \<in> carrier_vec n \<Longrightarrow> x \<in> indexed_Ints_vec I \<Longrightarrow> y \<in> indexed_Ints_vec I
  \<Longrightarrow> x + y \<in> indexed_Ints_vec I"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier_vec n; y \<in> carrier_vec n; x \<in> indexed_Ints_vec I; y \<in> indexed_Ints_vec I\<rbrakk> \<Longrightarrow> x + y \<in> indexed_Ints_vec I
[PROOF STEP]
unfolding indexed_Ints_vec_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> carrier_vec n; y \<in> carrier_vec n; x \<in> {x. \<forall>i<dim_vec x. i \<in> I \<longrightarrow> x $ i \<in> \<int>}; y \<in> {x. \<forall>i<dim_vec x. i \<in> I \<longrightarrow> x $ i \<in> \<int>}\<rbrakk> \<Longrightarrow> x + y \<in> {x. \<forall>i<dim_vec x. i \<in> I \<longrightarrow> x $ i \<in> \<int>}
[PROOF STEP]
by auto


[STATEMENT]
lemma map_union_fset:
  shows "map_fset f (S |\<union>| T) = map_fset f S |\<union>| map_fset f T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map_fset f (S |\<union>| T) = map_fset f S |\<union>| map_fset f T
[PROOF STEP]
by (descending) (simp)


[STATEMENT]
lemma line_is_dim1_subspace:
  assumes "n > 0"
    and "t > 0"
    and "is_line L n t"
  shows "is_subspace (restrict (\<lambda>y. L (y 0)) (cube 1 t)) 1 n t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_subspace (\<lambda>y\<in>cube 1 t. L (y 0)) 1 n t
[PROOF STEP]
using line_is_dim1_subspace_t_1[of n L] line_is_dim1_subspace_t_ge_1[of n t L] assms not_less_iff_gr_or_eq
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < n; is_line L n 1\<rbrakk> \<Longrightarrow> is_subspace (\<lambda>y\<in>cube 1 1. L (y 0)) 1 n 1
\<lbrakk>0 < n; 1 < t; is_line L n t\<rbrakk> \<Longrightarrow> is_subspace (\<lambda>y\<in>cube 1 t. L (y 0)) 1 n t
0 < n
0 < t
is_line L n t
(\<not> ?x < ?y) = (?y < ?x \<or> ?x = ?y)

goal (1 subgoal):
 1. is_subspace (\<lambda>y\<in>cube 1 t. L (y 0)) 1 n t
[PROOF STEP]
by blast


[STATEMENT]
lemma mset_link: "mset_hp (link h1 h2) = mset_hp h1 + mset_hp h2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mset_hp (link h1 h2) = mset_hp h1 + mset_hp h2
[PROOF STEP]
by(induction h1 h2 rule: link.induct)(auto simp: add_ac)


[STATEMENT]
lemma count_perm: "!! B. (\<forall> x. count_list A x = count_list B x) \<Longrightarrow> mset A = mset B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>B. \<forall>x. count_list A x = count_list B x \<Longrightarrow> mset A = mset B
[PROOF STEP]
by (simp add: count_eq multiset_eq_iff)


[STATEMENT]
lemma simply_connected_eq_contractible_path:
  fixes S :: "_::real_normed_vector set"
  shows "simply_connected S \<longleftrightarrow>
           path_connected S \<and>
           (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p
            \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))"
     (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected S = (path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. simply_connected S \<Longrightarrow> path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))
 2. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))) \<Longrightarrow> simply_connected S
[PROOF STEP]
assume ?lhs
[PROOF STATE]
proof (state)
this:
simply_connected S

goal (2 subgoals):
 1. simply_connected S \<Longrightarrow> path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))
 2. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))) \<Longrightarrow> simply_connected S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
simply_connected S
[PROOF STEP]
show ?rhs
[PROOF STATE]
proof (prove)
using this:
simply_connected S

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))
[PROOF STEP]
unfolding simply_connected_imp_path_connected
[PROOF STATE]
proof (prove)
using this:
simply_connected S

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))
[PROOF STEP]
by (metis simply_connected_eq_contractible_loop_some homotopic_loops_imp_homotopic_paths_null)
[PROOF STATE]
proof (state)
this:
path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))) \<Longrightarrow> simply_connected S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))) \<Longrightarrow> simply_connected S
[PROOF STEP]
assume  ?rhs
[PROOF STATE]
proof (state)
this:
path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))

goal (1 subgoal):
 1. path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p))) \<Longrightarrow> simply_connected S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))
[PROOF STEP]
show ?lhs
[PROOF STATE]
proof (prove)
using this:
path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))

goal (1 subgoal):
 1. simply_connected S
[PROOF STEP]
using homotopic_paths_imp_homotopic_loops simply_connected_eq_contractible_loop_some
[PROOF STATE]
proof (prove)
using this:
path_connected S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> S \<and> pathfinish p = pathstart p \<longrightarrow> homotopic_paths S p (linepath (pathstart p) (pathstart p)))
\<lbrakk>homotopic_paths ?s ?p ?q; pathfinish ?p = pathstart ?p; pathfinish ?q = pathstart ?p\<rbrakk> \<Longrightarrow> homotopic_loops ?s ?p ?q
simply_connected ?S = (path_connected ?S \<and> (\<forall>p. path p \<and> path_image p \<subseteq> ?S \<and> pathfinish p = pathstart p \<longrightarrow> (\<exists>a. a \<in> ?S \<and> homotopic_loops ?S p (linepath a a))))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem time_closest_pair_rec_bigo:
  "(\<lambda>xs. time (closest_pair_rec_tm xs)) \<in> O[length going_to at_top]((\<lambda>n. n * ln n) o length)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (time (closest_pair_rec_tm x))) \<in> O[length going_to sequentially]((\<lambda>n. real n * ln (real n)) \<circ> length)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. real (time (closest_pair_rec_tm x))) \<in> O[length going_to sequentially]((\<lambda>n. real n * ln (real n)) \<circ> length)
[PROOF STEP]
have 0: "\<And>ps. time (closest_pair_rec_tm ps) \<le> (closest_pair_recurrence o length) ps"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ps. real (time (closest_pair_rec_tm ps)) \<le> (closest_pair_recurrence \<circ> length) ps
[PROOF STEP]
unfolding comp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ps. real (time (closest_pair_rec_tm ps)) \<le> closest_pair_recurrence (length ps)
[PROOF STEP]
using time_closest_pair_rec_conv_closest_pair_recurrence
[PROOF STATE]
proof (prove)
using this:
real (time (closest_pair_rec_tm ?ps)) \<le> closest_pair_recurrence (length ?ps)

goal (1 subgoal):
 1. \<And>ps. real (time (closest_pair_rec_tm ps)) \<le> closest_pair_recurrence (length ps)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real (time (closest_pair_rec_tm ?ps)) \<le> (closest_pair_recurrence \<circ> length) ?ps

goal (1 subgoal):
 1. (\<lambda>x. real (time (closest_pair_rec_tm x))) \<in> O[length going_to sequentially]((\<lambda>n. real n * ln (real n)) \<circ> length)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (time (closest_pair_rec_tm x))) \<in> O[length going_to sequentially]((\<lambda>n. real n * ln (real n)) \<circ> length)
[PROOF STEP]
using bigo_measure_trans[OF 0] bigthetaD1[OF closest_pair_recurrence] of_nat_0_le_iff
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>closest_pair_recurrence \<in> O(?f); \<And>x. x \<in> ?A \<Longrightarrow> 0 \<le> real (time (closest_pair_rec_tm x))\<rbrakk> \<Longrightarrow> (\<lambda>x. real (time (closest_pair_rec_tm x))) \<in> O[length going_to sequentially within ?A](?f \<circ> length)
closest_pair_recurrence \<in> O(\<lambda>x. real x * ln (real x))
(0::?'a) \<le> of_nat ?n

goal (1 subgoal):
 1. (\<lambda>x. real (time (closest_pair_rec_tm x))) \<in> O[length going_to sequentially]((\<lambda>n. real n * ln (real n)) \<circ> length)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (time (closest_pair_rec_tm x))) \<in> O[length going_to sequentially]((\<lambda>n. real n * ln (real n)) \<circ> length)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma less_sets_singleton1 [simp]: "less_sets {a} A \<longleftrightarrow> (\<forall>x\<in>A. a < x)"
  and less_sets_singleton2 [simp]: "less_sets A {a} \<longleftrightarrow> (\<forall>x\<in>A. x < a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({a} \<lless> A) = (\<forall>x\<in>A. a < x) &&& (A \<lless> {a}) = (\<forall>x\<in>A. x < a)
[PROOF STEP]
by (simp_all add: less_sets_def)


[STATEMENT]
lemma "(47::nat) + 11 < 8 * 15"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 47 + 11 < 8 * 15
[PROOF STEP]
by linarith


[STATEMENT]
lemma "i < j ==> nat (i - j) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i < j \<Longrightarrow> nat (i - j) = 0
[PROOF STEP]
by linarith


[STATEMENT]
lemma AbsNat_plus: "AbsNat (i + j) = AbsNat i + AbsNat j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. AbsNat (i + j) = AbsNat i + AbsNat j
[PROOF STEP]
by (simp add: plus_Nat_def)


[STATEMENT]
lemma take_list_of:
  assumes "lfinite xs"
  shows "take n (list_of xs) = list_of (ltake (enat n) xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take n (list_of xs) = list_of (ltake (enat n) xs)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
lfinite xs

goal (1 subgoal):
 1. take n (list_of xs) = list_of (ltake (enat n) xs)
[PROOF STEP]
by(induct arbitrary: n)
  (simp_all add: take_Cons zero_enat_def[symmetric] eSuc_enat[symmetric] split: nat.split)


[STATEMENT]
lemma tendsto_fst [tendsto_intros]:
  assumes "(f \<longlongrightarrow> a) F"
  shows "((\<lambda>x. fst (f x)) \<longlongrightarrow> fst a) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. fst (f x)) \<longlongrightarrow> fst a) F
[PROOF STEP]
proof (rule topological_tendstoI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
fix S
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
assume "open S" and "fst a \<in> S"
[PROOF STATE]
proof (state)
this:
open S
fst a \<in> S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
open S
fst a \<in> S
[PROOF STEP]
have "open (fst -` S)" and "a \<in> fst -` S"
[PROOF STATE]
proof (prove)
using this:
open S
fst a \<in> S

goal (1 subgoal):
 1. open (fst -` S) &&& a \<in> fst -` S
[PROOF STEP]
by (simp_all add: open_vimage_fst)
[PROOF STATE]
proof (state)
this:
open (fst -` S)
a \<in> fst -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
(f \<longlongrightarrow> a) F
open (fst -` S)
a \<in> fst -` S
[PROOF STEP]
have "eventually (\<lambda>x. f x \<in> fst -` S) F"
[PROOF STATE]
proof (prove)
using this:
(f \<longlongrightarrow> a) F
open (fst -` S)
a \<in> fst -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. f x \<in> fst -` S
[PROOF STEP]
by (rule topological_tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S

goal (1 subgoal):
 1. \<And>S. \<lbrakk>open S; fst a \<in> S\<rbrakk> \<Longrightarrow> \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S
[PROOF STEP]
show "eventually (\<lambda>x. fst (f x) \<in> S) F"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. f x \<in> fst -` S

goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. fst (f x) \<in> S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. fst (f x) \<in> S

goal:
No subgoals!
[PROOF STEP]
qed