[STATEMENT]
lemma has_sum_finite_approximation:
  fixes f :: "'a \<Rightarrow> 'b::{comm_monoid_add,metric_space}"
  assumes "has_sum f A x" and "\<epsilon> > 0"
  shows "\<exists>F. finite F \<and> F \<subseteq> A \<and> dist (sum f F) x \<le> \<epsilon>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>F. finite F \<and> F \<subseteq> A \<and> dist (sum f F) x \<le> \<epsilon>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>F. finite F \<and> F \<subseteq> A \<and> dist (sum f F) x \<le> \<epsilon>
[PROOF STEP]
have "(sum f \<longlongrightarrow> x) (finite_subsets_at_top A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (sum f \<longlongrightarrow> x) (finite_subsets_at_top A)
[PROOF STEP]
by (meson assms(1) has_sum_def)
[PROOF STATE]
proof (state)
this:
(sum f \<longlongrightarrow> x) (finite_subsets_at_top A)

goal (1 subgoal):
 1. \<exists>F. finite F \<and> F \<subseteq> A \<and> dist (sum f F) x \<le> \<epsilon>
[PROOF STEP]
hence *: "\<forall>\<^sub>F F in (finite_subsets_at_top A). dist (sum f F) x < \<epsilon>"
[PROOF STATE]
proof (prove)
using this:
(sum f \<longlongrightarrow> x) (finite_subsets_at_top A)

goal (1 subgoal):
 1. \<forall>\<^sub>F F in finite_subsets_at_top A. dist (sum f F) x < \<epsilon>
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
(sum f \<longlongrightarrow> x) (finite_subsets_at_top A)
0 < \<epsilon>

goal (1 subgoal):
 1. \<forall>\<^sub>F F in finite_subsets_at_top A. dist (sum f F) x < \<epsilon>
[PROOF STEP]
by (rule tendstoD)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F F in finite_subsets_at_top A. dist (sum f F) x < \<epsilon>

goal (1 subgoal):
 1. \<exists>F. finite F \<and> F \<subseteq> A \<and> dist (sum f F) x \<le> \<epsilon>
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F F in finite_subsets_at_top A. dist (sum f F) x < \<epsilon>

goal (1 subgoal):
 1. \<exists>F. finite F \<and> F \<subseteq> A \<and> dist (sum f F) x \<le> \<epsilon>
[PROOF STEP]
unfolding eventually_finite_subsets_at_top
[PROOF STATE]
proof (prove)
using this:
\<exists>X. finite X \<and> X \<subseteq> A \<and> (\<forall>Y. finite Y \<and> X \<subseteq> Y \<and> Y \<subseteq> A \<longrightarrow> dist (sum f Y) x < \<epsilon>)

goal (1 subgoal):
 1. \<exists>F. finite F \<and> F \<subseteq> A \<and> dist (sum f F) x \<le> \<epsilon>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
\<exists>F. finite F \<and> F \<subseteq> A \<and> dist (sum f F) x \<le> \<epsilon>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_point_index_two_alt:
  assumes "i1 < dim_row M"
  assumes "i2 < dim_row M"
  shows "mat_point_index M {i1, i2} = card {j . j < dim_col M \<and> M $$(i1, j) = 1 \<and> M $$ (i2, j) = 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
let ?I = "{i1, i2}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
have ss: "{i1, i2} \<subseteq> {..<dim_row M}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i1, i2} \<subseteq> {..<dim_row M}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i1 < dim_row M
i2 < dim_row M

goal (1 subgoal):
 1. {i1, i2} \<subseteq> {..<dim_row M}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
{i1, i2} \<subseteq> {..<dim_row M}

goal (1 subgoal):
 1. mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
