[STATEMENT]
lemma trunc_ell2_norm_mono: \<open>M \<subseteq> N \<Longrightarrow> norm (trunc_ell2 M \<psi>) \<le> norm (trunc_ell2 N \<psi>)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M \<subseteq> N \<Longrightarrow> norm (trunc_ell2 M \<psi>) \<le> norm (trunc_ell2 N \<psi>)
[PROOF STEP]
proof (rule power2_le_imp_le[rotated], force, transfer)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M N \<psi>. \<lbrakk>M \<subseteq> N; has_ell2_norm \<psi>\<rbrakk> \<Longrightarrow> (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
fix M N :: \<open>'a set\<close> and \<psi> :: \<open>'a \<Rightarrow> complex\<close>
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>M N \<psi>. \<lbrakk>M \<subseteq> N; has_ell2_norm \<psi>\<rbrakk> \<Longrightarrow> (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
assume \<open>M \<subseteq> N\<close> and \<open>has_ell2_norm \<psi>\<close>
[PROOF STATE]
proof (state)
this:
M \<subseteq> N
has_ell2_norm \<psi>

goal (1 subgoal):
 1. \<And>M N \<psi>. \<lbrakk>M \<subseteq> N; has_ell2_norm \<psi>\<rbrakk> \<Longrightarrow> (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
have \<open>(ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 = (\<Sum>\<^sub>\<infinity>i\<in>M. (cmod (\<psi> i))\<^sup>2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 = (\<Sum>\<^sub>\<infinity>i\<in>M. (cmod (\<psi> i))\<^sup>2)
[PROOF STEP]
unfolding ell2_norm_square
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>i. (cmod (if i \<in> M then \<psi> i else 0))\<^sup>2) = (\<Sum>\<^sub>\<infinity>i\<in>M. (cmod (\<psi> i))\<^sup>2)
[PROOF STEP]
apply (rule infsum_cong_neutral)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. x \<in> M - UNIV \<Longrightarrow> (cmod (\<psi> x))\<^sup>2 = 0
 2. \<And>x. x \<in> UNIV - M \<Longrightarrow> (cmod (if x \<in> M then \<psi> x else 0))\<^sup>2 = 0
 3. \<And>x. x \<in> UNIV \<inter> M \<Longrightarrow> (cmod (if x \<in> M then \<psi> x else 0))\<^sup>2 = (cmod (\<psi> x))\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 = (\<Sum>\<^sub>\<infinity>i\<in>M. (cmod (\<psi> i))\<^sup>2)

goal (1 subgoal):
 1. \<And>M N \<psi>. \<lbrakk>M \<subseteq> N; has_ell2_norm \<psi>\<rbrakk> \<Longrightarrow> (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 = (\<Sum>\<^sub>\<infinity>i\<in>M. (cmod (\<psi> i))\<^sup>2)

goal (1 subgoal):
 1. \<And>M N \<psi>. \<lbrakk>M \<subseteq> N; has_ell2_norm \<psi>\<rbrakk> \<Longrightarrow> (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
have \<open>\<dots> \<le> (\<Sum>\<^sub>\<infinity>i\<in>N. (cmod (\<psi> i))\<^sup>2)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>i\<in>M. (cmod (\<psi> i))\<^sup>2) \<le> (\<Sum>\<^sub>\<infinity>i\<in>N. (cmod (\<psi> i))\<^sup>2)
[PROOF STEP]
apply (rule infsum_mono2)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. (\<lambda>i. (cmod (\<psi> i))\<^sup>2) summable_on M
 2. (\<lambda>i. (cmod (\<psi> i))\<^sup>2) summable_on N
 3. M \<subseteq> N
 4. \<And>x. x \<in> N - M \<Longrightarrow> 0 \<le> (cmod (\<psi> x))\<^sup>2
[PROOF STEP]
using \<open>has_ell2_norm \<psi>\<close> \<open>M \<subseteq> N\<close>
[PROOF STATE]
proof (prove)
using this:
has_ell2_norm \<psi>
M \<subseteq> N

goal (4 subgoals):
 1. (\<lambda>i. (cmod (\<psi> i))\<^sup>2) summable_on M
 2. (\<lambda>i. (cmod (\<psi> i))\<^sup>2) summable_on N
 3. M \<subseteq> N
 4. \<And>x. x \<in> N - M \<Longrightarrow> 0 \<le> (cmod (\<psi> x))\<^sup>2
[PROOF STEP]
by (auto simp add: ell2_norm_square has_ell2_norm_def simp flip: norm_power intro: summable_on_subset_banach)
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>i\<in>M. (cmod (\<psi> i))\<^sup>2) \<le> (\<Sum>\<^sub>\<infinity>i\<in>N. (cmod (\<psi> i))\<^sup>2)

goal (1 subgoal):
 1. \<And>M N \<psi>. \<lbrakk>M \<subseteq> N; has_ell2_norm \<psi>\<rbrakk> \<Longrightarrow> (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>i\<in>M. (cmod (\<psi> i))\<^sup>2) \<le> (\<Sum>\<^sub>\<infinity>i\<in>N. (cmod (\<psi> i))\<^sup>2)

goal (1 subgoal):
 1. \<And>M N \<psi>. \<lbrakk>M \<subseteq> N; has_ell2_norm \<psi>\<rbrakk> \<Longrightarrow> (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
have \<open>\<dots> = (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>i\<in>N. (cmod (\<psi> i))\<^sup>2) = (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
unfolding ell2_norm_square
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>\<^sub>\<infinity>i\<in>N. (cmod (\<psi> i))\<^sup>2) = (\<Sum>\<^sub>\<infinity>i. (cmod (if i \<in> N then \<psi> i else 0))\<^sup>2)
[PROOF STEP]
apply (rule infsum_cong_neutral)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. x \<in> UNIV - N \<Longrightarrow> (cmod (if x \<in> N then \<psi> x else 0))\<^sup>2 = 0
 2. \<And>x. x \<in> N - UNIV \<Longrightarrow> (cmod (\<psi> x))\<^sup>2 = 0
 3. \<And>x. x \<in> N \<inter> UNIV \<Longrightarrow> (cmod (\<psi> x))\<^sup>2 = (cmod (if x \<in> N then \<psi> x else 0))\<^sup>2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<Sum>\<^sub>\<infinity>i\<in>N. (cmod (\<psi> i))\<^sup>2) = (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2

goal (1 subgoal):
 1. \<And>M N \<psi>. \<lbrakk>M \<subseteq> N; has_ell2_norm \<psi>\<rbrakk> \<Longrightarrow> (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
show \<open>(ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2\<close>
[PROOF STATE]
proof (prove)
using this:
(ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2

goal (1 subgoal):
 1. (ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2
[PROOF STEP]
by -
[PROOF STATE]
proof (state)
this:
(ell2_norm (\<lambda>i. if i \<in> M then \<psi> i else 0))\<^sup>2 \<le> (ell2_norm (\<lambda>i. if i \<in> N then \<psi> i else 0))\<^sup>2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma three_fixed_points_01inf:
  assumes "moebius_pt M 0\<^sub>h = 0\<^sub>h" and "moebius_pt M 1\<^sub>h = 1\<^sub>h" and "moebius_pt M \<infinity>\<^sub>h = \<infinity>\<^sub>h"
  shows "M = id_moebius"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. M = id_moebius
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
moebius_pt M 0\<^sub>h = 0\<^sub>h
moebius_pt M 1\<^sub>h = 1\<^sub>h
moebius_pt M \<infinity>\<^sub>h = \<infinity>\<^sub>h

goal (1 subgoal):
 1. M = id_moebius
[PROOF STEP]
by (transfer, transfer, auto)


[STATEMENT]
lemma liminf_obtain:
  fixes u::"nat \<Rightarrow> 'a :: complete_linorder"
  assumes "liminf u < c"
  shows "\<exists>n \<ge> N. u n < c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>n\<ge>N. u n < c
[PROOF STEP]
using Liminf_obtain'[OF assms, of "\<lambda>n. n \<ge> N"]
[PROOF STATE]
proof (prove)
using this:
eventually ((\<le>) N) sequentially \<Longrightarrow> \<exists>n\<ge>N. u n < c

goal (1 subgoal):
 1. \<exists>n\<ge>N. u n < c
[PROOF STEP]
unfolding eventually_sequentially
[PROOF STATE]
proof (prove)
using this:
\<exists>Na. \<forall>n\<ge>Na. N \<le> n \<Longrightarrow> \<exists>n\<ge>N. u n < c

goal (1 subgoal):
 1. \<exists>n\<ge>N. u n < c
[PROOF STEP]
by auto


[STATEMENT]
lemma sorted_hd_last:
  "\<lbrakk>sorted l; l\<noteq>[]\<rbrakk> \<Longrightarrow> hd l \<le> last l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sorted l; l \<noteq> []\<rbrakk> \<Longrightarrow> hd l \<le> last l
[PROOF STEP]
by (metis eq_iff hd_Cons_tl last_in_set not_hd_in_tl sorted_wrt.simps(2))


[STATEMENT]
lemma equalityI'':
  assumes "\<And>x. A x \<Longrightarrow> B x"
  assumes "\<And>x. B x \<Longrightarrow> A x"
  shows "{x. A x} = {x. B x}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {x. A x} = {x. B x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A ?x \<Longrightarrow> B ?x
B ?x \<Longrightarrow> A ?x

goal (1 subgoal):
 1. {x. A x} = {x. B x}
[PROOF STEP]
by blast


[STATEMENT]
lemma hidden_sqrt_two_squared_cpx2:
  fixes x y :: complex
  shows "(sqrt 2) * ((sqrt 2) * (x * y)) / 2 = x * y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. complex_of_real (sqrt 2) * (complex_of_real (sqrt 2) * (x * y)) / 2 = x * y
[PROOF STEP]
using sqrt_two_squared_cpx
[PROOF STATE]
proof (prove)
using this:
complex_of_real (sqrt 2) * complex_of_real (sqrt 2) = 2

goal (1 subgoal):
 1. complex_of_real (sqrt 2) * (complex_of_real (sqrt 2) * (x * y)) / 2 = x * y
[PROOF STEP]
by auto


[STATEMENT]
lemma gcd_mono: "a dvd c \<Longrightarrow> b dvd d \<Longrightarrow> gcd a b dvd gcd c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a dvd c; b dvd d\<rbrakk> \<Longrightarrow> gcd a b dvd gcd c d
[PROOF STEP]
by (simp add: gcd_dvdI1 gcd_dvdI2)


[STATEMENT]
lemma col_upd_col_If: "col (upd_col M i x) j = (if i = j then x else col M j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. col (upd_col M i x) j = (if i = j then x else col M j)
[PROOF STEP]
by transfer (simp add: vec_eq_iff)


[STATEMENT]
lemma fps_mult_nth_0 [simp]: "(f * g) $ 0 = f $ 0 * g $ 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f * g) $ 0 = f $ 0 * g $ 0
[PROOF STEP]
unfolding fps_times_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs_fps (\<lambda>n. \<Sum>i = 0..n. f $ i * g $ (n - i)) $ 0 = f $ 0 * g $ 0
[PROOF STEP]
by simp


[STATEMENT]
lemma reduce_D0:
"reduce a b 0 A = (let Aaj = A$$(a,0); Abj = A $$ (b,0)
  in
  if Aaj = 0 then A else
  case euclid_ext2 Aaj Abj of (p,q,u,v,d) \<Rightarrow>
       Matrix.mat (dim_row A) (dim_col A)
          (\<lambda>(i,k). if i = a then  (p*A$$(a,k) + q*A$$(b,k))
                   else if i = b then  u * A$$(a,k) + v * A$$(b,k)
                   else A$$(i,k)
            )
  )" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduce a b 0 A = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))); j < dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))\<rbrakk> \<Longrightarrow> reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)
 2. dim_row (reduce a b 0 A) = dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
 3. dim_col (reduce a b 0 A) = dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
obtain p q u v d where pquvd: "(p,q,u,v,d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p q u v d. (p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (simp add: euclid_ext2_def)
[PROOF STATE]
proof (state)
this:
(p, q, u, v, d) = euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))); j < dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))\<rbrakk> \<Longrightarrow> reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)
 2. dim_row (reduce a b 0 A) = dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
 3. dim_col (reduce a b 0 A) = dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
have *:" Matrix.mat (dim_row A) (dim_col A)
        (\<lambda>(i, k).
            if i = a then let r = p * A $$ (a, k) + q * A $$ (b, k) in if 0 < \<bar>r\<bar> then
                                  if k = 0 \<and> 0 dvd r then 0 else r mod 0 else r
            else if i = b then let r = u * A $$ (a, k) + v * A $$ (b, k) in
                              if 0 < \<bar>r\<bar> then r mod 0 else r else A $$ (i, k))
        = Matrix.mat (dim_row A) (dim_col A)
          (\<lambda>(i,k). if i = a then  (p*A$$(a,k) + q*A$$(b,k))
                   else if i = b then  u * A$$(a,k) + v * A$$(b,k)
                   else A$$(i,k)
            )"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then let r = p * A $$ (a, k) + q * A $$ (b, k) in if 0 < \<bar>r\<bar> then if k = 0 \<and> 0 dvd r then 0 else r mod 0 else r else if i = b then let r = u * A $$ (a, k) + v * A $$ (b, k) in if 0 < \<bar>r\<bar> then r mod 0 else r else A $$ (i, k)) = Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))
[PROOF STEP]
by (rule eq_matI, auto simp add: Let_def)
[PROOF STATE]
proof (state)
this:
Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then let r = p * A $$ (a, k) + q * A $$ (b, k) in if 0 < \<bar>r\<bar> then if k = 0 \<and> 0 dvd r then 0 else r mod 0 else r else if i = b then let r = u * A $$ (a, k) + v * A $$ (b, k) in if 0 < \<bar>r\<bar> then r mod 0 else r else A $$ (i, k)) = Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))

