[STATEMENT]
lemma mult_poly_0_right: "p * (0::'a poly) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p * 0 = 0
[PROOF STEP]
by (induct p) (simp_all add: mult_poly_0_left)


[STATEMENT]
lemma infnorm_mul_lemma: "infnorm (a *\<^sub>R x) \<le> \<bar>a\<bar> * infnorm x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infnorm (a *\<^sub>R x) \<le> \<bar>a\<bar> * infnorm x
[PROOF STEP]
unfolding infnorm_mul
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<bar>a\<bar> * infnorm x \<le> \<bar>a\<bar> * infnorm x
[PROOF STEP]
..


[STATEMENT]
lemma gcd_code[code]:
"gcd a b = int_of_integer (gcd_integer (of_int a) (of_int b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. gcd a b = int_of_integer (gcd_integer (of_int a) (of_int b))
[PROOF STEP]
by (metis gcd_integer.abs_eq int_of_integer_integer_of_int integer_of_int_eq_of_int)


[STATEMENT]
lemma ordinal_div_plus_mod: "y * (x div y) + (x mod y) = (x::ordinal)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * (x div y) + x mod y = x
[PROOF STEP]
apply (simp add: mod_ordinal_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * (x div y) + (x - y * (x div y)) = x
[PROOF STEP]
apply (rule ordinal_plus_minus2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * (x div y) \<le> x
[PROOF STEP]
apply (rule ordinal_times_div_le)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma uminus_INF: "- (INF x\<in>A. B x) = (SUP x\<in>A. - B x)" for B :: \<open>'a \<Rightarrow> 'b::complete_orthocomplemented_lattice\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - \<Sqinter> (B ` A) = (\<Squnion>x\<in>A. - B x)
[PROOF STEP]
by (simp add: uminus_Inf image_image)


[STATEMENT]
lemma measure_measurable_prob_algebra2:
  "Sigma (space M) A \<in> sets (M \<Otimes>\<^sub>M N) \<Longrightarrow> L \<in> M \<rightarrow>\<^sub>M prob_algebra N \<Longrightarrow>
    (\<lambda>x. Sigma_Algebra.measure (L x) (A x)) \<in> borel_measurable M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Sigma (space M) A \<in> sets (M \<Otimes>\<^sub>M N); L \<in> M \<rightarrow>\<^sub>M prob_algebra N\<rbrakk> \<Longrightarrow> (\<lambda>x. Sigma_Algebra.measure (L x) (A x)) \<in> borel_measurable M
[PROOF STEP]
using measure_measurable_subprob_algebra2[of M A N L]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Sigma (space M) A \<in> sets (M \<Otimes>\<^sub>M N); L \<in> M \<rightarrow>\<^sub>M subprob_algebra N\<rbrakk> \<Longrightarrow> (\<lambda>x. Sigma_Algebra.measure (L x) (A x)) \<in> borel_measurable M

goal (1 subgoal):
 1. \<lbrakk>Sigma (space M) A \<in> sets (M \<Otimes>\<^sub>M N); L \<in> M \<rightarrow>\<^sub>M prob_algebra N\<rbrakk> \<Longrightarrow> (\<lambda>x. Sigma_Algebra.measure (L x) (A x)) \<in> borel_measurable M
[PROOF STEP]
by (auto intro: measurable_prob_algebraD)


[STATEMENT]
lemma finite_set_of_finite_funs_pred:
  assumes "finite { x::'a . True }"
      and "finite { y::'b . P y }"
    shows "finite { f . (\<forall>x::'a . P (f x)) }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {f. \<forall>x. P (f x)}
[PROOF STEP]
using assms finite_set_of_finite_funs
[PROOF STATE]
proof (prove)
using this:
finite {x. True}
finite {y. P y}
\<lbrakk>finite ?A; finite ?B\<rbrakk> \<Longrightarrow> finite {f. \<forall>x. (x \<in> ?A \<longrightarrow> f x \<in> ?B) \<and> (x \<notin> ?A \<longrightarrow> f x = ?d)}

goal (1 subgoal):
 1. finite {f. \<forall>x. P (f x)}
[PROOF STEP]
by force


[STATEMENT]
lemma "wordinterval_intersection'
          (RangeUnion (RangeUnion (WordInterval (1::32 word) 3) (WordInterval 8 10))
                      (WordInterval 1 3)) (WordInterval 1 3) =
          RangeUnion (RangeUnion (WordInterval 1 3) (WordInterval 1 0)) (WordInterval 1 3)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wordinterval_intersection' (RangeUnion (RangeUnion (WordInterval 1 3) (WordInterval 8 10)) (WordInterval 1 3)) (WordInterval 1 3) = RangeUnion (RangeUnion (WordInterval 1 3) (WordInterval 1 0)) (WordInterval 1 3)
[PROOF STEP]
by eval


[STATEMENT]
lemma Bernstein_coeffs_01_sum: assumes "degree P \<le> p"
  shows "P = (\<Sum>j = 0..p. smult (nth_default 0 (Bernstein_coeffs_01 p P) j)
             (Bernstein_Poly_01 j p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = (\<Sum>j = 0..p. smult (nth_default 0 (Bernstein_coeffs_01 p P) j) (Bernstein_Poly_01 j p))
[PROOF STEP]
apply (subst nth_default_Bernstein_coeffs_01[OF assms])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P = (\<Sum>j = 0..p. smult (inverse (real (p choose j)) * coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) (p - j)) (Bernstein_Poly_01 j p))
[PROOF STEP]
apply (subst Bernstein_sum_01[OF assms])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j = 0..p. smult (inverse (real (p choose j)) * coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) (p - j)) (Bernstein_Poly_01 j p)) = (\<Sum>j = 0..p. smult (inverse (real (p choose j)) * coeff (reciprocal_poly p P \<circ>\<^sub>p [:1, 1:]) (p - j)) (Bernstein_Poly_01 j p))
[PROOF STEP]
by argo


[STATEMENT]
lemma "- (-54321::real) = 54321"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. - (- 54321) = 54321
[PROOF STEP]
by simp


[STATEMENT]
lemma homotopic_paths:
   "homotopic_paths s p q \<longleftrightarrow>
      (\<exists>h. continuous_on ({0..1} \<times> {0..1}) h \<and>
          h ` ({0..1} \<times> {0..1}) \<subseteq> s \<and>
          (\<forall>x \<in> {0..1}. h(0,x) = p x) \<and>
          (\<forall>x \<in> {0..1}. h(1,x) = q x) \<and>
          (\<forall>t \<in> {0..1::real}. pathstart(h \<circ> Pair t) = pathstart p \<and>
                        pathfinish(h \<circ> Pair t) = pathfinish p))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. homotopic_paths s p q = (\<exists>h. continuous_on ({0..1} \<times> {0..1}) h \<and> h ` ({0..1} \<times> {0..1}) \<subseteq> s \<and> (\<forall>x\<in>{0..1}. h (0, x) = p x) \<and> (\<forall>x\<in>{0..1}. h (1, x) = q x) \<and> (\<forall>t\<in>{0..1}. pathstart (h \<circ> Pair t) = pathstart p \<and> pathfinish (h \<circ> Pair t) = pathfinish p))
[PROOF STEP]
by (auto simp: homotopic_paths_def homotopic_with pathstart_def pathfinish_def)


[STATEMENT]
lemma graph_memI'':
  assumes "a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)"
  assumes "g \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p"
  shows "(a@[g a]) \<in> graph n g "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a @ [g a] \<in> graph n g
[PROOF STEP]
using assms fun_graph_def
[PROOF STATE]
proof (prove)
using this:
a \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>)
g \<in> carrier (Q\<^sub>p\<^bsup>n\<^esup>) \<rightarrow> carrier Q\<^sub>p
fun_graph ?R ?n ?f = {as. \<exists>x\<in>carrier (?R\<^bsup>?n\<^esup>). as = x @ [?f x]}

goal (1 subgoal):
 1. a @ [g a] \<in> graph n g
[PROOF STEP]
by blast


[STATEMENT]
lemma ffb_g_ode_ivl: "t \<ge> 0 \<Longrightarrow> t \<in> T \<Longrightarrow> fb\<^sub>\<F> (x\<acute>=(\<lambda>t. f) & G on (\<lambda>s. {0..t}) S @ 0) Q =
  {s. s \<in> S \<longrightarrow> (\<forall>t\<in>{0..t}. (\<forall>\<tau>\<in>{0..t}. G (\<phi> \<tau> s)) \<longrightarrow> (\<phi> t s) \<in> Q)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> t; s2p T t\<rbrakk> \<Longrightarrow> fb\<^sub>\<F> x\<acute>=\<lambda>t. f & G on \<lambda>s. {0..t} S @ 0 Q = {s. s2p S s \<longrightarrow> (\<forall>t\<in>{0..t}. (\<forall>\<tau>\<in>{0..t}. G (\<phi> \<tau> s)) \<longrightarrow> s2p Q (\<phi> t s))}
[PROOF STEP]
apply(subst ffb_g_ode_subset, simp_all add: subintervalI init_time real_Icc_closed_segment)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 \<le> t; s2p T t\<rbrakk> \<Longrightarrow> {s. s2p S s \<longrightarrow> (\<forall>ta\<in>{0--t}. (\<forall>\<tau>. s2p {0--t} \<tau> \<and> \<tau> \<le> ta \<longrightarrow> G (\<phi> \<tau> s)) \<longrightarrow> s2p Q (\<phi> ta s))} = {s. s2p S s \<longrightarrow> (\<forall>t\<in>{0--t}. (\<forall>\<tau>\<in>{0..t}. G (\<phi> \<tau> s)) \<longrightarrow> s2p Q (\<phi> t s))}
[PROOF STEP]
by (auto simp: closed_segment_eq_real_ivl)


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


[STATEMENT]
lemma swap_delete_edges: "delete_edge a b c (delete_edge x y z H)
           = delete_edge x y z (delete_edge a b c H)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. delete_edge a b c (delete_edge x y z H) = delete_edge x y z (delete_edge a b c H)
[PROOF STEP]
unfolding delete_edge_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>nodes = nodes \<lparr>nodes = nodes H, edges = edges H - {(x, y, z)}\<rparr>, edges = edges \<lparr>nodes = nodes H, edges = edges H - {(x, y, z)}\<rparr> - {(a, b, c)}\<rparr> = \<lparr>nodes = nodes \<lparr>nodes = nodes H, edges = edges H - {(a, b, c)}\<rparr>, edges = edges \<lparr>nodes = nodes H, edges = edges H - {(a, b, c)}\<rparr> - {(x, y, z)}\<rparr>
[PROOF STEP]
by auto


[STATEMENT]
lemma scaleC_half_double [simp]:
  fixes a :: "'a::complex_vector"
  shows "(1 / 2) *\<^sub>C (a + a) = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (1 / 2) *\<^sub>C (a + a) = a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (1 / 2) *\<^sub>C (a + a) = a
[PROOF STEP]
have "\<And>r. r *\<^sub>C (a + a) = (r * 2) *\<^sub>C a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>r. r *\<^sub>C (a + a) = (r * 2) *\<^sub>C a
[PROOF STEP]
by (metis scaleC_2 scaleC_scaleC)
[PROOF STATE]
proof (state)
this:
?r *\<^sub>C (a + a) = (?r * 2) *\<^sub>C a

goal (1 subgoal):
 1. (1 / 2) *\<^sub>C (a + a) = a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
?r *\<^sub>C (a + a) = (?r * 2) *\<^sub>C a

goal (1 subgoal):
 1. (1 / 2) *\<^sub>C (a + a) = a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(1 / 2) *\<^sub>C (a + a) = a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powrat_add_pos:
  assumes "0 < x" and "0 < r" and "0 < s"
  shows "x pow\<^sub>\<rat> (r + s) = (x pow\<^sub>\<rat> r) * (x pow\<^sub>\<rat> s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
proof (cases r)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>r = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
case (Fract a b)
[PROOF STATE]
proof (state)
this:
r = Fract a b
0 < b
coprime a b

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>r = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
assume b0: "b > 0" and rf: "r = Fract a b"
[PROOF STATE]
proof (state)
this:
0 < b
r = Fract a b

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>r = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < b
r = Fract a b
[PROOF STEP]
have a0: "a > 0"
[PROOF STATE]
proof (prove)
using this:
0 < b
r = Fract a b

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
using Fract(1) assms(2) zero_less_Fract_iff
[PROOF STATE]
proof (prove)
using this:
0 < b
r = Fract a b
r = Fract a b
0 < r
0 < ?b \<Longrightarrow> (0 < Fract ?a ?b) = (0 < ?a)

goal (1 subgoal):
 1. 0 < a
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < a

goal (1 subgoal):
 1. \<And>a b. \<lbrakk>r = Fract a b; 0 < b; coprime a b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < a

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
proof (cases s)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa b. \<lbrakk>0 < a; s = Fract aa b; 0 < b; coprime aa b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
case (Fract c d)
[PROOF STATE]
proof (state)
this:
s = Fract c d
0 < d
coprime c d

goal (1 subgoal):
 1. \<And>aa b. \<lbrakk>0 < a; s = Fract aa b; 0 < b; coprime aa b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
assume d0: "d > 0" and sf: "s = Fract c d"
[PROOF STATE]
proof (state)
this:
0 < d
s = Fract c d

goal (1 subgoal):
 1. \<And>aa b. \<lbrakk>0 < a; s = Fract aa b; 0 < b; coprime aa b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < d
s = Fract c d
[PROOF STEP]
have c0: "c > 0"
[PROOF STATE]
proof (prove)
using this:
0 < d
s = Fract c d

goal (1 subgoal):
 1. 0 < c
[PROOF STEP]
using assms(3) zero_less_Fract_iff
[PROOF STATE]
proof (prove)
using this:
0 < d
s = Fract c d
0 < s
0 < ?b \<Longrightarrow> (0 < Fract ?a ?b) = (0 < ?a)

goal (1 subgoal):
 1. 0 < c
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < c

goal (1 subgoal):
 1. \<And>aa b. \<lbrakk>0 < a; s = Fract aa b; 0 < b; coprime aa b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < c
[PROOF STEP]
have bd0: "b * d > 0"
[PROOF STATE]
proof (prove)
using this:
0 < c

goal (1 subgoal):
 1. 0 < b * d
[PROOF STEP]
using b0 zero_less_mult_iff Fract(2)
[PROOF STATE]
proof (prove)
using this:
0 < c
0 < b
((0::?'a) < ?a * ?b) = ((0::?'a) < ?a \<and> (0::?'a) < ?b \<or> ?a < (0::?'a) \<and> ?b < (0::?'a))
0 < d

goal (1 subgoal):
 1. 0 < b * d
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < b * d

goal (1 subgoal):
 1. \<And>aa b. \<lbrakk>0 < a; s = Fract aa b; 0 < b; coprime aa b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < b * d
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < b * d

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
proof (cases "a * d > 0 \<and> c * b > 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
0 < a * d \<and> 0 < c * b

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
assume abcd: "a * d > 0 \<and> c * b > 0"
[PROOF STATE]
proof (state)
this:
0 < a * d \<and> 0 < c * b

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 < a * d \<and> 0 < c * b
[PROOF STEP]
have adcb0: "a * d + c * b > 0"
[PROOF STATE]
proof (prove)
using this:
0 < a * d \<and> 0 < c * b

goal (1 subgoal):
 1. 0 < a * d + c * b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < a * d + c * b

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
have "x ^ nat (a * d + c * b) =
                  ((x ^ (nat a)) ^ nat d) * (x ^ (nat c)) ^ nat b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x ^ nat (a * d + c * b) = (x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b
[PROOF STEP]
using abcd nat_mult_distrib nat_add_distrib
                    zero_less_Fract_iff Fract(3) a0 c0
[PROOF STATE]
proof (prove)
using this:
0 < a * d \<and> 0 < c * b
0 \<le> ?z \<Longrightarrow> nat (?z * ?z') = nat ?z * nat ?z'
\<lbrakk>0 \<le> ?z; 0 \<le> ?z'\<rbrakk> \<Longrightarrow> nat (?z + ?z') = nat ?z + nat ?z'
0 < ?b \<Longrightarrow> (0 < Fract ?a ?b) = (0 < ?a)
coprime c d
0 < a
0 < c

goal (1 subgoal):
 1. x ^ nat (a * d + c * b) = (x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b
[PROOF STEP]
by (simp add: power_mult power_add)
[PROOF STATE]
proof (state)
this:
x ^ nat (a * d + c * b) = (x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x ^ nat (a * d + c * b) = (x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b
[PROOF STEP]
have "root (nat b)
                        (root (nat d)
                           (x ^ nat (a * d + c * b))) =
                       root (nat b)
                        (root (nat d)
                          (((x ^ (nat a)) ^ nat d) * (x ^ (nat c)) ^ nat b))"
[PROOF STATE]
proof (prove)
using this:
x ^ nat (a * d + c * b) = (x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b

goal (1 subgoal):
 1. root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b))

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b))

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
have "... = root (nat b)
                              (root (nat d) ((x ^ (nat a)) ^ nat d) *
                               root (nat d) ((x ^ (nat c)) ^ nat b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root (nat b) (root (nat d) ((x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b)) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d) * root (nat d) ((x ^ nat c) ^ nat b))
[PROOF STEP]
by (simp add: Fract(2) real_root_mult)
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) ((x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b)) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d) * root (nat d) ((x ^ nat c) ^ nat b))

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) ((x ^ nat a) ^ nat d * (x ^ nat c) ^ nat b)) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d) * root (nat d) ((x ^ nat c) ^ nat b))

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
have "... = root (nat b)
                              (root (nat d) ((x ^ (nat a)) ^ nat d)) *
                             root (nat b)
                              (root (nat d) ((x ^ (nat c)) ^ nat b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root (nat b) (root (nat d) ((x ^ nat a) ^ nat d) * root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d)) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b))
[PROOF STEP]
using real_root_mult
[PROOF STATE]
proof (prove)
using this:
root ?n (?x * ?y) = root ?n ?x * root ?n ?y

goal (1 subgoal):
 1. root (nat b) (root (nat d) ((x ^ nat a) ^ nat d) * root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d)) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) ((x ^ nat a) ^ nat d) * root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d)) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b))

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) ((x ^ nat a) ^ nat d) * root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (root (nat d) ((x ^ nat a) ^ nat d)) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b))

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
have "... = root (nat b) (x ^ (nat a)) *
                             root (nat b)
                              (root (nat d) ((x ^ (nat c)) ^ nat b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root (nat b) (root (nat d) ((x ^ nat a) ^ nat d)) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (x ^ nat a) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b))
[PROOF STEP]
using real_root_power_cancel Fract(2) zero_less_nat_eq assms(1)
                    less_imp_le
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < ?n; 0 \<le> ?x\<rbrakk> \<Longrightarrow> root ?n (?x ^ ?n) = ?x
0 < d
(0 < nat ?z) = (0 < ?z)
0 < x
?x < ?y \<Longrightarrow> ?x \<le> ?y

goal (1 subgoal):
 1. root (nat b) (root (nat d) ((x ^ nat a) ^ nat d)) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (x ^ nat a) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) ((x ^ nat a) ^ nat d)) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (x ^ nat a) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b))

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) ((x ^ nat a) ^ nat d)) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (x ^ nat a) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b))

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
have "... =
                       root (nat b) (x ^ nat a) *  root (nat d) (x ^ nat c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. root (nat b) (x ^ nat a) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)
[PROOF STEP]
using  real_root_power [of "nat d"] real_root_power_cancel
                     real_root_pos_pos_le zero_less_nat_eq
                     Fract(2) zero_less_nat_eq b0 assms(1)
[PROOF STATE]
proof (prove)
using this:
0 < nat d \<Longrightarrow> root (nat d) (?x ^ ?k) = root (nat d) ?x ^ ?k
\<lbrakk>0 < ?n; 0 \<le> ?x\<rbrakk> \<Longrightarrow> root ?n (?x ^ ?n) = ?x
0 \<le> ?x \<Longrightarrow> 0 \<le> root ?n ?x
(0 < nat ?z) = (0 < ?z)
0 < d
(0 < nat ?z) = (0 < ?z)
0 < b
0 < x

goal (1 subgoal):
 1. root (nat b) (x ^ nat a) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
root (nat b) (x ^ nat a) * root (nat b) (root (nat d) ((x ^ nat c) ^ nat b)) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)
[PROOF STEP]
have "root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) =
                          root (nat b) (x ^ nat a) *  root (nat d) (x ^ nat c)"
[PROOF STATE]
proof (prove)
using this:
root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)

goal (1 subgoal):
 1. root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)
[PROOF STEP]
by assumption
[PROOF STATE]
proof (state)
this:
root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)

goal (2 subgoals):
 1. \<lbrakk>0 < b * d; 0 < a * d \<and> 0 < c * b\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
 2. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
using a0 b0 c0 d0 bd0 abcd adcb0 assms(1) sf rf
[PROOF STATE]
proof (prove)
using this:
root (nat b) (root (nat d) (x ^ nat (a * d + c * b))) = root (nat b) (x ^ nat a) * root (nat d) (x ^ nat c)
0 < a
0 < b
0 < c
0 < d
0 < b * d
0 < a * d \<and> 0 < c * b
0 < a * d + c * b
0 < x
s = Fract c d
r = Fract a b

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
by (auto simp add:  powrat_def quotient_of_Fract
                      real_root_mult_exp nat_mult_distrib
                      zero_less_Fract_iff real_root_normalize_cancel)
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s

goal (1 subgoal):
 1. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (0 < a * d \<and> 0 < c * b)

goal (1 subgoal):
 1. \<lbrakk>0 < b * d; \<not> (0 < a * d \<and> 0 < c * b)\<rbrakk> \<Longrightarrow> x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (0 < a * d \<and> 0 < c * b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (0 < a * d \<and> 0 < c * b)

goal (1 subgoal):
 1. x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s
[PROOF STEP]
by (simp add: a0 b0 c0 d0)
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> (r + s) = x pow\<^sub>\<rat> r * x pow\<^sub>\<rat> s

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diamond_y_gen_valid:
  assumes "a \<le> 0" "0 \<le> b"
  shows "diamond_y_gen piecewise_C1_differentiable_on {a..b}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. diamond_y_gen piecewise_C1_differentiable_on {a..b}
[PROOF STEP]
unfolding piecewise_C1_differentiable_on_def diamond_y_gen_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>t. 1 / 2 - \<bar>t\<bar>) \<and> (\<exists>S. finite S \<and> (\<lambda>t. 1 / 2 - \<bar>t\<bar>) C1_differentiable_on {a..b} - S)
[PROOF STEP]
proof (intro conjI exI)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. continuous_on {a..b} (\<lambda>t. 1 / 2 - \<bar>t\<bar>)
 2. finite ?S1
 3. (\<lambda>t. 1 / 2 - \<bar>t\<bar>) C1_differentiable_on {a..b} - ?S1
[PROOF STEP]
show "continuous_on {a..b} (\<lambda>t. 1 / 2 - \<bar>t\<bar>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on {a..b} (\<lambda>t. 1 / 2 - \<bar>t\<bar>)
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on {a..b} (\<lambda>t. 1 / 2 - \<bar>t\<bar>)

goal (2 subgoals):
 1. finite ?S1
 2. (\<lambda>t. 1 / 2 - \<bar>t\<bar>) C1_differentiable_on {a..b} - ?S1
[PROOF STEP]
show "finite{0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite {0::'a}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite {0::?'a1}

goal (1 subgoal):
 1. (\<lambda>t. 1 / 2 - \<bar>t\<bar>) C1_differentiable_on {a..b} - {0}
[PROOF STEP]
show "(\<lambda>t. 1 / 2 - \<bar>t\<bar>) C1_differentiable_on {a..b} - {0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>t. 1 / 2 - \<bar>t\<bar>) C1_differentiable_on {a..b} - {0}
[PROOF STEP]
by (intro derivative_intros) auto
[PROOF STATE]
proof (state)
this:
(\<lambda>t. 1 / 2 - \<bar>t\<bar>) C1_differentiable_on {a..b} - {0}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lists_UNION_nlists: "lists A = (\<Union>n. nlists A n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lists A = \<Union> (range (nlists A))
[PROOF STEP]
unfolding lists_def2 nlists_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {l. set l \<subseteq> A} = (\<Union>n. {l. set l \<subseteq> A \<and> length l = n})
[PROOF STEP]
by blast


[STATEMENT]
lemma Above_union:
  shows "x \<in> Above r (X \<union> Y) \<longleftrightarrow> x \<in> Above r X \<and> x \<in> Above r Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> Above r (X \<union> Y)) = (x \<in> Above r X \<and> x \<in> Above r Y)
[PROOF STEP]
unfolding Above_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> {b \<in> Field r. \<forall>a\<in>X \<union> Y. (a, b) \<in> r}) = (x \<in> {b \<in> Field r. \<forall>a\<in>X. (a, b) \<in> r} \<and> x \<in> {b \<in> Field r. \<forall>a\<in>Y. (a, b) \<in> r})
[PROOF STEP]
by blast


[STATEMENT]
lemma supports_finite:
  fixes S :: "'x set"
  and   x :: "'a"
  assumes a1: "S supports x"
  and     a2: "finite S"
  shows "finite ((supp x)::'x set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
have "(supp x)\<subseteq>S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp x \<subseteq> S
[PROOF STEP]
using a1 a2
[PROOF STATE]
proof (prove)
using this:
S supports x
finite S

goal (1 subgoal):
 1. supp x \<subseteq> S
[PROOF STEP]
by (rule supp_is_subset)
[PROOF STATE]
proof (state)
this:
supp x \<subseteq> S

goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
supp x \<subseteq> S

goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
using a2
[PROOF STATE]
proof (prove)
using this:
supp x \<subseteq> S
finite S

goal (1 subgoal):
 1. finite (supp x)
[PROOF STEP]
by (simp add: finite_subset)
[PROOF STATE]
proof (state)
this:
finite (supp x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma d_IN_current_of_bipartite:
  assumes f: "current (bipartite_web_of \<Gamma>) f"
  shows "d_IN (current_of_bipartite f) x = d_IN f (Inr x) - f (Inl x, Inr x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (current_of_bipartite f) x = d_IN f (Inr x) - f (Inl x, Inr x)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. d_IN (current_of_bipartite f) x = d_IN f (Inr x) - f (Inl x, Inr x)
[PROOF STEP]
have "d_IN (current_of_bipartite f) x = \<integral>\<^sup>+ y. f (y, Inr x) * indicator \<^bold>E (projl y, x) \<partial>count_space (range Inl)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. d_IN (current_of_bipartite f) x = (\<Sum>\<^sup>+ y\<in>range Inl. f (y, Inr x) * indicator \<^bold>E (projl y, x))
[PROOF STEP]
by(simp add: d_IN_def nn_integral_count_space_reindex)
[PROOF STATE]
proof (state)
this:
d_IN (current_of_bipartite f) x = (\<Sum>\<^sup>+ y\<in>range Inl. f (y, Inr x) * indicator \<^bold>E (projl y, x))

goal (1 subgoal):
 1. d_IN (current_of_bipartite f) x = d_IN f (Inr x) - f (Inl x, Inr x)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
d_IN (current_of_bipartite f) x = (\<Sum>\<^sup>+ y\<in>range Inl. f (y, Inr x) * indicator \<^bold>E (projl y, x))

goal (1 subgoal):
 1. d_IN (current_of_bipartite f) x = d_IN f (Inr x) - f (Inl x, Inr x)
[PROOF STEP]
have "\<dots> = d_IN f (Inr x) - \<integral>\<^sup>+ y. f (y, Inr x) * indicator {Inl x} y \<partial>count_space UNIV" (is "_ = _ - ?rest")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inl. f (y, Inr x) * indicator \<^bold>E (projl y, x)) = d_IN f (Inr x) - (\<integral>\<^sup>+y\<in>{Inl x}. f (y, Inr x)\<partial>count_space UNIV)
[PROOF STEP]
unfolding d_IN_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sup>+ y\<in>range Inl. f (y, Inr x) * indicator \<^bold>E (projl y, x)) = (\<Sum>\<^sup>+ xa. f (xa, Inr x)) - (\<integral>\<^sup>+y\<in>{Inl x}. f (y, Inr x)\<partial>count_space UNIV)
[PROOF STEP]
by(subst nn_integral_diff[symmetric])(auto 4 4 simp add: current_bipartite_web_finite[OF f] AE_count_space nn_integral_count_space_indicator no_loop split: split_indicator intro!: nn_integral_cong intro: currentD_outside[OF f] elim: edge_bipartite_webE)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sup>+ y\<in>range Inl. f (y, Inr x) * indicator \<^bold>E (projl y, x)) = d_IN f (Inr x) - (\<integral>\<^sup>+y\<in>{Inl x}. f (y, Inr x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. d_IN (current_of_bipartite f) x = d_IN f (Inr x) - f (Inl x, Inr x)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
d_IN (current_of_bipartite f) x = d_IN f (Inr x) - (\<integral>\<^sup>+y\<in>{Inl x}. f (y, Inr x)\<partial>count_space UNIV)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
d_IN (current_of_bipartite f) x = d_IN f (Inr x) - (\<integral>\<^sup>+y\<in>{Inl x}. f (y, Inr x)\<partial>count_space UNIV)

goal (1 subgoal):
 1. d_IN (current_of_bipartite f) x = d_IN f (Inr x) - f (Inl x, Inr x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
d_IN (current_of_bipartite f) x = d_IN f (Inr x) - f (Inl x, Inr x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem wls_fresh_psubst:
assumes "wls s X" and "wlsEnv rho"
shows
"fresh zs z (X #[rho]) =
 (\<forall> ys y. fresh ys y X \<or> freshImEnvAt zs z rho ys y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fresh zs z X #[rho] = (\<forall>ys y. fresh ys y X \<or> freshImEnvAt zs z rho ys y)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
wls s X
wlsEnv rho

goal (1 subgoal):
 1. fresh zs z X #[rho] = (\<forall>ys y. fresh ys y X \<or> freshImEnvAt zs z rho ys y)
[PROOF STEP]
by(simp add: fresh_psubst)


[STATEMENT]
lemma mult_mono: "a \<le> b \<Longrightarrow> c \<le> d \<Longrightarrow> a * c \<le> b * d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; c \<le> d\<rbrakk> \<Longrightarrow> a * c \<le> b * d
[PROOF STEP]
apply (rule_tac y = "a * d" in order_trans)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>a \<le> b; c \<le> d\<rbrakk> \<Longrightarrow> a * c \<le> a * d
 2. \<lbrakk>a \<le> b; c \<le> d\<rbrakk> \<Longrightarrow> a * d \<le> b * d
[PROOF STEP]
by (simp_all add: mult_right_mono mult_left_mono)


[STATEMENT]
lemma ofsm_table_partition_finite :
  assumes "equivalence_relation_on_states M f"
shows "finite (ofsm_table M f k ` states M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (ofsm_table M f k ` FSM.states M)
[PROOF STEP]
using ofsm_table_states[of M f, OF equivalence_relation_on_states_ran[OF assms]]
        fsm_states_finite[of M]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q. q \<in> FSM.states M \<Longrightarrow> q \<in> FSM.states M; ?q \<in> FSM.states M\<rbrakk> \<Longrightarrow> ofsm_table M f ?k ?q \<subseteq> FSM.states M
finite (FSM.states M)

goal (1 subgoal):
 1. finite (ofsm_table M f k ` FSM.states M)
[PROOF STEP]
unfolding finite_Pow_iff[of "states M", symmetric]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<And>q. q \<in> FSM.states M \<Longrightarrow> q \<in> FSM.states M; ?q \<in> FSM.states M\<rbrakk> \<Longrightarrow> ofsm_table M f ?k ?q \<subseteq> FSM.states M
finite (Pow (FSM.states M))

goal (1 subgoal):
 1. finite (ofsm_table M f k ` FSM.states M)
[PROOF STEP]
by simp


[STATEMENT]
lemma is_regular_sequence_remdups:
  assumes "is_regular_sequence fs"
  shows "is_regular_sequence (rev (remdups (rev fs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_regular_sequence fs

goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
proof (induct fs rule: rev_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_regular_sequence [] \<Longrightarrow> is_regular_sequence (rev (remdups (rev [])))
 2. \<And>x xs. \<lbrakk>is_regular_sequence xs \<Longrightarrow> is_regular_sequence (rev (remdups (rev xs))); is_regular_sequence (xs @ [x])\<rbrakk> \<Longrightarrow> is_regular_sequence (rev (remdups (rev (xs @ [x]))))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
is_regular_sequence []

goal (2 subgoals):
 1. is_regular_sequence [] \<Longrightarrow> is_regular_sequence (rev (remdups (rev [])))
 2. \<And>x xs. \<lbrakk>is_regular_sequence xs \<Longrightarrow> is_regular_sequence (rev (remdups (rev xs))); is_regular_sequence (xs @ [x])\<rbrakk> \<Longrightarrow> is_regular_sequence (rev (remdups (rev (xs @ [x]))))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev [])))
[PROOF STEP]
by (simp add: is_regular_sequence_Nil)
[PROOF STATE]
proof (state)
this:
is_regular_sequence (rev (remdups (rev [])))

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>is_regular_sequence xs \<Longrightarrow> is_regular_sequence (rev (remdups (rev xs))); is_regular_sequence (xs @ [x])\<rbrakk> \<Longrightarrow> is_regular_sequence (rev (remdups (rev (xs @ [x]))))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>is_regular_sequence xs \<Longrightarrow> is_regular_sequence (rev (remdups (rev xs))); is_regular_sequence (xs @ [x])\<rbrakk> \<Longrightarrow> is_regular_sequence (rev (remdups (rev (xs @ [x]))))
[PROOF STEP]
case (snoc f fs)
[PROOF STATE]
proof (state)
this:
is_regular_sequence fs \<Longrightarrow> is_regular_sequence (rev (remdups (rev fs)))
is_regular_sequence (fs @ [f])

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>is_regular_sequence xs \<Longrightarrow> is_regular_sequence (rev (remdups (rev xs))); is_regular_sequence (xs @ [x])\<rbrakk> \<Longrightarrow> is_regular_sequence (rev (remdups (rev (xs @ [x]))))
[PROOF STEP]
from snoc(2)
[PROOF STATE]
proof (chain)
picking this:
is_regular_sequence (fs @ [f])
[PROOF STEP]
have *: "is_regular_sequence fs"
[PROOF STATE]
proof (prove)
using this:
is_regular_sequence (fs @ [f])

goal (1 subgoal):
 1. is_regular_sequence fs
[PROOF STEP]
by (rule is_regular_sequence_snocD)
[PROOF STATE]
proof (state)
this:
is_regular_sequence fs

goal (1 subgoal):
 1. \<And>x xs. \<lbrakk>is_regular_sequence xs \<Longrightarrow> is_regular_sequence (rev (remdups (rev xs))); is_regular_sequence (xs @ [x])\<rbrakk> \<Longrightarrow> is_regular_sequence (rev (remdups (rev (xs @ [x]))))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev (fs @ [f]))))
[PROOF STEP]
proof (simp, intro conjI impI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f \<in> set fs \<Longrightarrow> is_regular_sequence (rev (remdups (rev fs)))
 2. f \<notin> set fs \<Longrightarrow> is_regular_sequence (rev (remdups (rev fs)) @ [f])
[PROOF STEP]
show "is_regular_sequence (rev (remdups (rev fs)) @ [f])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev fs)) @ [f])
[PROOF STEP]
proof (rule is_regular_sequence_snocI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q. q * f \<in> ideal (set (rev (remdups (rev fs)))) \<Longrightarrow> q \<in> ideal (set (rev (remdups (rev fs))))
 2. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
fix q
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q. q * f \<in> ideal (set (rev (remdups (rev fs)))) \<Longrightarrow> q \<in> ideal (set (rev (remdups (rev fs))))
 2. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
assume "q * f \<in> ideal (set (rev (remdups (rev fs))))"
[PROOF STATE]
proof (state)
this:
q * f \<in> ideal (set (rev (remdups (rev fs))))

goal (2 subgoals):
 1. \<And>q. q * f \<in> ideal (set (rev (remdups (rev fs)))) \<Longrightarrow> q \<in> ideal (set (rev (remdups (rev fs))))
 2. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
hence "q * f \<in> ideal (set fs)"
[PROOF STATE]
proof (prove)
using this:
q * f \<in> ideal (set (rev (remdups (rev fs))))

goal (1 subgoal):
 1. q * f \<in> ideal (set fs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q * f \<in> ideal (set fs)

goal (2 subgoals):
 1. \<And>q. q * f \<in> ideal (set (rev (remdups (rev fs)))) \<Longrightarrow> q \<in> ideal (set (rev (remdups (rev fs))))
 2. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
with snoc(2)
[PROOF STATE]
proof (chain)
picking this:
is_regular_sequence (fs @ [f])
q * f \<in> ideal (set fs)
[PROOF STEP]
have "q \<in> ideal (set fs)"
[PROOF STATE]
proof (prove)
using this:
is_regular_sequence (fs @ [f])
q * f \<in> ideal (set fs)

goal (1 subgoal):
 1. q \<in> ideal (set fs)
[PROOF STEP]
by (rule is_regular_sequence_snocD)
[PROOF STATE]
proof (state)
this:
q \<in> ideal (set fs)

goal (2 subgoals):
 1. \<And>q. q * f \<in> ideal (set (rev (remdups (rev fs)))) \<Longrightarrow> q \<in> ideal (set (rev (remdups (rev fs))))
 2. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
thus "q \<in> ideal (set (rev (remdups (rev fs))))"
[PROOF STATE]
proof (prove)
using this:
q \<in> ideal (set fs)

goal (1 subgoal):
 1. q \<in> ideal (set (rev (remdups (rev fs))))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
q \<in> ideal (set (rev (remdups (rev fs))))

goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
is_regular_sequence fs
[PROOF STEP]
show "is_regular_sequence (rev (remdups (rev fs)))"
[PROOF STATE]
proof (prove)
using this:
is_regular_sequence fs

goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
by (rule snoc.hyps)
[PROOF STATE]
proof (state)
this:
is_regular_sequence (rev (remdups (rev fs)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_regular_sequence (rev (remdups (rev fs)) @ [f])

goal (1 subgoal):
 1. f \<in> set fs \<Longrightarrow> is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<in> set fs \<Longrightarrow> is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
from *
[PROOF STATE]
proof (chain)
picking this:
is_regular_sequence fs
[PROOF STEP]
show "is_regular_sequence (rev (remdups (rev fs)))"
[PROOF STATE]
proof (prove)
using this:
is_regular_sequence fs

goal (1 subgoal):
 1. is_regular_sequence (rev (remdups (rev fs)))
[PROOF STEP]
by (rule snoc.hyps)
[PROOF STATE]
proof (state)
this:
is_regular_sequence (rev (remdups (rev fs)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
is_regular_sequence (rev (remdups (rev (fs @ [f]))))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rroots4: assumes deg: "degree p = 4"
  shows "set (rroots4 p) = { x. poly p x = 0}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (rroots4 p) = {x. poly p x = 0}
[PROOF STEP]
unfolding rroots4_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (roots4_generic solve_depressed_quartic_real p) = {x. poly p x = 0}
[PROOF STEP]
by (rule roots4_generic[OF deg solve_depressed_quartic_real])


[STATEMENT]
lemma vcard_vintersection_right: "vcard (A \<inter>\<^sub>\<circ> B) \<le> vcard B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vcard (A \<inter>\<^sub>\<circ> B) \<subseteq>\<^sub>\<circ> vcard B
[PROOF STEP]
by (simp add: vcard_mono)


[STATEMENT]
lemma eventually_at: "eventually P (at a within S) \<longleftrightarrow> (\<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<and> dist x a < d \<longrightarrow> P x)"
  for a :: "'a :: metric_space"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eventually P (at a within S) = (\<exists>d>0. \<forall>x\<in>S. x \<noteq> a \<and> dist x a < d \<longrightarrow> P x)
[PROOF STEP]
by (auto simp: eventually_at_filter eventually_nhds_metric)


[STATEMENT]
lemma isCont_bounded:
  fixes f :: "real \<Rightarrow> 'a::linorder_topology"
  shows "a \<le> b \<Longrightarrow> \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x \<Longrightarrow> \<exists>M. \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M
[PROOF STEP]
using isCont_eq_Ub[of a b f]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. (\<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M) \<and> (\<exists>x\<ge>a. x \<le> b \<and> f x = M)

goal (1 subgoal):
 1. \<lbrakk>a \<le> b; \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> isCont f x\<rbrakk> \<Longrightarrow> \<exists>M. \<forall>x. a \<le> x \<and> x \<le> b \<longrightarrow> f x \<le> M
[PROOF STEP]
by auto


[STATEMENT]
lemma "0 < x \<Longrightarrow> x \<le> y \<Longrightarrow> arctan y / y \<le> arctan x / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x \<le> y\<rbrakk> \<Longrightarrow> arctan y / y \<le> arctan x / x
[PROOF STEP]
using [[quickcheck_approximation_custom_seed = 1]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x \<le> y\<rbrakk> \<Longrightarrow> arctan y / y \<le> arctan x / x
[PROOF STEP]
quickcheck[approximation, expect=no_counterexample]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < x; x \<le> y\<rbrakk> \<Longrightarrow> arctan y / y \<le> arctan x / x
[PROOF STEP]
by (rule arctan_divide_mono)


[STATEMENT]
lemma set_sel_aux'_reasonable_fin:
  "\<lbrakk>finite x; sel_reasonable f\<rbrakk> \<Longrightarrow> set_sel_aux' f x y \<le> 1 \<and> set_sel_aux' f x y > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite x; sel_reasonable f\<rbrakk> \<Longrightarrow> set_sel_aux' f x y \<le> 1 \<and> 0 < set_sel_aux' f x y
[PROOF STEP]
unfolding set_sel_aux'_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite x; sel_reasonable f\<rbrakk> \<Longrightarrow> (\<Prod>x\<in>x. f x y) \<le> 1 \<and> 0 < (\<Prod>x\<in>x. f x y)
[PROOF STEP]
by(induction x rule: finite_induct) (auto simp: sel_reasonable_def mult_le_one)


[STATEMENT]
lemma floor_diff_of_int [simp]: "\<lfloor>x - of_int z\<rfloor> = \<lfloor>x\<rfloor> - z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lfloor>x - of_int z\<rfloor> = \<lfloor>x\<rfloor> - z
[PROOF STEP]
using floor_add_int [of x "- z"]
[PROOF STATE]
proof (prove)
using this:
\<lfloor>x\<rfloor> + - z = \<lfloor>x + of_int (- z)\<rfloor>

goal (1 subgoal):
 1. \<lfloor>x - of_int z\<rfloor> = \<lfloor>x\<rfloor> - z
[PROOF STEP]
by (simp add: algebra_simps)


[STATEMENT]
lemma continuous_dist[continuous_intros]:
  fixes f g :: "_ \<Rightarrow> 'a :: metric_space"
  shows "continuous F f \<Longrightarrow> continuous F g \<Longrightarrow> continuous F (\<lambda>x. dist (f x) (g x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. dist (f x) (g x))
[PROOF STEP]
unfolding continuous_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f \<longlongrightarrow> f (Lim F (\<lambda>x. x))) F; (g \<longlongrightarrow> g (Lim F (\<lambda>x. x))) F\<rbrakk> \<Longrightarrow> ((\<lambda>x. dist (f x) (g x)) \<longlongrightarrow> dist (f (Lim F (\<lambda>x. x))) (g (Lim F (\<lambda>x. x)))) F
[PROOF STEP]
by (rule tendsto_dist)


[STATEMENT]
lemma (in deutsch) prob0_deutsch_algo_balanced:
  assumes "is_balanced"
  shows "prob0 2 deutsch_algo 0 = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob0 2 deutsch_algo 0 = 0
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob0 2 deutsch_algo 0 = 0
[PROOF STEP]
have "{k| k::nat. (k < 4) \<and> \<not> select_index 2 0 k} = {0,1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {k |k. k < 4 \<and> \<not> select_index 2 0 k} = {0, 1}
[PROOF STEP]
using select_index_def
[PROOF STATE]
proof (prove)
using this:
select_index ?n ?i ?j \<equiv> ?i \<le> ?n - 1 \<and> ?j \<le> 2 ^ ?n - 1 \<and> 2 ^ (?n - 1 - ?i) \<le> ?j mod 2 ^ (?n - ?i)

goal (1 subgoal):
 1. {k |k. k < 4 \<and> \<not> select_index 2 0 k} = {0, 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{k |k. k < 4 \<and> \<not> select_index 2 0 k} = {0, 1}

goal (1 subgoal):
 1. prob0 2 deutsch_algo 0 = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{k |k. k < 4 \<and> \<not> select_index 2 0 k} = {0, 1}
[PROOF STEP]
have "prob0 2 deutsch_algo 0 = (\<Sum>j \<in> {0,1}. (cmod(deutsch_algo $$ (j,0)))\<^sup>2)"
[PROOF STATE]
proof (prove)
using this:
{k |k. k < 4 \<and> \<not> select_index 2 0 k} = {0, 1}

goal (1 subgoal):
 1. prob0 2 deutsch_algo 0 = (\<Sum>j\<in>{0, 1}. (cmod (deutsch_algo $$ (j, 0)))\<^sup>2)
[PROOF STEP]
using deutsch_algo_result_is_state prob0_def
[PROOF STATE]
proof (prove)
using this:
{k |k. k < 4 \<and> \<not> select_index 2 0 k} = {0, 1}
state 2 deutsch_algo
prob0 ?n ?v ?i \<equiv> \<Sum>j\<in>{k |k. k < 2 ^ ?n \<and> \<not> select_index ?n ?i k}. (cmod (?v $$ (j, 0)))\<^sup>2

goal (1 subgoal):
 1. prob0 2 deutsch_algo 0 = (\<Sum>j\<in>{0, 1}. (cmod (deutsch_algo $$ (j, 0)))\<^sup>2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
prob0 2 deutsch_algo 0 = (\<Sum>j\<in>{0, 1}. (cmod (deutsch_algo $$ (j, 0)))\<^sup>2)

goal (1 subgoal):
 1. prob0 2 deutsch_algo 0 = 0
[PROOF STEP]
thus "prob0 2 deutsch_algo 0 = 0"
[PROOF STATE]
proof (prove)
using this:
prob0 2 deutsch_algo 0 = (\<Sum>j\<in>{0, 1}. (cmod (deutsch_algo $$ (j, 0)))\<^sup>2)

goal (1 subgoal):
 1. prob0 2 deutsch_algo 0 = 0
[PROOF STEP]
using is_swap_values assms is_balanced_def
[PROOF STATE]
proof (prove)
using this:
prob0 2 deutsch_algo 0 = (\<Sum>j\<in>{0, 1}. (cmod (deutsch_algo $$ (j, 0)))\<^sup>2)
is_swap \<Longrightarrow> f 0 = 1
is_swap \<Longrightarrow> f 1 = 0
is_balanced
is_balanced \<equiv> (\<forall>x\<in>{0, 1}. f x = x) \<or> is_swap

goal (1 subgoal):
 1. prob0 2 deutsch_algo 0 = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
prob0 2 deutsch_algo 0 = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma N_trans_index_val: "i < dim_col N \<Longrightarrow> j < dim_row N \<Longrightarrow>
    N\<^sup>T $$ (i, j) = (if (\<V>s ! j) \<in> (\<B>s ! i) then 1 else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < dim_col N; j < dim_row N\<rbrakk> \<Longrightarrow> N\<^sup>T $$ (i, j) = (if \<V>s ! j \<in> \<B>s ! i then 1 else 0)
[PROOF STEP]
by (simp add: inc_mat_of_def)


[STATEMENT]
lemma zero_less_iff_neq_zero_hmset: "0 < M \<longleftrightarrow> M \<noteq> 0" for M :: hmultiset
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0 < M) = (M \<noteq> 0)
[PROOF STEP]
using not_gr_zero_hmset
[PROOF STATE]
proof (prove)
using this:
(\<not> 0 < ?M) = (?M = 0)

goal (1 subgoal):
 1. (0 < M) = (M \<noteq> 0)
[PROOF STEP]
by blast


[STATEMENT]
lemma Limsup_eq:
  assumes "eventually (\<lambda>x. f x = g x) net"
  shows "Limsup net f = Limsup net g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Limsup net f = Limsup net g
[PROOF STEP]
by (intro antisym Limsup_mono eventually_mono[OF assms]) auto


[STATEMENT]
lemma (in abelian_subgroup) a_cosets_finite:
     "\<lbrakk>c \<in> a_rcosets H;  H \<subseteq> carrier G;  finite (carrier G)\<rbrakk> \<Longrightarrow> finite c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>c \<in> a_rcosets H; H \<subseteq> carrier G; finite (carrier G)\<rbrakk> \<Longrightarrow> finite c
[PROOF STEP]
by (rule group.cosets_finite [OF a_group,
    folded A_RCOSETS_def, simplified monoid_record_simps])


[STATEMENT]
lemma alignUp_def3:
  "alignUp a sz = 2^ sz + (a - 1 AND NOT (mask sz))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. alignUp a sz = 2 ^ sz + (a - 1 AND NOT (mask sz))
[PROOF STEP]
by (simp add: alignUp_def2 is_aligned_triv field_simps mask_out_add_aligned)


[STATEMENT]
lemma card2_eE: "finite S \<Longrightarrow> \<exists>x y. x \<noteq> y \<and> x \<in> S \<and> y \<in> S \<Longrightarrow> 2 \<le> card S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; \<exists>x y. x \<noteq> y \<and> x \<in> S \<and> y \<in> S\<rbrakk> \<Longrightarrow> 2 \<le> card S
[PROOF STEP]
using card1_eE card_Suc_eq card_insert_if
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite ?S; \<exists>y. y \<in> ?S\<rbrakk> \<Longrightarrow> 1 \<le> card ?S
(card ?A = Suc ?k) = (\<exists>b B. ?A = insert b B \<and> b \<notin> B \<and> card B = ?k \<and> (?k = 0 \<longrightarrow> B = {}))
finite ?A \<Longrightarrow> card (insert ?x ?A) = (if ?x \<in> ?A then card ?A else Suc (card ?A))

goal (1 subgoal):
 1. \<lbrakk>finite S; \<exists>x y. x \<noteq> y \<and> x \<in> S \<and> y \<in> S\<rbrakk> \<Longrightarrow> 2 \<le> card S
[PROOF STEP]
by fastforce


[STATEMENT]
lemma lset_ltake_Suc:
  assumes "\<not>lnull xs" "lnth xs 0 = x" "lset (ltake (enat n) (ltl xs)) \<subseteq> A"
  shows "lset (ltake (enat (Suc n)) xs) \<subseteq> insert x A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lset (ltake (enat (Suc n)) xs) \<subseteq> insert x A
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. lset (ltake (enat (Suc n)) xs) \<subseteq> insert x A
[PROOF STEP]
have "lset (ltake (eSuc (enat n)) (LCons x (ltl xs))) \<subseteq> insert x A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lset (ltake (eSuc (enat n)) (LCons x (ltl xs))) \<subseteq> insert x A
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
lset (ltake (enat n) (ltl xs)) \<subseteq> A

goal (1 subgoal):
 1. lset (ltake (eSuc (enat n)) (LCons x (ltl xs))) \<subseteq> insert x A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
lset (ltake (eSuc (enat n)) (LCons x (ltl xs))) \<subseteq> insert x A

goal (1 subgoal):
 1. lset (ltake (enat (Suc n)) xs) \<subseteq> insert x A
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
lset (ltake (eSuc (enat n)) (LCons x (ltl xs))) \<subseteq> insert x A

goal (1 subgoal):
 1. lset (ltake (enat (Suc n)) xs) \<subseteq> insert x A
[PROOF STEP]
from assms(1,2)
[PROOF STATE]
proof (chain)
picking this:
\<not> lnull xs
lnth xs 0 = x
[PROOF STEP]
have "LCons x (ltl xs) = xs"
[PROOF STATE]
proof (prove)
using this:
\<not> lnull xs
lnth xs 0 = x

goal (1 subgoal):
 1. LCons x (ltl xs) = xs
[PROOF STEP]
by (metis lnth_0 ltl_simps(2) not_lnull_conv)
[PROOF STATE]
proof (state)
this:
LCons x (ltl xs) = xs

goal (1 subgoal):
 1. lset (ltake (enat (Suc n)) xs) \<subseteq> insert x A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
lset (ltake (eSuc (enat n)) (LCons x (ltl xs))) \<subseteq> insert x A
LCons x (ltl xs) = xs
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
lset (ltake (eSuc (enat n)) (LCons x (ltl xs))) \<subseteq> insert x A
LCons x (ltl xs) = xs

goal (1 subgoal):
 1. lset (ltake (enat (Suc n)) xs) \<subseteq> insert x A
[PROOF STEP]
by (simp add: eSuc_enat)
[PROOF STATE]
proof (state)
this:
lset (ltake (enat (Suc n)) xs) \<subseteq> insert x A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma ccSup_subset_mono: "countable B \<Longrightarrow> A \<subseteq> B \<Longrightarrow> Sup A \<le> Sup B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>countable B; A \<subseteq> B\<rbrakk> \<Longrightarrow> Sup A \<le> Sup B
[PROOF STEP]
by (auto intro: ccSup_least ccSup_upper countable_subset)


[STATEMENT]
lemma mem_sphere_0 [simp]: "x \<in> sphere 0 e \<longleftrightarrow> norm x = e"
  for x :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x \<in> sphere (0::'a) e) = (norm x = e)
[PROOF STEP]
by simp


[STATEMENT]
lemma eventually_imp_conv_disj: "(\<diamond>(P \<^bold>\<longrightarrow> Q)) = (\<diamond>(\<^bold>\<not>P) \<^bold>\<or> \<diamond>Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<diamond>(\<lambda>s. P s \<longrightarrow> Q s) = (\<lambda>s. (\<diamond>(\<lambda>s. \<not> P s)) s \<or> (\<diamond>Q) s)
[PROOF STEP]
unfolding defs
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>\<sigma>. \<exists>i. (P (\<sigma> |\<^sub>s i) \<longrightarrow> Q (\<sigma> |\<^sub>s i)) \<and> (\<forall>k<i. True)) = (\<lambda>s. (\<exists>i. \<not> P (s |\<^sub>s i) \<and> (\<forall>k<i. True)) \<or> (\<exists>i. Q (s |\<^sub>s i) \<and> (\<forall>k<i. True)))
[PROOF STEP]
by auto


[STATEMENT]
lemma less_b_least_impl_zero2: "\<lbrakk>y < x; b_least f x = x\<rbrakk> \<Longrightarrow> f x y = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>y < x; b_least f x = x\<rbrakk> \<Longrightarrow> f x y = 0
[PROOF STEP]
by (simp add: less_b_least_impl_zero)


[STATEMENT]
lemma dist_0_norm [simp]: "dist 0 x = norm x"
  for x :: "'a::real_normed_vector"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dist (0::'a) x = norm x
[PROOF STEP]
by (simp add: dist_norm)


[STATEMENT]
lemma digit_gen_sum_index_variant:
  assumes "b>1" shows "r>n \<Longrightarrow>
  (\<Sum>k< n.((nth_digit n k b )*b^k)) = (\<Sum>k< r.(nth_digit n k b)*b^k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < r \<Longrightarrow> (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. n < r \<Longrightarrow> (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
assume "r>n"
[PROOF STATE]
proof (state)
this:
n < r

goal (1 subgoal):
 1. n < r \<Longrightarrow> (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
have "b^r > r" for r
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. r < b ^ r
[PROOF STEP]
using \<open>b>1\<close>
[PROOF STATE]
proof (prove)
using this:
1 < b

goal (1 subgoal):
 1. r < b ^ r
[PROOF STEP]
by (induction r, auto simp add: less_trans_Suc)
[PROOF STATE]
proof (state)
this:
?r < b ^ ?r

goal (1 subgoal):
 1. n < r \<Longrightarrow> (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
hence powb: "\<forall>r.(r>n \<longrightarrow> b^r>n)"
[PROOF STATE]
proof (prove)
using this:
?r < b ^ ?r

goal (1 subgoal):
 1. \<forall>r>n. n < b ^ r
[PROOF STEP]
using less_trans
[PROOF STATE]
proof (prove)
using this:
?r < b ^ ?r
\<lbrakk>?x < ?y; ?y < ?z\<rbrakk> \<Longrightarrow> ?x < ?z

goal (1 subgoal):
 1. \<forall>r>n. n < b ^ r
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>r>n. n < b ^ r

goal (1 subgoal):
 1. n < r \<Longrightarrow> (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
hence "r > n \<longrightarrow> (nth_digit n r b = 0)" for r
[PROOF STATE]
proof (prove)
using this:
\<forall>r>n. n < b ^ r

goal (1 subgoal):
 1. n < r \<longrightarrow> nth_digit n r b = 0
[PROOF STEP]
by (auto simp add: nth_digit_def)
[PROOF STATE]
proof (state)
this:
n < ?r \<longrightarrow> nth_digit n ?r b = 0

goal (1 subgoal):
 1. n < r \<Longrightarrow> (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
hence "r > n \<longrightarrow> (nth_digit n r b) * b^r = 0" for r
[PROOF STATE]
proof (prove)
using this:
n < ?r \<longrightarrow> nth_digit n ?r b = 0

goal (1 subgoal):
 1. n < r \<longrightarrow> nth_digit n r b * b ^ r = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
n < ?r \<longrightarrow> nth_digit n ?r b * b ^ ?r = 0

goal (1 subgoal):
 1. n < r \<Longrightarrow> (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
n < ?r \<longrightarrow> nth_digit n ?r b * b ^ ?r = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
n < ?r \<longrightarrow> nth_digit n ?r b * b ^ ?r = 0

goal (1 subgoal):
 1. (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
using digit_gen_sum_repr digit_gen_sum_repr_variant powb \<open>n < r\<close> assms
[PROOF STATE]
proof (prove)
using this:
n < ?r \<longrightarrow> nth_digit n ?r b * b ^ ?r = 0
\<lbrakk>?n < ?b ^ ?c; 1 < ?b\<rbrakk> \<Longrightarrow> ?n = (\<Sum>k<?c. nth_digit ?n k ?b * ?b ^ k)
1 < ?b \<Longrightarrow> ?n = (\<Sum>k<?n. nth_digit ?n k ?b * ?b ^ k)
\<forall>r>n. n < b ^ r
n < r
1 < b

goal (1 subgoal):
 1. (\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>k<n. nth_digit n k b * b ^ k) = (\<Sum>k<r. nth_digit n k b * b ^ k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma wf_set_finite:
  assumes "wf_set n A"
  shows "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite A
[PROOF STEP]
using assms finite_nat_set_iff_bounded wf_set_def
[PROOF STATE]
proof (prove)
using this:
wf_set n A
finite ?N = (\<exists>m. \<forall>n\<in>?N. n < m)
wf_set ?n ?V = (\<forall>x\<in>?V. x < ?n)

goal (1 subgoal):
 1. finite A
[PROOF STEP]
by auto


[STATEMENT]
lemma hunion_less_iff [simp]: "\<lbrakk>Ord i; Ord j\<rbrakk> \<Longrightarrow> i \<squnion> j < k \<longleftrightarrow> i<k \<and> j<k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Ord i; Ord j\<rbrakk> \<Longrightarrow> (i \<squnion> j < k) = (i < k \<and> j < k)
[PROOF STEP]
by (metis Ord_linear_le le_iff_sup sup.order_iff sup.strict_boundedE)


[STATEMENT]
lemma landau_real_nat:
  fixes f :: "'a \<Rightarrow> int"
  assumes "(\<lambda>x. of_int (f x)) \<in> O[F](g)"
  shows "(\<lambda>x. real (nat (f x))) \<in> O[F](g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. real (nat (f x))) \<in> O[F](g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. real (nat (f x))) \<in> O[F](g)
[PROOF STEP]
obtain c where a: "c > 0" and b: "eventually (\<lambda>x. abs (of_int (f x)) \<le> c * abs (g x)) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. \<bar>real_of_int (f x)\<bar> \<le> c * \<bar>g x\<bar>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. real_of_int (f x)) \<in> O[F](g)

goal (1 subgoal):
 1. (\<And>c. \<lbrakk>0 < c; \<forall>\<^sub>F x in F. \<bar>real_of_int (f x)\<bar> \<le> c * \<bar>g x\<bar>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (simp add:bigo_def, blast)
[PROOF STATE]
proof (state)
this:
0 < c
\<forall>\<^sub>F x in F. \<bar>real_of_int (f x)\<bar> \<le> c * \<bar>g x\<bar>

goal (1 subgoal):
 1. (\<lambda>x. real (nat (f x))) \<in> O[F](g)
[PROOF STEP]
have "\<forall>\<^sub>F x in F. real (nat (f x)) \<le> c * \<bar>g x\<bar>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. real (nat (f x)) \<le> c * \<bar>g x\<bar>
[PROOF STEP]
by (rule eventually_mono[OF b],  simp)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in F. real (nat (f x)) \<le> c * \<bar>g x\<bar>

goal (1 subgoal):
 1. (\<lambda>x. real (nat (f x))) \<in> O[F](g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. real (nat (f x)) \<le> c * \<bar>g x\<bar>

goal (1 subgoal):
 1. (\<lambda>x. real (nat (f x))) \<in> O[F](g)
[PROOF STEP]
using a
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in F. real (nat (f x)) \<le> c * \<bar>g x\<bar>
0 < c

goal (1 subgoal):
 1. (\<lambda>x. real (nat (f x))) \<in> O[F](g)
[PROOF STEP]
by (auto simp:bigo_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. real (nat (f x))) \<in> O[F](g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma powr_nat:
  fixes n::nat and z::complex shows "z powr n = (if z = 0 then 0 else z^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z powr of_nat n = (if z = 0 then 0 else z ^ n)
[PROOF STEP]
by (simp add: exp_of_nat_mult powr_def)


[STATEMENT]
lemma icard_cartesian_product_singleton_right: "icard (A \<times> {x}) = icard A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. icard (A \<times> {x}) = icard A
[PROOF STEP]
by (simp add: icard_cartesian_product mult_eSuc_right)


[STATEMENT]
lemma inner_diff_right: "inner x (y - z) = inner x y - inner x z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x (y - z) = inner x y - inner x z
[PROOF STEP]
using inner_diff_left [of y z x]
[PROOF STATE]
proof (prove)
using this:
inner (y - z) x = inner y x - inner z x

goal (1 subgoal):
 1. inner x (y - z) = inner x y - inner x z
[PROOF STEP]
by (simp only: inner_commute)


[STATEMENT]
lemma Z_I_carrier:
  shows "Z_I \<in> carrier_mat 4 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Z_I \<in> carrier_mat 4 4
[PROOF STEP]
using tensor_mat_carrier Z_carrier
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
Z \<in> carrier_mat 2 2

goal (1 subgoal):
 1. Z_I \<in> carrier_mat 4 4
[PROOF STEP]
unfolding Z_I_def
[PROOF STATE]
proof (prove)
using this:
?U \<Otimes> ?V \<in> carrier_mat (dim_row ?U * dim_row ?V) (dim_col ?U * dim_col ?V)
Z \<in> carrier_mat 2 2

goal (1 subgoal):
 1. Z \<Otimes> 1\<^sub>m 2 \<in> carrier_mat 4 4
[PROOF STEP]
by auto


[STATEMENT]
lemma measure_le_0_iff: "measure M X \<le> 0 \<longleftrightarrow> measure M X = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Sigma_Algebra.measure M X \<le> 0) = (Sigma_Algebra.measure M X = 0)
[PROOF STEP]
using measure_nonneg[of M X]
[PROOF STATE]
proof (prove)
using this:
0 \<le> Sigma_Algebra.measure M X

goal (1 subgoal):
 1. (Sigma_Algebra.measure M X \<le> 0) = (Sigma_Algebra.measure M X = 0)
[PROOF STEP]
by linarith


[STATEMENT]
lemma cnj_divide [simp]: "cnj (x / y) = inverse (cnj y) * cnj x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Quaternions.cnj (x / y) = inverse (Quaternions.cnj y) * Quaternions.cnj x
[PROOF STEP]
by (simp add: divide_quat_def)


[STATEMENT]
lemma arity_sym_ne_infinity_if_\<delta>_gt_0: "\<delta> > 0 \<Longrightarrow> arity_sym f \<noteq> \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 < \<delta> \<Longrightarrow> arity_sym f \<noteq> \<infinity>
[PROOF STEP]
by (metis arity_hd.simps(2) arity_hd_ne_infinity_if_\<delta>_gt_0)


[STATEMENT]
lemma aeq: "(\<Sum>i<n. T (f i) (state f i)) = (\<Sum>i<n. A f i) - \<Phi>(state f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i<n. T (f i) (state f i)) = sum (A f) {..<n} - \<Phi> (state f n)
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. (\<Sum>i<0. T (f i) (state f i)) = sum (A f) {..<0} - \<Phi> (state f 0)
 2. \<And>n. (\<Sum>i<n. T (f i) (state f i)) = sum (A f) {..<n} - \<Phi> (state f n) \<Longrightarrow> (\<Sum>i<Suc n. T (f i) (state f i)) = sum (A f) {..<Suc n} - \<Phi> (state f (Suc n))
[PROOF STEP]
apply (simp add: p0)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (\<Sum>i<n. T (f i) (state f i)) = sum (A f) {..<n} - \<Phi> (state f n) \<Longrightarrow> (\<Sum>i<Suc n. T (f i) (state f i)) = sum (A f) {..<Suc n} - \<Phi> (state f (Suc n))
[PROOF STEP]
apply (simp add: A_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma has_derivative_within: "(f has_derivative f') (at x within s) \<longleftrightarrow>
    bounded_linear f' \<and> ((\<lambda>y. (1 / norm(y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<longlongrightarrow> 0) (at x within s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f has_derivative f') (at x within s) = (bounded_linear f' \<and> ((\<lambda>y. (1 / norm (y - x)) *\<^sub>R (f y - (f x + f' (y - x)))) \<longlongrightarrow> (0::'b)) (at x within s))
[PROOF STEP]
unfolding has_derivative_def tendsto_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (bounded_linear f' \<and> (\<forall>e>0. \<forall>\<^sub>F xa in at x within s. dist ((f xa - f (Lim (at x within s) (\<lambda>x. x)) - f' (xa - Lim (at x within s) (\<lambda>x. x))) /\<^sub>R norm (xa - Lim (at x within s) (\<lambda>x. x))) (0::'b) < e)) = (bounded_linear f' \<and> (\<forall>e>0. \<forall>\<^sub>F xa in at x within s. dist ((1 / norm (xa - x)) *\<^sub>R (f xa - (f x + f' (xa - x)))) (0::'b) < e))
[PROOF STEP]
by (subst eventually_Lim_ident_at) (auto simp add: field_simps)


[STATEMENT]
lemma lots_of_logic_expansions_meta [rule_format]:
  "(((A :: bool) = B) = True) == (((A \<longrightarrow> B) = True) & ((B \<longrightarrow> A) = True))"
  "((A :: bool) = B) = False == (((~A) | B) = False) | (((~B) | A) = False)"

  "((F = G) = True) == (\<forall>x. (F x = G x)) = True"
  "((F = G) = False) == (\<forall>x. (F x = G x)) = False"

  "(A | B) = True == (A = True) | (B = True)"
  "(A & B) = False == (A = False) | (B = False)"
  "(A | B) = False == (A = False) & (B = False)"
  "(A & B) = True == (A = True) & (B = True)"
  "(~ A) = True == A = False"
  "(~ A) = False == A = True"
  "~ (A = True) == A = False"
  "~ (A = False) == A = True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((((A = B) = True \<equiv> (A \<longrightarrow> B) = True \<and> (B \<longrightarrow> A) = True) &&& ((A = B) = False \<equiv> (\<not> A \<or> B) = False \<or> (\<not> B \<or> A) = False) &&& (F = G) = True \<equiv> (\<forall>x. F x = G x) = True) &&& ((F = G) = False \<equiv> (\<forall>x. F x = G x) = False) &&& ((A \<or> B) = True \<equiv> A = True \<or> B = True) &&& (A \<and> B) = False \<equiv> A = False \<or> B = False) &&& (((A \<or> B) = False \<equiv> A = False \<and> B = False) &&& ((A \<and> B) = True \<equiv> A = True \<and> B = True) &&& (\<not> A) = True \<equiv> A = False) &&& ((\<not> A) = False \<equiv> A = True) &&& (A \<noteq> True \<equiv> A = False) &&& A \<noteq> False \<equiv> A = True
[PROOF STEP]
by (rule eq_reflection, auto)+


[STATEMENT]
lemma autonomous_affine_sol_is_exp_plus_int:
  assumes "D X = (\<lambda>t. A *\<^sub>V X t + B) on {t\<^sub>0--t}" and "X t\<^sub>0 = s"
  shows "X t = exp ((t - t\<^sub>0) *\<^sub>R A) *\<^sub>V s + exp ((t - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>t(exp (- (\<tau> - t\<^sub>0) *\<^sub>R A) *\<^sub>V B)\<partial>\<tau>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X t = exp ((t - t\<^sub>0) *\<^sub>R A) *\<^sub>V s + exp ((t - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>t exp (- (\<tau> - t\<^sub>0) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>)
[PROOF STEP]
apply(rule sq_mtx_unique_sol_autonomous_affine[of "\<lambda>s. {t\<^sub>0--t}" _ t X A B])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. is_interval {t\<^sub>0--t}
 2. t \<in> {t\<^sub>0--t}
 3. X \<in> Sols (\<lambda>t s. A *\<^sub>V s + B) (\<lambda>s. {t\<^sub>0--t}) UNIV ?t\<^sub>0 ?s
 4. (\<lambda>a. exp ((a - t\<^sub>0) *\<^sub>R A) *\<^sub>V s + exp ((a - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>a exp (- (\<tau> - t\<^sub>0) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>)) \<in> Sols (\<lambda>t s. A *\<^sub>V s + B) (\<lambda>s. {t\<^sub>0--t}) UNIV ?t\<^sub>0 ?s
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
 D X = (\<lambda>t. A *\<^sub>V X t + B) on {t\<^sub>0--t}
X t\<^sub>0 = s

goal (4 subgoals):
 1. is_interval {t\<^sub>0--t}
 2. t \<in> {t\<^sub>0--t}
 3. X \<in> Sols (\<lambda>t s. A *\<^sub>V s + B) (\<lambda>s. {t\<^sub>0--t}) UNIV ?t\<^sub>0 ?s
 4. (\<lambda>a. exp ((a - t\<^sub>0) *\<^sub>R A) *\<^sub>V s + exp ((a - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>a exp (- (\<tau> - t\<^sub>0) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>)) \<in> Sols (\<lambda>t s. A *\<^sub>V s + B) (\<lambda>s. {t\<^sub>0--t}) UNIV ?t\<^sub>0 ?s
[PROOF STEP]
apply(simp_all add: ivp_sols_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>i.  D (\<lambda>x. X x $ i) = (\<lambda>x. A *\<^sub>V X x $ i + B $ i) on {t\<^sub>0--t}; X t\<^sub>0 = s\<rbrakk> \<Longrightarrow> X ?t\<^sub>0 = ?s \<and> ?t\<^sub>0 \<in> {t\<^sub>0--t}
 2. \<lbrakk>\<forall>i.  D (\<lambda>x. X x $ i) = (\<lambda>x. A *\<^sub>V X x $ i + B $ i) on {t\<^sub>0--t}; X t\<^sub>0 = s\<rbrakk> \<Longrightarrow> (\<forall>i.  D (\<lambda>x. exp ((x - t\<^sub>0) *\<^sub>R A) *\<^sub>V s $ i + exp ((x - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>x exp ((t\<^sub>0 - \<tau>) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>) $ i) = (\<lambda>x. A *\<^sub>V (exp ((x - t\<^sub>0) *\<^sub>R A) *\<^sub>V s + exp ((x - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>x exp ((t\<^sub>0 - \<tau>) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>)) $ i + B $ i) on {t\<^sub>0--t}) \<and> exp ((?t\<^sub>0 - t\<^sub>0) *\<^sub>R A) *\<^sub>V s + exp ((?t\<^sub>0 - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>?t\<^sub>0 exp ((t\<^sub>0 - \<tau>) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>) = ?s \<and> ?t\<^sub>0 \<in> {t\<^sub>0--t}
[PROOF STEP]
using has_vderiv_on_sq_mtx_affine
[PROOF STATE]
proof (prove)
using this:
 D (\<lambda>t. exp ((1 * (t - ?t\<^sub>0)) *\<^sub>R ?A) *\<^sub>V ?s + exp ((1 * (t - ?t\<^sub>0)) *\<^sub>R ?A) *\<^sub>V (\<integral>\<^sub>?t\<^sub>0\<^sup>t exp ((- 1 * (\<tau> - ?t\<^sub>0)) *\<^sub>R ?A) *\<^sub>V ?B\<partial>\<tau>)) = (\<lambda>t. ?A *\<^sub>V (exp ((1 * (t - ?t\<^sub>0)) *\<^sub>R ?A) *\<^sub>V ?s + exp ((1 * (t - ?t\<^sub>0)) *\<^sub>R ?A) *\<^sub>V (\<integral>\<^sub>?t\<^sub>0\<^sup>t exp ((- 1 * (\<tau> - ?t\<^sub>0)) *\<^sub>R ?A) *\<^sub>V ?B\<partial>\<tau>)) + ?B) on {?t\<^sub>0--?t}

goal (2 subgoals):
 1. \<lbrakk>\<forall>i.  D (\<lambda>x. X x $ i) = (\<lambda>x. A *\<^sub>V X x $ i + B $ i) on {t\<^sub>0--t}; X t\<^sub>0 = s\<rbrakk> \<Longrightarrow> X ?t\<^sub>0 = ?s \<and> ?t\<^sub>0 \<in> {t\<^sub>0--t}
 2. \<lbrakk>\<forall>i.  D (\<lambda>x. X x $ i) = (\<lambda>x. A *\<^sub>V X x $ i + B $ i) on {t\<^sub>0--t}; X t\<^sub>0 = s\<rbrakk> \<Longrightarrow> (\<forall>i.  D (\<lambda>x. exp ((x - t\<^sub>0) *\<^sub>R A) *\<^sub>V s $ i + exp ((x - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>x exp ((t\<^sub>0 - \<tau>) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>) $ i) = (\<lambda>x. A *\<^sub>V (exp ((x - t\<^sub>0) *\<^sub>R A) *\<^sub>V s + exp ((x - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>x exp ((t\<^sub>0 - \<tau>) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>)) $ i + B $ i) on {t\<^sub>0--t}) \<and> exp ((?t\<^sub>0 - t\<^sub>0) *\<^sub>R A) *\<^sub>V s + exp ((?t\<^sub>0 - t\<^sub>0) *\<^sub>R A) *\<^sub>V (\<integral>\<^sub>t\<^sub>0\<^sup>?t\<^sub>0 exp ((t\<^sub>0 - \<tau>) *\<^sub>R A) *\<^sub>V B\<partial>\<tau>) = ?s \<and> ?t\<^sub>0 \<in> {t\<^sub>0--t}
[PROOF STEP]
by force+


[STATEMENT]
lemma "tan (rad_of 30) \<in> {147 * 2 powr -8 .. 148 * 2 powr -8}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tan (rad_of 30) \<in> {147 * 2 powr - 8..148 * 2 powr - 8}
[PROOF STEP]
unfolding rad_of_def atLeastAtMost_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 147 * 2 powr - 8 \<le> tan (30 * pi / 180) \<and> tan (30 * pi / 180) \<le> 148 * 2 powr - 8
[PROOF STEP]
by (approximation 15)


[STATEMENT]
lemma mult_cancelL:
  assumes "trans s" "irrefl s" shows "(Z + X, Z + Y) \<in> mult s \<longleftrightarrow> (X, Y) \<in> mult s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((Z + X, Z + Y) \<in> mult s) = ((X, Y) \<in> mult s)
[PROOF STEP]
using assms mult_locally_cancelL
[PROOF STATE]
proof (prove)
using this:
trans s
irrefl s
\<lbrakk>trans ?s; locally_irrefl ?s (?X + ?Z); locally_irrefl ?s (?Y + ?Z)\<rbrakk> \<Longrightarrow> ((?Z + ?X, ?Z + ?Y) \<in> mult ?s) = ((?X, ?Y) \<in> mult ?s)

goal (1 subgoal):
 1. ((Z + X, Z + Y) \<in> mult s) = ((X, Y) \<in> mult s)
[PROOF STEP]
by (simp add: mult_cancel union_commute)


[STATEMENT]
lemma span_vec_eq: "vec.span X = span X"
  and dim_vec_eq: "vec.dim X = dim X"
  and dependent_vec_eq: "vec.dependent X = dependent X"
  and subspace_vec_eq: "vec.subspace X = subspace X"
  for X::"(real^'n) set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec.span X = span X &&& vec.dim X = dim X) &&& vec.dependent X = dependent X &&& vec.subspace X = subspace X
[PROOF STEP]
unfolding span_raw_def dim_raw_def dependent_raw_def subspace_raw_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (vec.span X = module.span (*\<^sub>R) X &&& vec.dim X = vector_space.dim (*\<^sub>R) X) &&& vec.dependent X = module.dependent (*\<^sub>R) X &&& vec.subspace X = module.subspace (*\<^sub>R) X
[PROOF STEP]
by (auto simp: scalar_mult_eq_scaleR)


[STATEMENT]
lemma row_to_poly_vec_sum:
  assumes "distinct ts" and "length ts = n"
  shows "row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = ((\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))::'t \<Rightarrow>\<^sub>0 'b::comm_monoid_add)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
proof (cases "finite I")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. finite I \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
 2. infinite I \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
finite I

goal (2 subgoals):
 1. finite I \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
 2. infinite I \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
finite I

goal (1 subgoal):
 1. row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
proof (induct I)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>{}. f i j)) = (\<Sum>i\<in>{}. row_to_poly ts (vec n (f i)))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>{}. f i j)) = (\<Sum>i\<in>{}. row_to_poly ts (vec n (f i)))
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>{}. f i j)) = (\<Sum>i\<in>{}. row_to_poly ts (vec n (f i)))
[PROOF STEP]
by (simp add: zero_vec_def[symmetric] assms(2)[symmetric])
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>{}. f i j)) = (\<Sum>i\<in>{}. row_to_poly ts (vec n (f i)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
case (insert x I)
[PROOF STATE]
proof (state)
this:
finite I
x \<notin> I
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
have "row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x I. f i j)) = row_to_poly ts (vec n (\<lambda>j. f x j + (\<Sum>i\<in>I. f i j)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x I. f i j)) = row_to_poly ts (vec n (\<lambda>j. f x j + (\<Sum>i\<in>I. f i j)))
[PROOF STEP]
by (simp add: insert(1) insert(2))
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x I. f i j)) = row_to_poly ts (vec n (\<lambda>j. f x j + (\<Sum>i\<in>I. f i j)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x I. f i j)) = row_to_poly ts (vec n (\<lambda>j. f x j + (\<Sum>i\<in>I. f i j)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
have "... = row_to_poly ts (vec n (f x + (\<lambda>j. (\<Sum>i\<in>I. f i j))))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (vec n (\<lambda>j. f x j + (\<Sum>i\<in>I. f i j))) = row_to_poly ts (vec n (f x + (\<lambda>j. \<Sum>i\<in>I. f i j)))
[PROOF STEP]
by (simp only: plus_fun_def)
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (\<lambda>j. f x j + (\<Sum>i\<in>I. f i j))) = row_to_poly ts (vec n (f x + (\<lambda>j. \<Sum>i\<in>I. f i j)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (\<lambda>j. f x j + (\<Sum>i\<in>I. f i j))) = row_to_poly ts (vec n (f x + (\<lambda>j. \<Sum>i\<in>I. f i j)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
distinct ts
length ts = n
[PROOF STEP]
have "... = row_to_poly ts (vec n (f x)) + row_to_poly ts (vec n (\<lambda>j. (\<Sum>i\<in>I. f i j)))"
[PROOF STATE]
proof (prove)
using this:
distinct ts
length ts = n

goal (1 subgoal):
 1. row_to_poly ts (vec n (f x + (\<lambda>j. \<Sum>i\<in>I. f i j))) = row_to_poly ts (vec n (f x)) + row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j))
[PROOF STEP]
by (rule row_to_poly_vec_plus)
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (f x + (\<lambda>j. \<Sum>i\<in>I. f i j))) = row_to_poly ts (vec n (f x)) + row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (f x + (\<lambda>j. \<Sum>i\<in>I. f i j))) = row_to_poly ts (vec n (f x)) + row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
have "... = row_to_poly ts (vec n (f x)) + (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (vec n (f x)) + row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = row_to_poly ts (vec n (f x)) + (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
by (simp only: insert(3))
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (f x)) + row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = row_to_poly ts (vec n (f x)) + (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (f x)) + row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = row_to_poly ts (vec n (f x)) + (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
have "... = (\<Sum>i\<in>insert x I. row_to_poly ts (vec n (f i)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row_to_poly ts (vec n (f x)) + (\<Sum>i\<in>I. row_to_poly ts (vec n (f i))) = (\<Sum>i\<in>insert x I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
by (simp add: insert(1) insert(2))
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (f x)) + (\<Sum>i\<in>I. row_to_poly ts (vec n (f i))) = (\<Sum>i\<in>insert x I. row_to_poly ts (vec n (f i)))

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>F. f i j)) = (\<Sum>i\<in>F. row_to_poly ts (vec n (f i)))\<rbrakk> \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x F. f i j)) = (\<Sum>i\<in>insert x F. row_to_poly ts (vec n (f i)))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x I. f i j)) = (\<Sum>i\<in>insert x I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x I. f i j)) = (\<Sum>i\<in>insert x I. row_to_poly ts (vec n (f i)))

goal (1 subgoal):
 1. row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x I. f i j)) = (\<Sum>i\<in>insert x I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>insert x I. f i j)) = (\<Sum>i\<in>insert x I. row_to_poly ts (vec n (f i)))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))

goal (1 subgoal):
 1. infinite I \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infinite I \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
infinite I

goal (1 subgoal):
 1. infinite I \<Longrightarrow> row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
infinite I

goal (1 subgoal):
 1. row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))
[PROOF STEP]
by (simp add: zero_vec_def[symmetric] assms(2)[symmetric])
[PROOF STATE]
proof (state)
this:
row_to_poly ts (vec n (\<lambda>j. \<Sum>i\<in>I. f i j)) = (\<Sum>i\<in>I. row_to_poly ts (vec n (f i)))

goal:
No subgoals!
[PROOF STEP]
qed