have filter: "\<And> j . j < dim_col M \<Longrightarrow> (\<forall> i \<in> ?I . M $$(i, j) = 1) \<longleftrightarrow> M $$(i1, j) = 1 \<and> M $$ (i2, j) = 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j. j < dim_col M \<Longrightarrow> (\<forall>i\<in>{i1, i2}. M $$ (i, j) = (1::'a)) = (M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
?j < dim_col M \<Longrightarrow> (\<forall>i\<in>{i1, i2}. M $$ (i, ?j) = (1::'a)) = (M $$ (i1, ?j) = (1::'a) \<and> M $$ (i2, ?j) = (1::'a))

goal (1 subgoal):
 1. mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
have "?I \<subseteq> {..< dim_row M}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i1, i2} \<subseteq> {..<dim_row M}
[PROOF STEP]
using assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
i1 < dim_row M
i2 < dim_row M

goal (1 subgoal):
 1. {i1, i2} \<subseteq> {..<dim_row M}
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
{i1, i2} \<subseteq> {..<dim_row M}

goal (1 subgoal):
 1. mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
{i1, i2} \<subseteq> {..<dim_row M}

goal (1 subgoal):
 1. mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
using filter ss
[PROOF STATE]
proof (prove)
using this:
{i1, i2} \<subseteq> {..<dim_row M}
?j < dim_col M \<Longrightarrow> (\<forall>i\<in>{i1, i2}. M $$ (i, ?j) = (1::'a)) = (M $$ (i1, ?j) = (1::'a) \<and> M $$ (i2, ?j) = (1::'a))
{i1, i2} \<subseteq> {..<dim_row M}

goal (1 subgoal):
 1. mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
unfolding mat_point_index_def
[PROOF STATE]
proof (prove)
using this:
{i1, i2} \<subseteq> {..<dim_row M}
?j < dim_col M \<Longrightarrow> (\<forall>i\<in>{i1, i2}. M $$ (i, ?j) = (1::'a)) = (M $$ (i1, ?j) = (1::'a) \<and> M $$ (i2, ?j) = (1::'a))
{i1, i2} \<subseteq> {..<dim_row M}

goal (1 subgoal):
 1. card {j. j < dim_col M \<and> (\<forall>i\<in>{i1, i2}. M $$ (i, j) = (1::'a))} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}
[PROOF STEP]
by meson
[PROOF STATE]
proof (state)
this:
mat_point_index M {i1, i2} = card {j. j < dim_col M \<and> M $$ (i1, j) = (1::'a) \<and> M $$ (i2, j) = (1::'a)}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma bounds_uminus:
  fixes a b :: "real \<Rightarrow> real"
  assumes "eventually (\<lambda>x. a x \<le> b x) at_top"
  shows   "eventually (\<lambda>x. -b x \<le> -a x) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. - b x \<le> - a x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in at_top. a x \<le> b x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_top. - b x \<le> - a x
[PROOF STEP]
by eventually_elim simp


[STATEMENT]
lemma nat_mod_cong:
  assumes "a = b+(c::nat)"
          "a mod n = b mod n"
  shows "c mod n = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
let ?k = "a mod n"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
obtain a1 where "a = a1*n + ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a1. a = a1 * n + a mod n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis div_mult_mod_eq)
[PROOF STATE]
proof (state)
this:
a = a1 * n + a mod n

goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a = a1 * n + a mod n

goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
obtain b1 where "b = b1*n + ?k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>b1. b = b1 * n + a mod n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
a mod n = b mod n

goal (1 subgoal):
 1. (\<And>b1. b = b1 * n + a mod n \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis div_mult_mod_eq)
[PROOF STATE]
proof (state)
this:
b = b1 * n + a mod n

goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a = a1 * n + a mod n
b = b1 * n + a mod n
[PROOF STEP]
have "a1 * n + ?k = b1 * n + ?k + c"
[PROOF STATE]
proof (prove)
using this:
a = a1 * n + a mod n
b = b1 * n + a mod n

goal (1 subgoal):
 1. a1 * n + a mod n = b1 * n + a mod n + c
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
a = a1 * n + a mod n
b = b1 * n + a mod n
a = b + c

goal (1 subgoal):
 1. a1 * n + a mod n = b1 * n + a mod n + c
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
a1 * n + a mod n = b1 * n + a mod n + c

goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a1 * n + a mod n = b1 * n + a mod n + c
[PROOF STEP]
have "c = (a1 - b1) * n"
[PROOF STATE]
proof (prove)
using this:
a1 * n + a mod n = b1 * n + a mod n + c

goal (1 subgoal):
 1. c = (a1 - b1) * n
[PROOF STEP]
by (simp add: diff_mult_distrib)
[PROOF STATE]
proof (state)
this:
c = (a1 - b1) * n

goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
c = (a1 - b1) * n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c = (a1 - b1) * n

goal (1 subgoal):
 1. c mod n = 0
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
c mod n = 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma closed_X1: "closed X1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed X1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. closed X1
[PROOF STEP]
have X1: "X1 = {x. le_vec 0 x \<and> norm x = 1}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X1 = {x. le_vec 0 x \<and> norm x = 1}
[PROOF STEP]
unfolding X1_def X_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. le_vec 0 x \<and> x \<noteq> 0} \<inter> {x. norm x = 1} = {x. le_vec 0 x \<and> norm x = 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
X1 = {x. le_vec 0 x \<and> norm x = 1}

goal (1 subgoal):
 1. closed X1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed X1
[PROOF STEP]
unfolding X1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. closed {x. le_vec 0 x \<and> norm x = 1}
[PROOF STEP]
by (intro closed_Collect_conj closed_Collect_all  closed_Collect_le closed_Collect_eq,
      auto intro: continuous_intros)
[PROOF STATE]
proof (state)
this:
closed X1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "\<forall>(x::'a::linordered_field) y z.
  (\<bar>5 * x + 3 * y + z\<bar> \<le> 5 * x + 3 * y + z \<and> \<bar>5 * x + 3 * y + z\<bar> \<ge> - (5 * x + 3 * y + z)) \<or>
  (\<bar>5 * x + 3 * y + z\<bar> \<ge> 5 * x + 3 * y + z \<and> \<bar>5 * x + 3 * y + z\<bar> \<le> - (5 * x + 3 * y + z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x y z. \<bar>(5::'a) * x + (3::'a) * y + z\<bar> \<le> (5::'a) * x + (3::'a) * y + z \<and> - ((5::'a) * x + (3::'a) * y + z) \<le> \<bar>(5::'a) * x + (3::'a) * y + z\<bar> \<or> (5::'a) * x + (3::'a) * y + z \<le> \<bar>(5::'a) * x + (3::'a) * y + z\<bar> \<and> \<bar>(5::'a) * x + (3::'a) * y + z\<bar> \<le> - ((5::'a) * x + (3::'a) * y + z)
[PROOF STEP]
by ferrack


[STATEMENT]
lemma bdd_above_norm_f:
  assumes "bounded_linear f"
  shows \<open>bdd_above {norm (f x) |x. norm x = 1}\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bdd_above {norm (f x) |x. norm x = 1}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. bdd_above {norm (f x) |x. norm x = 1}
[PROOF STEP]
have \<open>\<exists>M. \<forall>x. norm x = 1 \<longrightarrow> norm (f x) \<le> M\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M. \<forall>x. norm x = 1 \<longrightarrow> norm (f x) \<le> M
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
bounded_linear f

goal (1 subgoal):
 1. \<exists>M. \<forall>x. norm x = 1 \<longrightarrow> norm (f x) \<le> M
[PROOF STEP]
by (metis bounded_linear.axioms(2) bounded_linear_axioms_def)
[PROOF STATE]
proof (state)
this:
\<exists>M. \<forall>x. norm x = 1 \<longrightarrow> norm (f x) \<le> M

goal (1 subgoal):
 1. bdd_above {norm (f x) |x. norm x = 1}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>M. \<forall>x. norm x = 1 \<longrightarrow> norm (f x) \<le> M

goal (1 subgoal):
 1. bdd_above {norm (f x) |x. norm x = 1}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bdd_above {norm (f x) |x. norm x = 1}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma add_left_commute:
  "x \<in> V \<Longrightarrow> y \<in> V \<Longrightarrow> z \<in> V \<Longrightarrow> x + (y + z) = y + (x + z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> x + (y + z) = y + (x + z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> x + (y + z) = y + (x + z)
[PROOF STEP]
assume xyz: "x \<in> V"  "y \<in> V"  "z \<in> V"
[PROOF STATE]
proof (state)
this:
x \<in> V
y \<in> V
z \<in> V

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> x + (y + z) = y + (x + z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
y \<in> V
z \<in> V
[PROOF STEP]
have "x + (y + z) = (x + y) + z"
[PROOF STATE]
proof (prove)
using this:
x \<in> V
y \<in> V
z \<in> V

goal (1 subgoal):
 1. x + (y + z) = x + y + z
[PROOF STEP]
by (simp only: add_assoc)
[PROOF STATE]
proof (state)
this:
x + (y + z) = x + y + z

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> x + (y + z) = y + (x + z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x + (y + z) = x + y + z

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> x + (y + z) = y + (x + z)
[PROOF STEP]
from xyz
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
y \<in> V
z \<in> V
[PROOF STEP]
have "\<dots> = (y + x) + z"
[PROOF STATE]
proof (prove)
using this:
x \<in> V
y \<in> V
z \<in> V

goal (1 subgoal):
 1. x + y + z = y + x + z
[PROOF STEP]
by (simp only: add_commute)
[PROOF STATE]
proof (state)
this:
x + y + z = y + x + z

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> x + (y + z) = y + (x + z)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
x + y + z = y + x + z

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> x + (y + z) = y + (x + z)
[PROOF STEP]
from xyz
[PROOF STATE]
proof (chain)
picking this:
x \<in> V
y \<in> V
z \<in> V
[PROOF STEP]
have "\<dots> = y + (x + z)"
[PROOF STATE]
proof (prove)
using this:
x \<in> V
y \<in> V
z \<in> V

goal (1 subgoal):
 1. y + x + z = y + (x + z)
[PROOF STEP]
by (simp only: add_assoc)
[PROOF STATE]
proof (state)
this:
y + x + z = y + (x + z)

goal (1 subgoal):
 1. \<lbrakk>x \<in> V; y \<in> V; z \<in> V\<rbrakk> \<Longrightarrow> x + (y + z) = y + (x + z)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
x + (y + z) = y + (x + z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
x + (y + z) = y + (x + z)

goal (1 subgoal):
 1. x + (y + z) = y + (x + z)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
x + (y + z) = y + (x + z)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lemSpace2Sym:
    shows "space2 x y = space2 y x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space2 x y = space2 y x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. space2 x y = space2 y x
[PROOF STEP]
define xsep where "xsep = xval x - xval y"
[PROOF STATE]
proof (state)
this:
xsep = xval x - xval y

goal (1 subgoal):
 1. space2 x y = space2 y x
[PROOF STEP]
define ysep where "ysep = yval x - yval y"
[PROOF STATE]
proof (state)
this:
ysep = yval x - yval y

goal (1 subgoal):
 1. space2 x y = space2 y x
[PROOF STEP]
define zsep where "zsep = zval x - zval y"
[PROOF STATE]
proof (state)
this:
zsep = zval x - zval y

goal (1 subgoal):
 1. space2 x y = space2 y x
[PROOF STEP]
have spacexy: "space2 x y = (xsep*xsep) + (ysep*ysep) + (zsep*zsep)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space2 x y = xsep * xsep + ysep * ysep + zsep * zsep
[PROOF STEP]
by (simp add: xsep_def ysep_def zsep_def)
[PROOF STATE]
proof (state)
this:
space2 x y = xsep * xsep + ysep * ysep + zsep * zsep

goal (1 subgoal):
 1. space2 x y = space2 y x
[PROOF STEP]
have spaceyx: "space2 y x = (-xsep)*(-xsep) + (-ysep)*(-ysep) + (-zsep)*(-zsep)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. space2 y x = - xsep * - xsep + - ysep * - ysep + - zsep * - zsep
[PROOF STEP]
by (simp add: xsep_def ysep_def zsep_def)
[PROOF STATE]
proof (state)
this:
space2 y x = - xsep * - xsep + - ysep * - ysep + - zsep * - zsep

goal (1 subgoal):
 1. space2 x y = space2 y x
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
space2 y x = - xsep * - xsep + - ysep * - ysep + - zsep * - zsep

goal (1 subgoal):
 1. space2 x y = space2 y x
[PROOF STEP]
by (metis spacexy diff_0_right minus_diff_eq minus_mult_left minus_mult_right)
[PROOF STATE]
proof (state)
this:
space2 x y = space2 y x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma exists_nat_expansion:
  \<open>(\<exists>n \<ge> (n\<^sub>0::nat). P n) = (P n\<^sub>0 \<or> (\<exists>n \<ge> Suc n\<^sub>0. P n))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (P n\<^sub>0 \<or> (\<exists>n\<ge>Suc n\<^sub>0. P n))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (P n\<^sub>0 \<or> (\<exists>n\<ge>Suc n\<^sub>0. P n))
[PROOF STEP]
have \<open>(\<exists>n \<ge> (n\<^sub>0::nat). P n) = (\<exists>n. (n = n\<^sub>0 \<or> n > n\<^sub>0) \<and> P n)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (\<exists>n. (n = n\<^sub>0 \<or> n\<^sub>0 < n) \<and> P n)
[PROOF STEP]
using le_less
[PROOF STATE]
proof (prove)
using this:
(?x \<le> ?y) = (?x < ?y \<or> ?x = ?y)

goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (\<exists>n. (n = n\<^sub>0 \<or> n\<^sub>0 < n) \<and> P n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<exists>n\<ge>n\<^sub>0. P n) = (\<exists>n. (n = n\<^sub>0 \<or> n\<^sub>0 < n) \<and> P n)

goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (P n\<^sub>0 \<or> (\<exists>n\<ge>Suc n\<^sub>0. P n))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<exists>n\<ge>n\<^sub>0. P n) = (\<exists>n. (n = n\<^sub>0 \<or> n\<^sub>0 < n) \<and> P n)

goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (P n\<^sub>0 \<or> (\<exists>n\<ge>Suc n\<^sub>0. P n))
[PROOF STEP]
have \<open>... = (\<exists>n. (P n\<^sub>0) \<or> (n > n\<^sub>0 \<and> P n))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>n. (n = n\<^sub>0 \<or> n\<^sub>0 < n) \<and> P n) = (\<exists>n. P n\<^sub>0 \<or> n\<^sub>0 < n \<and> P n)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<exists>n. (n = n\<^sub>0 \<or> n\<^sub>0 < n) \<and> P n) = (\<exists>n. P n\<^sub>0 \<or> n\<^sub>0 < n \<and> P n)

goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (P n\<^sub>0 \<or> (\<exists>n\<ge>Suc n\<^sub>0. P n))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<exists>n\<ge>n\<^sub>0. P n) = (\<exists>n. P n\<^sub>0 \<or> n\<^sub>0 < n \<and> P n)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<exists>n\<ge>n\<^sub>0. P n) = (\<exists>n. P n\<^sub>0 \<or> n\<^sub>0 < n \<and> P n)

goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (P n\<^sub>0 \<or> (\<exists>n\<ge>Suc n\<^sub>0. P n))
[PROOF STEP]
using Suc_le_eq
[PROOF STATE]
proof (prove)
using this:
(\<exists>n\<ge>n\<^sub>0. P n) = (\<exists>n. P n\<^sub>0 \<or> n\<^sub>0 < n \<and> P n)
(Suc ?m \<le> ?n) = (?m < ?n)

goal (1 subgoal):
 1. (\<exists>n\<ge>n\<^sub>0. P n) = (P n\<^sub>0 \<or> (\<exists>n\<ge>Suc n\<^sub>0. P n))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>n\<ge>n\<^sub>0. P n) = (P n\<^sub>0 \<or> (\<exists>n\<ge>Suc n\<^sub>0. P n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma twod_lt_q:
  assumes "of_nat d < \<lceil>(log 2 q)::real\<rceil>"
  shows "2 powr (real d) < of_int q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 2 powr real d < real_of_int q
[PROOF STEP]
using assms less_log_iff[of 2 q d] d_lt_logq q_gt_zero
[PROOF STATE]
proof (prove)
using this:
int d < \<lceil>log 2 (real_of_int q)\<rceil>
\<lbrakk>1 < 2; 0 < real_of_int q\<rbrakk> \<Longrightarrow> (real d < log 2 (real_of_int q)) = (2 powr real d < real_of_int q)
int ?d < \<lceil>log 2 (real_of_int q)\<rceil> \<Longrightarrow> real ?d < log 2 (real_of_int q)
0 < q

goal (1 subgoal):
 1. 2 powr real d < real_of_int q
[PROOF STEP]
by auto


[STATEMENT]
lemma image_smult_cbox:"(\<lambda>x. m *\<^sub>R (x::_::euclidean_space)) ` cbox a b =
  (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a) (m *\<^sub>R b) else cbox (m *\<^sub>R b) (m *\<^sub>R a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (*\<^sub>R) m ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a) (m *\<^sub>R b) else cbox (m *\<^sub>R b) (m *\<^sub>R a))
[PROOF STEP]
using image_affinity_cbox[of m 0 a b]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. m *\<^sub>R x + (0::'a)) ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a + (0::'a)) (m *\<^sub>R b + (0::'a)) else cbox (m *\<^sub>R b + (0::'a)) (m *\<^sub>R a + (0::'a)))

goal (1 subgoal):
 1. (*\<^sub>R) m ` cbox a b = (if cbox a b = {} then {} else if 0 \<le> m then cbox (m *\<^sub>R a) (m *\<^sub>R b) else cbox (m *\<^sub>R b) (m *\<^sub>R a))
[PROOF STEP]
by auto


[STATEMENT]
lemma Complex_scale4:
  shows "c \<noteq> 0 \<Longrightarrow> Complex (a / c) (b / c) = Complex a b / cor c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> Complex (a / c) (b / c) = Complex a b / cor c
[PROOF STEP]
unfolding complex_of_real_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> Complex (a / c) (b / c) = Complex a b / Complex c 0
[PROOF STEP]
unfolding Complex_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c \<noteq> 0 \<Longrightarrow> cor (a / c) + \<i> * cor (b / c) = (cor a + \<i> * cor b) / (cor c + \<i> * cor 0)
[PROOF STEP]
by (auto simp add: field_simps power2_eq_square)


[STATEMENT]
lemma connected_component_unique:
  "\<lbrakk>x \<in> c; c \<subseteq> S; connected c;
    \<And>c'. \<lbrakk>x \<in> c'; c' \<subseteq> S; connected c'\<rbrakk> \<Longrightarrow> c' \<subseteq> c\<rbrakk>
        \<Longrightarrow> connected_component_set S x = c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> c; c \<subseteq> S; connected c; \<And>c'. \<lbrakk>x \<in> c'; c' \<subseteq> S; connected c'\<rbrakk> \<Longrightarrow> c' \<subseteq> c\<rbrakk> \<Longrightarrow> connected_component_set S x = c
[PROOF STEP]
apply (rule subset_antisym)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>x \<in> c; c \<subseteq> S; connected c; \<And>c'. \<lbrakk>x \<in> c'; c' \<subseteq> S; connected c'\<rbrakk> \<Longrightarrow> c' \<subseteq> c\<rbrakk> \<Longrightarrow> connected_component_set S x \<subseteq> c
 2. \<lbrakk>x \<in> c; c \<subseteq> S; connected c; \<And>c'. \<lbrakk>x \<in> c'; c' \<subseteq> S; connected c'\<rbrakk> \<Longrightarrow> c' \<subseteq> c\<rbrakk> \<Longrightarrow> c \<subseteq> connected_component_set S x
[PROOF STEP]
apply (meson connected_component_maximal connected_component_subset connected_connected_component contra_subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> c; c \<subseteq> S; connected c; \<And>c'. \<lbrakk>x \<in> c'; c' \<subseteq> S; connected c'\<rbrakk> \<Longrightarrow> c' \<subseteq> c\<rbrakk> \<Longrightarrow> c \<subseteq> connected_component_set S x
[PROOF STEP]
by (simp add: connected_component_maximal)


[STATEMENT]
lemma dot_square_norm: "inner x x = (norm x)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inner x x = (norm x)\<^sup>2
[PROOF STEP]
by (simp only: power2_norm_eq_inner)


[STATEMENT]
lemma v_sum_type_rep: "\<v> = (\<Sum> g \<in> group_sizes . g * (groups_of_size g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)
[PROOF STEP]
have gs: "set_mset {# card G . G \<in># mset_set \<G> #} = group_sizes"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (image_mset card (mset_set \<G>)) = group_sizes
[PROOF STEP]
unfolding group_sizes_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set_mset (image_mset card (mset_set \<G>)) = {card G |G. G \<in> \<G>}
[PROOF STEP]
using groups_finite
[PROOF STATE]
proof (prove)
using this:
finite \<G>

goal (1 subgoal):
 1. set_mset (image_mset card (mset_set \<G>)) = {card G |G. G \<in> \<G>}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
set_mset (image_mset card (mset_set \<G>)) = group_sizes

goal (1 subgoal):
 1. \<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)
[PROOF STEP]
have "\<v> = card (\<Union>(\<Union>{{ G \<in> \<G> . card G = g } | g . g \<in> group_sizes}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<v> = card (\<Union> (\<Union> {{G \<in> \<G>. card G = g} |g. g \<in> group_sizes}))
[PROOF STEP]
using group_size_partition_covers_points
[PROOF STATE]
proof (prove)
using this:
\<Union> (\<Union> {{G \<in> \<G>. card G = g} |g. g \<in> group_sizes}) = \<V>

goal (1 subgoal):
 1. \<v> = card (\<Union> (\<Union> {{G \<in> \<G>. card G = g} |g. g \<in> group_sizes}))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<v> = card (\<Union> (\<Union> {{G \<in> \<G>. card G = g} |g. g \<in> group_sizes}))

goal (1 subgoal):
 1. \<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)
[PROOF STEP]
have v1: "\<v> = (\<Sum>x \<in># {# card G . G \<in># mset_set \<G> #}. x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<v> = (\<Sum>x\<in>#image_mset card (mset_set \<G>). x)
[PROOF STEP]
by (simp add: sum_unfold_sum_mset v_equals_sum_group_sizes)
[PROOF STATE]
proof (state)
this:
\<v> = (\<Sum>x\<in>#image_mset card (mset_set \<G>). x)

goal (1 subgoal):
 1. \<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<v> = (\<Sum>x\<in>#image_mset card (mset_set \<G>). x)
[PROOF STEP]
have "\<v> = (\<Sum>x \<in> set_mset {# card G . G \<in># mset_set \<G> #} . x * (count {# card G . G \<in># mset_set \<G> #} x))"
[PROOF STATE]
proof (prove)
using this:
\<v> = (\<Sum>x\<in>#image_mset card (mset_set \<G>). x)

goal (1 subgoal):
 1. \<v> = (\<Sum>x\<in>set_mset (image_mset card (mset_set \<G>)). x * count (image_mset card (mset_set \<G>)) x)
[PROOF STEP]
using mset_set_size_card_count
[PROOF STATE]
proof (prove)
using this:
\<v> = (\<Sum>x\<in>#image_mset card (mset_set \<G>). x)
(\<Sum>x\<in>#?A. x) = (\<Sum>x\<in>set_mset ?A. x * count ?A x)

goal (1 subgoal):
 1. \<v> = (\<Sum>x\<in>set_mset (image_mset card (mset_set \<G>)). x * count (image_mset card (mset_set \<G>)) x)
[PROOF STEP]
by (simp add: v1)
[PROOF STATE]
proof (state)
this:
\<v> = (\<Sum>x\<in>set_mset (image_mset card (mset_set \<G>)). x * count (image_mset card (mset_set \<G>)) x)

goal (1 subgoal):
 1. \<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<v> = (\<Sum>x\<in>set_mset (image_mset card (mset_set \<G>)). x * count (image_mset card (mset_set \<G>)) x)

goal (1 subgoal):
 1. \<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)
[PROOF STEP]
using gs groups_of_size_alt_def_count
[PROOF STATE]
proof (prove)
using this:
\<v> = (\<Sum>x\<in>set_mset (image_mset card (mset_set \<G>)). x * count (image_mset card (mset_set \<G>)) x)
set_mset (image_mset card (mset_set \<G>)) = group_sizes
groups_of_size ?g = count (image_mset card (mset_set \<G>)) ?g

goal (1 subgoal):
 1. \<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<v> = (\<Sum>g\<in>group_sizes. g * groups_of_size g)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma card_Inv_sym: "card(Inv xs ys) = card(Inv ys xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (Inv xs ys) = card (Inv ys xs)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. card (Inv xs ys) = card (Inv ys xs)
[PROOF STEP]
have "Inv xs ys = (\<lambda>(x,y). (y,x)) ` Inv ys xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Inv xs ys = (\<lambda>(x, y). (y, x)) ` Inv ys xs
[PROOF STEP]
by(auto simp: Inv_def)
[PROOF STATE]
proof (state)
this:
Inv xs ys = (\<lambda>(x, y). (y, x)) ` Inv ys xs

goal (1 subgoal):
 1. card (Inv xs ys) = card (Inv ys xs)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
Inv xs ys = (\<lambda>(x, y). (y, x)) ` Inv ys xs

goal (1 subgoal):
 1. card (Inv xs ys) = card (Inv ys xs)
[PROOF STEP]
by (metis card_image swap_inj_on)
[PROOF STATE]
proof (state)
this:
card (Inv xs ys) = card (Inv ys xs)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_fst_zip_take:
  "map fst (zip xs ys) = take (min (length xs) (length ys)) xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. map fst (zip xs ys) = take (min (length xs) (length ys)) xs
[PROOF STEP]
by (induct xs ys rule: list_induct2') simp_all


[STATEMENT]
theorem prefix_Cons: "prefix xs (y # ys) = (xs = [] \<or> (\<exists>zs. xs = y # zs \<and> prefix zs ys))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prefix xs (y # ys) = (xs = [] \<or> (\<exists>zs. xs = y # zs \<and> prefix zs ys))
[PROOF STEP]
by (cases xs) (auto simp add: prefix_def)


[STATEMENT]
theorem F2map_comp: "F2map (f o g) = F2map f o F2map g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F2map (f \<circ> g) = F2map f \<circ> F2map g
[PROOF STEP]
by (unfold F.map_comp0[symmetric] o_id) (rule refl)


[STATEMENT]
lemma integral_nonneg:
  fixes f :: "'n::euclidean_space \<Rightarrow> real"
  assumes f: "f integrable_on S" and 0: "\<And>x. x \<in> S \<Longrightarrow> 0 \<le> f x"
  shows "0 \<le> integral S f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> integral S f
[PROOF STEP]
by (rule has_integral_nonneg[OF f[unfolded has_integral_integral] 0])


[STATEMENT]
lemma sum_3: "sum f (UNIV::3 set) = f 1 + f 2 + f 3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f UNIV = f 1 + f 2 + f 3
[PROOF STEP]
unfolding UNIV_3
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f {1, 2, 3} = f 1 + f 2 + f 3
[PROOF STEP]
by (simp add: ac_simps)


[STATEMENT]
lemma row_id_matrix:
assumes "i < nr"
shows "row (id_matrix nr nc) i = unit_vec nc i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. row (id_matrix nr nc) i = unit_vec nc i
[PROOF STEP]
by (rule eq_vecI, simp add: assms id_matrix_def unit_vec_def, simp add: id_matrix_dim(2))


[STATEMENT]
lemma convergent_prod_mult:
  assumes f: "convergent_prod f" and g: "convergent_prod g"
  shows "convergent_prod (\<lambda>n. f n * g n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convergent_prod (\<lambda>n. f n * g n)
[PROOF STEP]
unfolding convergent_prod_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>M p. raw_has_prod (\<lambda>n. f n * g n) M p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>M p. raw_has_prod (\<lambda>n. f n * g n) M p
[PROOF STEP]
obtain M p N q where p: "raw_has_prod f M p" and q: "raw_has_prod g N q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>M p N q. \<lbrakk>raw_has_prod f M p; raw_has_prod g N q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using convergent_prod_def f g
[PROOF STATE]
proof (prove)
using this:
convergent_prod ?f \<equiv> \<exists>M p. raw_has_prod ?f M p
convergent_prod f
convergent_prod g

goal (1 subgoal):
 1. (\<And>M p N q. \<lbrakk>raw_has_prod f M p; raw_has_prod g N q\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
raw_has_prod f M p
raw_has_prod g N q

goal (1 subgoal):
 1. \<exists>M p. raw_has_prod (\<lambda>n. f n * g n) M p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
raw_has_prod f M p
raw_has_prod g N q
[PROOF STEP]
obtain p' q' where p': "raw_has_prod f (max M N) p'" and q': "raw_has_prod g (max M N) q'"
[PROOF STATE]
proof (prove)
using this:
raw_has_prod f M p
raw_has_prod g N q

goal (1 subgoal):
 1. (\<And>p' q'. \<lbrakk>raw_has_prod f (max M N) p'; raw_has_prod g (max M N) q'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (meson raw_has_prod_ignore_initial_segment max.cobounded1 max.cobounded2)
[PROOF STATE]
proof (state)
this:
raw_has_prod f (max M N) p'
raw_has_prod g (max M N) q'

goal (1 subgoal):
 1. \<exists>M p. raw_has_prod (\<lambda>n. f n * g n) M p
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
raw_has_prod f (max M N) p'
raw_has_prod g (max M N) q'
[PROOF STEP]
show "\<exists>M p. raw_has_prod (\<lambda>n. f n * g n) M p"
[PROOF STATE]
proof (prove)
using this:
raw_has_prod f (max M N) p'
raw_has_prod g (max M N) q'

goal (1 subgoal):
 1. \<exists>M p. raw_has_prod (\<lambda>n. f n * g n) M p
[PROOF STEP]
using raw_has_prod_mult
[PROOF STATE]
proof (prove)
using this:
raw_has_prod f (max M N) p'
raw_has_prod g (max M N) q'
\<lbrakk>raw_has_prod ?f ?M ?a; raw_has_prod ?g ?M ?b\<rbrakk> \<Longrightarrow> raw_has_prod (\<lambda>n. ?f n * ?g n) ?M (?a * ?b)

goal (1 subgoal):
 1. \<exists>M p. raw_has_prod (\<lambda>n. f n * g n) M p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>M p. raw_has_prod (\<lambda>n. f n * g n) M p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma op_norm0: "\<parallel>(0::('a::real_normed_field)^'n^'m)\<parallel>\<^sub>o\<^sub>p = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<parallel>0\<parallel>\<^sub>o\<^sub>p = 0
[PROOF STEP]
using op_norm_eq_0[of 0]
[PROOF STATE]
proof (prove)
using this:
(\<parallel>0\<parallel>\<^sub>o\<^sub>p = 0) = (0 = 0)

goal (1 subgoal):
 1. \<parallel>0\<parallel>\<^sub>o\<^sub>p = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma convex_set_plus:
  assumes "convex S" and "convex T" shows "convex (S + T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (S + T)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. convex (S + T)
[PROOF STEP]
have "convex (\<Union>x\<in> S. \<Union>y \<in> T. {x + y})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. convex (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
convex S
convex T

goal (1 subgoal):
 1. convex (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})
[PROOF STEP]
by (rule convex_sums)
[PROOF STATE]
proof (state)
this:
convex (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})

goal (1 subgoal):
 1. convex (S + T)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
convex (\<Union>x\<in>S. \<Union>y\<in>T. {x + y})

goal (1 subgoal):
 1. convex (S + T)
[PROOF STEP]
have "(\<Union>x\<in> S. \<Union>y \<in> T. {x + y}) = S + T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = S + T
[PROOF STEP]
unfolding set_plus_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = {c. \<exists>a\<in>S. \<exists>b\<in>T. c = a + b}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>S. \<Union>y\<in>T. {x + y}) = S + T

goal (1 subgoal):
 1. convex (S + T)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
convex (S + T)
[PROOF STEP]
show "convex (S + T)"
[PROOF STATE]
proof (prove)
using this:
convex (S + T)

goal (1 subgoal):
 1. convex (S + T)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
convex (S + T)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integrable_on_affinity:
  assumes "m \<noteq> 0" "f integrable_on (cbox a b)"
  shows   "(\<lambda>x. f (m *\<^sub>R x + c)) integrable_on ((\<lambda>x. (1 / m) *\<^sub>R x - ((1 / m) *\<^sub>R c)) ` cbox a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f (m *\<^sub>R x + c)) integrable_on (\<lambda>x. (1 / m) *\<^sub>R x - (1 / m) *\<^sub>R c) ` cbox a b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f (m *\<^sub>R x + c)) integrable_on (\<lambda>x. (1 / m) *\<^sub>R x - (1 / m) *\<^sub>R c) ` cbox a b
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
m \<noteq> 0
f integrable_on cbox a b
[PROOF STEP]
obtain I where "(f has_integral I) (cbox a b)"
[PROOF STATE]
proof (prove)
using this:
m \<noteq> 0
f integrable_on cbox a b

goal (1 subgoal):
 1. (\<And>I. (f has_integral I) (cbox a b) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: integrable_on_def)
[PROOF STATE]
proof (state)
this:
(f has_integral I) (cbox a b)

goal (1 subgoal):
 1. (\<lambda>x. f (m *\<^sub>R x + c)) integrable_on (\<lambda>x. (1 / m) *\<^sub>R x - (1 / m) *\<^sub>R c) ` cbox a b
[PROOF STEP]
from has_integral_affinity[OF this assms(1), of c]
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f (m *\<^sub>R x + c)) has_integral (1 / \<bar>m\<bar> ^ DIM('a)) *\<^sub>R I) ((\<lambda>x. (1 / m) *\<^sub>R x + - ((1 / m) *\<^sub>R c)) ` cbox a b)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f (m *\<^sub>R x + c)) has_integral (1 / \<bar>m\<bar> ^ DIM('a)) *\<^sub>R I) ((\<lambda>x. (1 / m) *\<^sub>R x + - ((1 / m) *\<^sub>R c)) ` cbox a b)

goal (1 subgoal):
 1. (\<lambda>x. f (m *\<^sub>R x + c)) integrable_on (\<lambda>x. (1 / m) *\<^sub>R x - (1 / m) *\<^sub>R c) ` cbox a b
[PROOF STEP]
by (auto simp: integrable_on_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f (m *\<^sub>R x + c)) integrable_on (\<lambda>x. (1 / m) *\<^sub>R x - (1 / m) *\<^sub>R c) ` cbox a b

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma lookup_sum_list: "lookup (sum_list ps) a = sum_list (map (\<lambda>p. lookup p a) ps)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (sum_list ps) a = (\<Sum>p\<leftarrow>ps. lookup p a)
[PROOF STEP]
proof (induct ps)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. lookup (sum_list []) a = (\<Sum>p\<leftarrow>[]. lookup p a)
 2. \<And>aa ps. lookup (sum_list ps) a = (\<Sum>p\<leftarrow>ps. lookup p a) \<Longrightarrow> lookup (sum_list (aa # ps)) a = (\<Sum>p\<leftarrow>aa # ps. lookup p a)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. lookup (sum_list []) a = (\<Sum>p\<leftarrow>[]. lookup p a)
 2. \<And>aa ps. lookup (sum_list ps) a = (\<Sum>p\<leftarrow>ps. lookup p a) \<Longrightarrow> lookup (sum_list (aa # ps)) a = (\<Sum>p\<leftarrow>aa # ps. lookup p a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup (sum_list []) a = (\<Sum>p\<leftarrow>[]. lookup p a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
lookup (sum_list []) a = (\<Sum>p\<leftarrow>[]. lookup p a)

goal (1 subgoal):
 1. \<And>aa ps. lookup (sum_list ps) a = (\<Sum>p\<leftarrow>ps. lookup p a) \<Longrightarrow> lookup (sum_list (aa # ps)) a = (\<Sum>p\<leftarrow>aa # ps. lookup p a)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa ps. lookup (sum_list ps) a = (\<Sum>p\<leftarrow>ps. lookup p a) \<Longrightarrow> lookup (sum_list (aa # ps)) a = (\<Sum>p\<leftarrow>aa # ps. lookup p a)
[PROOF STEP]
case (Cons p ps)
[PROOF STATE]
proof (state)
this:
lookup (sum_list ps) a = (\<Sum>p\<leftarrow>ps. lookup p a)

goal (1 subgoal):
 1. \<And>aa ps. lookup (sum_list ps) a = (\<Sum>p\<leftarrow>ps. lookup p a) \<Longrightarrow> lookup (sum_list (aa # ps)) a = (\<Sum>p\<leftarrow>aa # ps. lookup p a)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
lookup (sum_list ps) a = (\<Sum>p\<leftarrow>ps. lookup p a)

goal (1 subgoal):
 1. lookup (sum_list (p # ps)) a = (\<Sum>p\<leftarrow>p # ps. lookup p a)
[PROOF STEP]
by (simp add: lookup_add)
[PROOF STATE]
proof (state)
this:
lookup (sum_list (p # ps)) a = (\<Sum>p\<leftarrow>p # ps. lookup p a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma orthogonal_self_eq_0:
  fixes v :: "('a::real_inner)^'n"
  assumes "orthogonal v v"
  shows "v = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v = 0
[PROOF STEP]
using inner_eq_zero_iff [of v] and assms
[PROOF STATE]
proof (prove)
using this:
(v \<bullet> v = 0) = (v = 0)
orthogonal v v

goal (1 subgoal):
 1. v = 0
[PROOF STEP]
unfolding orthogonal_def
[PROOF STATE]
proof (prove)
using this:
(v \<bullet> v = 0) = (v = 0)
v \<bullet> v = 0

goal (1 subgoal):
 1. v = 0
[PROOF STEP]
by simp


[STATEMENT]
lemma mset_le_add_iff1:
  "j \<le> (i::nat) \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (repeat_mset (i-j) u + m \<le> n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. j \<le> i \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (repeat_mset (i - j) u + m \<le> n)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. j \<le> i \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (repeat_mset (i - j) u + m \<le> n)
[PROOF STEP]
assume "j \<le> i"
[PROOF STATE]
proof (state)
this:
j \<le> i

goal (1 subgoal):
 1. j \<le> i \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (repeat_mset (i - j) u + m \<le> n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j \<le> i
[PROOF STEP]
have "j + (i - j) = i"
[PROOF STATE]
proof (prove)
using this:
j \<le> i

goal (1 subgoal):
 1. j + (i - j) = i
[PROOF STEP]
using le_add_diff_inverse
[PROOF STATE]
proof (prove)
using this:
j \<le> i
?b \<le> ?a \<Longrightarrow> ?b + (?a - ?b) = ?a

goal (1 subgoal):
 1. j + (i - j) = i
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
j + (i - j) = i

goal (1 subgoal):
 1. j \<le> i \<Longrightarrow> (repeat_mset i u + m \<le> repeat_mset j u + n) = (repeat_mset (i - j) u + m \<le> n)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
j + (i - j) = i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
j + (i - j) = i

goal (1 subgoal):
 1. (repeat_mset i u + m \<le> repeat_mset j u + n) = (repeat_mset (i - j) u + m \<le> n)
[PROOF STEP]
by (metis (no_types) add_le_cancel_left left_add_mult_distrib_mset)
[PROOF STATE]
proof (state)
this:
(repeat_mset i u + m \<le> repeat_mset j u + n) = (repeat_mset (i - j) u + m \<le> n)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma EM_remainder_converges_cnj:
  assumes "continuous_on {a..} f" and "EM_remainder_converges n f a"
  shows   "EM_remainder_converges n (\<lambda>x. cnj (f x)) a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
interpret bounded_linear cnj
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bounded_linear cnj
[PROOF STEP]
by (rule bounded_linear_cnj)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
obtain L where L: "((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>L. ((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
continuous_on {real_of_int a..} f
EM_remainder_converges n f a

goal (1 subgoal):
 1. (\<And>L. ((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
unfolding EM_remainder_converges_def
[PROOF STATE]
proof (prove)
using this:
continuous_on {real_of_int a..} f
\<exists>L. ((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top

goal (1 subgoal):
 1. (\<And>L. ((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
((\<lambda>x. EM_remainder' n f (real_of_int a) (real_of_int x)) \<longlongrightarrow> L) at_top

goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
note tendsto_cnj [OF this]
[PROOF STATE]
proof (state)
this:
((\<lambda>x. cnj (EM_remainder' n f (real_of_int a) (real_of_int x))) \<longlongrightarrow> cnj L) at_top

goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. cnj (EM_remainder' n f (real_of_int a) (real_of_int x))) \<longlongrightarrow> cnj L) at_top

goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
have "(\<lambda>x. cnj (EM_remainder' n f (real_of_int a) (real_of_int x))) =
               (\<lambda>x. EM_remainder' n (\<lambda>x. cnj (f x)) (real_of_int a) (real_of_int x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. cnj (EM_remainder' n f (real_of_int a) (real_of_int x))) = (\<lambda>x. EM_remainder' n (\<lambda>x. cnj (f x)) (real_of_int a) (real_of_int x))
[PROOF STEP]
by (subst EM_remainder'_bounded_linear [OF bounded_linear_cnj])
       (rule continuous_on_subset [OF assms(1)], auto)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. cnj (EM_remainder' n f (real_of_int a) (real_of_int x))) = (\<lambda>x. EM_remainder' n (\<lambda>x. cnj (f x)) (real_of_int a) (real_of_int x))

goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. EM_remainder' n (\<lambda>x. cnj (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> cnj L) at_top
[PROOF STEP]
have L': "(\<dots> \<longlongrightarrow> cnj L) at_top"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. EM_remainder' n (\<lambda>x. cnj (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> cnj L) at_top

goal (1 subgoal):
 1. ((\<lambda>x. EM_remainder' n (\<lambda>x. cnj (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> cnj L) at_top
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>x. EM_remainder' n (\<lambda>x. cnj (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> cnj L) at_top

goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
thus "EM_remainder_converges n (\<lambda>x. cnj (f x)) a"
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. EM_remainder' n (\<lambda>x. cnj (f x)) (real_of_int a) (real_of_int x)) \<longlongrightarrow> cnj L) at_top

goal (1 subgoal):
 1. EM_remainder_converges n (\<lambda>x. cnj (f x)) a
[PROOF STEP]
by (auto simp: EM_remainder_converges_def)
[PROOF STATE]
proof (state)
this:
EM_remainder_converges n (\<lambda>x. cnj (f x)) a

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma measure_eq_sum_singleton:
  "finite S \<Longrightarrow> (\<And>x. x \<in> S \<Longrightarrow> {x} \<in> sets M) \<Longrightarrow> (\<And>x. x \<in> S \<Longrightarrow> emeasure M {x} \<noteq> \<infinity>) \<Longrightarrow>
    measure M S = (\<Sum>x\<in>S. measure M {x})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>finite S; \<And>x. x \<in> S \<Longrightarrow> {x} \<in> sets M; \<And>x. x \<in> S \<Longrightarrow> emeasure M {x} \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M S = (\<Sum>x\<in>S. Sigma_Algebra.measure M {x})
[PROOF STEP]
using emeasure_eq_sum_singleton[of S M]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>finite S; \<And>x. x \<in> S \<Longrightarrow> {x} \<in> sets M\<rbrakk> \<Longrightarrow> emeasure M S = (\<Sum>x\<in>S. emeasure M {x})

goal (1 subgoal):
 1. \<lbrakk>finite S; \<And>x. x \<in> S \<Longrightarrow> {x} \<in> sets M; \<And>x. x \<in> S \<Longrightarrow> emeasure M {x} \<noteq> \<infinity>\<rbrakk> \<Longrightarrow> Sigma_Algebra.measure M S = (\<Sum>x\<in>S. Sigma_Algebra.measure M {x})
[PROOF STEP]
by (intro measure_eq_emeasure_eq_ennreal) (auto simp: sum_nonneg emeasure_eq_ennreal_measure)


[STATEMENT]
lemma clinear_eq_butterflyI:
  fixes F G :: \<open>('a::{chilbert_space,cfinite_dim} \<Rightarrow>\<^sub>C\<^sub>L 'b::complex_inner) \<Rightarrow> 'c::complex_vector\<close>
  assumes "clinear F" and "clinear G"
  assumes \<open>cspan basisA = UNIV\<close> \<open>cspan basisB = UNIV\<close>
  assumes \<open>is_ortho_set basisA\<close> \<open>is_ortho_set basisB\<close>
  assumes "\<And>a b. a\<in>basisA \<Longrightarrow> b\<in>basisB \<Longrightarrow> F (butterfly a b) = G (butterfly a b)"
  assumes \<open>\<And>b. b\<in>basisB \<Longrightarrow> norm b = 1\<close>
  shows "F = G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F = G
[PROOF STEP]
apply (rule complex_vector.linear_eq_on_span[where f=F, THEN ext, rotated 3])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. x \<in> cspan (?B1 x)
 2. \<And>x. clinear F
 3. \<And>x. clinear G
 4. \<And>x xa. xa \<in> ?B1 x \<Longrightarrow> F xa = G xa
[PROOF STEP]
apply (subst cspan_butterfly_UNIV)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>x. cspan (?basisA7 x x) = UNIV
 2. \<And>x. cspan (?basisB7 x x) = UNIV
 3. \<And>x. is_ortho_set (?basisB7 x x)
 4. \<And>x b. b \<in> ?basisB7 x x \<Longrightarrow> norm b = 1
 5. \<And>x. x \<in> UNIV
 6. \<And>x. clinear F
 7. \<And>x. clinear G
 8. \<And>x xa. xa \<in> {butterfly a b |a b. a \<in> ?basisA7 x x \<and> b \<in> ?basisB7 x x} \<Longrightarrow> F xa = G xa
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
clinear F
clinear G
cspan basisA = UNIV
cspan basisB = UNIV
is_ortho_set basisA
is_ortho_set basisB
\<lbrakk>?a \<in> basisA; ?b \<in> basisB\<rbrakk> \<Longrightarrow> F (butterfly ?a ?b) = G (butterfly ?a ?b)
?b \<in> basisB \<Longrightarrow> norm ?b = 1

goal (8 subgoals):
 1. \<And>x. cspan (?basisA7 x x) = UNIV
 2. \<And>x. cspan (?basisB7 x x) = UNIV
 3. \<And>x. is_ortho_set (?basisB7 x x)
 4. \<And>x b. b \<in> ?basisB7 x x \<Longrightarrow> norm b = 1
 5. \<And>x. x \<in> UNIV
 6. \<And>x. clinear F
 7. \<And>x. clinear G
 8. \<And>x xa. xa \<in> {butterfly a b |a b. a \<in> ?basisA7 x x \<and> b \<in> ?basisB7 x x} \<Longrightarrow> F xa = G xa
[PROOF STEP]
by auto


[STATEMENT]
lemma get_fstn_args_take: "\<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow>
  map (\<lambda> f. rec_exec f xs) (get_fstn_args m n)= take n xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m n) = take n xs
[PROOF STEP]
proof(induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>length xs = m; 0 \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m 0) = take 0 xs
 2. \<And>n. \<lbrakk>\<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m n) = take n xs; length xs = m; Suc n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m (Suc n)) = take (Suc n) xs
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
length xs = m
0 \<le> m

goal (2 subgoals):
 1. \<lbrakk>length xs = m; 0 \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m 0) = take 0 xs
 2. \<And>n. \<lbrakk>\<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m n) = take n xs; length xs = m; Suc n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m (Suc n)) = take (Suc n) xs
[PROOF STEP]
thus "?case"
[PROOF STATE]
proof (prove)
using this:
length xs = m
0 \<le> m

goal (1 subgoal):
 1. map (\<lambda>f. rec_exec f xs) (get_fstn_args m 0) = take 0 xs
[PROOF STEP]
by(simp add: get_fstn_args.simps)
[PROOF STATE]
proof (state)
this:
map (\<lambda>f. rec_exec f xs) (get_fstn_args m 0) = take 0 xs

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m n) = take n xs; length xs = m; Suc n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m (Suc n)) = take (Suc n) xs
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m n) = take n xs; length xs = m; Suc n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m (Suc n)) = take (Suc n) xs
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
\<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m n) = take n xs
length xs = m
Suc n \<le> m

goal (1 subgoal):
 1. \<And>n. \<lbrakk>\<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m n) = take n xs; length xs = m; Suc n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m (Suc n)) = take (Suc n) xs
[PROOF STEP]
thus "?case"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>length xs = m; n \<le> m\<rbrakk> \<Longrightarrow> map (\<lambda>f. rec_exec f xs) (get_fstn_args m n) = take n xs
length xs = m
Suc n \<le> m

goal (1 subgoal):
 1. map (\<lambda>f. rec_exec f xs) (get_fstn_args m (Suc n)) = take (Suc n) xs
[PROOF STEP]
by(simp add: get_fstn_args.simps rec_exec.simps
        take_Suc_conv_app_nth)
[PROOF STATE]
proof (state)
this:
map (\<lambda>f. rec_exec f xs) (get_fstn_args m (Suc n)) = take (Suc n) xs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma order_char_poly_smult: fixes A :: "complex mat"
  assumes A: "A \<in> carrier_mat n n"
  and k: "k \<noteq> 0"
shows "order x (char_poly (k \<cdot>\<^sub>m A)) = order (x / k) (char_poly A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x (char_poly (k \<cdot>\<^sub>m A)) = order (x / k) (char_poly A)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. order x (char_poly (k \<cdot>\<^sub>m A)) = order (x / k) (char_poly A)
[PROOF STEP]
from char_poly_factorized[OF A]
[PROOF STATE]
proof (chain)
picking this:
\<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n
[PROOF STEP]
obtain as where "char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:])"
[PROOF STATE]
proof (prove)
using this:
\<exists>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<and> length as = n

goal (1 subgoal):
 1. (\<And>as. char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:]) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
char_poly A = (\<Prod>a\<leftarrow>as. [:- a, 1:])

goal (1 subgoal):
 1. order x (char_poly (k \<cdot>\<^sub>m A)) = order (x / k) (char_poly A)
[PROOF STEP]
from jordan_nf_exists[OF A this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>n_as. jordan_nf A n_as
[PROOF STEP]
obtain n_as where jnf: "jordan_nf A n_as"
[PROOF STATE]
proof (prove)
using this:
\<exists>n_as. jordan_nf A n_as

goal (1 subgoal):
 1. (\<And>n_as. jordan_nf A n_as \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
jordan_nf A n_as

goal (1 subgoal):
 1. order x (char_poly (k \<cdot>\<^sub>m A)) = order (x / k) (char_poly A)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. order x (char_poly (k \<cdot>\<^sub>m A)) = order (x / k) (char_poly A)
[PROOF STEP]
unfolding jordan_nf_order[OF jnf] jordan_nf_order[OF jordan_nf_smult[OF jnf k]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum_list (map fst (filter (\<lambda>na. snd na = x) (map (\<lambda>(n, a). (n, k * a)) n_as))) = sum_list (map fst (filter (\<lambda>na. snd na = x / k) n_as))
[PROOF STEP]
by (induct n_as, auto simp: k)
[PROOF STATE]
proof (state)
this:
order x (char_poly (k \<cdot>\<^sub>m A)) = order (x / k) (char_poly A)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma norm_infsetsum_bound:
  "norm (infsetsum f A) \<le> infsetsum (\<lambda>x. norm (f x)) A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (infsetsum f A) \<le> (\<Sum>\<^sub>ax\<in>A. norm (f x))
[PROOF STEP]
unfolding abs_summable_on_def infsetsum_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral\<^sup>L (count_space A) f) \<le> LINT x|count_space A. norm (f x)
[PROOF STEP]
by (rule Bochner_Integration.integral_norm_bound)


[STATEMENT]
lemma ennreal_top_eq_mult_iff:
  fixes a b :: ennreal
  shows "top = a * b \<longleftrightarrow> (a = top \<and> b \<noteq> 0) \<or> (b = top \<and> a \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (top = a * b) = (a = top \<and> b \<noteq> 0 \<or> b = top \<and> a \<noteq> 0)
[PROOF STEP]
using ennreal_mult_eq_top_iff[of a b]
[PROOF STATE]
proof (prove)
using this:
(a * b = top) = (a = top \<and> b \<noteq> 0 \<or> b = top \<and> a \<noteq> 0)

goal (1 subgoal):
 1. (top = a * b) = (a = top \<and> b \<noteq> 0 \<or> b = top \<and> a \<noteq> 0)
[PROOF STEP]
by auto


[STATEMENT]
lemma cnj_transpose_is_dagger [simp]:
  "(M\<^sup>\<star>)\<^sup>t = (M\<^sup>\<dagger>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M\<^sup>\<star>\<^sup>t = M\<^sup>\<dagger>
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row M\<^sup>\<dagger>; j < dim_col M\<^sup>\<dagger>\<rbrakk> \<Longrightarrow> M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)
 2. dim_row M\<^sup>\<star>\<^sup>t = dim_row M\<^sup>\<dagger>
 3. dim_col M\<^sup>\<star>\<^sup>t = dim_col M\<^sup>\<dagger>
[PROOF STEP]
show "dim_row ((M\<^sup>\<star>)\<^sup>t) = dim_row (M\<^sup>\<dagger>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row M\<^sup>\<star>\<^sup>t = dim_row M\<^sup>\<dagger>
[PROOF STEP]
by (simp add: transpose_mat_def cpx_mat_cnj_def dagger_def)
[PROOF STATE]
proof (state)
this:
dim_row M\<^sup>\<star>\<^sup>t = dim_row M\<^sup>\<dagger>

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row M\<^sup>\<dagger>; j < dim_col M\<^sup>\<dagger>\<rbrakk> \<Longrightarrow> M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)
 2. dim_col M\<^sup>\<star>\<^sup>t = dim_col M\<^sup>\<dagger>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row M\<^sup>\<dagger>; j < dim_col M\<^sup>\<dagger>\<rbrakk> \<Longrightarrow> M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)
 2. dim_col M\<^sup>\<star>\<^sup>t = dim_col M\<^sup>\<dagger>
[PROOF STEP]
show "dim_col ((M\<^sup>\<star>)\<^sup>t) = dim_col (M\<^sup>\<dagger>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col M\<^sup>\<star>\<^sup>t = dim_col M\<^sup>\<dagger>
[PROOF STEP]
by (simp add: transpose_mat_def cpx_mat_cnj_def dagger_def)
[PROOF STATE]
proof (state)
this:
dim_col M\<^sup>\<star>\<^sup>t = dim_col M\<^sup>\<dagger>

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M\<^sup>\<dagger>; j < dim_col M\<^sup>\<dagger>\<rbrakk> \<Longrightarrow> M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M\<^sup>\<dagger>; j < dim_col M\<^sup>\<dagger>\<rbrakk> \<Longrightarrow> M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)
[PROOF STEP]
fix i j::nat
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M\<^sup>\<dagger>; j < dim_col M\<^sup>\<dagger>\<rbrakk> \<Longrightarrow> M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)
[PROOF STEP]
assume "i < dim_row M\<^sup>\<dagger>" and "j < dim_col M\<^sup>\<dagger>"
[PROOF STATE]
proof (state)
this:
i < dim_row M\<^sup>\<dagger>
j < dim_col M\<^sup>\<dagger>

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row M\<^sup>\<dagger>; j < dim_col M\<^sup>\<dagger>\<rbrakk> \<Longrightarrow> M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row M\<^sup>\<dagger>
j < dim_col M\<^sup>\<dagger>
[PROOF STEP]
show "M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)"
[PROOF STATE]
proof (prove)
using this:
i < dim_row M\<^sup>\<dagger>
j < dim_col M\<^sup>\<dagger>

goal (1 subgoal):
 1. M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)
[PROOF STEP]
by (simp add: transpose_mat_def cpx_mat_cnj_def dagger_def)
[PROOF STATE]
proof (state)
this:
M\<^sup>\<star>\<^sup>t $$ (i, j) = M\<^sup>\<dagger> $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma size_of_rhs_R:
  fixes p:: "real poly"
  fixes qs :: "real poly list"
  fixes subsets :: "(nat list*nat list) list"
  shows "dim_vec (construct_rhs_vector_R p qs subsets) = length subsets"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (v_vec_R p qs subsets) = length subsets
[PROOF STEP]
unfolding construct_rhs_vector_R_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (vec_of_list (map (\<lambda>(I1, I2). construct_NofI_R p (retrieve_polys qs I1) (retrieve_polys qs I2)) subsets)) = length subsets
[PROOF STEP]
by simp


[STATEMENT]
lemma orthogonalD[elim]:
  "orthogonal vs \<Longrightarrow> i < length vs \<Longrightarrow> j < length vs \<Longrightarrow>
  (nth vs i \<bullet> nth vs j = 0) = (i \<noteq> j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>orthogonal vs; i < length vs; j < length vs\<rbrakk> \<Longrightarrow> (vs ! i \<bullet> vs ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
unfolding orthogonal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i j. i < length vs \<longrightarrow> j < length vs \<longrightarrow> (vs ! i \<bullet> vs ! j = (0::'a)) = (i \<noteq> j); i < length vs; j < length vs\<rbrakk> \<Longrightarrow> (vs ! i \<bullet> vs ! j = (0::'a)) = (i \<noteq> j)
[PROOF STEP]
by auto


[STATEMENT]
lemma vimage2p_map_rel_prod:
  "vimage2p (map_prod f g) (map_prod f' g') (rel_prod A B) = rel_prod (vimage2p f f' A) (vimage2p g g' B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vimage2p (map_prod f g) (map_prod f' g') (rel_prod A B) = rel_prod (vimage2p f f' A) (vimage2p g g' B)
[PROOF STEP]
by(simp add: vimage2p_def prod.rel_map)


[STATEMENT]
lemma absolutely_integrable_on_def:
  fixes f :: "'a::euclidean_space \<Rightarrow> 'b::euclidean_space"
  shows "f absolutely_integrable_on S \<longleftrightarrow> f integrable_on S \<and> (\<lambda>x. norm (f x)) integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f absolutely_integrable_on S) = (f integrable_on S \<and> (\<lambda>x. norm (f x)) integrable_on S)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> f integrable_on S
 2. f absolutely_integrable_on S \<Longrightarrow> (\<lambda>x. norm (f x)) integrable_on S
 3. \<lbrakk>f integrable_on S; (\<lambda>x. norm (f x)) integrable_on S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
assume f: "f absolutely_integrable_on S"
[PROOF STATE]
proof (state)
this:
f absolutely_integrable_on S

goal (3 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> f integrable_on S
 2. f absolutely_integrable_on S \<Longrightarrow> (\<lambda>x. norm (f x)) integrable_on S
 3. \<lbrakk>f integrable_on S; (\<lambda>x. norm (f x)) integrable_on S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
f absolutely_integrable_on S
[PROOF STEP]
have nf: "integrable lebesgue (\<lambda>x. norm (indicator S x *\<^sub>R f x))"
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on S

goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. norm (indicat_real S x *\<^sub>R f x))
[PROOF STEP]
using integrable_norm set_integrable_def
[PROOF STATE]
proof (prove)
using this:
f absolutely_integrable_on S
integrable ?M ?f \<Longrightarrow> integrable ?M (\<lambda>x. norm (?f x))
set_integrable ?M ?A ?f \<equiv> integrable ?M (\<lambda>x. indicat_real ?A x *\<^sub>R ?f x)

goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. norm (indicat_real S x *\<^sub>R f x))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
integrable lebesgue (\<lambda>x. norm (indicat_real S x *\<^sub>R f x))

goal (3 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> f integrable_on S
 2. f absolutely_integrable_on S \<Longrightarrow> (\<lambda>x. norm (f x)) integrable_on S
 3. \<lbrakk>f integrable_on S; (\<lambda>x. norm (f x)) integrable_on S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
show "f integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on S
[PROOF STEP]
by (rule set_lebesgue_integral_eq_integral[OF f])
[PROOF STATE]
proof (state)
this:
f integrable_on S

goal (2 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> (\<lambda>x. norm (f x)) integrable_on S
 2. \<lbrakk>f integrable_on S; (\<lambda>x. norm (f x)) integrable_on S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
have "(\<lambda>x. norm (indicator S x *\<^sub>R f x)) = (\<lambda>x. if x \<in> S then norm (f x) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. norm (indicat_real S x *\<^sub>R f x)) = (\<lambda>x. if x \<in> S then norm (f x) else 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<lambda>x. norm (indicat_real S x *\<^sub>R f x)) = (\<lambda>x. if x \<in> S then norm (f x) else 0)

goal (2 subgoals):
 1. f absolutely_integrable_on S \<Longrightarrow> (\<lambda>x. norm (f x)) integrable_on S
 2. \<lbrakk>f integrable_on S; (\<lambda>x. norm (f x)) integrable_on S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
with integrable_on_lebesgue[OF nf]
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>x. norm (indicat_real S x *\<^sub>R f x)) integrable_on UNIV
(\<lambda>x. norm (indicat_real S x *\<^sub>R f x)) = (\<lambda>x. if x \<in> S then norm (f x) else 0)
[PROOF STEP]
show "(\<lambda>x. norm (f x)) integrable_on S"
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. norm (indicat_real S x *\<^sub>R f x)) integrable_on UNIV
(\<lambda>x. norm (indicat_real S x *\<^sub>R f x)) = (\<lambda>x. if x \<in> S then norm (f x) else 0)

goal (1 subgoal):
 1. (\<lambda>x. norm (f x)) integrable_on S
[PROOF STEP]
by (simp add: integrable_restrict_UNIV)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. norm (f x)) integrable_on S

goal (1 subgoal):
 1. \<lbrakk>f integrable_on S; (\<lambda>x. norm (f x)) integrable_on S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>f integrable_on S; (\<lambda>x. norm (f x)) integrable_on S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
assume f: "f integrable_on S" and nf: "(\<lambda>x. norm (f x)) integrable_on S"
[PROOF STATE]
proof (state)
this:
f integrable_on S
(\<lambda>x. norm (f x)) integrable_on S

goal (1 subgoal):
 1. \<lbrakk>f integrable_on S; (\<lambda>x. norm (f x)) integrable_on S\<rbrakk> \<Longrightarrow> f absolutely_integrable_on S
[PROOF STEP]
show "f absolutely_integrable_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f absolutely_integrable_on S
[PROOF STEP]
unfolding set_integrable_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integrable lebesgue (\<lambda>x. indicat_real S x *\<^sub>R f x)
[PROOF STEP]
proof (rule integrableI_bounded)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue
 2. \<integral>\<^sup>+ x. ennreal (norm (indicat_real S x *\<^sub>R f x)) \<partial>lebesgue < \<infinity>
[PROOF STEP]
show "(\<lambda>x. indicator S x *\<^sub>R f x) \<in> borel_measurable lebesgue"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue
[PROOF STEP]
using f has_integral_implies_lebesgue_measurable[of f _ S]
[PROOF STATE]
proof (prove)
using this:
f integrable_on S
(f has_integral ?I) S \<Longrightarrow> (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue

goal (1 subgoal):
 1. (\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue
[PROOF STEP]
by (auto simp: integrable_on_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. indicat_real S x *\<^sub>R f x) \<in> borel_measurable lebesgue

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (indicat_real S x *\<^sub>R f x)) \<partial>lebesgue < \<infinity>
[PROOF STEP]
show "(\<integral>\<^sup>+ x. ennreal (norm (indicator S x *\<^sub>R f x)) \<partial>lebesgue) < \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (indicat_real S x *\<^sub>R f x)) \<partial>lebesgue < \<infinity>
[PROOF STEP]
using nf nn_integral_has_integral_lebesgue[of "\<lambda>x. norm (f x)" _ S]
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. norm (f x)) integrable_on S
\<lbrakk>\<And>x. 0 \<le> norm (f x); ((\<lambda>x. norm (f x)) has_integral ?I) S\<rbrakk> \<Longrightarrow> \<integral>\<^sup>+ x. ennreal (indicat_real S x * norm (f x)) \<partial>lborel = ennreal ?I

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (norm (indicat_real S x *\<^sub>R f x)) \<partial>lebesgue < \<infinity>
[PROOF STEP]
by (auto simp: integrable_on_def nn_integral_completion)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ x. ennreal (norm (indicat_real S x *\<^sub>R f x)) \<partial>lebesgue < \<infinity>

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
f absolutely_integrable_on S

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem infinite_UNIV_fun1 [simp]:
"infinite (UNIV :: 'a set) \<Longrightarrow>
 card (UNIV :: 'b set) \<noteq> Suc 0 \<Longrightarrow>
 infinite (UNIV :: ('a \<Rightarrow> 'b) set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>infinite UNIV; card UNIV \<noteq> Suc 0\<rbrakk> \<Longrightarrow> infinite UNIV
[PROOF STEP]
apply (erule contrapos_nn)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>card UNIV \<noteq> Suc 0; finite UNIV\<rbrakk> \<Longrightarrow> finite UNIV
[PROOF STEP]
apply (erule finite_fun_UNIVD1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card UNIV \<noteq> Suc 0 \<Longrightarrow> card UNIV \<noteq> Suc 0
[PROOF STEP]
apply (assumption)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma float_mult:
  "float (a1, e1) * float (a2, e2) = (float (a1 * a2, e1 + e2))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. float (a1, e1) * float (a2, e2) = float (a1 * a2, e1 + e2)
[PROOF STEP]
by (simp add: float_def powr_add)


[STATEMENT]
lemma eqpoll_connected_components_Euclidean_complements:
  assumes S: "closedin (Euclidean_space n) S" and T: "closedin (Euclidean_space n) T"
     and ST: "(subtopology (Euclidean_space n) S) homeomorphic_space (subtopology (Euclidean_space n) T)"
  shows "connected_components_of
             (subtopology (Euclidean_space n)
                          (topspace(Euclidean_space n) - S))
        \<approx> connected_components_of
             (subtopology (Euclidean_space n)
                          (topspace(Euclidean_space n) - T))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - S)) \<approx> connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - T))
[PROOF STEP]
using eqpoll_path_components_Euclidean_complements [OF assms]
[PROOF STATE]
proof (prove)
using this:
path_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - S)) \<approx> path_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - T))

goal (1 subgoal):
 1. connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - S)) \<approx> connected_components_of (subtopology (Euclidean_space n) (topspace (Euclidean_space n) - T))
[PROOF STEP]
by (metis S T closedin_def locally_path_connected_Euclidean_space locally_path_connected_space_open_subset path_components_eq_connected_components_of)


[STATEMENT]
lemma fib_add: "fib (Suc (n + k)) = fib (Suc k) * fib (Suc n) + fib k * fib n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fib (Suc (n + k)) = fib (Suc k) * fib (Suc n) + fib k * fib n
[PROOF STEP]
by (induct n rule: fib.induct) (auto simp add: field_simps)