goal (3 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))); j < dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))\<rbrakk> \<Longrightarrow> reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)
 2. dim_row (reduce a b 0 A) = dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
 3. dim_col (reduce a b 0 A) = dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
show "dim_row ?lhs = dim_row ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (reduce a b 0 A) = dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
unfolding reduce.simps Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_row (if A $$ (a, 0) = 0 then A else case euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then if k = 0 then if 0 dvd p * A $$ (a, k) + q * A $$ (b, k) then 0 else p * A $$ (a, k) + q * A $$ (b, k) else (p * A $$ (a, k) + q * A $$ (b, k)) gmod 0 else if i = b then if k = 0 then u * A $$ (a, k) + v * A $$ (b, k) else (u * A $$ (a, k) + v * A $$ (b, k)) gmod 0 else A $$ (i, k))) = dim_row (if A $$ (a, 0) = 0 then A else case euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
by (smt dim_row_mat(1) pquvd prod.simps(2))
[PROOF STATE]
proof (state)
this:
dim_row (reduce a b 0 A) = dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))

goal (2 subgoals):
 1. \<And>i j. \<lbrakk>i < dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))); j < dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))\<rbrakk> \<Longrightarrow> reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)
 2. dim_col (reduce a b 0 A) = dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
show "dim_col ?lhs = dim_col ?rhs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (reduce a b 0 A) = dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
unfolding reduce.simps Let_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_col (if A $$ (a, 0) = 0 then A else case euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then if k = 0 then if 0 dvd p * A $$ (a, k) + q * A $$ (b, k) then 0 else p * A $$ (a, k) + q * A $$ (b, k) else (p * A $$ (a, k) + q * A $$ (b, k)) gmod 0 else if i = b then if k = 0 then u * A $$ (a, k) + v * A $$ (b, k) else (u * A $$ (a, k) + v * A $$ (b, k)) gmod 0 else A $$ (i, k))) = dim_col (if A $$ (a, 0) = 0 then A else case euclid_ext2 (A $$ (a, 0)) (A $$ (b, 0)) of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
[PROOF STEP]
by (smt dim_col_mat(1) pquvd prod.simps(2))
[PROOF STATE]
proof (state)
this:
dim_col (reduce a b 0 A) = dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))); j < dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))\<rbrakk> \<Longrightarrow> reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))); j < dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))\<rbrakk> \<Longrightarrow> reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)
[PROOF STEP]
assume i: "i<dim_row ?rhs" and j: "j<dim_col ?rhs"
[PROOF STATE]
proof (state)
this:
i < dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))
j < dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))

goal (1 subgoal):
 1. \<And>i j. \<lbrakk>i < dim_row (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))); j < dim_col (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k)))\<rbrakk> \<Longrightarrow> reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)
