[STATEMENT]
lemma integral_prod_continuous:
  fixes f :: "('a::euclidean_space * 'b::euclidean_space) \<Rightarrow> 'c::banach"
  assumes "continuous_on (cbox (a, c) (b, d)) f" (is "continuous_on ?CBOX f")
    shows "integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
proof (cases "content ?CBOX = 0")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. content (cbox (a, c) (b, d)) = 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
 2. content (cbox (a, c) (b, d)) \<noteq> 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
content (cbox (a, c) (b, d)) = 0

goal (2 subgoals):
 1. content (cbox (a, c) (b, d)) = 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
 2. content (cbox (a, c) (b, d)) \<noteq> 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
content (cbox (a, c) (b, d)) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
content (cbox (a, c) (b, d)) = 0

goal (1 subgoal):
 1. integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
by (auto simp: content_Pair)
[PROOF STATE]
proof (state)
this:
integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))

goal (1 subgoal):
 1. content (cbox (a, c) (b, d)) \<noteq> 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. content (cbox (a, c) (b, d)) \<noteq> 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
content (cbox (a, c) (b, d)) \<noteq> 0

goal (1 subgoal):
 1. content (cbox (a, c) (b, d)) \<noteq> 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
content (cbox (a, c) (b, d)) \<noteq> 0
[PROOF STEP]
have cbp: "content ?CBOX > 0"
[PROOF STATE]
proof (prove)
using this:
content (cbox (a, c) (b, d)) \<noteq> 0

goal (1 subgoal):
 1. 0 < content (cbox (a, c) (b, d))
[PROOF STEP]
using content_lt_nz
[PROOF STATE]
proof (prove)
using this:
content (cbox (a, c) (b, d)) \<noteq> 0
(0 < content (cbox ?a ?b)) = (content (cbox ?a ?b) \<noteq> 0)

goal (1 subgoal):
 1. 0 < content (cbox (a, c) (b, d))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
0 < content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. content (cbox (a, c) (b, d)) \<noteq> 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
have "norm (integral ?CBOX f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x,y)))) = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) = 0
[PROOF STEP]
proof (rule dense_eq0_I, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
fix e :: real
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
assume "0 < e"
[PROOF STATE]
proof (state)
this:
0 < e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
with \<open>content ?CBOX > 0\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < content (cbox (a, c) (b, d))
0 < e
[PROOF STEP]
have "0 < e/content ?CBOX"
[PROOF STATE]
proof (prove)
using this:
0 < content (cbox (a, c) (b, d))
0 < e

goal (1 subgoal):
 1. 0 < e / content (cbox (a, c) (b, d))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < e / content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have f_int_acbd: "f integrable_on ?CBOX"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on cbox (a, c) (b, d)
[PROOF STEP]
by (rule integrable_continuous [OF assms])
[PROOF STATE]
proof (state)
this:
f integrable_on cbox (a, c) (b, d)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
f integrable_on cbox (a, c) (b, d)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
assume p: "p division_of ?CBOX"
[PROOF STATE]
proof (state)
this:
p division_of cbox (a, c) (b, d)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
p division_of cbox (a, c) (b, d)
[PROOF STEP]
have "finite p"
[PROOF STATE]
proof (prove)
using this:
p division_of cbox (a, c) (b, d)

goal (1 subgoal):
 1. finite p
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
finite p

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
define e' where "e' = e/content ?CBOX"
[PROOF STATE]
proof (state)
this:
e' = e / content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
with \<open>0 < e\<close> \<open>0 < e/content ?CBOX\<close>
[PROOF STATE]
proof (chain)
picking this:
0 < e
0 < e / content (cbox (a, c) (b, d))
e' = e / content (cbox (a, c) (b, d))
[PROOF STEP]
have "0 < e'"
[PROOF STATE]
proof (prove)
using this:
0 < e
0 < e / content (cbox (a, c) (b, d))
e' = e / content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. 0 < e'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
0 < e'

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
interpret operative conj True
           "\<lambda>k. \<forall>a' b' c' d'.
                cbox (a', c') (b', d') \<subseteq> k \<and> cbox (a', c') (b', d') \<subseteq> ?CBOX
                \<longrightarrow> norm (integral (cbox (a', c') (b', d')) f -
                         integral (cbox a' b') (\<lambda>x. integral (cbox c' d') (\<lambda>y. f ((x, y)))))
                    \<le> e' * content (cbox (a', c') (b', d'))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. operative (\<and>) True (\<lambda>k. \<forall>a' b' c' d'. cbox (a', c') (b', d') \<subseteq> k \<and> cbox (a', c') (b', d') \<subseteq> cbox (a, c) (b, d) \<longrightarrow> norm (integral (cbox (a', c') (b', d')) f - integral (cbox a' b') (\<lambda>x. integral (cbox c' d') (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a', c') (b', d')))
[PROOF STEP]
using assms \<open>0 < e'\<close>
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox (a, c) (b, d)) f
0 < e'

goal (1 subgoal):
 1. operative (\<and>) True (\<lambda>k. \<forall>a' b' c' d'. cbox (a', c') (b', d') \<subseteq> k \<and> cbox (a', c') (b', d') \<subseteq> cbox (a, c) (b, d) \<longrightarrow> norm (integral (cbox (a', c') (b', d')) f - integral (cbox a' b') (\<lambda>x. integral (cbox c' d') (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a', c') (b', d')))
[PROOF STEP]
by (rule integral_swap_operativeI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have "norm (integral ?CBOX f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y))))
          \<le> e' * content ?CBOX"
        if "\<And>t u v w z. t \<in> p \<Longrightarrow> cbox (u, w) (v, z) \<subseteq> t \<Longrightarrow> cbox (u, w) (v, z) \<subseteq> ?CBOX
          \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f -
              integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y))))
              \<le> e' * content (cbox (u, w) (v, z))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a, c) (b, d))
[PROOF STEP]
using that division [of p "(a, c)" "(b, d)"] p \<open>finite p\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?t1 \<in> p; cbox (?u1, ?w1) (?v1, ?z1) \<subseteq> ?t1; cbox (?u1, ?w1) (?v1, ?z1) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (?u1, ?w1) (?v1, ?z1)) f - integral (cbox ?u1 ?v1) (\<lambda>x. integral (cbox ?w1 ?z1) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (?u1, ?w1) (?v1, ?z1))
p division_of cbox (a, c) (b, d) \<Longrightarrow> F (\<lambda>k. \<forall>a' b' c' d'. cbox (a', c') (b', d') \<subseteq> k \<and> cbox (a', c') (b', d') \<subseteq> cbox (a, c) (b, d) \<longrightarrow> norm (integral (cbox (a', c') (b', d')) f - integral (cbox a' b') (\<lambda>x. integral (cbox c' d') (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a', c') (b', d'))) p = (\<forall>a' b' c' d'. cbox (a', c') (b', d') \<subseteq> cbox (a, c) (b, d) \<and> cbox (a', c') (b', d') \<subseteq> cbox (a, c) (b, d) \<longrightarrow> norm (integral (cbox (a', c') (b', d')) f - integral (cbox a' b') (\<lambda>x. integral (cbox c' d') (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a', c') (b', d')))
p division_of cbox (a, c) (b, d)
finite p

goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a, c) (b, d))
[PROOF STEP]
by (auto simp add: comm_monoid_set_F_and)
[PROOF STATE]
proof (state)
this:
(\<And>t u v w z. \<lbrakk>t \<in> p; cbox (u, w) (v, z) \<subseteq> t; cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (u, w) (v, z))) \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
with False
[PROOF STATE]
proof (chain)
picking this:
content (cbox (a, c) (b, d)) \<noteq> 0
(\<And>t u v w z. \<lbrakk>t \<in> p; cbox (u, w) (v, z) \<subseteq> t; cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (u, w) (v, z))) \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a, c) (b, d))
[PROOF STEP]
have "norm (integral ?CBOX f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y))))
          \<le> e"
        if "\<And>t u v w z. t \<in> p \<Longrightarrow> cbox (u, w) (v, z) \<subseteq> t \<Longrightarrow> cbox (u, w) (v, z) \<subseteq> ?CBOX
          \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f -
              integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y))))
              \<le> e * content (cbox (u, w) (v, z)) / content ?CBOX"
[PROOF STATE]
proof (prove)
using this:
content (cbox (a, c) (b, d)) \<noteq> 0
(\<And>t u v w z. \<lbrakk>t \<in> p; cbox (u, w) (v, z) \<subseteq> t; cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (u, w) (v, z))) \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
content (cbox (a, c) (b, d)) \<noteq> 0
(\<And>t u v w z. \<lbrakk>t \<in> p; cbox (u, w) (v, z) \<subseteq> t; cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (u, w) (v, z))) \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e' * content (cbox (a, c) (b, d))
\<lbrakk>?t1 \<in> p; cbox (?u1, ?w1) (?v1, ?z1) \<subseteq> ?t1; cbox (?u1, ?w1) (?v1, ?z1) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (?u1, ?w1) (?v1, ?z1)) f - integral (cbox ?u1 ?v1) (\<lambda>x. integral (cbox ?w1 ?z1) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (?u1, ?w1) (?v1, ?z1)) / content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
by (simp add: e'_def)
[PROOF STATE]
proof (state)
this:
(\<And>t u v w z. \<lbrakk>t \<in> p; cbox (u, w) (v, z) \<subseteq> t; cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d))) \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?p2 division_of cbox (a, c) (b, d); \<And>t u v w z. \<lbrakk>t \<in> ?p2; cbox (u, w) (v, z) \<subseteq> t; cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d))\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
note op_acbd = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>?p2 division_of cbox (a, c) (b, d); \<And>t u v w z. \<lbrakk>t \<in> ?p2; cbox (u, w) (v, z) \<subseteq> t; cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d))\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>?p2 division_of cbox (a, c) (b, d); \<And>t u v w z. \<lbrakk>t \<in> ?p2; cbox (u, w) (v, z) \<subseteq> t; cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d))\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
fix k::real and \<D> and u::'a and v w and z::'b and t1 t2 l
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
assume k: "0 < k"
         and nf: "\<And>x y u v.
                  \<lbrakk>x \<in> cbox a b; y \<in> cbox c d; u \<in> cbox a b; v\<in>cbox c d; norm (u-x, v-y) < k\<rbrakk>
                  \<Longrightarrow> norm (f(u,v) - f(x,y)) < e/(2 * (content ?CBOX))"
         and p_acbd: "\<D> tagged_division_of cbox (a,c) (b,d)"
         and fine: "(\<lambda>x. ball x k) fine \<D>"  "((t1,t2), l) \<in> \<D>"
         and uwvz_sub: "cbox (u,w) (v,z) \<subseteq> l" "cbox (u,w) (v,z) \<subseteq> cbox (a,c) (b,d)"
