[STATEMENT]
lemma unat_shiftr_shiftl_mask_zero:
  "\<lbrakk> c + a \<ge> LENGTH('a) + b ; c < LENGTH('a) \<rbrakk>
   \<Longrightarrow> unat (((q :: 'a :: len word) >> a << b) AND NOT(mask c)) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>LENGTH('a) + b \<le> c + a; c < LENGTH('a)\<rbrakk> \<Longrightarrow> unat ((q >> a << b) AND NOT (mask c)) = 0
[PROOF STEP]
by (fastforce intro: unat_is_aligned_add[where p=0 and n=c, simplified, THEN conjunct2]
                       unat_shiftl_less_t2n unat_shiftr_less_t2n unat_pow_le_intro)


[STATEMENT]
theorem cond_2:
  assumes "ego.s_stop \<ge> other.s_stop"
  shows "collision {0 ..}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. collision {0..}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
other.s_stop \<le> ego.s_stop

goal (1 subgoal):
 1. collision {0..}
[PROOF STEP]
apply (intro collision_subset[where t="{0 ..}" and s = "{0 .. max ego.t_stop other.t_stop}"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. other.s_stop \<le> ego.s_stop \<Longrightarrow> collision {0..max ego.t_stop other.t_stop}
 2. other.s_stop \<le> ego.s_stop \<Longrightarrow> {0..max ego.t_stop other.t_stop} \<subseteq> {0..}
[PROOF STEP]
apply (intro ego_other_ivt[where t = "max ego.t_stop other.t_stop"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. other.s_stop \<le> ego.s_stop \<Longrightarrow> other.s (max ego.t_stop other.t_stop) \<le> ego.s (max ego.t_stop other.t_stop)
 2. other.s_stop \<le> ego.s_stop \<Longrightarrow> {0..max ego.t_stop other.t_stop} \<subseteq> {0..}
[PROOF STEP]
apply (auto simp: ego.s_eq_s_stop other.s_eq_s_stop)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem tree_height_estimate:
  "tree_invar t \<Longrightarrow> size (tree_to_multiset t) = (2::nat)^(height_tree t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tree_invar t \<Longrightarrow> size (tree_to_multiset t) = 2 ^ height_tree t
[PROOF STEP]
apply (cases t, simp only:)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 x3 x4. \<lbrakk>tree_invar (Node x1 x2 x3 x4); t = Node x1 x2 x3 x4\<rbrakk> \<Longrightarrow> size (tree_to_multiset (Node x1 x2 x3 x4)) = 2 ^ height_tree (Node x1 x2 x3 x4)
[PROOF STEP]
apply (frule tree_rank_estimate)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 x3 x4. \<lbrakk>tree_invar (Node x1 x2 x3 x4); t = Node x1 x2 x3 x4; size (tree_to_multiset (Node x1 x2 x3 x4)) = 2 ^ x3\<rbrakk> \<Longrightarrow> size (tree_to_multiset (Node x1 x2 x3 x4)) = 2 ^ height_tree (Node x1 x2 x3 x4)
[PROOF STEP]
apply (frule tree_rank_height)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x1 x2 x3 x4. \<lbrakk>tree_invar (Node x1 x2 x3 x4); t = Node x1 x2 x3 x4; size (tree_to_multiset (Node x1 x2 x3 x4)) = 2 ^ x3; height_tree (Node x1 x2 x3 x4) = x3\<rbrakk> \<Longrightarrow> size (tree_to_multiset (Node x1 x2 x3 x4)) = 2 ^ height_tree (Node x1 x2 x3 x4)
[PROOF STEP]
apply (simp only: )
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma LIMSEQ_norm_0_pow:
  assumes "k > 0" "b > 1"
  assumes  "\<And>n::nat. norm (s n) \<le> k / b^n"
  shows "s \<longlonglongrightarrow> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. s \<longlonglongrightarrow> (0::'a)
[PROOF STEP]
proof (rule metric_LIMSEQ_I)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (s n) (0::'a) < r
[PROOF STEP]
fix e
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (s n) (0::'a) < r
[PROOF STEP]
assume "e > (0::real)"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (s n) (0::'a) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < e
[PROOF STEP]
have "k / e > 0"
[PROOF STATE]
proof (prove)
using this:
0 < e

goal (1 subgoal):
 1. 0 < k / e
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
0 < e
0 < k

goal (1 subgoal):
 1. 0 < k / e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < k / e

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (s n) (0::'a) < r
[PROOF STEP]
obtain N where N: "b^(N::nat) > k / e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>N. k / e < b ^ N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
1 < b

goal (1 subgoal):
 1. (\<And>N. k / e < b ^ N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using real_arch_pow
[PROOF STATE]
proof (prove)
using this:
1 < b
1 < ?x \<Longrightarrow> \<exists>n. ?y < ?x ^ n

goal (1 subgoal):
 1. (\<And>N. k / e < b ^ N \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
k / e < b ^ N

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (s n) (0::'a) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
k / e < b ^ N
[PROOF STEP]
have "norm (s n) < e" if "n \<ge> N" for n
[PROOF STATE]
proof (prove)
using this:
k / e < b ^ N

goal (1 subgoal):
 1. norm (s n) < e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k / e < b ^ N \<Longrightarrow> norm (s n) < e
[PROOF STEP]
have "k / b^n \<le> k / b^N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k / b ^ n \<le> k / b ^ N
[PROOF STEP]
by (smt assms(1) assms(2) frac_le leD power_less_imp_less_exp that zero_less_power)
[PROOF STATE]
proof (state)
this:
k / b ^ n \<le> k / b ^ N

goal (1 subgoal):
 1. k / e < b ^ N \<Longrightarrow> norm (s n) < e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
k / b ^ n \<le> k / b ^ N

goal (1 subgoal):
 1. k / e < b ^ N \<Longrightarrow> norm (s n) < e
[PROOF STEP]
have " ... < e"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k / b ^ N < e
[PROOF STEP]
using N
[PROOF STATE]
proof (prove)
using this:
k / e < b ^ N

goal (1 subgoal):
 1. k / b ^ N < e
[PROOF STEP]
by (metis \<open>0 < e\<close> assms(2) less_trans mult.commute pos_divide_less_eq zero_less_one zero_less_power)
[PROOF STATE]
proof (state)
this:
k / b ^ N < e

goal (1 subgoal):
 1. k / e < b ^ N \<Longrightarrow> norm (s n) < e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
k / b ^ n < e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
k / b ^ n < e

goal (1 subgoal):
 1. norm (s n) < e
[PROOF STEP]
by (meson assms less_eq_real_def not_le order_trans)
[PROOF STATE]
proof (state)
this:
norm (s n) < e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
N \<le> ?n \<Longrightarrow> norm (s ?n) < e

goal (1 subgoal):
 1. \<And>r. 0 < r \<Longrightarrow> \<exists>no. \<forall>n\<ge>no. dist (s n) (0::'a) < r
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
N \<le> ?n \<Longrightarrow> norm (s ?n) < e
[PROOF STEP]
show "\<exists>no. \<forall>n\<ge>no. dist (s n) 0 < e"
[PROOF STATE]
proof (prove)
using this:
N \<le> ?n \<Longrightarrow> norm (s ?n) < e

goal (1 subgoal):
 1. \<exists>no. \<forall>n\<ge>no. dist (s n) (0::'a) < e
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>no. \<forall>n\<ge>no. dist (s n) (0::'a) < e

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fv_subterms_subst_eq[simp]: "fv\<^sub>s\<^sub>e\<^sub>t (subterms (t \<cdot> \<theta>)) = fv\<^sub>s\<^sub>e\<^sub>t (subterms t \<cdot>\<^sub>s\<^sub>e\<^sub>t \<theta>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fv\<^sub>s\<^sub>e\<^sub>t (subterms (t \<cdot> \<theta>)) = fv\<^sub>s\<^sub>e\<^sub>t (subterms t \<cdot>\<^sub>s\<^sub>e\<^sub>t \<theta>)
[PROOF STEP]
using fv_subterms
[PROOF STATE]
proof (prove)
using this:
fv\<^sub>s\<^sub>e\<^sub>t (subterms ?t) = fv ?t

goal (1 subgoal):
 1. fv\<^sub>s\<^sub>e\<^sub>t (subterms (t \<cdot> \<theta>)) = fv\<^sub>s\<^sub>e\<^sub>t (subterms t \<cdot>\<^sub>s\<^sub>e\<^sub>t \<theta>)
[PROOF STEP]
by (induct t) force+


[STATEMENT]
lemma poly_exp_expand:
  "p = (prod (\<lambda> (a,i). a ^ i) as) * prod (\<lambda> (a,i). a) as"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p = (\<Prod>(a, i)\<in>as. a ^ i) * (\<Prod>(a, i)\<in>as. a)
[PROOF STEP]
unfolding p prod.distrib[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Prod>(a, i)\<in>as. a ^ Suc i) = (\<Prod>x\<in>as. (case x of (x, xa) \<Rightarrow> x ^ xa) * (case x of (a, i) \<Rightarrow> a))
[PROOF STEP]
by (rule prod.cong, auto)


[STATEMENT]
lemma mult_distrib_inverse [simp]: "(a * b) / b = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<cdot> b / b = a
[PROOF STEP]
by (metis local.mult_1_right local.multi_inverse_conv_div mult.right_inverse mult_assoc)


[STATEMENT]
lemma alw_holds_sset:
  "alw (holds P) xs = (\<forall> x \<in> sset xs. P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alw (holds P) xs = (\<forall>x\<in>sset xs. P x)
[PROOF STEP]
by (simp add: alw_holds_pred_stream_iff stream.pred_set)


[STATEMENT]
lemma class_exists_equiv2:
 "(\<exists>x. fst x = cn \<and> x \<in> set (P1 @ P2)) = (class P1 cn \<noteq> None \<or> class P2 cn \<noteq> None)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>x. fst x = cn \<and> x \<in> set (P1 @ P2)) = (class P1 cn \<noteq> None \<or> class P2 cn \<noteq> None)
[PROOF STEP]
by (simp only: class_exists_equiv [where P = "P1@P2"], simp add: class_def)


[STATEMENT]
lemma index_enum_less[intro, simp]: "index enum_class.enum (i::'n::enum) < CARD('n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index enum_class.enum i < CARD('n)
[PROOF STEP]
by (auto intro!: index_less simp: enum_UNIV card_UNIV_length_enum)


[STATEMENT]
lemma binomial_unroll:
  "n > 0 \<Longrightarrow> (n choose k) = (if k = 0 then 1 else (n - 1) choose (k - 1) + ((n - 1) choose k))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n \<Longrightarrow> n choose k = (if k = 0 then 1 else n - 1 choose (k - 1) + (n - 1 choose k))
[PROOF STEP]
by (auto simp add: gr0_conv_Suc)


[STATEMENT]
lemma permutep_single:
  "bij f \<Longrightarrow> permutep f (Poly_Mapping.single a b) = Poly_Mapping.single (inv_into UNIV f a) b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij f \<Longrightarrow> permutep f (Poly_Mapping.single a b) = Poly_Mapping.single (inv f a) b
[PROOF STEP]
by transfer (auto simp: fun_eq_iff when_def inv_f_f surj_f_inv_f bij_is_inj bij_is_surj)


[STATEMENT]
lemma dim_eq_card:
  assumes "B \<subseteq> U\<^sub>V\<^sub>S"
    and "V \<subseteq> U\<^sub>V\<^sub>S"
    and BV: "span B = span V"
    and B: "\<not>dependent B"
  shows "dim V = card B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.dim V = card B
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.dim V = card B
[PROOF STEP]
define p where "p b \<equiv> b \<subseteq> U\<^sub>V\<^sub>S \<and> \<not>dependent b \<and> span b = span V" for b
[PROOF STATE]
proof (state)
this:
p ?b \<equiv> ?b \<subseteq> U\<^sub>V\<^sub>S \<and> \<not> local.dependent ?b \<and> local.span ?b = local.span V

goal (1 subgoal):
 1. local.dim V = card B
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
B \<subseteq> U\<^sub>V\<^sub>S
V \<subseteq> U\<^sub>V\<^sub>S
local.span B = local.span V
\<not> local.dependent B
[PROOF STEP]
have "p (SOME B. p B)"
[PROOF STATE]
proof (prove)
using this:
B \<subseteq> U\<^sub>V\<^sub>S
V \<subseteq> U\<^sub>V\<^sub>S
local.span B = local.span V
\<not> local.dependent B

goal (1 subgoal):
 1. p (SOME B. p B)
[PROOF STEP]
by (intro someI[of p B], unfold p_def) simp
[PROOF STATE]
proof (state)
this:
p (SOME B. p B)

goal (1 subgoal):
 1. local.dim V = card B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p (SOME B. p B)
[PROOF STEP]
have "\<exists>f. bij_betw f B (SOME B. p B) \<and> (\<forall>x\<in>U\<^sub>V\<^sub>S. f x \<in> U\<^sub>V\<^sub>S)"
[PROOF STATE]
proof (prove)
using this:
p (SOME B. p B)

goal (1 subgoal):
 1. \<exists>f. bij_betw f B (SOME B. p B) \<and> (\<forall>x\<in>U\<^sub>V\<^sub>S. f x \<in> U\<^sub>V\<^sub>S)
[PROOF STEP]
by (subst (asm) p_def, intro bij_if_span_eq_span_bases) (simp_all add: assms)
[PROOF STATE]
proof (state)
this:
\<exists>f. bij_betw f B (SOME B. p B) \<and> (\<forall>x\<in>U\<^sub>V\<^sub>S. f x \<in> U\<^sub>V\<^sub>S)

goal (1 subgoal):
 1. local.dim V = card B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. bij_betw f B (SOME B. p B) \<and> (\<forall>x\<in>U\<^sub>V\<^sub>S. f x \<in> U\<^sub>V\<^sub>S)
[PROOF STEP]
have "card B = card (SOME B. p B)"
[PROOF STATE]
proof (prove)
using this:
\<exists>f. bij_betw f B (SOME B. p B) \<and> (\<forall>x\<in>U\<^sub>V\<^sub>S. f x \<in> U\<^sub>V\<^sub>S)

goal (1 subgoal):
 1. card B = card (SOME B. p B)
[PROOF STEP]
by (auto intro: bij_betw_same_card)
[PROOF STATE]
proof (state)
this:
card B = card (SOME B. p B)

goal (1 subgoal):
 1. local.dim V = card B
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card B = card (SOME B. p B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card B = card (SOME B. p B)

goal (1 subgoal):
 1. local.dim V = card B
[PROOF STEP]
using assms(1,3,4)
[PROOF STATE]
proof (prove)
using this:
card B = card (SOME B. p B)
B \<subseteq> U\<^sub>V\<^sub>S
local.span B = local.span V
\<not> local.dependent B

goal (1 subgoal):
 1. local.dim V = card B
[PROOF STEP]
unfolding dim_def p_def
[PROOF STATE]
proof (prove)
using this:
card B = card (SOME B. B \<subseteq> U\<^sub>V\<^sub>S \<and> \<not> local.dependent B \<and> local.span B = local.span V)
B \<subseteq> U\<^sub>V\<^sub>S
local.span B = local.span V
\<not> local.dependent B

goal (1 subgoal):
 1. (if \<exists>b\<subseteq>U\<^sub>V\<^sub>S. \<not> local.dependent b \<and> local.span b = local.span V then card (SOME b. b \<subseteq> U\<^sub>V\<^sub>S \<and> \<not> local.dependent b \<and> local.span b = local.span V) else 0) = card B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
local.dim V = card B

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem p31: "\<not>(\<exists>x. F(x) \<and> (G(x) \<or> H(x))) \<Longrightarrow> \<exists>x. I(x) \<and> F(x) \<Longrightarrow> \<forall>x. \<not>H(x) \<longrightarrow> J(x) \<Longrightarrow>
  \<exists>x. I(x) \<and> J(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<nexists>x. F x \<and> (G x \<or> H x); \<exists>x. I x \<and> F x; \<forall>x. \<not> H x \<longrightarrow> J x\<rbrakk> \<Longrightarrow> \<exists>x. I x \<and> J x
[PROOF STEP]
by auto2


[STATEMENT]
lemma dual_anti_iff: "(x \<le> y) = (\<partial> y \<le> \<partial> x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<le> y) = (\<partial> y \<le> \<partial> x)
[PROOF STEP]
by (simp add: dual_inj less_eq_dual_def the_inv_f_f)


[STATEMENT]
lemma set_plus_rearrange2: "a +o (b +o C) = (a + b) +o C"
  for a b :: "'a::semigroup_add"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a +o (b +o C) = (a + b) +o C
[PROOF STEP]
by (auto simp add: elt_set_plus_def add.assoc)


[STATEMENT]
lemma construct_lhs_vector_cleaner:
  assumes "p \<noteq> 0"
  shows "(construct_lhs_vector p qs signs) =
   vec_of_list (map (\<lambda>s. rat_of_int (card {x. poly p x = 0 \<and> ((consistent_sign_vec_copr qs x) = s)})) signs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. construct_lhs_vector p qs signs = vec_of_list (map (\<lambda>s. rat_of_int (int (card {x. poly p x = 0 \<and> consistent_sign_vec_copr qs x = s}))) signs)
[PROOF STEP]
apply (rule eq_vecI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < dim_vec (vec_of_list (map (\<lambda>s. rat_of_int (int (card {x. poly p x = 0 \<and> consistent_sign_vec_copr qs x = s}))) signs)) \<Longrightarrow> construct_lhs_vector p qs signs $ i = vec_of_list (map (\<lambda>s. rat_of_int (int (card {x. poly p x = 0 \<and> consistent_sign_vec_copr qs x = s}))) signs) $ i
 2. dim_vec (construct_lhs_vector p qs signs) = dim_vec (vec_of_list (map (\<lambda>s. rat_of_int (int (card {x. poly p x = 0 \<and> consistent_sign_vec_copr qs x = s}))) signs))
[PROOF STEP]
apply (auto simp add:  construct_lhs_vector_clean[OF assms] )
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < length signs \<Longrightarrow> construct_lhs_vector p qs signs $ i = rat_of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec_copr qs x = vec_of_list signs $ i})
 2. dim_vec (construct_lhs_vector p qs signs) = length signs
[PROOF STEP]
apply (simp add: vec_of_list_index)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < length signs \<Longrightarrow> construct_lhs_vector p qs signs $ i = rat_of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec_copr qs x = signs ! i})
 2. dim_vec (construct_lhs_vector p qs signs) = length signs
[PROOF STEP]
unfolding construct_lhs_vector_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. i < length signs \<Longrightarrow> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs) $ i = rat_of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec_copr qs x = signs ! i})
 2. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
using assms construct_lhs_vector_clean construct_lhs_vector_def
[PROOF STATE]
proof (prove)
using this:
p \<noteq> 0
\<lbrakk>?p \<noteq> 0; ?i < length ?signs\<rbrakk> \<Longrightarrow> of_rat (construct_lhs_vector ?p ?qs ?signs $ ?i) = of_nat (card {x. poly ?p x = 0 \<and> consistent_sign_vec_copr ?qs x = ?signs ! ?i})
construct_lhs_vector ?p ?qs ?signs \<equiv> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr ?qs) (characterize_root_list_p ?p)))))) ?signs)

goal (2 subgoals):
 1. \<And>i. i < length signs \<Longrightarrow> vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs) $ i = rat_of_nat (card {x. poly p x = 0 \<and> consistent_sign_vec_copr qs x = signs ! i})
 2. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_of_list (map (\<lambda>w. rat_of_int (int (length (filter (\<lambda>v. v = w) (map (consistent_sign_vec_copr qs) (characterize_root_list_p p)))))) signs)) = length signs
[PROOF STEP]
by simp


[STATEMENT]
lemma infinite_card_of_diff_singl:
assumes "\<not>finite A"
shows "|A - {a}| =o |A|"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. |A - {a}| =o |A|
[PROOF STEP]
by (metis assms card_of_infinite_diff_finite finite.emptyI finite_insert)


[STATEMENT]
lemma is_process5_sing:
"\<lbrakk> is_process P ; (s,{x}) \<notin> FAILURES P;(s,{}) \<in> FAILURES P\<rbrakk> \<Longrightarrow> (s @ [x],{}) \<in> FAILURES P"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_process P; (s, {x}) \<notin> FAILURES P; (s, {}) \<in> FAILURES P\<rbrakk> \<Longrightarrow> (s @ [x], {}) \<in> FAILURES P
[PROOF STEP]
by(drule_tac X="{}" in is_process5_S1, auto)


[STATEMENT]
lemma lemma_2_10_30:
  "((b l\<rightarrow> a) r\<rightarrow> a) l\<rightarrow> a = b l\<rightarrow> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((b l\<rightarrow> a) r\<rightarrow> a) l\<rightarrow> a = b l\<rightarrow> a
[PROOF STEP]
apply (rule order.antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. ((b l\<rightarrow> a) r\<rightarrow> a) l\<rightarrow> a \<le> b l\<rightarrow> a
 2. b l\<rightarrow> a \<le> ((b l\<rightarrow> a) r\<rightarrow> a) l\<rightarrow> a
[PROOF STEP]
apply (simp_all add: lemma_2_10_26)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((b l\<rightarrow> a) r\<rightarrow> a) l\<rightarrow> a \<le> b l\<rightarrow> a
[PROOF STEP]
apply (rule lemma_2_5_13_a)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. b \<le> (b l\<rightarrow> a) r\<rightarrow> a
[PROOF STEP]
by (rule lemma_2_10_24)


[STATEMENT]
lemma nn_integral_spmf_neq_infinity: "(\<integral>\<^sup>+ x. spmf p x \<partial>count_space UNIV) \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ x. ennreal (spmf p x)) \<noteq> \<infinity>
[PROOF STEP]
using nn_integral_measure_spmf[where f="\<lambda>_. 1", of p, symmetric]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>\<^sup>+ x. ennreal (spmf p x) * 1) = \<integral>\<^sup>+ x. 1 \<partial>measure_spmf p

goal (1 subgoal):
 1. (\<Sum>\<^sup>+ x. ennreal (spmf p x)) \<noteq> \<infinity>
[PROOF STEP]
by simp


[STATEMENT]
lemma floor_add: "\<lfloor>x + y\<rfloor> = (if frac x + frac y < 1 then \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> else (\<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>) + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>x + y\<rfloor> = (if frac x + frac y < (1::'a) then \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> else \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> + 1)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lfloor>x + y\<rfloor> = (if frac x + frac y < (1::'a) then \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> else \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> + 1)
[PROOF STEP]
have "x + y < 1 + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>
[PROOF STEP]
by (metis add.commute floor_unique le_floor_add le_floor_iff of_int_add)
[PROOF STATE]
proof (state)
this:
x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>

goal (1 subgoal):
 1. \<lfloor>x + y\<rfloor> = (if frac x + frac y < (1::'a) then \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> else \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> + 1)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>

goal (1 subgoal):
 1. \<lfloor>x + y\<rfloor> = (if frac x + frac y < (1::'a) then \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> else \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> + 1)
[PROOF STEP]
have "\<not> x + y < 1 + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = 1 + (\<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = 1 + (\<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>)
[PROOF STEP]
apply (simp add: floor_eq_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> x + y < (2::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>)
[PROOF STEP]
apply (auto simp add: algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> x + y < of_int \<lfloor>x\<rfloor> + (of_int \<lfloor>y\<rfloor> + (2::'a))
[PROOF STEP]
apply linarith
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<not> x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = 1 + (\<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>)

goal (1 subgoal):
 1. \<lfloor>x + y\<rfloor> = (if frac x + frac y < (1::'a) then \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> else \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> + 1)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>
\<not> x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = 1 + (\<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>
\<not> x + y < (1::'a) + (of_int \<lfloor>x\<rfloor> + of_int \<lfloor>y\<rfloor>) \<Longrightarrow> \<lfloor>x + y\<rfloor> = 1 + (\<lfloor>x\<rfloor> + \<lfloor>y\<rfloor>)

goal (1 subgoal):
 1. \<lfloor>x + y\<rfloor> = (if frac x + frac y < (1::'a) then \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> else \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> + 1)
[PROOF STEP]
by (auto simp add: frac_def algebra_simps)
[PROOF STATE]
proof (state)
this:
\<lfloor>x + y\<rfloor> = (if frac x + frac y < (1::'a) then \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> else \<lfloor>x\<rfloor> + \<lfloor>y\<rfloor> + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ordinal_plus_0 [simp]: "x + 0 = (x::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + 0 = x
[PROOF STEP]
by (simp add: plus_ordinal_def)


[STATEMENT]
lemma conefield_expansion_estimate:
  fixes u v::"'a::euclidean_space" and F::"'a \<Rightarrow> 'a"
  assumes "t \<in> {0 .. pi / 2}"
  assumes angle_pos: "0 < vangle u v" "vangle u v < pi / 2"
  assumes angle_le: "vangle (F u) (F v) \<le> vangle u v"
  assumes "bounded_linear F"
  assumes "x \<in> conefield u v"
  shows "norm (F x) \<ge> min (norm (F u)/norm u) (norm (F v)/norm v) * norm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
proof cases
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
assume [simp]: "x \<noteq> 0"
[PROOF STATE]
proof (state)
this:
x \<noteq> (0::'a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
t \<in> {0..pi / 2}
0 < vangle u v
vangle u v < pi / 2
vangle (F u) (F v) \<le> vangle u v
bounded_linear F
x \<in> conefield u v
[PROOF STEP]
have [simp]: "u \<noteq> 0" "v \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
t \<in> {0..pi / 2}
0 < vangle u v
vangle u v < pi / 2
vangle (F u) (F v) \<le> vangle u v
bounded_linear F
x \<in> conefield u v

goal (1 subgoal):
 1. u \<noteq> (0::'a) &&& v \<noteq> (0::'a)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
u \<noteq> (0::'a)
v \<noteq> (0::'a)

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
interpret bounded_linear F
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear F
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
define u1 where "u1 = u /\<^sub>R norm u"
[PROOF STATE]
proof (state)
this:
u1 = u /\<^sub>R norm u

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
define v1 where "v1 = v /\<^sub>R norm v"
[PROOF STATE]
proof (state)
this:
v1 = v /\<^sub>R norm v

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
note \<open>x \<in> conefield u v\<close>
[PROOF STATE]
proof (state)
this:
x \<in> conefield u v

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x \<in> conefield u v

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
have \<open>conefield u v = conefield u1 v1\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. conefield u v = conefield u1 v1
[PROOF STEP]
by (auto simp: u1_def v1_def conefield_scaleR conefield_commute[of u])
[PROOF STATE]
proof (state)
this:
conefield u v = conefield u1 v1

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x \<in> conefield u1 v1
[PROOF STEP]
obtain c t where x: "x = c *\<^sub>R conemem u1 v1 t" "t \<in> {0 .. pi / 2}" "c \<ge> 0"
[PROOF STATE]
proof (prove)
using this:
x \<in> conefield u1 v1

goal (1 subgoal):
 1. (\<And>c t. \<lbrakk>x = c *\<^sub>R conemem u1 v1 t; t \<in> {0..pi / 2}; 0 \<le> c\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: conefield_def cone_hull_expl conesegment_def)
[PROOF STATE]
proof (state)
this:
x = c *\<^sub>R conemem u1 v1 t
t \<in> {0..pi / 2}
0 \<le> c

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = c *\<^sub>R conemem u1 v1 t
t \<in> {0..pi / 2}
0 \<le> c
[PROOF STEP]
have xc: "x /\<^sub>R c = conemem u1 v1 t"
[PROOF STATE]
proof (prove)
using this:
x = c *\<^sub>R conemem u1 v1 t
t \<in> {0..pi / 2}
0 \<le> c

goal (1 subgoal):
 1. x /\<^sub>R c = conemem u1 v1 t
[PROOF STEP]
by (auto simp: divide_simps)
[PROOF STATE]
proof (state)
this:
x /\<^sub>R c = conemem u1 v1 t

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x /\<^sub>R c = conemem u1 v1 t

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
have "F \<dots> = conemem (F u1) (F v1) t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F (conemem u1 v1 t) = conemem (F u1) (F v1) t
[PROOF STEP]
by (simp add: bounded_linear_image_conemem assms)
[PROOF STATE]
proof (state)
this:
F (conemem u1 v1 t) = conemem (F u1) (F v1) t

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
F (conemem u1 v1 t) = conemem (F u1) (F v1) t

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
have "norm \<dots> \<ge> min (norm (F u1)) (norm (F v1)) * norm (conemem u1 v1 t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (norm (F u1)) (norm (F v1)) * norm (conemem u1 v1 t) \<le> norm (conemem (F u1) (F v1) t)
[PROOF STEP]
apply (rule conemem_expansion_estimate)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. t \<in> {0..pi / 2}
 2. 0 < vangle u1 v1
 3. vangle u1 v1 < pi / 2
 4. vangle (F u1) (F v1) \<le> vangle u1 v1
 5. norm u1 = 1
 6. norm v1 = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t \<in> {0..pi / 2}
[PROOF STEP]
by fact
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. 0 < vangle u1 v1
 2. vangle u1 v1 < pi / 2
 3. vangle (F u1) (F v1) \<le> vangle u1 v1
 4. norm u1 = 1
 5. norm v1 = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < vangle u1 v1
[PROOF STEP]
using angle_pos
[PROOF STATE]
proof (prove)
using this:
0 < vangle u v
vangle u v < pi / 2

goal (1 subgoal):
 1. 0 < vangle u1 v1
[PROOF STEP]
by (simp add: u1_def v1_def vangle_scaleR)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. vangle u1 v1 < pi / 2
 2. vangle (F u1) (F v1) \<le> vangle u1 v1
 3. norm u1 = 1
 4. norm v1 = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle u1 v1 < pi / 2
[PROOF STEP]
using angle_pos
[PROOF STATE]
proof (prove)
using this:
0 < vangle u v
vangle u v < pi / 2

goal (1 subgoal):
 1. vangle u1 v1 < pi / 2
[PROOF STEP]
by (simp add: u1_def v1_def vangle_scaleR)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. vangle (F u1) (F v1) \<le> vangle u1 v1
 2. norm u1 = 1
 3. norm v1 = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vangle (F u1) (F v1) \<le> vangle u1 v1
[PROOF STEP]
using angle_le
[PROOF STATE]
proof (prove)
using this:
vangle (F u) (F v) \<le> vangle u v

goal (1 subgoal):
 1. vangle (F u1) (F v1) \<le> vangle u1 v1
[PROOF STEP]
by (simp add: u1_def v1_def scaleR vangle_scaleR)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. norm u1 = 1
 2. norm v1 = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm u1 = 1
[PROOF STEP]
using angle_le
[PROOF STATE]
proof (prove)
using this:
vangle (F u) (F v) \<le> vangle u v

goal (1 subgoal):
 1. norm u1 = 1
[PROOF STEP]
by (simp add: u1_def v1_def scaleR vangle_scaleR)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm v1 = 1
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm v1 = 1
[PROOF STEP]
using angle_le
[PROOF STATE]
proof (prove)
using this:
vangle (F u) (F v) \<le> vangle u v

goal (1 subgoal):
 1. norm v1 = 1
[PROOF STEP]
by (simp add: u1_def v1_def scaleR vangle_scaleR)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
min (norm (F u1)) (norm (F v1)) * norm (conemem u1 v1 t) \<le> norm (conemem (F u1) (F v1) t)

goal (2 subgoals):
 1. ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
 2. \<not> ?P \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
min (norm (F u1)) (norm (F v1)) * norm (conemem u1 v1 t) \<le> norm (F (x /\<^sub>R c))
[PROOF STEP]
show "norm (F x) \<ge> min (norm (F u)/norm u) (norm (F v)/norm v) * norm x"
[PROOF STATE]
proof (prove)
using this:
min (norm (F u1)) (norm (F v1)) * norm (conemem u1 v1 t) \<le> norm (F (x /\<^sub>R c))

goal (1 subgoal):
 1. min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
unfolding xc[symmetric] scaleR u1_def v1_def norm_scaleR x
[PROOF STATE]
proof (prove)
using this:
min (\<bar>inverse (norm u)\<bar> * norm (F u)) (\<bar>inverse (norm v)\<bar> * norm (F v)) * norm (conemem (u /\<^sub>R norm u) (v /\<^sub>R norm v) t) \<le> \<bar>inverse c\<bar> * (\<bar>c\<bar> * norm (F (conemem (u /\<^sub>R norm u) (v /\<^sub>R norm v) t)))

goal (1 subgoal):
 1. min (norm (F u) / norm u) (norm (F v) / norm v) * (\<bar>c\<bar> * norm (conemem (u /\<^sub>R norm u) (v /\<^sub>R norm v) t)) \<le> \<bar>c\<bar> * norm (F (conemem (u /\<^sub>R norm u) (v /\<^sub>R norm v) t))
[PROOF STEP]
using \<open>c \<ge> 0\<close>
[PROOF STATE]
proof (prove)
using this:
min (\<bar>inverse (norm u)\<bar> * norm (F u)) (\<bar>inverse (norm v)\<bar> * norm (F v)) * norm (conemem (u /\<^sub>R norm u) (v /\<^sub>R norm v) t) \<le> \<bar>inverse c\<bar> * (\<bar>c\<bar> * norm (F (conemem (u /\<^sub>R norm u) (v /\<^sub>R norm v) t)))
0 \<le> c

goal (1 subgoal):
 1. min (norm (F u) / norm u) (norm (F v) / norm v) * (\<bar>c\<bar> * norm (conemem (u /\<^sub>R norm u) (v /\<^sub>R norm v) t)) \<le> \<bar>c\<bar> * norm (F (conemem (u /\<^sub>R norm u) (v /\<^sub>R norm v) t))
[PROOF STEP]
by (simp add: divide_simps split: if_splits)
[PROOF STATE]
proof (state)
this:
min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)

goal (1 subgoal):
 1. \<not> x \<noteq> (0::'a) \<Longrightarrow> min (norm (F u) / norm u) (norm (F v) / norm v) * norm x \<le> norm (F x)
[PROOF STEP]
qed simp


[STATEMENT]
lemma assert_fun_dual: "((assert_fun p) o \<top>) \<sqinter> (dual_fun (assert_fun p)) = assert_fun p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (assert_fun p \<circ> \<top>) \<sqinter> dual_fun (assert_fun p) = assert_fun p
[PROOF STEP]
by (simp add: fun_eq_iff inf_fun_def dual_fun_def o_def assert_fun_def top_fun_def inf_sup_distrib)


[STATEMENT]
lemma oexp_succ [simp]: "Ord \<beta> \<Longrightarrow> \<alpha>\<up>(succ \<beta>) = \<alpha>\<up>\<beta> * \<alpha>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Ord \<beta> \<Longrightarrow> \<alpha> \<up> ZFC_in_HOL.succ \<beta> = \<alpha> \<up> \<beta> * \<alpha>
[PROOF STEP]
by (simp add: def_transrec [OF oexp_def])


[STATEMENT]
lemma div_mult_le: "(a div b) * c \<le> (a * c) div (b :: nat)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a div b * c \<le> a * c div b
[PROOF STEP]
by (metis div_mult2_eq div_mult_mult2 mult.commute mult_0_right times_div_less_eq_dividend)


[STATEMENT]
lemma accepts_or:
 "accepts (or L R) w = (accepts L w | accepts R w)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. NAe.accepts (RegExp2NAe.or L R) w = (NAe.accepts L w \<or> NAe.accepts R w)
[PROOF STEP]
apply (simp add:accepts_def steps_or)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>q. (w = [] \<and> q = start (RegExp2NAe.or L R) \<or> (\<exists>p. q = True # p \<and> (start L, p) \<in> NAe.steps L w \<or> q = False # p \<and> (start R, p) \<in> NAe.steps R w)) \<and> fin (RegExp2NAe.or L R) q) = ((\<exists>q. (start L, q) \<in> NAe.steps L w \<and> fin L q) \<or> (\<exists>q. (start R, q) \<in> NAe.steps R w \<and> fin R q))
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma tendsto_iff_Liminf_eq_Limsup:
  fixes f0 :: "'a :: {complete_linorder,linorder_topology}"
  shows "\<not> trivial_limit F \<Longrightarrow> (f \<longlongrightarrow> f0) F \<longleftrightarrow> (Liminf F f = f0 \<and> Limsup F f = f0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F \<noteq> bot \<Longrightarrow> (f \<longlongrightarrow> f0) F = (Liminf F f = f0 \<and> Limsup F f = f0)
[PROOF STEP]
by (metis Liminf_eq_Limsup lim_imp_Limsup lim_imp_Liminf)


[STATEMENT]
lemma (in -) nested_Collect: "{f y |y. y \<in> {g x |x. x \<in> X}} = {f (g x) |x. x \<in> X}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {f y |y::'b. y \<in> {g x |x::'c. x \<in> X}} = {f (g x) |x::'c. x \<in> X}
variables:
X :: 'c set
g :: 'c \<Rightarrow> 'b
f :: 'b \<Rightarrow> 'a
type variables:
'a, 'b, 'c :: type
[PROOF STEP]
by blast


[STATEMENT]
lemma (in PolynRg) scf_d_pol:"\<lbrakk>p \<in> carrier R; deg R S X p \<le> an d\<rbrakk> \<Longrightarrow>
      pol_coeff S (scf_d R S X p d) \<and> fst (scf_d R S X p d) = d \<and>
       p = polyn_expr R X d (scf_d R S X p d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; deg R S X p \<le> an d\<rbrakk> \<Longrightarrow> pol_coeff S (scf_d R S X p d) \<and> fst (scf_d R S X p d) = d \<and> p = polyn_expr R X d (scf_d R S X p d)
[PROOF STEP]
apply (frule scf_d_polTr[of "p" "d"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>p \<in> carrier R; deg R S X p \<le> an d; scf_cond R S X p d (scf_d R S X p d)\<rbrakk> \<Longrightarrow> pol_coeff S (scf_d R S X p d) \<and> fst (scf_d R S X p d) = d \<and> p = polyn_expr R X d (scf_d R S X p d)
[PROOF STEP]
apply (simp add:scf_cond_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "(\<forall>x y. \<exists>z. \<forall>w. (P x \<and> Q y \<longrightarrow> R z \<and> S w))
    \<longrightarrow> (\<exists>x y. P x \<and> Q y) \<longrightarrow> (\<exists>z. R z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>x y. \<exists>z. \<forall>w. P x \<and> Q y \<longrightarrow> R z \<and> S w) \<longrightarrow> (\<exists>x y. P x \<and> Q y) \<longrightarrow> (\<exists>z. R z)
[PROOF STEP]
by blast


[STATEMENT]
lemma list_ex_length:
  "list_ex P xs \<longleftrightarrow> (\<exists>n < length xs. P (xs ! n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. list_ex P xs = (\<exists>n<length xs. P (xs ! n))
[PROOF STEP]
by (auto simp add: list_ex_iff set_conv_nth)


[STATEMENT]
lemma single_input_alt_def :
  "single_input M = (\<forall> q1 x x' y y' q1' q1'' . (q1,x,y,q1') \<in> transitions M \<and> (q1,x',y',q1'') \<in> transitions M \<longrightarrow> x = x')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. single_input M = (\<forall>q1 x x' y y' q1' q1''. (q1, x, y, q1') \<in> FSM.transitions M \<and> (q1, x', y', q1'') \<in> FSM.transitions M \<longrightarrow> x = x')
[PROOF STEP]
by fastforce


[STATEMENT]
lemma evContainsEx_containsEx0:
  "[| branch subs (pseq fs) f; !n . ~ proofTree (tree subs (f n)) |]
  ==> EV (contains f (i,FAll Neg A)) -->
      EV (contains f (0,FAll Neg A))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>branch subs (pseq fs) f; \<forall>n. \<not> proofTree (tree subs (f n))\<rbrakk> \<Longrightarrow> EV (contains f (i, FAll Neg A)) \<longrightarrow> EV (contains f (0, FAll Neg A))
[PROOF STEP]
apply (induct i, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<lbrakk>branch subs (pseq fs) f; \<forall>n. \<not> proofTree (tree subs (f n))\<rbrakk> \<Longrightarrow> EV (contains f (i, FAll Neg A)) \<longrightarrow> EV (contains f (0, FAll Neg A)); branch subs (pseq fs) f; \<forall>n. \<not> proofTree (tree subs (f n))\<rbrakk> \<Longrightarrow> EV (contains f (Suc i, FAll Neg A)) \<longrightarrow> EV (contains f (0, FAll Neg A))
[PROOF STEP]
apply(blast dest!: evContainsExSuc_containsEx)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma ratfps_has_asymptotics_correct:
  assumes "ratfps_has_asymptotics q k R"
  shows   "fps_nth (fps_of_poly p / fps_of_poly q) \<in> O(\<lambda>n. of_nat n ^ k * of_real R ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ($) (fps_of_poly p / fps_of_poly q) \<in> O(\<lambda>n. of_nat n ^ k * complex_of_real R ^ n)
[PROOF STEP]
proof (rule ratfps_nth_bigo_square_free_factorization')
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. square_free_factorization q (?b, ?cs)
 2. q \<noteq> 0
 3. 0 < R
 4. list_all (\<lambda>cl. proots_ball_card (fst cl) 0 (1 / R) = 0) ?cs
 5. list_all (\<lambda>cl. proots_sphere_card (fst cl) 0 (1 / R) = 0) (filter (\<lambda>cl. k < snd cl) ?cs)
[PROOF STEP]
show "square_free_factorization q (fst (yun_factorization gcd q), snd (yun_factorization gcd q))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_free_factorization q (fst (yun_factorization gcd q), snd (yun_factorization gcd q))
[PROOF STEP]
by (rule yun_factorization) simp
[PROOF STATE]
proof (state)
this:
square_free_factorization q (fst (yun_factorization gcd q), snd (yun_factorization gcd q))

goal (4 subgoals):
 1. q \<noteq> 0
 2. 0 < R
 3. list_all (\<lambda>cl. proots_ball_card (fst cl) 0 (1 / R) = 0) (snd (yun_factorization gcd q))
 4. list_all (\<lambda>cl. proots_sphere_card (fst cl) 0 (1 / R) = 0) (filter (\<lambda>cl. k < snd cl) (snd (yun_factorization gcd q)))
[PROOF STEP]
qed (insert assms, auto simp: ratfps_has_asymptotics_def Let_def list_all_def)


[STATEMENT]
theorem (in dcharacter) polya_vinogradov_inequality:
  assumes nonprincipal: "\<chi> \<noteq> principal_dchar n"
  shows   "norm (\<Sum>m=1..x. \<chi> m) < 2 * sqrt n * ln n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
have "n div conductor > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < n div conductor
[PROOF STEP]
using n conductor_dvd dvd_div_eq_0_iff[of conductor n]
[PROOF STATE]
proof (prove)
using this:
1 < n
conductor dvd n
conductor dvd n \<Longrightarrow> (n div conductor = 0) = (n = 0)

goal (1 subgoal):
 1. 0 < n div conductor
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 < n div conductor

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
have "norm (\<Sum>m=1..x. \<chi> m) < sqrt conductor * ln conductor * divisor_count (n div conductor)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < sqrt (real conductor) * ln (real conductor) * real (divisor_count (n div conductor))
[PROOF STEP]
using nonprincipal
[PROOF STATE]
proof (prove)
using this:
\<chi> \<noteq> principal_dchar n

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < sqrt (real conductor) * ln (real conductor) * real (divisor_count (n div conductor))
[PROOF STEP]
by (rule polya_vinogradov_inequality_explicit)
[PROOF STATE]
proof (state)
this:
cmod (sum \<chi> {1..x}) < sqrt (real conductor) * ln (real conductor) * real (divisor_count (n div conductor))

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cmod (sum \<chi> {1..x}) < sqrt (real conductor) * ln (real conductor) * real (divisor_count (n div conductor))

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
have "\<dots> \<le> sqrt conductor * ln conductor * (2 * sqrt (n div conductor))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (real conductor) * ln (real conductor) * real (divisor_count (n div conductor)) \<le> sqrt (real conductor) * ln (real conductor) * (2 * sqrt (real (n div conductor)))
[PROOF STEP]
using conductor_gr_0 \<open>n div conductor > 0\<close>
[PROOF STATE]
proof (prove)
using this:
0 < conductor
0 < n div conductor

goal (1 subgoal):
 1. sqrt (real conductor) * ln (real conductor) * real (divisor_count (n div conductor)) \<le> sqrt (real conductor) * ln (real conductor) * (2 * sqrt (real (n div conductor)))
[PROOF STEP]
by (intro mult_left_mono divisor_count_upper_bound') (auto simp: Suc_le_eq)
[PROOF STATE]
proof (state)
this:
sqrt (real conductor) * ln (real conductor) * real (divisor_count (n div conductor)) \<le> sqrt (real conductor) * ln (real conductor) * (2 * sqrt (real (n div conductor)))

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt (real conductor) * ln (real conductor) * real (divisor_count (n div conductor)) \<le> sqrt (real conductor) * ln (real conductor) * (2 * sqrt (real (n div conductor)))

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
have "sqrt (n div conductor) = sqrt n / sqrt conductor"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (real (n div conductor)) = sqrt (real n) / sqrt (real conductor)
[PROOF STEP]
using conductor_dvd
[PROOF STATE]
proof (prove)
using this:
conductor dvd n

goal (1 subgoal):
 1. sqrt (real (n div conductor)) = sqrt (real n) / sqrt (real conductor)
[PROOF STEP]
by (simp add: Real.real_of_nat_div real_sqrt_divide)
[PROOF STATE]
proof (state)
this:
sqrt (real (n div conductor)) = sqrt (real n) / sqrt (real conductor)

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt (real (n div conductor)) = sqrt (real n) / sqrt (real conductor)

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
have "sqrt conductor * ln conductor * (2 * (sqrt n / sqrt conductor)) =
               2 * sqrt n * ln conductor"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sqrt (real conductor) * ln (real conductor) * (2 * (sqrt (real n) / sqrt (real conductor))) = 2 * sqrt (real n) * ln (real conductor)
[PROOF STEP]
using conductor_gr_0 n
[PROOF STATE]
proof (prove)
using this:
0 < conductor
1 < n

goal (1 subgoal):
 1. sqrt (real conductor) * ln (real conductor) * (2 * (sqrt (real n) / sqrt (real conductor))) = 2 * sqrt (real n) * ln (real conductor)
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
sqrt (real conductor) * ln (real conductor) * (2 * (sqrt (real n) / sqrt (real conductor))) = 2 * sqrt (real n) * ln (real conductor)

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
sqrt (real conductor) * ln (real conductor) * (2 * (sqrt (real n) / sqrt (real conductor))) = 2 * sqrt (real n) * ln (real conductor)

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
have "\<dots> \<le> 2 * sqrt n * ln n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 * sqrt (real n) * ln (real conductor) \<le> 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
using conductor_le_modulus conductor_gr_0
[PROOF STATE]
proof (prove)
using this:
conductor \<le> n
0 < conductor

goal (1 subgoal):
 1. 2 * sqrt (real n) * ln (real conductor) \<le> 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
by (intro mult_left_mono) auto
[PROOF STATE]
proof (state)
this:
2 * sqrt (real n) * ln (real conductor) \<le> 2 * sqrt (real n) * ln (real n)

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)

goal (1 subgoal):
 1. cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cmod (sum \<chi> {1..x}) < 2 * sqrt (real n) * ln (real n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma p_gt_0: "p > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < p
[PROOF STEP]
using p_ge_18
[PROOF STATE]
proof (prove)
using this:
18 \<le> p

goal (1 subgoal):
 1. 0 < p
[PROOF STEP]
by simp


[STATEMENT]
lemma transpose_transpose [simp]: "transpose(transpose A) = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Finite_Cartesian_Product.transpose (Finite_Cartesian_Product.transpose A) = A
[PROOF STEP]
by (vector transpose_def)


[STATEMENT]
lemma integral_FTC_atLeastAtMost:
  fixes f :: "real \<Rightarrow> 'a :: euclidean_space"
  assumes "a \<le> b"
    and F: "\<And>x. a \<le> x \<Longrightarrow> x \<le> b \<Longrightarrow> (F has_vector_derivative f x) (at x within {a .. b})"
    and f: "continuous_on {a .. b} f"
  shows "integral\<^sup>L lborel (\<lambda>x. indicator {a .. b} x *\<^sub>R f x) = F b - F a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
let ?f = "\<lambda>x. indicator {a .. b} x *\<^sub>R f x"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
have "(?f has_integral (\<integral>x. ?f x \<partial>lborel)) UNIV"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral LBINT x. indicat_real {a..b} x *\<^sub>R f x) UNIV
[PROOF STEP]
using borel_integrable_atLeastAtMost'[OF f]
[PROOF STATE]
proof (prove)
using this:
set_integrable lborel {a..b} f

goal (1 subgoal):
 1. ((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral LBINT x. indicat_real {a..b} x *\<^sub>R f x) UNIV
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
using this:
integrable lborel (\<lambda>x. indicat_real {a..b} x *\<^sub>R f x)

goal (1 subgoal):
 1. ((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral LBINT x. indicat_real {a..b} x *\<^sub>R f x) UNIV
[PROOF STEP]
by (rule has_integral_integral_lborel)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral LBINT x. indicat_real {a..b} x *\<^sub>R f x) UNIV

goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral LBINT x. indicat_real {a..b} x *\<^sub>R f x) UNIV

goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
have "(f has_integral F b - F a) {a .. b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_integral F b - F a) {a..b}
[PROOF STEP]
by (intro fundamental_theorem_of_calculus ballI assms) auto
[PROOF STATE]
proof (state)
this:
(f has_integral F b - F a) {a..b}

goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(f has_integral F b - F a) {a..b}
[PROOF STEP]
have "(?f has_integral F b - F a) {a .. b}"
[PROOF STATE]
proof (prove)
using this:
(f has_integral F b - F a) {a..b}

goal (1 subgoal):
 1. ((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral F b - F a) {a..b}
[PROOF STEP]
by (subst has_integral_cong[where g=f]) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral F b - F a) {a..b}

goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral F b - F a) {a..b}
[PROOF STEP]
have "(?f has_integral F b - F a) UNIV"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral F b - F a) {a..b}

goal (1 subgoal):
 1. ((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral F b - F a) UNIV
[PROOF STEP]
by (intro has_integral_on_superset[where T=UNIV and S="{a..b}"]) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral F b - F a) UNIV

goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral LBINT x. indicat_real {a..b} x *\<^sub>R f x) UNIV
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral F b - F a) UNIV
[PROOF STEP]
show "integral\<^sup>L lborel ?f = F b - F a"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral LBINT x. indicat_real {a..b} x *\<^sub>R f x) UNIV
((\<lambda>x. indicat_real {a..b} x *\<^sub>R f x) has_integral F b - F a) UNIV

goal (1 subgoal):
 1. LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a
[PROOF STEP]
by (rule has_integral_unique)
[PROOF STATE]
proof (state)
this:
LBINT x. indicat_real {a..b} x *\<^sub>R f x = F b - F a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Corps) one_plus_x_nonzero:"\<lbrakk>valuation K v; x \<in> carrier K; v x < 0\<rbrakk>
      \<Longrightarrow> 1\<^sub>r \<plusminus> x \<in> carrier K \<and> v (1\<^sub>r \<plusminus> x) < 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; v x < 0\<rbrakk> \<Longrightarrow> 1\<^sub>r \<plusminus> x \<in> carrier K \<and> v (1\<^sub>r \<plusminus> x) < 0
[PROOF STEP]
apply (cut_tac field_is_ring, frule Ring.ring_is_ag[of "K"],
       frule Ring.ring_one[of "K"],
       frule aGroup.ag_pOp_closed[of "K" "1\<^sub>r" "x"], assumption+,
       simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valuation K v; x \<in> carrier K; v x < 0; Ring K; aGroup K; 1\<^sub>r \<in> carrier K; 1\<^sub>r \<plusminus> x \<in> carrier K\<rbrakk> \<Longrightarrow> v (1\<^sub>r \<plusminus> x) < 0
[PROOF STEP]
apply (frule value_less_eq[of "v" "x" "1\<^sub>r"], assumption+,
       simp add:value_of_one, simp add:aGroup.ag_pOp_commute)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
theorem (in Group) rcs_eq:"\<lbrakk>G \<guillemotright> H; a \<in> carrier G; b \<in> carrier G\<rbrakk> \<Longrightarrow>
                            (b \<cdot> (\<rho> a) \<in> H) = (H \<bullet> a = H \<bullet> b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G\<rbrakk> \<Longrightarrow> (b \<cdot> \<rho> a \<in> H) = (H \<bullet> a = H \<bullet> b)
[PROOF STEP]
apply (rule iffI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; b \<cdot> \<rho> a \<in> H\<rbrakk> \<Longrightarrow> H \<bullet> a = H \<bullet> b
 2. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; H \<bullet> a = H \<bullet> b\<rbrakk> \<Longrightarrow> b \<cdot> \<rho> a \<in> H
[PROOF STEP]
apply (rule equalityI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; b \<cdot> \<rho> a \<in> H\<rbrakk> \<Longrightarrow> H \<bullet> a \<subseteq> H \<bullet> b
 2. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; b \<cdot> \<rho> a \<in> H\<rbrakk> \<Longrightarrow> H \<bullet> b \<subseteq> H \<bullet> a
 3. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; H \<bullet> a = H \<bullet> b\<rbrakk> \<Longrightarrow> b \<cdot> \<rho> a \<in> H
[PROOF STEP]
apply (frule rcsTr7[of "H" "a" "b"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; b \<cdot> \<rho> a \<in> H\<rbrakk> \<Longrightarrow> H \<bullet> b \<subseteq> H \<bullet> a
 2. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; H \<bullet> a = H \<bullet> b\<rbrakk> \<Longrightarrow> b \<cdot> \<rho> a \<in> H
[PROOF STEP]
apply (frule rcs_tool1[of "H" "a" "b"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; b \<cdot> \<rho> a \<in> H; a \<cdot> \<rho> b \<in> H\<rbrakk> \<Longrightarrow> H \<bullet> b \<subseteq> H \<bullet> a
 2. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; H \<bullet> a = H \<bullet> b\<rbrakk> \<Longrightarrow> b \<cdot> \<rho> a \<in> H
[PROOF STEP]
apply (rule rcsTr7[of "H" "b" "a"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; H \<bullet> a = H \<bullet> b\<rbrakk> \<Longrightarrow> b \<cdot> \<rho> a \<in> H
[PROOF STEP]
apply (frule a_in_rcs[of "H" "a"], assumption, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; H \<bullet> a = H \<bullet> b; a \<in> H \<bullet> b\<rbrakk> \<Longrightarrow> b \<cdot> \<rho> a \<in> H
[PROOF STEP]
apply (simp add:rcs_eqTr1[of "H" "a" "b"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>G \<guillemotright> H ; a \<in> carrier G; b \<in> carrier G; H \<bullet> a = H \<bullet> b; a \<cdot> \<rho> b \<in> H\<rbrakk> \<Longrightarrow> b \<cdot> \<rho> a \<in> H
[PROOF STEP]
apply (rule rcs_tool1, assumption+)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in domain) univ_poly_units_incl:
  assumes "subring K R" shows "Units (K[X]) \<subseteq> { [ k ] | k. k \<in> K - { \<zero> } }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Units (K [X]) \<subseteq> {[k] |k. k \<in> K - {\<zero>}}
[PROOF STEP]
using domain.univ_poly_carrier_units_incl[OF subring_is_domain[OF assms]]
        univ_poly_consistent[OF assms]
[PROOF STATE]
proof (prove)
using this:
Units (poly_ring (R\<lparr>carrier := K\<rparr>)) \<subseteq> {[k] |k. k \<in> carrier (R\<lparr>carrier := K\<rparr>) - {\<zero>\<^bsub>R\<lparr>carrier := K\<rparr>\<^esub>}}
univ_poly (R\<lparr>carrier := K\<rparr>) = univ_poly R

goal (1 subgoal):
 1. Units (K [X]) \<subseteq> {[k] |k. k \<in> K - {\<zero>}}
[PROOF STEP]
by auto


[STATEMENT]
lemma vector_derivative_chain_at:
  assumes "f differentiable at x" "(g differentiable at (f x))"
  shows "vector_derivative (g \<circ> f) (at x) =
         vector_derivative f (at x) *\<^sub>R vector_derivative g (at (f x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vector_derivative (g \<circ> f) (at x) = vector_derivative f (at x) *\<^sub>R vector_derivative g (at (f x))
[PROOF STEP]
by (metis vector_diff_chain_at vector_derivative_at vector_derivative_works assms)