[PROOF STEP]
show "?lhs $$ (i,j) = ?rhs $$ (i,j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)
[PROOF STEP]
by (cases " A $$ (a, 0) = 0", insert * pquvd i j, auto simp add: case_prod_beta Let_def)
[PROOF STATE]
proof (state)
this:
reduce a b 0 A $$ (i, j) = (let Aaj = A $$ (a, 0); Abj = A $$ (b, 0) in if Aaj = 0 then A else case euclid_ext2 Aaj Abj of (p, q, u, v, d) \<Rightarrow> Matrix.mat (dim_row A) (dim_col A) (\<lambda>(i, k). if i = a then p * A $$ (a, k) + q * A $$ (b, k) else if i = b then u * A $$ (a, k) + v * A $$ (b, k) else A $$ (i, k))) $$ (i, j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Red_F_eq_Red_F_diff_Red_F: "Red_F N = Red_F (N - Red_F N)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Red_F N = Red_F (N - Red_F N)
[PROOF STEP]
by (simp add: Red_F_of_subset Red_F_subs_Red_F_diff_Red_F set_eq_subset)


[STATEMENT]
lemma neighbor_set_meets_e_reg_cond:
  fixes \<epsilon>::real
  assumes "edge_density X Y G \<ge> 2*\<epsilon>"
  and "card (neighbors_ss x Y G) \<ge> (edge_density X Y G - \<epsilon>) * card Y"
shows "card (neighbors_ss x Y G) \<ge> \<epsilon> * card (Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<epsilon> * real (card Y) \<le> real (card (neighbors_ss x Y G))
[PROOF STEP]
by (smt (verit) assms mult_right_mono of_nat_0_le_iff)


[STATEMENT]
lemma "(12::nat) * 11 = 132"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 12 * 11 = 132
[PROOF STEP]
by simp


[STATEMENT]
lemma "((P | Q) | R) = (P | (Q | R))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((P \<or> Q) \<or> R) = (P \<or> Q \<or> R)
[PROOF STEP]
by normalization


[STATEMENT]
lemma Arcsin_1 [simp]: "Arcsin 1 = pi/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Arcsin 1 = complex_of_real (pi / 2)
[PROOF STEP]
by (metis Arcsin_sin Im_complex_of_real Re_complex_of_real numeral_One of_real_numeral pi_half_ge_zero real_sqrt_abs real_sqrt_pow2 real_sqrt_power sin_of_real sin_pi_half)


[STATEMENT]
lemma card_Suc_lemma:
  "\<lbrakk>card (insert a A) \<le> Suc n; a\<notin>A; finite A\<rbrakk> \<Longrightarrow> card A \<le> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>card (insert a A) \<le> Suc n; a \<notin> A; finite A\<rbrakk> \<Longrightarrow> card A \<le> n
[PROOF STEP]
by auto


[STATEMENT]
lemma bigtheta_powr_1 [landau_simp]:
  "eventually (\<lambda>x. (f x :: real) \<ge> 0) F \<Longrightarrow> (\<lambda>x. f x powr 1) \<in> \<Theta>[F](f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in F. 0 \<le> f x \<Longrightarrow> (\<lambda>x. f x powr 1) \<in> \<Theta>[F](f)
[PROOF STEP]
by (intro bigthetaI_cong) (auto elim!: eventually_mono)


[STATEMENT]
theorem regular_singstr: "regular {[a]}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. regular {[a]}
[PROOF STEP]
apply (auto simp: regular_def accepts_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>fsm. {[a]} = {xs. \<exists>st st'. reaches fsm st xs st' \<and> st \<^bold>\<in> init fsm \<and> st' \<^bold>\<in> final fsm}
[PROOF STEP]
apply (rule exI [where x = "SingStr a"], auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. reaches (SingStr a) 0 x 1 \<Longrightarrow> x = [a]
[PROOF STEP]
apply (case_tac x, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>list. reaches (SingStr a) 1 list 1 \<Longrightarrow> list = []
[PROOF STEP]
apply (case_tac list, auto)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subdegree_mod:
  assumes "subdegree (f::'a::field fps) < subdegree g"
  shows   "subdegree (f mod g) = subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subdegree (f mod g) = subdegree f
[PROOF STEP]
proof (cases "f = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. f = 0 \<Longrightarrow> subdegree (f mod g) = subdegree f
 2. f \<noteq> 0 \<Longrightarrow> subdegree (f mod g) = subdegree f
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
f \<noteq> 0

goal (2 subgoals):
 1. f = 0 \<Longrightarrow> subdegree (f mod g) = subdegree f
 2. f \<noteq> 0 \<Longrightarrow> subdegree (f mod g) = subdegree f
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
subdegree f < subdegree g
f \<noteq> 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
subdegree f < subdegree g
f \<noteq> 0

goal (1 subgoal):
 1. subdegree (f mod g) = subdegree f
[PROOF STEP]
by  (intro subdegreeI)
        (auto simp: inverse_mult_eq_1 fps_mod_def Let_def fps_cutoff_left_mult_nth mult.assoc)
[PROOF STATE]
proof (state)
this:
subdegree (f mod g) = subdegree f

goal (1 subgoal):
 1. f = 0 \<Longrightarrow> subdegree (f mod g) = subdegree f
[PROOF STEP]
qed (simp add: fps_mod_def)


[STATEMENT]
lemma RG_mult_closed :
  defines RG: "RG \<equiv> group_ring :: ('r::ring_1, 'g) aezfun set"
  shows   "x \<in> RG \<Longrightarrow> y \<in> RG \<Longrightarrow> x * y \<in> RG"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<in> RG; y \<in> RG\<rbrakk> \<Longrightarrow> x * y \<in> RG
[PROOF STEP]
using   RG supp_aezfun_times[of x y]
          set_plus_closed[of "supp (aezfun x)" "supp (aezfun y)"]
          group_ringD
[PROOF STATE]
proof (prove)
using this:
RG \<equiv> group_ring
supp (aezfun (x * y)) \<subseteq> supp (aezfun x) + supp (aezfun y)
\<lbrakk>supp (aezfun x) \<subseteq> G; supp (aezfun y) \<subseteq> G\<rbrakk> \<Longrightarrow> supp (aezfun x) + supp (aezfun y) \<subseteq> G
group_ring = {x. supp (aezfun x) \<subseteq> G}

goal (1 subgoal):
 1. \<lbrakk>x \<in> RG; y \<in> RG\<rbrakk> \<Longrightarrow> x * y \<in> RG
[PROOF STEP]
by      blast


[STATEMENT]
lemma polyfun_eq_0:
  fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}"
    shows  "(\<forall>z. (\<Sum>i\<le>n. c i * z^i) = 0) \<longleftrightarrow> (\<forall>k. k \<le> n \<longrightarrow> c k = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
proof (cases "(\<forall>z. (\<Sum>i\<le>n. c i * z^i) = 0)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
 2. \<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)

goal (2 subgoals):
 1. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
 2. \<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)
[PROOF STEP]
have "\<not> finite {z. (\<Sum>i\<le>n. c i * z^i) = 0}"
[PROOF STATE]
proof (prove)
using this:
\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)

goal (1 subgoal):
 1. infinite {z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)}
[PROOF STEP]
by (simp add: infinite_UNIV_char_0)
[PROOF STATE]
proof (state)
this:
infinite {z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)}

goal (2 subgoals):
 1. \<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
 2. \<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
with True
[PROOF STATE]
proof (chain)
picking this:
\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)
infinite {z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)
infinite {z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)}

goal (1 subgoal):
 1. (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
by (metis (poly_guards_query) polyfun_rootbound_finite)
[PROOF STATE]
proof (state)
this:
(\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))

goal (1 subgoal):
 1. \<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a))

goal (1 subgoal):
 1. \<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) \<Longrightarrow> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a))