[PROOF STATE]
proof (state)
this:
0 < k
\<lbrakk>?x \<in> cbox a b; ?y \<in> cbox c d; ?u \<in> cbox a b; ?v \<in> cbox c d; norm (?u - ?x, ?v - ?y) < k\<rbrakk> \<Longrightarrow> norm (f (?u, ?v) - f (?x, ?y)) < e / (2 * content (cbox (a, c) (b, d)))
\<D> tagged_division_of cbox (a, c) (b, d)
(\<lambda>x. ball x k) fine \<D>
((t1, t2), l) \<in> \<D>
cbox (u, w) (v, z) \<subseteq> l
cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have t: "t1 \<in> cbox a b" "t2 \<in> cbox c d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. t1 \<in> cbox a b &&& t2 \<in> cbox c d
[PROOF STEP]
by (meson fine p_acbd cbox_Pair_iff tag_in_interval)+
[PROOF STATE]
proof (state)
this:
t1 \<in> cbox a b
t2 \<in> cbox c d

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have ls: "l \<subseteq> ball (t1,t2) k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l \<subseteq> ball (t1, t2) k
[PROOF STEP]
using fine
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. ball x k) fine \<D>
((t1, t2), l) \<in> \<D>

goal (1 subgoal):
 1. l \<subseteq> ball (t1, t2) k
[PROOF STEP]
by (simp add: fine_def Ball_def)
[PROOF STATE]
proof (state)
this:
l \<subseteq> ball (t1, t2) k

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
l \<subseteq> ball (t1, t2) k

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
fix x1 x2
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
assume xuvwz: "x1 \<in> cbox u v" "x2 \<in> cbox w z"
[PROOF STATE]
proof (state)
this:
x1 \<in> cbox u v
x2 \<in> cbox w z

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x1 \<in> cbox u v
x2 \<in> cbox w z
[PROOF STEP]
have x: "x1 \<in> cbox a b" "x2 \<in> cbox c d"
[PROOF STATE]
proof (prove)
using this:
x1 \<in> cbox u v
x2 \<in> cbox w z

goal (1 subgoal):
 1. x1 \<in> cbox a b &&& x2 \<in> cbox c d
[PROOF STEP]
using uwvz_sub
[PROOF STATE]
proof (prove)
using this:
x1 \<in> cbox u v
x2 \<in> cbox w z
cbox (u, w) (v, z) \<subseteq> l
cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)

goal (1 subgoal):
 1. x1 \<in> cbox a b &&& x2 \<in> cbox c d
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x1 \<in> cbox a b
x2 \<in> cbox c d

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have "norm (x1 - t1, x2 - t2) = norm (t1 - x1, t2 - x2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (x1 - t1, x2 - t2) = norm (t1 - x1, t2 - x2)
[PROOF STEP]
by (simp add: norm_Pair norm_minus_commute)
[PROOF STATE]
proof (state)
this:
norm (x1 - t1, x2 - t2) = norm (t1 - x1, t2 - x2)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (x1 - t1, x2 - t2) = norm (t1 - x1, t2 - x2)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have "norm (t1 - x1, t2 - x2) < k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (t1 - x1, t2 - x2) < k
[PROOF STEP]
using xuvwz ls uwvz_sub
[PROOF STATE]
proof (prove)
using this:
x1 \<in> cbox u v
x2 \<in> cbox w z
l \<subseteq> ball (t1, t2) k
cbox (u, w) (v, z) \<subseteq> l
cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)

goal (1 subgoal):
 1. norm (t1 - x1, t2 - x2) < k
[PROOF STEP]
unfolding ball_def
[PROOF STATE]
proof (prove)
using this:
x1 \<in> cbox u v
x2 \<in> cbox w z
l \<subseteq> {y. dist (t1, t2) y < k}
cbox (u, w) (v, z) \<subseteq> l
cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)

goal (1 subgoal):
 1. norm (t1 - x1, t2 - x2) < k
[PROOF STEP]
by (force simp add: cbox_Pair_eq dist_norm )
[PROOF STATE]
proof (state)
this:
norm (t1 - x1, t2 - x2) < k

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (x1 - t1, x2 - t2) < k
[PROOF STEP]
have "norm (f (x1,x2) - f (t1,t2)) \<le> e/content ?CBOX/2"
[PROOF STATE]
proof (prove)
using this:
norm (x1 - t1, x2 - t2) < k

goal (1 subgoal):
 1. norm (f (x1, x2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
using nf [OF t x]
[PROOF STATE]
proof (prove)
using this:
norm (x1 - t1, x2 - t2) < k
norm (x1 - t1, x2 - t2) < k \<Longrightarrow> norm (f (x1, x2) - f (t1, t2)) < e / (2 * content (cbox (a, c) (b, d)))

goal (1 subgoal):
 1. norm (f (x1, x2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
norm (f (x1, x2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x1.2 \<in> cbox u v; ?x2.2 \<in> cbox w z\<rbrakk> \<Longrightarrow> norm (f (?x1.2, ?x2.2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
note nf' = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x1.2 \<in> cbox u v; ?x2.2 \<in> cbox w z\<rbrakk> \<Longrightarrow> norm (f (?x1.2, ?x2.2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have f_int_uwvz: "f integrable_on cbox (u,w) (v,z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f integrable_on cbox (u, w) (v, z)
[PROOF STEP]
using f_int_acbd uwvz_sub integrable_on_subcbox
[PROOF STATE]
proof (prove)
using this:
f integrable_on cbox (a, c) (b, d)
cbox (u, w) (v, z) \<subseteq> l
cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)
\<lbrakk>?f integrable_on ?S; cbox ?a ?b \<subseteq> ?S\<rbrakk> \<Longrightarrow> ?f integrable_on cbox ?a ?b

goal (1 subgoal):
 1. f integrable_on cbox (u, w) (v, z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
f integrable_on cbox (u, w) (v, z)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have f_int_uv: "\<And>x. x \<in> cbox u v \<Longrightarrow> (\<lambda>y. f (x,y)) integrable_on cbox w z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> cbox u v \<Longrightarrow> (\<lambda>y. f (x, y)) integrable_on cbox w z
[PROOF STEP]
using assms continuous_on_subset uwvz_sub
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox (a, c) (b, d)) f
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f
cbox (u, w) (v, z) \<subseteq> l
cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)

goal (1 subgoal):
 1. \<And>x. x \<in> cbox u v \<Longrightarrow> (\<lambda>y. f (x, y)) integrable_on cbox w z
[PROOF STEP]
by (blast intro: continuous_on_imp_integrable_on_Pair1)
[PROOF STATE]
proof (state)
this:
?x \<in> cbox u v \<Longrightarrow> (\<lambda>y. f (?x, y)) integrable_on cbox w z

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have 1: "norm (integral (cbox (u,w) (v,z)) f - integral (cbox (u,w) (v,z)) (\<lambda>x. f (t1,t2)))
             \<le> e * content (cbox (u,w) (v,z)) / content ?CBOX/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral (cbox (u, w) (v, z)) f - integral (cbox (u, w) (v, z)) (\<lambda>x. f (t1, t2))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
using cbp \<open>0 < e/content ?CBOX\<close> nf'
[PROOF STATE]
proof (prove)
using this:
0 < content (cbox (a, c) (b, d))
0 < e / content (cbox (a, c) (b, d))
\<lbrakk>?x1.2 \<in> cbox u v; ?x2.2 \<in> cbox w z\<rbrakk> \<Longrightarrow> norm (f (?x1.2, ?x2.2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. norm (integral (cbox (u, w) (v, z)) f - integral (cbox (u, w) (v, z)) (\<lambda>x. f (t1, t2))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
apply (simp only: integral_diff [symmetric] f_int_uwvz integrable_const)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < content (cbox (a, c) (b, d)); 0 < e / content (cbox (a, c) (b, d)); \<And>x1 x2. \<lbrakk>x1 \<in> cbox u v; x2 \<in> cbox w z\<rbrakk> \<Longrightarrow> norm (f (x1, x2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2\<rbrakk> \<Longrightarrow> norm (integral (cbox (u, w) (v, z)) (\<lambda>x. f x - f (t1, t2))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
apply (auto simp: integrable_diff f_int_uwvz integrable_const intro: order_trans [OF integrable_bound [of "e/content ?CBOX/2"]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
norm (integral (cbox (u, w) (v, z)) f - integral (cbox (u, w) (v, z)) (\<lambda>x. f (t1, t2))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have int_integrable: "(\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y))) integrable_on cbox u v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y))) integrable_on cbox u v
[PROOF STEP]
using assms integral_integrable_2dim continuous_on_subset uwvz_sub(2)
[PROOF STATE]
proof (prove)
using this:
continuous_on (cbox (a, c) (b, d)) f
continuous_on (cbox (?a, ?c) (?b, ?d)) ?f \<Longrightarrow> (\<lambda>x. integral (cbox ?c ?d) (\<lambda>y. ?f (x, y))) integrable_on cbox ?a ?b
\<lbrakk>continuous_on ?s ?f; ?t \<subseteq> ?s\<rbrakk> \<Longrightarrow> continuous_on ?t ?f
cbox (u, w) (v, z) \<subseteq> cbox (a, c) (b, d)

goal (1 subgoal):
 1. (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y))) integrable_on cbox u v
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y))) integrable_on cbox u v

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have normint_wz:
         "\<And>x. x \<in> cbox u v \<Longrightarrow>
               norm (integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2)))
               \<le> e * content (cbox w z) / content (cbox (a, c) (b, d))/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. x \<in> cbox u v \<Longrightarrow> norm (integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2))) \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
using cbp \<open>0 < e/content ?CBOX\<close> nf'
[PROOF STATE]
proof (prove)
using this:
0 < content (cbox (a, c) (b, d))
0 < e / content (cbox (a, c) (b, d))
\<lbrakk>?x1.2 \<in> cbox u v; ?x2.2 \<in> cbox w z\<rbrakk> \<Longrightarrow> norm (f (?x1.2, ?x2.2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. \<And>x. x \<in> cbox u v \<Longrightarrow> norm (integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2))) \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
apply (simp only: integral_diff [symmetric] f_int_uv integrable_const)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> cbox u v; 0 < content (cbox (a, c) (b, d)); 0 < e / content (cbox (a, c) (b, d)); \<And>x1 x2. \<lbrakk>x1 \<in> cbox u v; x2 \<in> cbox w z\<rbrakk> \<Longrightarrow> norm (f (x1, x2) - f (t1, t2)) \<le> e / content (cbox (a, c) (b, d)) / 2\<rbrakk> \<Longrightarrow> norm (integral (cbox w z) (\<lambda>xa. f (x, xa) - f (t1, t2))) \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
apply (auto simp: integrable_diff f_int_uv integrable_const intro: order_trans [OF integrable_bound [of "e/content ?CBOX/2"]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
?x \<in> cbox u v \<Longrightarrow> norm (integral (cbox w z) (\<lambda>y. f (?x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2))) \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have "norm (integral (cbox u v)
               (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x,y)) - integral (cbox w z) (\<lambda>y. f (t1,t2))))
            \<le> e * content (cbox w z) / content ?CBOX/2 * content (cbox u v)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2)))) \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2 * content (cbox u v)
[PROOF STEP]
using cbp \<open>0 < e/content ?CBOX\<close>
[PROOF STATE]
proof (prove)
using this:
0 < content (cbox (a, c) (b, d))
0 < e / content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2)))) \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2 * content (cbox u v)
[PROOF STEP]
apply (intro integrable_bound [OF _ _ normint_wz])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>0 < content (cbox (a, c) (b, d)); 0 < e / content (cbox (a, c) (b, d))\<rbrakk> \<Longrightarrow> 0 \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2
 2. \<lbrakk>0 < content (cbox (a, c) (b, d)); 0 < e / content (cbox (a, c) (b, d))\<rbrakk> \<Longrightarrow> (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2))) integrable_on cbox u v
 3. \<And>x. \<lbrakk>0 < content (cbox (a, c) (b, d)); 0 < e / content (cbox (a, c) (b, d)); x \<in> cbox u v\<rbrakk> \<Longrightarrow> x \<in> cbox u v