goal (1 subgoal):
 1. (\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(\<forall>z. (\<Sum>i\<le>n. c i * z ^ i) = (0::'a)) = (\<forall>k\<le>n. c k = (0::'a))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma Vagree_univ:"\<And>a b c d. Vagree (a,b) (c,d) UNIV \<Longrightarrow> a = c \<and> b = d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b c d. Vagree (a, b) (c, d) UNIV \<Longrightarrow> a = c \<and> b = d
[PROOF STEP]
by (auto simp add: Vagree_def vec_eq_iff)


[STATEMENT]
lemma prod_mset_pos: "(\<And>x :: 'a :: linordered_semidom. x \<in># A \<Longrightarrow> x > 0) \<Longrightarrow> prod_mset A > 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in># A \<Longrightarrow> (0::'a) < x) \<Longrightarrow> (0::'a) < \<Prod>\<^sub># A
[PROOF STEP]
by (induction A) simp_all


[STATEMENT]
lemma integral_exp [simp]:
  fixes a::real
  assumes "a \<le> b" shows "integral {a..b} exp = exp b - exp a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral {a..b} exp = exp b - exp a
[PROOF STEP]
by (meson DERIV_exp assms fundamental_theorem_of_calculus has_real_derivative_iff_has_vector_derivative
       has_vector_derivative_at_within integral_unique)


[STATEMENT]
lemma card_intersect_sum_disjoint:
  assumes "finite B" "finite C" "A = B \<union> C" "B \<inter> C = {}"
    shows "card (A \<inter> X) = card (B \<inter> X) + card (C \<inter> X)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card (A \<inter> X) = card (B \<inter> X) + card (C \<inter> X)
[PROOF STEP]
by (metis (no_types, lifting) Un_Diff_Int assms card_Un_disjoint finite_Int inf.commute
      inf_sup_distrib2 sup_eq_bot_iff)


[STATEMENT]
lemma vderiv_sinI[poly_derivatives]:
  assumes "D (f::real \<Rightarrow> real) = f' on T" and "g = (\<lambda>t. (f' t) * cos (f t))"
  shows "D (\<lambda>t. sin (f t)) = g on T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1.  D (\<lambda>t. sin (f t)) = g on T
[PROOF STEP]
apply(rule vderiv_on_composeI[OF _ assms(1), of "\<lambda>t. sin t"])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1.  D sin = ?f' on f ` T
 2. g = (\<lambda>t. f' t *\<^sub>R ?f' (f t))
[PROOF STEP]
unfolding has_vderiv_on_def has_vector_derivative_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<forall>x\<in>f ` T. D sin \<mapsto> (\<lambda>xa. xa *\<^sub>R ?f' x) at x within f ` T
 2. g = (\<lambda>t. f' t *\<^sub>R ?f' (f t))
[PROOF STEP]
by (auto intro!: derivative_eq_intros simp: assms)


[STATEMENT]
lemma \<phi>_right_support:
  "x \<in> {0 .. 1::real} \<Longrightarrow> \<phi> (l,i) ((x + real i) / 2^(l + 1)) = 1 - x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {0..1} \<Longrightarrow> \<phi> (l, int i) ((x + real i) / 2 ^ (l + 1)) = 1 - x
[PROOF STEP]
by (auto simp: \<phi>_def field_simps split: split_max)


[STATEMENT]
lemma subst_word_star [simp]: "subst_word f ` (star A) = star (subst_word f ` A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst_word f ` star A = star (subst_word f ` A)
[PROOF STEP]
by (simp add: star_def image_UN)


[STATEMENT]
lemma star_n_mult: "star_n X * star_n Y = star_n (\<lambda>n. X n * Y n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. star_n X * star_n Y = star_n (\<lambda>n. X n * Y n)
[PROOF STEP]
by (simp only: star_mult_def starfun2_star_n)


[STATEMENT]
lemma mk_poly_others[simp]:
  assumes i: "i < dim_row A" and j: "j < dim_col A - 1"
  shows "mk_poly A $$ (i,j) = [: A $$ (i,j) :]"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_poly A $$ (i, j) = [:A $$ (i, j):]
[PROOF STEP]
unfolding mk_poly_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. mk_poly_sub (coeff_lift_hom.mat_hom A) (dim_col A - 1) (dim_col A - 1) $$ (i, j) = [:A $$ (i, j):]
[PROOF STEP]
apply(subst mk_poly_sub_others)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. dim_col A - 1 \<noteq> j
 2. i < dim_row (coeff_lift_hom.mat_hom A)
 3. j < dim_col (coeff_lift_hom.mat_hom A)
 4. coeff_lift_hom.mat_hom A $$ (i, j) = [:A $$ (i, j):]
[PROOF STEP]
using i j
[PROOF STATE]
proof (prove)
using this:
i < dim_row A
j < dim_col A - 1

goal (4 subgoals):
 1. dim_col A - 1 \<noteq> j
 2. i < dim_row (coeff_lift_hom.mat_hom A)
 3. j < dim_col (coeff_lift_hom.mat_hom A)
 4. coeff_lift_hom.mat_hom A $$ (i, j) = [:A $$ (i, j):]
[PROOF STEP]
by auto


[STATEMENT]
lemma lm095:
  assumes "finite Y"
  shows "set (concat [[f +* {(x,y)}. y \<leftarrow> sorted_list_of_set(Y - (Range f))]. f \<leftarrow> F]) =
         (\<Union> f \<in> set F.{f +* {(x,y)} | y . y \<in> Y - (Range f)})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (concat (map (\<lambda>f. map (\<lambda>y. f +< {(x, y)}) (sorted_list_of_set (Y - Range f))) F)) = (\<Union>f\<in>set F. {f +< {(x, y)} |y. y \<in> Y - Range f})
[PROOF STEP]
using assms lm094 lm092
[PROOF STATE]
proof (prove)
using this:
finite Y
finite ?Y \<Longrightarrow> set (map (\<lambda>y. ?f +< {(?x, y)}) (sorted_list_of_set (?Y - Range ?f))) = {?f +< {(?x, y)} |y. y \<in> ?Y - Range ?f}
\<forall>x\<in>set ?L. set (?F x) = ?G x \<Longrightarrow> set (concat (map ?F ?L)) = \<Union> (?G ` set ?L)

goal (1 subgoal):
 1. set (concat (map (\<lambda>f. map (\<lambda>y. f +< {(x, y)}) (sorted_list_of_set (Y - Range f))) F)) = (\<Union>f\<in>set F. {f +< {(x, y)} |y. y \<in> Y - Range f})
[PROOF STEP]
by auto


[STATEMENT]
lemma index_append: "index (xs @ ys) x =
  (if x : set xs then index xs x else size xs + index ys x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. index (xs @ ys) x = (if x \<in> set xs then index xs x else length xs + index ys x)
[PROOF STEP]
by (induct xs) simp_all


[STATEMENT]
lemma numbers_of_marks_mark_out:
    "numbers_of_marks n (mark_out m bs) = {q \<in> numbers_of_marks n bs. \<not> Suc m dvd Suc q - n}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. numbers_of_marks n (mark_out m bs) = {q \<in> numbers_of_marks n bs. \<not> Suc m dvd Suc q - n}
[PROOF STEP]
by (auto simp add: numbers_of_marks_def mark_out_def in_set_enumerate_eq image_iff
    nth_enumerate_eq less_eq_dvd_minus)


[STATEMENT]
lemma even_diffI:
  "even a \<Longrightarrow> even b \<Longrightarrow> even (a - b :: 'a :: unique_euclidean_ring_with_nat)"
  "odd a \<Longrightarrow> odd b \<Longrightarrow> even (a - b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lbrakk>even a; even b\<rbrakk> \<Longrightarrow> even (a - b)) &&& (\<lbrakk>odd a; odd b\<rbrakk> \<Longrightarrow> even (a - b))
[PROOF STEP]
by auto


[STATEMENT]
lemma sum_subset_iff: "A\<Uplus>B \<le> C\<Uplus>D \<longleftrightarrow> A\<le>C \<and> B\<le>D"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (A \<Uplus> B \<le> C \<Uplus> D) = (A \<le> C \<and> B \<le> D)
[PROOF STEP]
by (auto simp: less_eq_V_def)


[STATEMENT]
lemma prime_set_non_empty: "prime_set \<noteq> {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prime_set \<noteq> {}
[PROOF STEP]
using prime_set_gt_2
[PROOF STATE]
proof (prove)
using this:
2 < card prime_set

goal (1 subgoal):
 1. prime_set \<noteq> {}
[PROOF STEP]
by auto


[STATEMENT]
lemma GreenThm_typeI_divisible_region_boundary:
  assumes
    gen_division: "gen_division s (cubeImage ` two_chain)" and
    two_cubes_trace_horizontal_boundaries:
    "two_chain_horizontal_boundary two_chain \<subseteq> \<gamma>" and
    boundary_of_region_is_subset_of_partition_boundary:
    "\<gamma> \<subseteq> two_chain_boundary two_chain"
  shows "integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F(a) \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
let ?F_b' = "partial_vector_derivative (\<lambda>a. F(a) \<bullet> i)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have all_two_cubes_have_four_distict_edges: "\<forall>twoCube \<in> two_chain. card (boundary twoCube) = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>twoCube\<in>two_chain. card (boundary twoCube) = 4
[PROOF STEP]
using valid_typeI_div valid_two_chain_def valid_two_cube_def
[PROOF STATE]
proof (prove)
using this:
valid_typeI_division s two_chain
valid_two_chain ?twoChain \<equiv> (\<forall>twoCube\<in>?twoChain. valid_two_cube twoCube) \<and> pairwise (\<lambda>c1 c2. boundary c1 \<inter> boundary c2 = {}) ?twoChain \<and> inj_on cubeImage ?twoChain
valid_two_cube ?twoC \<equiv> card (boundary ?twoC) = 4

goal (1 subgoal):
 1. \<forall>twoCube\<in>two_chain. card (boundary twoCube) = 4
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>twoCube\<in>two_chain. card (boundary twoCube) = 4

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have no_shared_edges_have_similar_orientations:
    "\<forall>twoCube1 \<in> two_chain. \<forall>twoCube2 \<in> two_chain.
        twoCube1 \<noteq> twoCube2 \<longrightarrow> boundary twoCube1 \<inter> boundary twoCube2 = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>twoCube1\<in>two_chain. \<forall>twoCube2\<in>two_chain. twoCube1 \<noteq> twoCube2 \<longrightarrow> boundary twoCube1 \<inter> boundary twoCube2 = {}
[PROOF STEP]
using valid_typeI_div valid_two_chain_def
[PROOF STATE]
proof (prove)
using this:
valid_typeI_division s two_chain
valid_two_chain ?twoChain \<equiv> (\<forall>twoCube\<in>?twoChain. valid_two_cube twoCube) \<and> pairwise (\<lambda>c1 c2. boundary c1 \<inter> boundary c2 = {}) ?twoChain \<and> inj_on cubeImage ?twoChain

goal (1 subgoal):
 1. \<forall>twoCube1\<in>two_chain. \<forall>twoCube2\<in>two_chain. twoCube1 \<noteq> twoCube2 \<longrightarrow> boundary twoCube1 \<inter> boundary twoCube2 = {}
[PROOF STEP]
by (auto simp add: pairwise_def)
[PROOF STATE]
proof (state)
this:
\<forall>twoCube1\<in>two_chain. \<forall>twoCube2\<in>two_chain. twoCube1 \<noteq> twoCube2 \<longrightarrow> boundary twoCube1 \<inter> boundary twoCube2 = {}

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
(*Proving that line_integral on the x axis is 0 for the vertical 1-cubes*)
[PROOF STATE]
proof (state)
this:
\<forall>twoCube1\<in>two_chain. \<forall>twoCube2\<in>two_chain. twoCube1 \<noteq> twoCube2 \<longrightarrow> boundary twoCube1 \<inter> boundary twoCube2 = {}

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have vert_line_integral_zero:
    "one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) = 0
[PROOF STEP]
proof (simp add: one_chain_line_integral_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>two_chain_vertical_boundary two_chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
have "line_integral F {i} (snd oneCube) = 0"
      if oneCube: "oneCube \<in> two_chain_vertical_boundary(two_chain)" for oneCube
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
obtain x y1 y2 k where vert_edge_def: "oneCube = (k, (\<lambda>t::real. (x::real, (1 - t) * (y2) + t * y1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k x y2 y1. oneCube = (k, \<lambda>t. (x, (1 - t) * y2 + t * y1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using valid_typeI_div oneCube
[PROOF STATE]
proof (prove)
using this:
valid_typeI_division s two_chain
oneCube \<in> two_chain_vertical_boundary two_chain

goal (1 subgoal):
 1. (\<And>k x y2 y1. oneCube = (k, \<lambda>t. (x, (1 - t) * y2 + t * y1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: typeI_twoCube_def two_chain_vertical_boundary_def vertical_boundary_def)
[PROOF STATE]
proof (state)
this:
oneCube = (k, \<lambda>t. (x, (1 - t) * y2 + t * y1))

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
let ?vert_edge = "(snd oneCube)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
have vert_edge_x_const: "\<forall>t. (?vert_edge t) \<bullet> i = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t. snd oneCube t \<bullet> i = x
[PROOF STEP]
by (simp add: i_is_x_axis vert_edge_def)
[PROOF STATE]
proof (state)
this:
\<forall>t. snd oneCube t \<bullet> i = x

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
have vert_edge_is_straight_path: "?vert_edge = (\<lambda>t. (x, y2 + t * (y1 - y2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd oneCube = (\<lambda>t. (x, y2 + t * (y1 - y2)))
[PROOF STEP]
using vert_edge_def Product_Type.snd_conv
[PROOF STATE]
proof (prove)
using this:
oneCube = (k, \<lambda>t. (x, (1 - t) * y2 + t * y1))
snd (?x1.0, ?x2.0) = ?x2.0

goal (1 subgoal):
 1. snd oneCube = (\<lambda>t. (x, y2 + t * (y1 - y2)))
[PROOF STEP]
by (auto simp add: mult.commute right_diff_distrib')
[PROOF STATE]
proof (state)
this:
snd oneCube = (\<lambda>t. (x, y2 + t * (y1 - y2)))

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
by (simp add: i_is_x_axis line_integral_on_pair_straight_path(1) mult.commute straight_path_diffrentiable_x vert_edge_is_straight_path)
[PROOF STATE]
proof (state)
this:
line_integral F {i} (snd oneCube) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?oneCube \<in> two_chain_vertical_boundary two_chain \<Longrightarrow> line_integral F {i} (snd ?oneCube) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>two_chain_vertical_boundary two_chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?oneCube \<in> two_chain_vertical_boundary two_chain \<Longrightarrow> line_integral F {i} (snd ?oneCube) = 0
[PROOF STEP]
show "(\<Sum>x\<in>two_chain_vertical_boundary two_chain. case x of (k, g) \<Rightarrow> k * line_integral F {i} g) = 0"
[PROOF STATE]
proof (prove)
using this:
?oneCube \<in> two_chain_vertical_boundary two_chain \<Longrightarrow> line_integral F {i} (snd ?oneCube) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>two_chain_vertical_boundary two_chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
using comm_monoid_add_class.sum.neutral
[PROOF STATE]
proof (prove)
using this:
?oneCube \<in> two_chain_vertical_boundary two_chain \<Longrightarrow> line_integral F {i} (snd ?oneCube) = 0
\<forall>x\<in>?A. ?g x = (0::?'a) \<Longrightarrow> sum ?g ?A = (0::?'a)

goal (1 subgoal):
 1. (\<Sum>x\<in>two_chain_vertical_boundary two_chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
by (simp add: prod.case_eq_if)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>two_chain_vertical_boundary two_chain. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) = 0

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
(*then, the x axis line_integral on the boundaries of the twoCube is equal to the line_integral on the horizontal boundaries of the twoCube \<longrightarrow> 1*)
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) = 0

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have boundary_is_finite: "finite (two_chain_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (two_chain_boundary two_chain)
[PROOF STEP]
unfolding two_chain_boundary_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (\<Union> (boundary ` two_chain))
[PROOF STEP]
by (metis all_two_cubes_have_four_distict_edges card.infinite finite_UN_I finite_imageD
              gen_division gen_division_def zero_neq_numeral valid_typeI_div valid_two_chain_def)
[PROOF STATE]
proof (state)
this:
finite (two_chain_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have boundary_is_vert_hor: "(two_chain_boundary two_chain) =
                              (two_chain_vertical_boundary two_chain) \<union>
                              (two_chain_horizontal_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_chain_boundary two_chain = two_chain_vertical_boundary two_chain \<union> two_chain_horizontal_boundary two_chain
[PROOF STEP]
by(auto simp add: two_chain_boundary_def two_chain_vertical_boundary_def two_chain_horizontal_boundary_def
        boundary_def)
[PROOF STATE]
proof (state)
this:
two_chain_boundary two_chain = two_chain_vertical_boundary two_chain \<union> two_chain_horizontal_boundary two_chain

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
two_chain_boundary two_chain = two_chain_vertical_boundary two_chain \<union> two_chain_horizontal_boundary two_chain
[PROOF STEP]
have hor_vert_finite:
    "finite (two_chain_vertical_boundary two_chain)"
    "finite (two_chain_horizontal_boundary two_chain)"
[PROOF STATE]
proof (prove)
using this:
two_chain_boundary two_chain = two_chain_vertical_boundary two_chain \<union> two_chain_horizontal_boundary two_chain

goal (1 subgoal):
 1. finite (two_chain_vertical_boundary two_chain) &&& finite (two_chain_horizontal_boundary two_chain)
[PROOF STEP]
using boundary_is_finite
[PROOF STATE]
proof (prove)
using this:
two_chain_boundary two_chain = two_chain_vertical_boundary two_chain \<union> two_chain_horizontal_boundary two_chain
finite (two_chain_boundary two_chain)

goal (1 subgoal):
 1. finite (two_chain_vertical_boundary two_chain) &&& finite (two_chain_horizontal_boundary two_chain)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite (two_chain_vertical_boundary two_chain)
finite (two_chain_horizontal_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have horiz_verti_disjoint:
    "(two_chain_vertical_boundary two_chain) \<inter> (two_chain_horizontal_boundary two_chain) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. two_chain_vertical_boundary two_chain \<inter> two_chain_horizontal_boundary two_chain = {}
[PROOF STEP]
proof (simp add: two_chain_vertical_boundary_def two_chain_horizontal_boundary_def horizontal_boundary_def
        vertical_boundary_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1, \<lambda>y. x (1, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>xa. x (xa, 0)), (- 1, \<lambda>xa. x (xa, 1))}) = {}
[PROOF STEP]
show "(\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1::int, \<lambda>y. x (1::real, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>z. x (z, 0)), (- 1, \<lambda>z. x (z, 1))}) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1, \<lambda>y. x (1, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>z. x (z, 0)), (- 1, \<lambda>z. x (z, 1))}) = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1, \<lambda>y. x (1, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>z. x (z, 0)), (- 1, \<lambda>z. x (z, 1))}) = {}
[PROOF STEP]
have "{(- 1, \<lambda>y. twoCube (0, y)), (1::int, \<lambda>y. twoCube (1, y))} \<inter>
            {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}"
        if "twoCube\<in>two_chain" "twoCube2\<in>two_chain" for twoCube twoCube2
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
proof (cases "twoCube = twoCube2")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. twoCube = twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
 2. twoCube \<noteq> twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
twoCube = twoCube2

goal (2 subgoals):
 1. twoCube = twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
 2. twoCube \<noteq> twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
have "card {(- 1::int, \<lambda>y. twoCube2 (0::real, y)), (1::int, \<lambda>y. twoCube2 (1, y)), (1, \<lambda>x. twoCube2 (x, 0)), (- 1, \<lambda>x. twoCube2 (x, 1))} = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. card {(- 1, \<lambda>y. twoCube2 (0, y)), (1, \<lambda>y. twoCube2 (1, y)), (1, \<lambda>x. twoCube2 (x, 0)), (- 1, \<lambda>x. twoCube2 (x, 1))} = 4
[PROOF STEP]
using all_two_cubes_have_four_distict_edges that(2)
[PROOF STATE]
proof (prove)
using this:
\<forall>twoCube\<in>two_chain. card (boundary twoCube) = 4
twoCube2 \<in> two_chain

goal (1 subgoal):
 1. card {(- 1, \<lambda>y. twoCube2 (0, y)), (1, \<lambda>y. twoCube2 (1, y)), (1, \<lambda>x. twoCube2 (x, 0)), (- 1, \<lambda>x. twoCube2 (x, 1))} = 4
[PROOF STEP]
by (auto simp add: boundary_def vertical_boundary_def horizontal_boundary_def)
[PROOF STATE]
proof (state)
this:
card {(- 1, \<lambda>y. twoCube2 (0, y)), (1, \<lambda>y. twoCube2 (1, y)), (1, \<lambda>x. twoCube2 (x, 0)), (- 1, \<lambda>x. twoCube2 (x, 1))} = 4

goal (2 subgoals):
 1. twoCube = twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
 2. twoCube \<noteq> twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
card {(- 1, \<lambda>y. twoCube2 (0, y)), (1, \<lambda>y. twoCube2 (1, y)), (1, \<lambda>x. twoCube2 (x, 0)), (- 1, \<lambda>x. twoCube2 (x, 1))} = 4
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
card {(- 1, \<lambda>y. twoCube2 (0, y)), (1, \<lambda>y. twoCube2 (1, y)), (1, \<lambda>x. twoCube2 (x, 0)), (- 1, \<lambda>x. twoCube2 (x, 1))} = 4

goal (1 subgoal):
 1. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
by (auto simp: True card_insert_if split: if_split_asm)
[PROOF STATE]
proof (state)
this:
{(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}

goal (1 subgoal):
 1. twoCube \<noteq> twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. twoCube \<noteq> twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
twoCube \<noteq> twoCube2

goal (1 subgoal):
 1. twoCube \<noteq> twoCube2 \<Longrightarrow> {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
twoCube \<noteq> twoCube2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
twoCube \<noteq> twoCube2

goal (1 subgoal):
 1. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
using no_shared_edges_have_similar_orientations
[PROOF STATE]
proof (prove)
using this:
twoCube \<noteq> twoCube2
\<forall>twoCube1\<in>two_chain. \<forall>twoCube2\<in>two_chain. twoCube1 \<noteq> twoCube2 \<longrightarrow> boundary twoCube1 \<inter> boundary twoCube2 = {}

goal (1 subgoal):
 1. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}
[PROOF STEP]
by (simp add: that boundary_def vertical_boundary_def horizontal_boundary_def)
[PROOF STATE]
proof (state)
this:
{(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))} \<inter> {(1, \<lambda>z. twoCube2 (z, 0)), (- 1, \<lambda>z. twoCube2 (z, 1))} = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>?twoCube \<in> two_chain; ?twoCube2.0 \<in> two_chain\<rbrakk> \<Longrightarrow> {(- 1, \<lambda>y. ?twoCube (0, y)), (1, \<lambda>y. ?twoCube (1, y))} \<inter> {(1, \<lambda>z. ?twoCube2.0 (z, 0)), (- 1, \<lambda>z. ?twoCube2.0 (z, 1))} = {}

goal (1 subgoal):
 1. (\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1, \<lambda>y. x (1, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>z. x (z, 0)), (- 1, \<lambda>z. x (z, 1))}) = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>?twoCube \<in> two_chain; ?twoCube2.0 \<in> two_chain\<rbrakk> \<Longrightarrow> {(- 1, \<lambda>y. ?twoCube (0, y)), (1, \<lambda>y. ?twoCube (1, y))} \<inter> {(1, \<lambda>z. ?twoCube2.0 (z, 0)), (- 1, \<lambda>z. ?twoCube2.0 (z, 1))} = {}
[PROOF STEP]
have "\<Union> ((\<lambda>twoCube. {(-1::int, \<lambda>y. twoCube (0,y)), (1, \<lambda>y. twoCube (1, y))}) ` two_chain)
               \<inter> \<Union> ((\<lambda>twoCube. {(1, \<lambda>y. twoCube (y, 0)), (-1, \<lambda>z. twoCube (z, 1))}) ` two_chain) = {}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?twoCube \<in> two_chain; ?twoCube2.0 \<in> two_chain\<rbrakk> \<Longrightarrow> {(- 1, \<lambda>y. ?twoCube (0, y)), (1, \<lambda>y. ?twoCube (1, y))} \<inter> {(1, \<lambda>z. ?twoCube2.0 (z, 0)), (- 1, \<lambda>z. ?twoCube2.0 (z, 1))} = {}

goal (1 subgoal):
 1. (\<Union>twoCube\<in>two_chain. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))}) \<inter> (\<Union>twoCube\<in>two_chain. {(1, \<lambda>y. twoCube (y, 0)), (- 1, \<lambda>z. twoCube (z, 1))}) = {}
[PROOF STEP]
using Complete_Lattices.Union_disjoint
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?twoCube \<in> two_chain; ?twoCube2.0 \<in> two_chain\<rbrakk> \<Longrightarrow> {(- 1, \<lambda>y. ?twoCube (0, y)), (1, \<lambda>y. ?twoCube (1, y))} \<inter> {(1, \<lambda>z. ?twoCube2.0 (z, 0)), (- 1, \<lambda>z. ?twoCube2.0 (z, 1))} = {}
(\<Union> ?C \<inter> ?A = {}) = (\<forall>B\<in>?C. B \<inter> ?A = {})

goal (1 subgoal):
 1. (\<Union>twoCube\<in>two_chain. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))}) \<inter> (\<Union>twoCube\<in>two_chain. {(1, \<lambda>y. twoCube (y, 0)), (- 1, \<lambda>z. twoCube (z, 1))}) = {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<Union>twoCube\<in>two_chain. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))}) \<inter> (\<Union>twoCube\<in>two_chain. {(1, \<lambda>y. twoCube (y, 0)), (- 1, \<lambda>z. twoCube (z, 1))}) = {}

goal (1 subgoal):
 1. (\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1, \<lambda>y. x (1, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>z. x (z, 0)), (- 1, \<lambda>z. x (z, 1))}) = {}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Union>twoCube\<in>two_chain. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))}) \<inter> (\<Union>twoCube\<in>two_chain. {(1, \<lambda>y. twoCube (y, 0)), (- 1, \<lambda>z. twoCube (z, 1))}) = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Union>twoCube\<in>two_chain. {(- 1, \<lambda>y. twoCube (0, y)), (1, \<lambda>y. twoCube (1, y))}) \<inter> (\<Union>twoCube\<in>two_chain. {(1, \<lambda>y. twoCube (y, 0)), (- 1, \<lambda>z. twoCube (z, 1))}) = {}

goal (1 subgoal):
 1. (\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1, \<lambda>y. x (1, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>z. x (z, 0)), (- 1, \<lambda>z. x (z, 1))}) = {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1, \<lambda>y. x (1, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>z. x (z, 0)), (- 1, \<lambda>z. x (z, 1))}) = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Union>x\<in>two_chain. {(- 1, \<lambda>y. x (0, y)), (1, \<lambda>y. x (1, y))}) \<inter> (\<Union>x\<in>two_chain. {(1, \<lambda>z. x (z, 0)), (- 1, \<lambda>z. x (z, 1))}) = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
two_chain_vertical_boundary two_chain \<inter> two_chain_horizontal_boundary two_chain = {}

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have "one_chain_line_integral F {i} (two_chain_boundary two_chain)
        = one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) +
          one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)
[PROOF STEP]
using boundary_is_vert_hor horiz_verti_disjoint
[PROOF STATE]
proof (prove)
using this:
two_chain_boundary two_chain = two_chain_vertical_boundary two_chain \<union> two_chain_horizontal_boundary two_chain
two_chain_vertical_boundary two_chain \<inter> two_chain_horizontal_boundary two_chain = {}

goal (1 subgoal):
 1. one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)
[PROOF STEP]
by (auto simp add: one_chain_line_integral_def hor_vert_finite sum.union_disjoint)
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)
[PROOF STEP]
have x_axis_line_integral_is_only_horizontal:
    "one_chain_line_integral F {i} (two_chain_boundary two_chain)
     = one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)"
[PROOF STATE]
proof (prove)
using this:
one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)

goal (1 subgoal):
 1. one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)
[PROOF STEP]
using vert_line_integral_zero
[PROOF STATE]
proof (prove)
using this:
one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)
one_chain_line_integral F {i} (two_chain_vertical_boundary two_chain) = 0

goal (1 subgoal):
 1. one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
(*Since \<gamma> \<subseteq> the boundary of the 2-chain and the horizontal boundaries are \<subseteq> \<gamma>, then there is some \<V> \<subseteq> \<partial>\<^sub>V(2-\<C>) such that \<gamma> = \<V> \<union> \<partial>\<^sub>H(2-\<C>)*)
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have "\<exists>\<V>. \<V> \<subseteq> (two_chain_vertical_boundary two_chain) \<and> \<gamma> = \<V> \<union> (two_chain_horizontal_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>\<V>\<subseteq>two_chain_vertical_boundary two_chain. \<gamma> = \<V> \<union> two_chain_horizontal_boundary two_chain
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ?\<V> \<subseteq> two_chain_vertical_boundary two_chain \<and> \<gamma> = ?\<V> \<union> two_chain_horizontal_boundary two_chain
[PROOF STEP]
let ?\<V> = "\<gamma> - (two_chain_horizontal_boundary two_chain)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ?\<V> \<subseteq> two_chain_vertical_boundary two_chain \<and> \<gamma> = ?\<V> \<union> two_chain_horizontal_boundary two_chain
[PROOF STEP]
show "?\<V> \<subseteq> two_chain_vertical_boundary two_chain \<and> \<gamma> = ?\<V> \<union> two_chain_horizontal_boundary two_chain"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<gamma> - two_chain_horizontal_boundary two_chain \<subseteq> two_chain_vertical_boundary two_chain \<and> \<gamma> = \<gamma> - two_chain_horizontal_boundary two_chain \<union> two_chain_horizontal_boundary two_chain
[PROOF STEP]
using two_cubes_trace_horizontal_boundaries
        boundary_of_region_is_subset_of_partition_boundary boundary_is_vert_hor
[PROOF STATE]
proof (prove)
using this:
two_chain_horizontal_boundary two_chain \<subseteq> \<gamma>
\<gamma> \<subseteq> two_chain_boundary two_chain
two_chain_boundary two_chain = two_chain_vertical_boundary two_chain \<union> two_chain_horizontal_boundary two_chain

goal (1 subgoal):
 1. \<gamma> - two_chain_horizontal_boundary two_chain \<subseteq> two_chain_vertical_boundary two_chain \<and> \<gamma> = \<gamma> - two_chain_horizontal_boundary two_chain \<union> two_chain_horizontal_boundary two_chain
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<gamma> - two_chain_horizontal_boundary two_chain \<subseteq> two_chain_vertical_boundary two_chain \<and> \<gamma> = \<gamma> - two_chain_horizontal_boundary two_chain \<union> two_chain_horizontal_boundary two_chain

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>\<V>\<subseteq>two_chain_vertical_boundary two_chain. \<gamma> = \<V> \<union> two_chain_horizontal_boundary two_chain

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>\<V>\<subseteq>two_chain_vertical_boundary two_chain. \<gamma> = \<V> \<union> two_chain_horizontal_boundary two_chain
[PROOF STEP]
obtain \<V> where
    v_props: "\<V> \<subseteq> (two_chain_vertical_boundary two_chain)" "\<gamma> = \<V> \<union> (two_chain_horizontal_boundary two_chain)"
[PROOF STATE]
proof (prove)
using this:
\<exists>\<V>\<subseteq>two_chain_vertical_boundary two_chain. \<gamma> = \<V> \<union> two_chain_horizontal_boundary two_chain

goal (1 subgoal):
 1. (\<And>\<V>. \<lbrakk>\<V> \<subseteq> two_chain_vertical_boundary two_chain; \<gamma> = \<V> \<union> two_chain_horizontal_boundary two_chain\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<V> \<subseteq> two_chain_vertical_boundary two_chain
\<gamma> = \<V> \<union> two_chain_horizontal_boundary two_chain

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have v_horiz_disj: "\<V> \<inter> (two_chain_horizontal_boundary two_chain) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<V> \<inter> two_chain_horizontal_boundary two_chain = {}
[PROOF STEP]
using horiz_verti_disjoint v_props(1)
[PROOF STATE]
proof (prove)
using this:
two_chain_vertical_boundary two_chain \<inter> two_chain_horizontal_boundary two_chain = {}
\<V> \<subseteq> two_chain_vertical_boundary two_chain

goal (1 subgoal):
 1. \<V> \<inter> two_chain_horizontal_boundary two_chain = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<V> \<inter> two_chain_horizontal_boundary two_chain = {}

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have v_finite: "finite \<V>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite \<V>
[PROOF STEP]
using hor_vert_finite v_props(1) Finite_Set.rev_finite_subset
[PROOF STATE]
proof (prove)
using this:
finite (two_chain_vertical_boundary two_chain)
finite (two_chain_horizontal_boundary two_chain)
\<V> \<subseteq> two_chain_vertical_boundary two_chain
\<lbrakk>finite ?B; ?A \<subseteq> ?B\<rbrakk> \<Longrightarrow> finite ?A

goal (1 subgoal):
 1. finite \<V>
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
finite \<V>

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have line_integral_on_path: "one_chain_line_integral F {i} \<gamma> =
                               one_chain_line_integral F {i} \<V> + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} \<V> + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)
[PROOF STEP]
by(auto simp add: one_chain_line_integral_def v_props sum.union_disjoint[OF v_finite hor_vert_finite(2) v_horiz_disj])
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} \<V> + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
(*Since \<V> \<subseteq> \<partial>\<^sub>V(2-\<C>), then the line_integral on the x axis along \<H> is 0, and from 1 Q.E.D. *)
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} \<V> + one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
have "one_chain_line_integral F {i} \<V> = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. one_chain_line_integral F {i} \<V> = 0
[PROOF STEP]
proof (simp add: one_chain_line_integral_def)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>x\<in>\<V>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
have "line_integral F {i} (snd oneCube) = 0"
      if oneCube: "oneCube \<in> two_chain_vertical_boundary(two_chain)" for oneCube
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
obtain x y1 y2 k where vert_edge_def: "oneCube = (k, (\<lambda>t::real. (x::real, (1 - t) * (y2) + t * y1)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>k x y2 y1. oneCube = (k, \<lambda>t. (x, (1 - t) * y2 + t * y1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using valid_typeI_div oneCube
[PROOF STATE]
proof (prove)
using this:
valid_typeI_division s two_chain
oneCube \<in> two_chain_vertical_boundary two_chain

goal (1 subgoal):
 1. (\<And>k x y2 y1. oneCube = (k, \<lambda>t. (x, (1 - t) * y2 + t * y1)) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp add: typeI_twoCube_def two_chain_vertical_boundary_def vertical_boundary_def)
[PROOF STATE]
proof (state)
this:
oneCube = (k, \<lambda>t. (x, (1 - t) * y2 + t * y1))

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
let ?vert_edge = "(snd oneCube)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
have vert_edge_x_const: "\<forall>t. (?vert_edge t) \<bullet> i = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>t. snd oneCube t \<bullet> i = x
[PROOF STEP]
by (simp add: i_is_x_axis vert_edge_def)
[PROOF STATE]
proof (state)
this:
\<forall>t. snd oneCube t \<bullet> i = x

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
have vert_edge_is_straight_path:
        "?vert_edge = (\<lambda>t. (x, y2 + t * (y1 - y2)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. snd oneCube = (\<lambda>t. (x, y2 + t * (y1 - y2)))
[PROOF STEP]
by (auto simp: vert_edge_def algebra_simps)
[PROOF STATE]
proof (state)
this:
snd oneCube = (\<lambda>t. (x, y2 + t * (y1 - y2)))

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
have "\<forall>x. ?vert_edge differentiable at x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. snd oneCube differentiable at x
[PROOF STEP]
by (metis mult.commute vert_edge_is_straight_path straight_path_diffrentiable_x)
[PROOF STATE]
proof (state)
this:
\<forall>x. snd oneCube differentiable at x

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>x. snd oneCube differentiable at x
[PROOF STEP]
show "line_integral F {i} (snd oneCube) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>x. snd oneCube differentiable at x

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
using line_integral_on_pair_straight_path(1) vert_edge_x_const
[PROOF STATE]
proof (prove)
using this:
\<forall>x. snd oneCube differentiable at x
\<lbrakk>\<forall>x. ?\<gamma> x \<bullet> ?i = ?a; \<forall>x\<in>{0..1}. ?\<gamma> differentiable at x\<rbrakk> \<Longrightarrow> line_integral ?F {?i} ?\<gamma> = 0
\<forall>t. snd oneCube t \<bullet> i = x

goal (1 subgoal):
 1. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
line_integral F {i} (snd oneCube) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
?oneCube \<in> two_chain_vertical_boundary two_chain \<Longrightarrow> line_integral F {i} (snd ?oneCube) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>\<V>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?oneCube \<in> two_chain_vertical_boundary two_chain \<Longrightarrow> line_integral F {i} (snd ?oneCube) = 0
[PROOF STEP]
have "\<forall>oneCube \<in> \<V>. line_integral F {i} (snd oneCube) = 0"
[PROOF STATE]
proof (prove)
using this:
?oneCube \<in> two_chain_vertical_boundary two_chain \<Longrightarrow> line_integral F {i} (snd ?oneCube) = 0

goal (1 subgoal):
 1. \<forall>oneCube\<in>\<V>. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
using v_props
[PROOF STATE]
proof (prove)
using this:
?oneCube \<in> two_chain_vertical_boundary two_chain \<Longrightarrow> line_integral F {i} (snd ?oneCube) = 0
\<V> \<subseteq> two_chain_vertical_boundary two_chain
\<gamma> = \<V> \<union> two_chain_horizontal_boundary two_chain

goal (1 subgoal):
 1. \<forall>oneCube\<in>\<V>. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>oneCube\<in>\<V>. line_integral F {i} (snd oneCube) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>\<V>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>oneCube\<in>\<V>. line_integral F {i} (snd oneCube) = 0
[PROOF STEP]
show "(\<Sum>x\<in>\<V>. case x of (k, g) \<Rightarrow> k * line_integral F {i} g) = 0"
[PROOF STATE]
proof (prove)
using this:
\<forall>oneCube\<in>\<V>. line_integral F {i} (snd oneCube) = 0

goal (1 subgoal):
 1. (\<Sum>x\<in>\<V>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
using comm_monoid_add_class.sum.neutral
[PROOF STATE]
proof (prove)
using this:
\<forall>oneCube\<in>\<V>. line_integral F {i} (snd oneCube) = 0
\<forall>x\<in>?A. ?g x = (0::?'a) \<Longrightarrow> sum ?g ?A = (0::?'a)

goal (1 subgoal):
 1. (\<Sum>x\<in>\<V>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0
[PROOF STEP]
by (simp add: prod.case_eq_if)
[PROOF STATE]
proof (state)
this:
(\<Sum>x\<in>\<V>. case x of (k, g) \<Rightarrow> real_of_int k * line_integral F {i} g) = 0

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} \<V> = 0

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
one_chain_line_integral F {i} \<V> = 0
[PROOF STEP]
have "one_chain_line_integral F {i} \<gamma> =
             one_chain_line_integral F {i} (two_chain_boundary two_chain)"
[PROOF STATE]
proof (prove)
using this:
one_chain_line_integral F {i} \<V> = 0

goal (1 subgoal):
 1. one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
using x_axis_line_integral_is_only_horizontal
[PROOF STATE]
proof (prove)
using this:
one_chain_line_integral F {i} \<V> = 0
one_chain_line_integral F {i} (two_chain_boundary two_chain) = one_chain_line_integral F {i} (two_chain_horizontal_boundary two_chain)

goal (1 subgoal):
 1. one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
by (simp add: line_integral_on_path)
[PROOF STATE]
proof (state)
this:
one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} (two_chain_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} (two_chain_boundary two_chain)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} (two_chain_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
using assms and GreenThm_typeI_divisible
[PROOF STATE]
proof (prove)
using this:
one_chain_line_integral F {i} \<gamma> = one_chain_line_integral F {i} (two_chain_boundary two_chain)
gen_division s (cubeImage ` two_chain)
two_chain_horizontal_boundary two_chain \<subseteq> \<gamma>
\<gamma> \<subseteq> two_chain_boundary two_chain
gen_division s (cubeImage ` two_chain) \<Longrightarrow> integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} (two_chain_boundary two_chain)

goal (1 subgoal):
 1. integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
integral s (\<lambda>x. - partial_vector_derivative (\<lambda>a. F a \<bullet> i) j x) = one_chain_line_integral F {i} \<gamma>

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma LFP_lowerbound:
  assumes "x \<in> carrier L" "f x \<sqsubseteq> x"
  shows "LFP f \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LFP f \<sqsubseteq> x
[PROOF STEP]
by (auto intro:inf_lower assms simp add:LEAST_FP_def)


[STATEMENT]
lemma bitwise_inner_prod_fst_el_0:
  assumes "i < 2^n \<or> j < 2^n"
  shows "(i \<cdot>\<^bsub>Suc n\<^esub> j) = (i mod 2^n) \<cdot>\<^bsub>n\<^esub> (j mod 2^n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
have "bip i (Suc n) j = (\<Sum>k\<in>{0..<(Suc n)}. (bin_rep (Suc n) i) ! k * (bin_rep (Suc n) j) ! k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)
[PROOF STEP]
using bitwise_inner_prod_def
[PROOF STATE]
proof (prove)
using this:
?i \<cdot>\<^bsub>?n\<^esub>  ?j = (\<Sum>k = 0..<?n. bin_rep ?n ?i ! k * bin_rep ?n ?j ! k)

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
have "... = bin_rep (Suc n) i ! 0 * bin_rep (Suc n) j ! 0 +
             (\<Sum>k\<in>{1..<(Suc n)}. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 0..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = bin_rep (Suc n) i ! 0 * bin_rep (Suc n) j ! 0 + (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)
[PROOF STEP]
by (simp add: sum.atLeast_Suc_lessThan)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = bin_rep (Suc n) i ! 0 * bin_rep (Suc n) j ! 0 + (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 0..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = bin_rep (Suc n) i ! 0 * bin_rep (Suc n) j ! 0 + (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
have "... = (\<Sum>k\<in>{1..<(Suc n)}. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bin_rep (Suc n) i ! 0 * bin_rep (Suc n) j ! 0 + (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)
[PROOF STEP]
using bin_rep_index_0[of i n] bin_rep_index_0[of j n] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>i < 2 ^ n; n < ?k\<rbrakk> \<Longrightarrow> bin_rep ?k i ! 0 = 0
\<lbrakk>j < 2 ^ n; n < ?k\<rbrakk> \<Longrightarrow> bin_rep ?k j ! 0 = 0
i < 2 ^ n \<or> j < 2 ^ n

goal (1 subgoal):
 1. bin_rep (Suc n) i ! 0 * bin_rep (Suc n) j ! 0 + (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
bin_rep (Suc n) i ! 0 * bin_rep (Suc n) j ! 0 + (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
bin_rep (Suc n) i ! 0 * bin_rep (Suc n) j ! 0 + (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k)

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
have "... = (\<Sum>k\<in>{0..<n}. bin_rep (Suc n) i !(k+1) * bin_rep (Suc n) j ! (k+1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))
[PROOF STEP]
using sum.shift_bounds_Suc_ivl[of "\<lambda>k. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k" "0" "n"]
[PROOF STATE]
proof (prove)
using this:
(\<Sum>k = Suc 0..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = (\<Sum>ia = 0..<n. bin_rep (Suc n) i ! Suc ia * bin_rep (Suc n) j ! Suc ia)

goal (1 subgoal):
 1. (\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))
[PROOF STEP]
by (metis (no_types, lifting) One_nat_def add.commute plus_1_eq_Suc sum.cong)
[PROOF STATE]
proof (state)
this:
(\<Sum>k = 1..<Suc n. bin_rep (Suc n) i ! k * bin_rep (Suc n) j ! k) = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))
[PROOF STEP]
have "bip i (Suc n) j = (\<Sum>k\<in>{0..<n}. bin_rep (Suc n) i ! (k+1) * bin_rep (Suc n) j ! (k+1))"
[PROOF STATE]
proof (prove)
using this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
have "k\<in>{0..n} \<longrightarrow> bin_rep (Suc n) i ! (k+1) = bin_rep n (i mod 2^n) ! k" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) i ! (k + 1) = bin_rep n (i mod 2 ^ n) ! k
[PROOF STEP]
using bin_rep_def
[PROOF STATE]
proof (prove)
using this:
bin_rep ?n ?m = butlast (bin_rep_aux ?n ?m)

goal (1 subgoal):
 1. k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) i ! (k + 1) = bin_rep n (i mod 2 ^ n) ! k
[PROOF STEP]
by (simp add: bin_rep_aux_neq_nil)
[PROOF STATE]
proof (state)
this:
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) i ! (?k + 1) = bin_rep n (i mod 2 ^ n) ! ?k

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) i ! (?k + 1) = bin_rep n (i mod 2 ^ n) ! ?k

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
have "k\<in>{0..n} \<longrightarrow> bin_rep (Suc n) j !(k+1) = bin_rep n (j mod 2^n) ! k" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) j ! (k + 1) = bin_rep n (j mod 2 ^ n) ! k
[PROOF STEP]
using bin_rep_def
[PROOF STATE]
proof (prove)
using this:
bin_rep ?n ?m = butlast (bin_rep_aux ?n ?m)

goal (1 subgoal):
 1. k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) j ! (k + 1) = bin_rep n (j mod 2 ^ n) ! k
[PROOF STEP]
by (simp add: bin_rep_aux_neq_nil)
[PROOF STATE]
proof (state)
this:
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) j ! (?k + 1) = bin_rep n (j mod 2 ^ n) ! ?k

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) i ! (?k + 1) = bin_rep n (i mod 2 ^ n) ! ?k
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) j ! (?k + 1) = bin_rep n (j mod 2 ^ n) ! ?k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) i ! (?k + 1) = bin_rep n (i mod 2 ^ n) ! ?k
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) j ! (?k + 1) = bin_rep n (j mod 2 ^ n) ! ?k

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
using assms bin_rep_index_0 bitwise_inner_prod_def
[PROOF STATE]
proof (prove)
using this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = (\<Sum>k = 0..<n. bin_rep (Suc n) i ! (k + 1) * bin_rep (Suc n) j ! (k + 1))
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) i ! (?k + 1) = bin_rep n (i mod 2 ^ n) ! ?k
?k \<in> {0..n} \<longrightarrow> bin_rep (Suc n) j ! (?k + 1) = bin_rep n (j mod 2 ^ n) ! ?k
i < 2 ^ n \<or> j < 2 ^ n
\<lbrakk>?m < 2 ^ ?n; ?n < ?k\<rbrakk> \<Longrightarrow> bin_rep ?k ?m ! 0 = 0
?i \<cdot>\<^bsub>?n\<^esub>  ?j = (\<Sum>k = 0..<?n. bin_rep ?n ?i ! k * bin_rep ?n ?j ! k)

goal (1 subgoal):
 1. i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i \<cdot>\<^bsub>Suc n\<^esub>  j = i mod 2 ^ n \<cdot>\<^bsub>n\<^esub>  j mod 2 ^ n

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma isPartition_wrt_trans:
\<open>(\<And> x y z. \<lbrakk>R x y; R y z\<rbrakk> \<Longrightarrow> R x z) \<Longrightarrow>
  isPartition_wrt R xs lo hi p \<Longrightarrow>
  (\<forall>i j. lo \<le> i \<and> i < p \<and> p < j \<and> j \<le> hi \<longrightarrow> R (xs!i) (xs!j))\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>x y z. \<lbrakk>R x y; R y z\<rbrakk> \<Longrightarrow> R x z; isPartition_wrt R xs lo hi p\<rbrakk> \<Longrightarrow> \<forall>i j. lo \<le> i \<and> i < p \<and> p < j \<and> j \<le> hi \<longrightarrow> R (xs ! i) (xs ! j)
[PROOF STEP]
by (auto simp add: isPartition_wrt_def)


[STATEMENT]
lemma lookup_lcs_pp: "lookup_pp (lcs s t) x = max (lookup_pp s x) (lookup_pp t x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. lookup_pp (lcs s t) x = max (lookup_pp s x) (lookup_pp t x)
[PROOF STEP]
by (transfer, simp add: lookup_lcs_fun lcs_fun_def)


[STATEMENT]
lemma cGDERIV_diff:
  "\<lbrakk>cGDERIV f x :> df; cGDERIV g x :> dg\<rbrakk>
     \<Longrightarrow> cGDERIV (\<lambda>x. f x - g x) x :> df - dg"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cGDERIV f x :> df; cGDERIV g x :> dg\<rbrakk> \<Longrightarrow> cGDERIV (\<lambda>x. f x - g x) x :> df - dg
[PROOF STEP]
unfolding cgderiv_def cinner_diff_left
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(f has_derivative cinner df) (at x); (g has_derivative cinner dg) (at x)\<rbrakk> \<Longrightarrow> ((\<lambda>x. f x - g x) has_derivative (\<lambda>z. cinner df z - cinner dg z)) (at x)
[PROOF STEP]
by (rule has_derivative_diff)