[PROOF STEP]
apply (auto simp: field_split_simps integrable_diff int_integrable integrable_const)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2)))) \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2 * content (cbox u v)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2)))) \<le> e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2 * content (cbox u v)

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have "... \<le> e * content (cbox (u,w) (v,z)) / content ?CBOX/2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2 * content (cbox u v) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
by (simp add: content_Pair field_split_simps)
[PROOF STATE]
proof (state)
this:
e * content (cbox w z) / content (cbox (a, c) (b, d)) / 2 * content (cbox u v) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
have 2: "norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x,y))) -
                      integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (t1,t2))))
                \<le> e * content (cbox (u,w) (v,z)) / content ?CBOX/2"
[PROOF STATE]
proof (prove)
using this:
norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)) - integral (cbox w z) (\<lambda>y. f (t1, t2)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y))) - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (t1, t2)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2
[PROOF STEP]
by (simp only: integral_diff [symmetric] int_integrable integrable_const)
[PROOF STATE]
proof (state)
this:
norm (integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y))) - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (t1, t2)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d)) / 2

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have norm_xx: "\<lbrakk>x' = y'; norm(x - x') \<le> e/2; norm(y - y') \<le> e/2\<rbrakk> \<Longrightarrow> norm(x - y) \<le> e" for x::'c and y x' y' e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x' = y'; norm (x - x') \<le> e / 2; norm (y - y') \<le> e / 2\<rbrakk> \<Longrightarrow> norm (x - y) \<le> e
[PROOF STEP]
using norm_triangle_mono [of "x-y'" "e/2" "y'-y" "e/2"] field_sum_of_halves
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>norm (x - y') \<le> e / 2; norm (y' - y) \<le> e / 2\<rbrakk> \<Longrightarrow> norm (x - y' + (y' - y)) \<le> e / 2 + e / 2
?x / (2::?'a) + ?x / (2::?'a) = ?x

goal (1 subgoal):
 1. \<lbrakk>x' = y'; norm (x - x') \<le> e / 2; norm (y - y') \<le> e / 2\<rbrakk> \<Longrightarrow> norm (x - y) \<le> e
[PROOF STEP]
by (simp add: norm_minus_commute)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?x' = ?y'; norm (?x - ?x') \<le> ?e / 2; norm (?y - ?y') \<le> ?e / 2\<rbrakk> \<Longrightarrow> norm (?x - ?y) \<le> ?e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have "norm (integral (cbox (u,w) (v,z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x,y))))
            \<le> e * content (cbox (u,w) (v,z)) / content ?CBOX"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d))
[PROOF STEP]
by (rule norm_xx [OF integral_Pair_const 1 2])
[PROOF STATE]
proof (state)
this:
norm (integral (cbox (u, w) (v, z)) f - integral (cbox u v) (\<lambda>x. integral (cbox w z) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (u, w) (v, z)) / content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?k2; \<And>x y u v. \<lbrakk>x \<in> cbox a b; y \<in> cbox c d; u \<in> cbox a b; v \<in> cbox c d; norm (u - x, v - y) < ?k2\<rbrakk> \<Longrightarrow> norm (f (u, v) - f (x, y)) < e / (2 * content (cbox (a, c) (b, d))); ?\<D>2 tagged_division_of cbox (a, c) (b, d); (\<lambda>x. ball x ?k2) fine ?\<D>2; ((?t1.2, ?t2.2), ?l2) \<in> ?\<D>2; cbox (?u2, ?w2) (?v2, ?z2) \<subseteq> ?l2; cbox (?u2, ?w2) (?v2, ?z2) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (?u2, ?w2) (?v2, ?z2)) f - integral (cbox ?u2 ?v2) (\<lambda>x. integral (cbox ?w2 ?z2) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (?u2, ?w2) (?v2, ?z2)) / content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
note * = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>0 < ?k2; \<And>x y u v. \<lbrakk>x \<in> cbox a b; y \<in> cbox c d; u \<in> cbox a b; v \<in> cbox c d; norm (u - x, v - y) < ?k2\<rbrakk> \<Longrightarrow> norm (f (u, v) - f (x, y)) < e / (2 * content (cbox (a, c) (b, d))); ?\<D>2 tagged_division_of cbox (a, c) (b, d); (\<lambda>x. ball x ?k2) fine ?\<D>2; ((?t1.2, ?t2.2), ?l2) \<in> ?\<D>2; cbox (?u2, ?w2) (?v2, ?z2) \<subseteq> ?l2; cbox (?u2, ?w2) (?v2, ?z2) \<subseteq> cbox (a, c) (b, d)\<rbrakk> \<Longrightarrow> norm (integral (cbox (?u2, ?w2) (?v2, ?z2)) f - integral (cbox ?u2 ?v2) (\<lambda>x. integral (cbox ?w2 ?z2) (\<lambda>y. f (x, y)))) \<le> e * content (cbox (?u2, ?w2) (?v2, ?z2)) / content (cbox (a, c) (b, d))

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
have "norm (integral ?CBOX f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x,y)))) \<le> e"
      if "\<forall>x\<in>?CBOX. \<forall>x'\<in>?CBOX. norm (x' - x) < k \<longrightarrow> norm (f x' - f x) < e /(2 * content (?CBOX))" "0 < k" for k
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
obtain p where ptag: "p tagged_division_of cbox (a, c) (b, d)"
                 and fine: "(\<lambda>x. ball x k) fine p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p tagged_division_of cbox (a, c) (b, d); (\<lambda>x. ball x k) fine p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using fine_division_exists \<open>0 < k\<close>
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>gauge ?g; \<And>p. \<lbrakk>p tagged_division_of cbox ?a ?b; ?g fine p\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
0 < k

goal (1 subgoal):
 1. (\<And>p. \<lbrakk>p tagged_division_of cbox (a, c) (b, d); (\<lambda>x. ball x k) fine p\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
p tagged_division_of cbox (a, c) (b, d)
(\<lambda>x. ball x k) fine p

goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
using that fine ptag \<open>0 < k\<close>
[PROOF STATE]
proof (prove)
using this:
\<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < k \<longrightarrow> norm (f x' - f x) < e / (2 * content (cbox (a, c) (b, d)))
0 < k
(\<lambda>x. ball x k) fine p
p tagged_division_of cbox (a, c) (b, d)
0 < k

goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
by (auto simp: * intro: op_acbd [OF division_of_tagged_division [OF ptag]])
[PROOF STATE]
proof (state)
this:
norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>\<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < ?k \<longrightarrow> norm (f x' - f x) < e / (2 * content (cbox (a, c) (b, d))); 0 < ?k\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e

goal (1 subgoal):
 1. \<And>e. 0 < e \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>\<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < ?k \<longrightarrow> norm (f x' - f x) < e / (2 * content (cbox (a, c) (b, d))); 0 < ?k\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
show "norm (integral ?CBOX f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x,y)))) \<le> e"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < ?k \<longrightarrow> norm (f x' - f x) < e / (2 * content (cbox (a, c) (b, d))); 0 < ?k\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e

goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
using compact_uniformly_continuous [OF assms compact_cbox]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < ?k \<longrightarrow> norm (f x' - f x) < e / (2 * content (cbox (a, c) (b, d))); 0 < ?k\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
uniformly_continuous_on (cbox (a, c) (b, d)) f

goal (1 subgoal):
 1. norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
apply (simp add: uniformly_continuous_on_def dist_norm)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>k. \<lbrakk>\<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < k \<longrightarrow> norm (f x' - f x) < e / (2 * content (cbox (a, c) (b, d))); 0 < k\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e; \<forall>e>0. \<exists>da>0. \<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < da \<longrightarrow> norm (f x' - f x) < e\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
apply (drule_tac x="e/2 / content?CBOX" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<And>k. \<lbrakk>\<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < k \<longrightarrow> norm (f x' - f x) < e / (2 * content (cbox (a, c) (b, d))); 0 < k\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e; 0 < e / 2 / content (cbox (a, c) (b, d)) \<longrightarrow> (\<exists>da>0. \<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < da \<longrightarrow> norm (f x' - f x) < e / 2 / content (cbox (a, c) (b, d)))\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
using cbp \<open>0 < e\<close>
[PROOF STATE]
proof (prove)
using this:
0 < content (cbox (a, c) (b, d))
0 < e

goal (1 subgoal):
 1. \<lbrakk>\<And>k. \<lbrakk>\<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < k \<longrightarrow> norm (f x' - f x) < e / (2 * content (cbox (a, c) (b, d))); 0 < k\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e; 0 < e / 2 / content (cbox (a, c) (b, d)) \<longrightarrow> (\<exists>da>0. \<forall>x\<in>cbox (a, c) (b, d). \<forall>x'\<in>cbox (a, c) (b, d). norm (x' - x) < da \<longrightarrow> norm (f x' - f x) < e / 2 / content (cbox (a, c) (b, d)))\<rbrakk> \<Longrightarrow> norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e
[PROOF STEP]
by (auto simp: zero_less_mult_iff)
[PROOF STATE]
proof (state)
this:
norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) \<le> e

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) = 0

goal (1 subgoal):
 1. content (cbox (a, c) (b, d)) \<noteq> 0 \<Longrightarrow> integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
norm (integral (cbox (a, c) (b, d)) f - integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))) = 0

goal (1 subgoal):
 1. integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
integral (cbox (a, c) (b, d)) f = integral (cbox a b) (\<lambda>x. integral (cbox c d) (\<lambda>y. f (x, y)))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma integer_division2:
  "PRE (\<lambda>s::nat store. x \<ge> 0)
    (''q'' ::= (\<lambda>s. 0));
    (''r'' ::= (\<lambda>s. x));
    (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0)
     DO
      (''q'' ::= (\<lambda>s. s ''q'' + 1));
      (''r'' ::= (\<lambda>s. s ''r'' - y))
      OD)
   POST (\<lambda>s. x = s ''q'' * y + s ''r'' \<and> s ''r'' \<ge> 0 \<and> s ''r'' < y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rdom \<lceil>\<lambda>s. 0 \<le> x\<rceil> \<subseteq> wp ((''q'' ::= (\<lambda>s. 0)) ; (''r'' ::= (\<lambda>s. x)) ; (WHILE (\<lambda>s. y \<le> s ''r'') INV (\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> 0 \<le> s ''r'') DO (''q'' ::= (\<lambda>s. s ''q'' + 1)) ; (''r'' ::= (\<lambda>s. s ''r'' - y)) OD)) \<lceil>\<lambda>s. x = s ''q'' \<cdot> y + s ''r'' \<and> 0 \<le> s ''r'' \<and> s ''r'' < y\<rceil>
[PROOF STEP]
by hoare simp_all


[STATEMENT]
theorem STRIPS_sema_sound_compact_version:
    "sound_system \<Sigma> M\<^sub>0 s\<^sub>0 f \<Longrightarrow> set \<alpha>s \<subseteq> \<Sigma>
    \<Longrightarrow> ground_action_path M\<^sub>0 \<alpha>s M'
    \<Longrightarrow> \<exists>s'. compose_actions (map f \<alpha>s) s\<^sub>0 = Some s'
          \<and> (\<forall>fmla\<in>close_world M'. s' \<Turnstile>\<^sub>= fmla)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sound_system \<Sigma> M\<^sub>0 s\<^sub>0 f; set \<alpha>s \<subseteq> \<Sigma>; ground_action_path M\<^sub>0 \<alpha>s M'\<rbrakk> \<Longrightarrow> \<exists>s'. compose_actions (map f \<alpha>s) s\<^sub>0 = Some s' \<and> (\<forall>fmla\<in>close_world M'. close_eq s' \<Turnstile> fmla)
[PROOF STEP]
using STRIPS_sema_sound
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>sound_system ?\<Sigma> ?M\<^sub>0 ?s\<^sub>0 ?f; set ?\<alpha>s \<subseteq> ?\<Sigma>; ground_action_path ?M\<^sub>0 ?\<alpha>s ?M'; \<And>s'. \<lbrakk>compose_actions (map ?f ?\<alpha>s) ?s\<^sub>0 = Some s'; \<forall>fmla\<in>close_world ?M'. close_eq s' \<Turnstile> fmla\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis

goal (1 subgoal):
 1. \<lbrakk>sound_system \<Sigma> M\<^sub>0 s\<^sub>0 f; set \<alpha>s \<subseteq> \<Sigma>; ground_action_path M\<^sub>0 \<alpha>s M'\<rbrakk> \<Longrightarrow> \<exists>s'. compose_actions (map f \<alpha>s) s\<^sub>0 = Some s' \<and> (\<forall>fmla\<in>close_world M'. close_eq s' \<Turnstile> fmla)
[PROOF STEP]
by metis


[STATEMENT]
lemma l7_20:
  assumes "Col A M B" and
    "Cong M A M B"
  shows "A = B \<or> M Midpoint A B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B \<or> M Midpoint A B
[PROOF STEP]
by (metis Bet_cases Col_def Midpoint_def assms(1) assms(2) between_cong cong_left_commutativity not_cong_3412)


[STATEMENT]
lemma mat_kernel_mult_right_basis: assumes A: "A \<in> carrier_mat nr nc"
  and B: "B \<in> carrier_mat nc nc"
  and C: "C \<in> carrier_mat nc nc"
  and inv: "B * C = 1\<^sub>m nc"
  and fin: "finite gen"
  and basis: "kernel.basis nc (A * B) gen"
  shows "kernel.basis nc A (((*\<^sub>v) B) ` gen)"
  "card (((*\<^sub>v) B) ` gen) = card gen"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. vectorspace.basis class_ring (module_vec TYPE('a) nc\<lparr>carrier := mat_kernel A\<rparr>) ((*\<^sub>v) B ` gen) &&& card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vectorspace.basis class_ring (module_vec TYPE('a) nc\<lparr>carrier := mat_kernel A\<rparr>) ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
let ?AB = "A * B"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vectorspace.basis class_ring (module_vec TYPE('a) nc\<lparr>carrier := mat_kernel A\<rparr>) ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
let ?gen = "((*\<^sub>v) B) ` gen"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vectorspace.basis class_ring (module_vec TYPE('a) nc\<lparr>carrier := mat_kernel A\<rparr>) ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
from A B
[PROOF STATE]
proof (chain)
picking this:
A \<in> carrier_mat nr nc
B \<in> carrier_mat nc nc
[PROOF STEP]
have AB: "?AB \<in> carrier_mat nr nc"
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
B \<in> carrier_mat nc nc

goal (1 subgoal):
 1. A * B \<in> carrier_mat nr nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A * B \<in> carrier_mat nr nc

goal (2 subgoals):
 1. vectorspace.basis class_ring (module_vec TYPE('a) nc\<lparr>carrier := mat_kernel A\<rparr>) ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
from B
[PROOF STATE]
proof (chain)
picking this:
B \<in> carrier_mat nc nc
[PROOF STEP]
have dimB: "dim_row B = nc"
[PROOF STATE]
proof (prove)
using this:
B \<in> carrier_mat nc nc

goal (1 subgoal):
 1. dim_row B = nc
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
dim_row B = nc

goal (2 subgoals):
 1. vectorspace.basis class_ring (module_vec TYPE('a) nc\<lparr>carrier := mat_kernel A\<rparr>) ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
from inv B C
[PROOF STATE]
proof (chain)
picking this:
B * C = 1\<^sub>m nc
B \<in> carrier_mat nc nc
C \<in> carrier_mat nc nc
[PROOF STEP]
have CB: "C * B = 1\<^sub>m nc"
[PROOF STATE]
proof (prove)
using this:
B * C = 1\<^sub>m nc
B \<in> carrier_mat nc nc
C \<in> carrier_mat nc nc

goal (1 subgoal):
 1. C * B = 1\<^sub>m nc
[PROOF STEP]
by (metis mat_mult_left_right_inverse)
[PROOF STATE]
proof (state)
this:
C * B = 1\<^sub>m nc

goal (2 subgoals):
 1. vectorspace.basis class_ring (module_vec TYPE('a) nc\<lparr>carrier := mat_kernel A\<rparr>) ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
interpret AB: kernel nr nc ?AB
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Kernel.kernel nr nc (A * B)
[PROOF STEP]
by (unfold_locales, rule AB)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. vectorspace.basis class_ring (AB.NC.vs (mat_kernel A)) ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
interpret A: kernel nr nc A
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix_Kernel.kernel nr nc A
[PROOF STEP]
by (unfold_locales, rule A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A.basis ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
from basis[unfolded AB.Ker.basis_def]
[PROOF STATE]
proof (chain)
picking this:
AB.lin_indpt gen \<and> AB.span gen = mat_kernel (A * B) \<and> gen \<subseteq> mat_kernel (A * B)
[PROOF STEP]
have gen_set: "AB.gen_set gen" and genAB: "gen \<subseteq> mat_kernel ?AB"
[PROOF STATE]
proof (prove)
using this:
AB.lin_indpt gen \<and> AB.span gen = mat_kernel (A * B) \<and> gen \<subseteq> mat_kernel (A * B)

goal (1 subgoal):
 1. AB.gen_set gen &&& gen \<subseteq> mat_kernel (A * B)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
AB.gen_set gen
gen \<subseteq> mat_kernel (A * B)

goal (2 subgoals):
 1. A.basis ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
from mat_kernel_mult_right_gen_set[OF A B C inv gen_set genAB]
[PROOF STATE]
proof (chain)
picking this:
A.gen_set ((*\<^sub>v) B ` gen)
(*\<^sub>v) B ` gen \<subseteq> mat_kernel A
card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
have gen: "A.gen_set ?gen" and sub: "?gen \<subseteq> mat_kernel A" and card: "card ?gen = card gen"
[PROOF STATE]
proof (prove)
using this:
A.gen_set ((*\<^sub>v) B ` gen)
(*\<^sub>v) B ` gen \<subseteq> mat_kernel A
card ((*\<^sub>v) B ` gen) = card gen

goal (1 subgoal):
 1. A.gen_set ((*\<^sub>v) B ` gen) &&& (*\<^sub>v) B ` gen \<subseteq> mat_kernel A &&& card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A.gen_set ((*\<^sub>v) B ` gen)
(*\<^sub>v) B ` gen \<subseteq> mat_kernel A
card ((*\<^sub>v) B ` gen) = card gen

goal (2 subgoals):
 1. A.basis ((*\<^sub>v) B ` gen)
 2. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
from card
[PROOF STATE]
proof (chain)
picking this:
card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
show "card ?gen = card gen"
[PROOF STATE]
proof (prove)
using this:
card ((*\<^sub>v) B ` gen) = card gen

goal (1 subgoal):
 1. card ((*\<^sub>v) B ` gen) = card gen
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
card ((*\<^sub>v) B ` gen) = card gen

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from fin
[PROOF STATE]
proof (chain)
picking this:
finite gen
[PROOF STEP]
have fing: "finite ?gen"
[PROOF STATE]
proof (prove)
using this:
finite gen

goal (1 subgoal):
 1. finite ((*\<^sub>v) B ` gen)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite ((*\<^sub>v) B ` gen)

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from gen
[PROOF STATE]
proof (chain)
picking this:
A.gen_set ((*\<^sub>v) B ` gen)
[PROOF STEP]
have gen: "A.Ker.span ?gen = mat_kernel A"
[PROOF STATE]
proof (prove)
using this:
A.gen_set ((*\<^sub>v) B ` gen)

goal (1 subgoal):
 1. A.span ((*\<^sub>v) B ` gen) = mat_kernel A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A.span ((*\<^sub>v) B ` gen) = mat_kernel A

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
have ABC: "A * B * C = A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B * C = A
[PROOF STEP]
using A B C inv
[PROOF STATE]
proof (prove)
using this:
A \<in> carrier_mat nr nc
B \<in> carrier_mat nc nc
C \<in> carrier_mat nc nc
B * C = 1\<^sub>m nc

goal (1 subgoal):
 1. A * B * C = A
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
A * B * C = A

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from kernel_basis_exists[OF A]
[PROOF STATE]
proof (chain)
picking this:
\<exists>B. finite B \<and> A.basis B
[PROOF STEP]
obtain bas where finb: "finite bas" and bas: "A.basis bas"
[PROOF STATE]
proof (prove)
using this:
\<exists>B. finite B \<and> A.basis B

goal (1 subgoal):
 1. (\<And>bas. \<lbrakk>finite bas; A.basis bas\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
finite bas
A.basis bas

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from bas
[PROOF STATE]
proof (chain)
picking this:
A.basis bas
[PROOF STEP]
have bas': "A.gen_set bas" "bas \<subseteq> mat_kernel A"
[PROOF STATE]
proof (prove)
using this:
A.basis bas

goal (1 subgoal):
 1. A.gen_set bas &&& bas \<subseteq> mat_kernel A
[PROOF STEP]
unfolding A.Ker.basis_def
[PROOF STATE]
proof (prove)
using this:
A.lin_indpt bas \<and> A.span bas = mat_kernel A \<and> bas \<subseteq> mat_kernel A

goal (1 subgoal):
 1. A.gen_set bas &&& bas \<subseteq> mat_kernel A
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A.gen_set bas
bas \<subseteq> mat_kernel A

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
let ?bas = "(*\<^sub>v) C ` bas"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from mat_kernel_mult_right_gen_set[OF AB C B CB, unfolded ABC, OF bas']
[PROOF STATE]
proof (chain)
picking this:
AB.gen_set ((*\<^sub>v) C ` bas)
(*\<^sub>v) C ` bas \<subseteq> mat_kernel (A * B)
card ((*\<^sub>v) C ` bas) = card bas
[PROOF STEP]
have bas': "?bas \<subseteq> mat_kernel ?AB" "AB.Ker.span ?bas = mat_kernel ?AB" "card ?bas = card bas"
[PROOF STATE]
proof (prove)
using this:
AB.gen_set ((*\<^sub>v) C ` bas)
(*\<^sub>v) C ` bas \<subseteq> mat_kernel (A * B)
card ((*\<^sub>v) C ` bas) = card bas

goal (1 subgoal):
 1. (*\<^sub>v) C ` bas \<subseteq> mat_kernel (A * B) &&& AB.span ((*\<^sub>v) C ` bas) = mat_kernel (A * B) &&& card ((*\<^sub>v) C ` bas) = card bas
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(*\<^sub>v) C ` bas \<subseteq> mat_kernel (A * B)
AB.span ((*\<^sub>v) C ` bas) = mat_kernel (A * B)
card ((*\<^sub>v) C ` bas) = card bas

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from finb bas
[PROOF STATE]
proof (chain)
picking this:
finite bas
A.basis bas
[PROOF STEP]
have cardb: "A.dim = card bas"
[PROOF STATE]
proof (prove)
using this:
finite bas
A.basis bas

goal (1 subgoal):
 1. A.dim = card bas
[PROOF STEP]
by (rule A.Ker.dim_basis)
[PROOF STATE]
proof (state)
this:
A.dim = card bas

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from fin basis
[PROOF STATE]
proof (chain)
picking this:
finite gen
AB.basis gen
[PROOF STEP]
have cardg: "AB.dim = card gen"
[PROOF STATE]
proof (prove)
using this:
finite gen
AB.basis gen

goal (1 subgoal):
 1. AB.dim = card gen
[PROOF STEP]
by (rule AB.Ker.dim_basis)
[PROOF STATE]
proof (state)
this:
AB.dim = card gen

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from AB.Ker.gen_ge_dim[OF _ bas'(1-2)] finb bas'(3) cardb cardg
[PROOF STATE]
proof (chain)
picking this:
finite ((*\<^sub>v) C ` bas) \<Longrightarrow> AB.dim \<le> card ((*\<^sub>v) C ` bas)
finite bas
card ((*\<^sub>v) C ` bas) = card bas
A.dim = card bas
AB.dim = card gen
[PROOF STEP]
have ineq1: "card gen \<le> A.dim"
[PROOF STATE]
proof (prove)
using this:
finite ((*\<^sub>v) C ` bas) \<Longrightarrow> AB.dim \<le> card ((*\<^sub>v) C ` bas)
finite bas
card ((*\<^sub>v) C ` bas) = card bas
A.dim = card bas
AB.dim = card gen

goal (1 subgoal):
 1. card gen \<le> A.dim
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
card gen \<le> A.dim

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
from A.Ker.dim_gen_is_basis[OF fing sub gen, unfolded card, OF this]
[PROOF STATE]
proof (chain)
picking this:
A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
show "A.basis ?gen"
[PROOF STATE]
proof (prove)
using this:
A.basis ((*\<^sub>v) B ` gen)

goal (1 subgoal):
 1. A.basis ((*\<^sub>v) B ` gen)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
A.basis ((*\<^sub>v) B ` gen)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma even_word_imp_odd_next:"even (unat (x::('a::len) word)) \<Longrightarrow> x + 1 = 0 \<or> odd (unat (x + 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. even (unat x) \<Longrightarrow> x + 1 = 0 \<or> odd (unat (x + 1))
[PROOF STEP]
apply (cut_tac x=x in word_overflow_unat)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>even (unat x); unat (x + 1) = unat x + 1 \<or> x + 1 = 0\<rbrakk> \<Longrightarrow> x + 1 = 0 \<or> odd (unat (x + 1))
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma frontier_of_Un_subset: "X frontier_of(S \<union> T) \<subseteq> X frontier_of S \<union> X frontier_of T"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. X frontier_of (S \<union> T) \<subseteq> X frontier_of S \<union> X frontier_of T
[PROOF STEP]
by (metis Diff_Un frontier_of_Int_subset frontier_of_complement)


[STATEMENT]
lemma tendsto_0_smallo_1: "f \<in> o(\<lambda>x. 1 :: real) \<Longrightarrow> (f \<longlongrightarrow> 0) at_top"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<in> o(\<lambda>x. 1) \<Longrightarrow> (f \<longlongrightarrow> 0) at_top
[PROOF STEP]
by (drule smalloD_tendsto) simp


[STATEMENT]
lemma all_edges_between_subset_times: "all_edges_between X Y \<subseteq> (X \<inter> \<Union>E) \<times> (Y \<inter> \<Union>E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_edges_between X Y \<subseteq> (X \<inter> \<Union> E) \<times> (Y \<inter> \<Union> E)
[PROOF STEP]
by (auto simp: all_edges_between_def)


[STATEMENT]
lemma link_mset[simp]: "tree_to_multiset (link t1 t2)
                  = tree_to_multiset t1 +tree_to_multiset t2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. tree_to_multiset (link t1 t2) = tree_to_multiset t1 + tree_to_multiset t2
[PROOF STEP]
by (cases t1, cases t2, auto simp add:union_ac)


[STATEMENT]
theorem know_composition_neg_ine_k:
assumes "\<not> know P (kKS key)"
       and "\<not> know Q (kKS key)"
       and "subcomponents PQ = {P,Q}"
       and "correctCompositionIn PQ"
shows    "\<not> (ine PQ (kE key))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> ine PQ (kE key)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> know P (kKS key)
\<not> know Q (kKS key)
subcomponents PQ = {P, Q}
correctCompositionIn PQ

goal (1 subgoal):
 1. \<not> ine PQ (kE key)
[PROOF STEP]
by (metis TBtheorem3a not_know_k_not_ine)


[STATEMENT]
lemma intersection_ofE:
     "\<lbrakk>(P intersection_of Q) S; \<And>T. \<lbrakk>P T; T \<subseteq> Collect Q\<rbrakk> \<Longrightarrow> R(\<Inter>T)\<rbrakk> \<Longrightarrow> R S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(P intersection_of Q) S; \<And>T. \<lbrakk>P T; T \<subseteq> Collect Q\<rbrakk> \<Longrightarrow> R (\<Inter> T)\<rbrakk> \<Longrightarrow> R S
[PROOF STEP]
by (auto simp: intersection_of_def)


[STATEMENT]
lemma less_multiset\<^sub>D\<^sub>M:
  "M < N \<longleftrightarrow> (\<exists>X Y. X \<noteq> {#} \<and> X \<subseteq># N \<and> M = N - X + Y \<and> (\<forall>k. k \<in># Y \<longrightarrow> (\<exists>a. a \<in># X \<and> k < a)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (M < N) = (\<exists>X Y. X \<noteq> {#} \<and> X \<subseteq># N \<and> M = N - X + Y \<and> (\<forall>k. k \<in># Y \<longrightarrow> (\<exists>a. a \<in># X \<and> k < a)))
[PROOF STEP]
by (rule mult\<^sub>D\<^sub>M[folded multp_def less_multiset_def])


[STATEMENT]
lemma Suffixes_rev: "Suffixes (rev ` A) = rev ` Prefixes A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Suffixes (rev ` A) = rev ` Prefixes A
[PROOF STEP]
by (auto simp: Prefixes_altdef suffixes_rev Suffixes_altdef)


[STATEMENT]
lemma negligible_UNIV: "negligible S \<longleftrightarrow> (indicat_real S has_integral 0) UNIV" (is "_=?rhs")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. negligible S = (indicat_real S has_integral 0) UNIV
[PROOF STEP]
by (metis lmeasurable_iff_indicator_has_integral negligible_iff_measure)


[STATEMENT]
lemma (in ring) coeff_add:
  assumes "subring K R"
  assumes "f \<in> carrier (K[X])" "g \<in> carrier (K[X])"
  shows "coeff (f \<oplus>\<^bsub>K[X]\<^esub> g) i = coeff f i \<oplus>\<^bsub>R\<^esub> coeff g i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (f \<oplus>\<^bsub>K [X]\<^esub> g) i = local.coeff f i \<oplus> local.coeff g i
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. local.coeff (f \<oplus>\<^bsub>K [X]\<^esub> g) i = local.coeff f i \<oplus> local.coeff g i
[PROOF STEP]
have a:"set f \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set f \<subseteq> carrier R
[PROOF STEP]
using assms(1,2) univ_poly_carrier
[PROOF STATE]
proof (prove)
using this:
subring K R
f \<in> carrier (K [X])
polynomial\<^bsub>?R\<^esub> ?K ?p = (?p \<in> carrier (?K [X]\<^bsub>?R\<^esub>))

goal (1 subgoal):
 1. set f \<subseteq> carrier R
[PROOF STEP]
using subringE(1)[OF assms(1)] polynomial_incl
[PROOF STATE]
proof (prove)
using this:
subring K R
f \<in> carrier (K [X])
polynomial\<^bsub>?R\<^esub> ?K ?p = (?p \<in> carrier (?K [X]\<^bsub>?R\<^esub>))
K \<subseteq> carrier R
polynomial ?K ?p \<Longrightarrow> set ?p \<subseteq> ?K

goal (1 subgoal):
 1. set f \<subseteq> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set f \<subseteq> carrier R

goal (1 subgoal):
 1. local.coeff (f \<oplus>\<^bsub>K [X]\<^esub> g) i = local.coeff f i \<oplus> local.coeff g i
[PROOF STEP]
have b:"set g \<subseteq> carrier R"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set g \<subseteq> carrier R
[PROOF STEP]
using assms(1,3) univ_poly_carrier
[PROOF STATE]
proof (prove)
using this:
subring K R
g \<in> carrier (K [X])
polynomial\<^bsub>?R\<^esub> ?K ?p = (?p \<in> carrier (?K [X]\<^bsub>?R\<^esub>))

goal (1 subgoal):
 1. set g \<subseteq> carrier R
[PROOF STEP]
using subringE(1)[OF assms(1)] polynomial_incl
[PROOF STATE]
proof (prove)
using this:
subring K R
g \<in> carrier (K [X])
polynomial\<^bsub>?R\<^esub> ?K ?p = (?p \<in> carrier (?K [X]\<^bsub>?R\<^esub>))
K \<subseteq> carrier R
polynomial ?K ?p \<Longrightarrow> set ?p \<subseteq> ?K

goal (1 subgoal):
 1. set g \<subseteq> carrier R
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
set g \<subseteq> carrier R

goal (1 subgoal):
 1. local.coeff (f \<oplus>\<^bsub>K [X]\<^esub> g) i = local.coeff f i \<oplus> local.coeff g i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff (f \<oplus>\<^bsub>K [X]\<^esub> g) i = local.coeff f i \<oplus> local.coeff g i
[PROOF STEP]
unfolding univ_poly_add poly_add_coeff[OF a b]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. local.coeff f i \<oplus> local.coeff g i = local.coeff f i \<oplus> local.coeff g i
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
local.coeff (f \<oplus>\<^bsub>K [X]\<^esub> g) i = local.coeff f i \<oplus> local.coeff g i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cnj_mult_vv:
  shows "cnj (v1 *\<^sub>v\<^sub>v v2) = (vec_cnj v1) *\<^sub>v\<^sub>v (vec_cnj v2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cnj (v1 *\<^sub>v\<^sub>v v2) = vec_cnj v1 *\<^sub>v\<^sub>v vec_cnj v2
[PROOF STEP]
by (cases v1, cases v2) (simp add: vec_cnj_def)


[STATEMENT]
lemma eq_from_eq_frac:
  assumes "local.frac r s = local.frac r' s'"
    and "s \<in> (R \<setminus> I)" and "s' \<in> (R \<setminus> I)" and "r \<in> R" "r' \<in> R"
  obtains h where "h \<in> (R \<setminus> I)" "h \<cdot> (s' \<cdot> r - s \<cdot> r') = \<zero>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>h. \<lbrakk>h \<in> R\<setminus>I; h \<cdot> (s' \<cdot> r - s \<cdot> r') = \<zero>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using local.frac_eq_Ex[of r s r' s'] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(r, s) \<in> R \<times> (R\<setminus>I); (r', s') \<in> R \<times> (R\<setminus>I); local.frac r s = local.frac r' s'; \<And>s1. \<lbrakk>s1 \<in> R\<setminus>I; s1 \<cdot> (s' \<cdot> r - s \<cdot> r') = \<zero>\<rbrakk> \<Longrightarrow> ?thesis\<rbrakk> \<Longrightarrow> ?thesis
local.frac r s = local.frac r' s'
s \<in> R\<setminus>I
s' \<in> R\<setminus>I
r \<in> R
r' \<in> R

goal (1 subgoal):
 1. (\<And>h. \<lbrakk>h \<in> R\<setminus>I; h \<cdot> (s' \<cdot> r - s \<cdot> r') = \<zero>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast


[STATEMENT]
lemma apply_rassocl\<^sub>w [simp]: "apply_wiring rassocl\<^sub>w ((res1 \<oplus>\<^sub>O res2) \<oplus>\<^sub>O res3) = res1 \<oplus>\<^sub>O res2 \<oplus>\<^sub>O res3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. apply_wiring rassocl\<^sub>w ((res1 \<oplus>\<^sub>O res2) \<oplus>\<^sub>O res3) = res1 \<oplus>\<^sub>O res2 \<oplus>\<^sub>O res3
[PROOF STEP]
by(simp add: apply_wiring_def rassocl\<^sub>w_def map_lsumr_plus_oracle)


[STATEMENT]
lemma (in Module) eSum_in_Submodule:"\<lbrakk>H \<subseteq> carrier M; K \<subseteq> H;
      f \<in> {j. j \<le> (n::nat)} \<rightarrow> K; s \<in> {j. j \<le> n} \<rightarrow> carrier R\<rbrakk> \<Longrightarrow>
      l_comb R (mdl M (fgs R M K)) n s f = l_comb R M n s f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M; K \<subseteq> H; f \<in> {j. j \<le> n} \<rightarrow> K; s \<in> {j. j \<le> n} \<rightarrow> carrier R\<rbrakk> \<Longrightarrow> l_comb R (mdl M (fgs R M K)) n s f = l_comb R M n s f
[PROOF STEP]
apply (simp add:eSum_in_SubmoduleTr)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma open_translation_subtract:
  fixes S :: "'a::real_normed_vector set"
  assumes "open S"
  shows "open ((\<lambda>x. x - a) ` S)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. open ((\<lambda>x. x - a) ` S)
[PROOF STEP]
using assms open_translation [of S "- a"]
[PROOF STATE]
proof (prove)
using this:
open S
open S \<Longrightarrow> open ((+) (- a) ` S)

goal (1 subgoal):
 1. open ((\<lambda>x. x - a) ` S)
[PROOF STEP]
by (simp cong: image_cong_simp)


[STATEMENT]
theorem pochhammer_Gamma: "z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> pochhammer z n = Gamma (z + of_nat n) / Gamma z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> pochhammer z n = Gamma (z + of_nat n) / Gamma z
[PROOF STEP]
using pochhammer_rGamma[of z]
[PROOF STATE]
proof (prove)
using this:
rGamma z = pochhammer z ?n * rGamma (z + of_nat ?n)

goal (1 subgoal):
 1. z \<notin> \<int>\<^sub>\<le>\<^sub>0 \<Longrightarrow> pochhammer z n = Gamma (z + of_nat n) / Gamma z
[PROOF STEP]
by (simp add: rGamma_inverse_Gamma Gamma_eq_zero_iff field_simps)


[STATEMENT]
lemma neg_numeral_less_eq_signed_real_of_word_sum:
  \<open>- numeral n \<le> signed_real_of_word v + signed_real_of_word w
    \<longleftrightarrow> - numeral n \<le> sint v + sint w\<close> (is \<open>?P \<longleftrightarrow> ?Q\<close>)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (- numeral n \<le> sint v + sint w)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (- numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (- numeral n \<le> sint v + sint w)
[PROOF STEP]
have \<open>?Q \<longleftrightarrow> real_of_int (- numeral n) \<le> real_of_int (sint v + sint w)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (- numeral n \<le> sint v + sint w) = (real_of_int (- numeral n) \<le> real_of_int (sint v + sint w))
[PROOF STEP]
by (simp only: of_int_le_iff)
[PROOF STATE]
proof (state)
this:
(- numeral n \<le> sint v + sint w) = (real_of_int (- numeral n) \<le> real_of_int (sint v + sint w))

goal (1 subgoal):
 1. (- numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (- numeral n \<le> sint v + sint w)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(- numeral n \<le> sint v + sint w) = (real_of_int (- numeral n) \<le> real_of_int (sint v + sint w))

goal (1 subgoal):
 1. (- numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (- numeral n \<le> sint v + sint w)
[PROOF STEP]
have \<open>\<dots> \<longleftrightarrow> ?P\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (real_of_int (- numeral n) \<le> real_of_int (sint v + sint w)) = (- numeral n \<le> signed_real_of_word v + signed_real_of_word w)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(real_of_int (- numeral n) \<le> real_of_int (sint v + sint w)) = (- numeral n \<le> signed_real_of_word v + signed_real_of_word w)

goal (1 subgoal):
 1. (- numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (- numeral n \<le> sint v + sint w)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(- numeral n \<le> sint v + sint w) = (- numeral n \<le> signed_real_of_word v + signed_real_of_word w)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(- numeral n \<le> sint v + sint w) = (- numeral n \<le> signed_real_of_word v + signed_real_of_word w)

goal (1 subgoal):
 1. (- numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (- numeral n \<le> sint v + sint w)
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
(- numeral n \<le> signed_real_of_word v + signed_real_of_word w) = (- numeral n \<le> sint v + sint w)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma map_idI: "(\<And>x. x \<in> set xs \<Longrightarrow> f x = x) \<Longrightarrow> map f xs = xs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x. x \<in> set xs \<Longrightarrow> f x = x) \<Longrightarrow> map f xs = xs
[PROOF STEP]
by (induct xs, auto)


[STATEMENT]
lemma lift_01_vec_simp[simp]: "dim_vec (lift_01_vec v) = dim_vec v"
"i < dim_vec v \<Longrightarrow> (lift_01_vec v) $ i = of_zero_neq_one (v $ i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. dim_vec (lift_01_vec v) = dim_vec v &&& (i < dim_vec v \<Longrightarrow> lift_01_vec v $ i = of_zero_neq_one (v $ i))
[PROOF STEP]
by (simp_all add: lift_01_vec_def)


[STATEMENT]
lemma log_of_power_eq:
  assumes "m = b ^ n" "b > 1"
  shows "n = log b (real m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n = log b (real m)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real n = log b (real m)
[PROOF STEP]
have "n = log b (b ^ n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real n = log b (b ^ n)
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
1 < b

goal (1 subgoal):
 1. real n = log b (b ^ n)
[PROOF STEP]
by (simp add: log_nat_power)
[PROOF STATE]
proof (state)
this:
real n = log b (b ^ n)

goal (1 subgoal):
 1. real n = log b (real m)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real n = log b (b ^ n)

goal (1 subgoal):
 1. real n = log b (real m)
[PROOF STEP]
have "\<dots> = log b m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. log b (b ^ n) = log b (real m)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
real m = b ^ n
1 < b

goal (1 subgoal):
 1. log b (b ^ n) = log b (real m)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
log b (b ^ n) = log b (real m)

goal (1 subgoal):
 1. real n = log b (real m)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
real n = log b (real m)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
real n = log b (real m)

goal (1 subgoal):
 1. real n = log b (real m)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
real n = log b (real m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma hfunction_hunion: "hdomain f \<sqinter> hdomain g = 0
            \<Longrightarrow> hfunction (f \<squnion> g) \<longleftrightarrow> hfunction f \<and> hfunction g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. hdomain f \<sqinter> hdomain g = 0 \<Longrightarrow> hfunction (f \<squnion> g) = (hfunction f \<and> hfunction g)
[PROOF STEP]
by (auto simp: hfunction_def) (metis hdomainI hinter_iff hmem_hempty)+


[STATEMENT]
theorem is_reduced_GB_unique:
  assumes Ared: "is_reduced_GB A" and Bred: "is_reduced_GB B" and id_eq: "pmdl A = pmdl B"
  shows "A = B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A = B
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. A \<subseteq> B
 2. B \<subseteq> A
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
is_reduced_GB A
is_reduced_GB B
pmdl A = pmdl B
[PROOF STEP]
show "A \<subseteq> B"
[PROOF STATE]
proof (prove)
using this:
is_reduced_GB A
is_reduced_GB B
pmdl A = pmdl B

goal (1 subgoal):
 1. A \<subseteq> B
[PROOF STEP]
by (rule is_reduced_GB_unique')
[PROOF STATE]
proof (state)
this:
A \<subseteq> B

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
from Bred Ared id_eq[symmetric]
[PROOF STATE]
proof (chain)
picking this:
is_reduced_GB B
is_reduced_GB A
pmdl B = pmdl A
[PROOF STEP]
show "B \<subseteq> A"
[PROOF STATE]
proof (prove)
using this:
is_reduced_GB B
is_reduced_GB A
pmdl B = pmdl A

goal (1 subgoal):
 1. B \<subseteq> A
[PROOF STEP]
by (rule is_reduced_GB_unique')
[PROOF STATE]
proof (state)
this:
B \<subseteq> A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma dvd_gcdD2: "a dvd gcd b c \<Longrightarrow> a dvd c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a dvd gcd b c \<Longrightarrow> a dvd c
[PROOF STEP]
using gcd_dvd2 [of b c]
[PROOF STATE]
proof (prove)
using this:
gcd b c dvd c

goal (1 subgoal):
 1. a dvd gcd b c \<Longrightarrow> a dvd c
[PROOF STEP]
by (blast intro: dvd_trans)


[STATEMENT]
lemma sig_red_tail_rtrancl_lc_rep_list:
  assumes "(sig_red sing_reg (\<prec>) F)\<^sup>*\<^sup>* p q"
  shows "punit.lc (rep_list q) = punit.lc (rep_list p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. punit.lc (rep_list q) = punit.lc (rep_list p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(sig_red sing_reg (\<prec>) F)\<^sup>*\<^sup>* p q

goal (1 subgoal):
 1. punit.lc (rep_list q) = punit.lc (rep_list p)
[PROOF STEP]
by (induct, auto dest: sig_red_tail_lc_rep_list)


[STATEMENT]
lemma inf_concat_add:
  assumes res: "inf_concat n k = (i,j)"
    and j: "j + m < n i"
  shows "inf_concat n (k + m) = (i,j+m)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_concat n (k + m) = (i, j + m)
[PROOF STEP]
using j
[PROOF STATE]
proof (prove)
using this:
j + m < n i

goal (1 subgoal):
 1. inf_concat n (k + m) = (i, j + m)
[PROOF STEP]
proof (induct m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. j + 0 < n i \<Longrightarrow> inf_concat n (k + 0) = (i, j + 0)
 2. \<And>m. \<lbrakk>j + m < n i \<Longrightarrow> inf_concat n (k + m) = (i, j + m); j + Suc m < n i\<rbrakk> \<Longrightarrow> inf_concat n (k + Suc m) = (i, j + Suc m)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
j + 0 < n i

goal (2 subgoals):
 1. j + 0 < n i \<Longrightarrow> inf_concat n (k + 0) = (i, j + 0)
 2. \<And>m. \<lbrakk>j + m < n i \<Longrightarrow> inf_concat n (k + m) = (i, j + m); j + Suc m < n i\<rbrakk> \<Longrightarrow> inf_concat n (k + Suc m) = (i, j + Suc m)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inf_concat n (k + 0) = (i, j + 0)
[PROOF STEP]
using res
[PROOF STATE]
proof (prove)
using this:
inf_concat n k = (i, j)

goal (1 subgoal):
 1. inf_concat n (k + 0) = (i, j + 0)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inf_concat n (k + 0) = (i, j + 0)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>j + m < n i \<Longrightarrow> inf_concat n (k + m) = (i, j + m); j + Suc m < n i\<rbrakk> \<Longrightarrow> inf_concat n (k + Suc m) = (i, j + Suc m)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>j + m < n i \<Longrightarrow> inf_concat n (k + m) = (i, j + m); j + Suc m < n i\<rbrakk> \<Longrightarrow> inf_concat n (k + Suc m) = (i, j + Suc m)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
j + m < n i \<Longrightarrow> inf_concat n (k + m) = (i, j + m)
j + Suc m < n i

goal (1 subgoal):
 1. \<And>m. \<lbrakk>j + m < n i \<Longrightarrow> inf_concat n (k + m) = (i, j + m); j + Suc m < n i\<rbrakk> \<Longrightarrow> inf_concat n (k + Suc m) = (i, j + Suc m)
[PROOF STEP]
hence "inf_concat n (k + m) = (i, j+m)"
[PROOF STATE]
proof (prove)
using this:
j + m < n i \<Longrightarrow> inf_concat n (k + m) = (i, j + m)
j + Suc m < n i

goal (1 subgoal):
 1. inf_concat n (k + m) = (i, j + m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inf_concat n (k + m) = (i, j + m)

goal (1 subgoal):
 1. \<And>m. \<lbrakk>j + m < n i \<Longrightarrow> inf_concat n (k + m) = (i, j + m); j + Suc m < n i\<rbrakk> \<Longrightarrow> inf_concat n (k + Suc m) = (i, j + Suc m)
[PROOF STEP]
with Suc(2)
[PROOF STATE]
proof (chain)
picking this:
j + Suc m < n i
inf_concat n (k + m) = (i, j + m)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
j + Suc m < n i
inf_concat n (k + m) = (i, j + m)

goal (1 subgoal):
 1. inf_concat n (k + Suc m) = (i, j + Suc m)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
inf_concat n (k + Suc m) = (i, j + Suc m)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma negative_psi:
assumes "i<j"
shows "\<psi>^j * \<psi>inv ^i = \<psi>^(j-i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> ^ j * \<psi>inv ^ i = \<psi> ^ (j - i)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<psi> ^ j * \<psi>inv ^ i = \<psi> ^ (j - i)
[PROOF STEP]
have j: "\<psi>^j = \<psi>^(j-i) * \<psi>^i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> ^ j = \<psi> ^ (j - i) * \<psi> ^ i
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
i < j

goal (1 subgoal):
 1. \<psi> ^ j = \<psi> ^ (j - i) * \<psi> ^ i
[PROOF STEP]
by (metis add.commute le_add_diff_inverse nat_less_le power_add)
[PROOF STATE]
proof (state)
this:
\<psi> ^ j = \<psi> ^ (j - i) * \<psi> ^ i

goal (1 subgoal):
 1. \<psi> ^ j * \<psi>inv ^ i = \<psi> ^ (j - i)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> ^ j * \<psi>inv ^ i = \<psi> ^ (j - i)
[PROOF STEP]
unfolding j
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<psi> ^ (j - i) * \<psi> ^ i * \<psi>inv ^ i = \<psi> ^ (j - i)
[PROOF STEP]
by (simp add: left_right_inverse_power psi_psiinv)
[PROOF STATE]
proof (state)
this:
\<psi> ^ j * \<psi>inv ^ i = \<psi> ^ (j - i)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma squarefree_factorial_semiring':
  assumes "n \<noteq> 0"
  shows   "squarefree (n :: 'a :: factorial_semiring) \<longleftrightarrow>
             (\<forall>p\<in>prime_factors n. multiplicity p n = 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. squarefree n = (\<forall>p\<in>#prime_factorization n. multiplicity p n = 1)
[PROOF STEP]
proof (subst squarefree_factorial_semiring [OF assms], safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<forall>p. prime p \<longrightarrow> \<not> p\<^sup>2 dvd n; p \<in># prime_factorization n\<rbrakk> \<Longrightarrow> multiplicity p n = 1
 2. \<And>p. \<lbrakk>\<forall>p\<in>#prime_factorization n. multiplicity p n = 1; prime p; p\<^sup>2 dvd n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
fix p
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<forall>p. prime p \<longrightarrow> \<not> p\<^sup>2 dvd n; p \<in># prime_factorization n\<rbrakk> \<Longrightarrow> multiplicity p n = 1
 2. \<And>p. \<lbrakk>\<forall>p\<in>#prime_factorization n. multiplicity p n = 1; prime p; p\<^sup>2 dvd n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
assume "\<forall>p\<in>#prime_factorization n. multiplicity p n = 1" "prime p" "p^2 dvd n"
[PROOF STATE]
proof (state)
this:
\<forall>p\<in>#prime_factorization n. multiplicity p n = 1
prime p
p\<^sup>2 dvd n

goal (2 subgoals):
 1. \<And>p. \<lbrakk>\<forall>p. prime p \<longrightarrow> \<not> p\<^sup>2 dvd n; p \<in># prime_factorization n\<rbrakk> \<Longrightarrow> multiplicity p n = 1
 2. \<And>p. \<lbrakk>\<forall>p\<in>#prime_factorization n. multiplicity p n = 1; prime p; p\<^sup>2 dvd n\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
n \<noteq> (0::'a)
\<forall>p\<in>#prime_factorization n. multiplicity p n = 1
prime p
p\<^sup>2 dvd n
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
n \<noteq> (0::'a)
\<forall>p\<in>#prime_factorization n. multiplicity p n = 1
prime p
p\<^sup>2 dvd n

goal (1 subgoal):
 1. False
[PROOF STEP]
by (cases "p dvd n")
       (auto simp: prime_factors_dvd power_dvd_iff_le_multiplicity not_dvd_imp_multiplicity_0)
[PROOF STATE]
proof (state)
this:
False

goal (1 subgoal):
 1. \<And>p. \<lbrakk>\<forall>p. prime p \<longrightarrow> \<not> p\<^sup>2 dvd n; p \<in># prime_factorization n\<rbrakk> \<Longrightarrow> multiplicity p n = 1
[PROOF STEP]
qed (auto intro!: multiplicity_eqI simp: power2_eq_square [symmetric])


[STATEMENT]
lemma span_add_eq: assumes x: "x \<in> span S" shows "x + y \<in> span S \<longleftrightarrow> y \<in> span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x + y \<in> span S) = (y \<in> span S)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. x + y \<in> span S \<Longrightarrow> y \<in> span S
 2. y \<in> span S \<Longrightarrow> x + y \<in> span S
[PROOF STEP]
assume *: "x + y \<in> span S"
[PROOF STATE]
proof (state)
this:
x + y \<in> span S

goal (2 subgoals):
 1. x + y \<in> span S \<Longrightarrow> y \<in> span S
 2. y \<in> span S \<Longrightarrow> x + y \<in> span S
[PROOF STEP]
have "(x + y) - x \<in> span S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x + y - x \<in> span S
[PROOF STEP]
using * x
[PROOF STATE]
proof (prove)
using this:
x + y \<in> span S
x \<in> span S

goal (1 subgoal):
 1. x + y - x \<in> span S
[PROOF STEP]
by (rule span_diff)
[PROOF STATE]
proof (state)
this:
x + y - x \<in> span S

goal (2 subgoals):
 1. x + y \<in> span S \<Longrightarrow> y \<in> span S
 2. y \<in> span S \<Longrightarrow> x + y \<in> span S
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x + y - x \<in> span S
[PROOF STEP]
show "y \<in> span S"
[PROOF STATE]
proof (prove)
using this:
x + y - x \<in> span S

goal (1 subgoal):
 1. y \<in> span S
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
y \<in> span S

goal (1 subgoal):
 1. y \<in> span S \<Longrightarrow> x + y \<in> span S
[PROOF STEP]
qed (intro span_add x)


[STATEMENT]
lemma monic_prod_list:
  fixes as :: "'a :: idom poly list"
  assumes "\<And> a. a \<in> set as \<Longrightarrow> monic a"
  shows "monic (prod_list as)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monic (prod_list as)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
?a \<in> set as \<Longrightarrow> monic ?a

goal (1 subgoal):
 1. monic (prod_list as)
[PROOF STEP]
by (induct as, auto intro: monic_mult)


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

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

goal (1 subgoal):
 1. x pow\<^sub>\<rat> r \<noteq> 0
[PROOF STEP]
by (simp add: assms powrat_def)
[PROOF STATE]
proof (state)
this:
x pow\<^sub>\<rat> r \<noteq> 0

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diff_ord_nonzero:
  assumes "x \<in> nonzero Q\<^sub>p"
  assumes "y \<in> nonzero Q\<^sub>p"
  assumes "ord x \<noteq> ord y"
  shows "x \<oplus> y \<in> nonzero Q\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<oplus> y \<in> nonzero Q\<^sub>p
[PROOF STEP]
proof(rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x \<oplus> y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
assume " x \<oplus> y \<notin> nonzero Q\<^sub>p"
[PROOF STATE]
proof (state)
this:
x \<oplus> y \<notin> nonzero Q\<^sub>p

goal (1 subgoal):
 1. x \<oplus> y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<oplus> y \<notin> nonzero Q\<^sub>p
[PROOF STEP]
have "x \<oplus> y = \<zero>"
[PROOF STATE]
proof (prove)
using this:
x \<oplus> y \<notin> nonzero Q\<^sub>p

goal (1 subgoal):
 1. x \<oplus> y = \<zero>
[PROOF STEP]
using Qp.add.m_closed Qp.nonzero_closed Qp.nonzero_memI assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
x \<oplus> y \<notin> nonzero Q\<^sub>p
\<lbrakk>?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> ?x \<oplus> ?y \<in> carrier Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
\<lbrakk>?a \<in> carrier Q\<^sub>p; ?a \<noteq> \<zero>\<rbrakk> \<Longrightarrow> ?a \<in> nonzero Q\<^sub>p
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. x \<oplus> y = \<zero>
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x \<oplus> y = \<zero>

goal (1 subgoal):
 1. x \<oplus> y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x \<oplus> y = \<zero>
[PROOF STEP]
have "x = \<ominus> y"
[PROOF STATE]
proof (prove)
using this:
x \<oplus> y = \<zero>

goal (1 subgoal):
 1. x = \<ominus> y
[PROOF STEP]
using Qp.minus_equality Qp.nonzero_closed assms(1) assms(2)
[PROOF STATE]
proof (prove)
using this:
x \<oplus> y = \<zero>
\<lbrakk>?y \<oplus> ?x = \<zero>; ?x \<in> carrier Q\<^sub>p; ?y \<in> carrier Q\<^sub>p\<rbrakk> \<Longrightarrow> \<ominus> ?x = ?y
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ?a \<in> carrier Q\<^sub>p
x \<in> nonzero Q\<^sub>p
y \<in> nonzero Q\<^sub>p

goal (1 subgoal):
 1. x = \<ominus> y
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
x = \<ominus> y

goal (1 subgoal):
 1. x \<oplus> y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
x = \<ominus> y
[PROOF STEP]
have "ord x = ord y"
[PROOF STATE]
proof (prove)
using this:
x = \<ominus> y

goal (1 subgoal):
 1. ord x = ord y
[PROOF STEP]
using assms(2) ord_minus
[PROOF STATE]
proof (prove)
using this:
x = \<ominus> y
y \<in> nonzero Q\<^sub>p
?a \<in> nonzero Q\<^sub>p \<Longrightarrow> ord ?a = ord (\<ominus> ?a)

goal (1 subgoal):
 1. ord x = ord y
[PROOF STEP]
by presburger
[PROOF STATE]
proof (state)
this:
ord x = ord y

goal (1 subgoal):
 1. x \<oplus> y \<notin> nonzero Q\<^sub>p \<Longrightarrow> False
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ord x = ord y
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
ord x = ord y

goal (1 subgoal):
 1. False
[PROOF STEP]
using assms(3)
[PROOF STATE]
proof (prove)
using this:
ord x = ord y
ord x \<noteq> ord y

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

goal:
No subgoals!
[PROOF STEP]
qed