[STATEMENT]
lemma cindex_polyE_combine:
  assumes "a<b" "b<c"
  shows "cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
define A B where "A=cindex_poly a b q p - jumpF_polyL q p b"
               and "B=jumpF_polyR q p b + cindex_poly b c q p"
[PROOF STATE]
proof (state)
this:
A = real_of_int (cindex_poly a b q p) - jumpF_polyL q p b
B = jumpF_polyR q p b + real_of_int (cindex_poly b c q p)

goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
have "cindex_polyE a b q p + cindex_polyE b c q p =
                    jumpF_polyR q p a + (A +B) - jumpF_polyL q p c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = jumpF_polyR q p a + (A + B) - jumpF_polyL q p c
[PROOF STEP]
unfolding cindex_polyE_def A_def B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyR q p a + real_of_int (cindex_poly a b q p) - jumpF_polyL q p b + (jumpF_polyR q p b + real_of_int (cindex_poly b c q p) - jumpF_polyL q p c) = jumpF_polyR q p a + (real_of_int (cindex_poly a b q p) - jumpF_polyL q p b + (jumpF_polyR q p b + real_of_int (cindex_poly b c q p))) - jumpF_polyL q p c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_polyE a b q p + cindex_polyE b c q p = jumpF_polyR q p a + (A + B) - jumpF_polyL q p c

goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_polyE a b q p + cindex_polyE b c q p = jumpF_polyR q p a + (A + B) - jumpF_polyL q p c

goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
have "... = jumpF_polyR q p a + cindex_poly a c q p - jumpF_polyL q p c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
have "A+B = cindex_poly a b q p + (jumpF_polyR q p b - jumpF_polyL q p b)
                    + cindex_poly b c q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A + B = real_of_int (cindex_poly a b q p) + (jumpF_polyR q p b - jumpF_polyL q p b) + real_of_int (cindex_poly b c q p)
[PROOF STEP]
unfolding A_def B_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (cindex_poly a b q p) - jumpF_polyL q p b + (jumpF_polyR q p b + real_of_int (cindex_poly b c q p)) = real_of_int (cindex_poly a b q p) + (jumpF_polyR q p b - jumpF_polyL q p b) + real_of_int (cindex_poly b c q p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
A + B = real_of_int (cindex_poly a b q p) + (jumpF_polyR q p b - jumpF_polyL q p b) + real_of_int (cindex_poly b c q p)

goal (1 subgoal):
 1. jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
A + B = real_of_int (cindex_poly a b q p) + (jumpF_polyR q p b - jumpF_polyL q p b) + real_of_int (cindex_poly b c q p)

goal (1 subgoal):
 1. jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
have "... = cindex_poly a b q p + real_of_int (jump_poly q p b) + cindex_poly b c q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (cindex_poly a b q p) + (jumpF_polyR q p b - jumpF_polyL q p b) + real_of_int (cindex_poly b c q p) = real_of_int (cindex_poly a b q p) + real_of_int (jump_poly q p b) + real_of_int (cindex_poly b c q p)
[PROOF STEP]
using jump_poly_jumpF_poly
[PROOF STATE]
proof (prove)
using this:
real_of_int (jump_poly ?q ?p ?x) = jumpF_polyR ?q ?p ?x - jumpF_polyL ?q ?p ?x

goal (1 subgoal):
 1. real_of_int (cindex_poly a b q p) + (jumpF_polyR q p b - jumpF_polyL q p b) + real_of_int (cindex_poly b c q p) = real_of_int (cindex_poly a b q p) + real_of_int (jump_poly q p b) + real_of_int (cindex_poly b c q p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (cindex_poly a b q p) + (jumpF_polyR q p b - jumpF_polyL q p b) + real_of_int (cindex_poly b c q p) = real_of_int (cindex_poly a b q p) + real_of_int (jump_poly q p b) + real_of_int (cindex_poly b c q p)

goal (1 subgoal):
 1. jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
real_of_int (cindex_poly a b q p) + (jumpF_polyR q p b - jumpF_polyL q p b) + real_of_int (cindex_poly b c q p) = real_of_int (cindex_poly a b q p) + real_of_int (jump_poly q p b) + real_of_int (cindex_poly b c q p)

goal (1 subgoal):
 1. jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
have "... = cindex_poly a c q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (cindex_poly a b q p) + real_of_int (jump_poly q p b) + real_of_int (cindex_poly b c q p) = real_of_int (cindex_poly a c q p)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
a < b
b < c

goal (1 subgoal):
 1. real_of_int (cindex_poly a b q p) + real_of_int (jump_poly q p b) + real_of_int (cindex_poly b c q p) = real_of_int (cindex_poly a c q p)
[PROOF STEP]
apply (subst (3) cindex_poly_combine[symmetric,of _ b])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>a < b; b < c\<rbrakk> \<Longrightarrow> a < b
 2. \<lbrakk>a < b; b < c\<rbrakk> \<Longrightarrow> b < c
 3. \<lbrakk>a < b; b < c\<rbrakk> \<Longrightarrow> real_of_int (cindex_poly a b q p) + real_of_int (jump_poly q p b) + real_of_int (cindex_poly b c q p) = real_of_int (cindex_poly a b q p + jump_poly q p b + cindex_poly b c q p)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (cindex_poly a b q p) + real_of_int (jump_poly q p b) + real_of_int (cindex_poly b c q p) = real_of_int (cindex_poly a c q p)

goal (1 subgoal):
 1. jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
A + B = real_of_int (cindex_poly a c q p)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
A + B = real_of_int (cindex_poly a c q p)

goal (1 subgoal):
 1. jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c

goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
jumpF_polyR q p a + (A + B) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c

goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
have "... = cindex_polyE a c q p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c = cindex_polyE a c q p
[PROOF STEP]
unfolding cindex_polyE_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c = jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
jumpF_polyR q p a + real_of_int (cindex_poly a c q p) - jumpF_polyL q p c = cindex_polyE a c q p

goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p

goal (1 subgoal):
 1. cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_polyE a b q p + cindex_polyE b c q p = cindex_polyE a c q p

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "p1 = (x, y) \<and> p2 = (y, x) \<Longrightarrow> fst p1 = snd p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. p1 = (x, y) \<and> p2 = (y, x) \<Longrightarrow> fst p1 = snd p2
[PROOF STEP]
using fst_conv snd_conv
[PROOF STATE]
proof (prove)
using this:
fst (?x1.0, ?x2.0) = ?x1.0
snd (?x1.0, ?x2.0) = ?x2.0

goal (1 subgoal):
 1. p1 = (x, y) \<and> p2 = (y, x) \<Longrightarrow> fst p1 = snd p2
[PROOF STEP]
by (smt (verit))


[STATEMENT]
lemma separation_normal_local:
  fixes S :: "'a::euclidean_space set"
  assumes US: "closedin (top_of_set U) S"
      and UT: "closedin (top_of_set U) T"
      and "S \<inter> T = {}"
  obtains S' T' where "openin (top_of_set U) S'"
                      "openin (top_of_set U) T'"
                      "S \<subseteq> S'"  "T \<subseteq> T'"  "S' \<inter> T' = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (cases "S = {} \<or> T = {}")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; S = {} \<or> T = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; \<not> (S = {} \<or> T = {})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
S = {} \<or> T = {}

goal (2 subgoals):
 1. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; S = {} \<or> T = {}\<rbrakk> \<Longrightarrow> thesis
 2. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; \<not> (S = {} \<or> T = {})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
with that
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>openin (top_of_set U) ?S'; openin (top_of_set U) ?T'; S \<subseteq> ?S'; T \<subseteq> ?T'; ?S' \<inter> ?T' = {}\<rbrakk> \<Longrightarrow> thesis
S = {} \<or> T = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>openin (top_of_set U) ?S'; openin (top_of_set U) ?T'; S \<subseteq> ?S'; T \<subseteq> ?T'; ?S' \<inter> ?T' = {}\<rbrakk> \<Longrightarrow> thesis
S = {} \<or> T = {}

goal (1 subgoal):
 1. thesis
[PROOF STEP]
using UT US
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>openin (top_of_set U) ?S'; openin (top_of_set U) ?T'; S \<subseteq> ?S'; T \<subseteq> ?T'; ?S' \<inter> ?T' = {}\<rbrakk> \<Longrightarrow> thesis
S = {} \<or> T = {}
closedin (top_of_set U) T
closedin (top_of_set U) S

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

goal (1 subgoal):
 1. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; \<not> (S = {} \<or> T = {})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; \<not> (S = {} \<or> T = {})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (S = {} \<or> T = {})

goal (1 subgoal):
 1. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; \<not> (S = {} \<or> T = {})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
define f where "f \<equiv> \<lambda>x. setdist {x} T - setdist {x} S"
[PROOF STATE]
proof (state)
this:
f \<equiv> \<lambda>x. setdist {x} T - setdist {x} S

goal (1 subgoal):
 1. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; \<not> (S = {} \<or> T = {})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
have contf: "continuous_on U f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on U f
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on U (\<lambda>x. setdist {x} T - setdist {x} S)
[PROOF STEP]
by (intro continuous_intros)
[PROOF STATE]
proof (state)
this:
continuous_on U f

goal (1 subgoal):
 1. \<lbrakk>\<And>S' T'. \<lbrakk>openin (top_of_set U) S'; openin (top_of_set U) T'; S \<subseteq> S'; T \<subseteq> T'; S' \<inter> T' = {}\<rbrakk> \<Longrightarrow> thesis; \<not> (S = {} \<or> T = {})\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. thesis
[PROOF STEP]
proof (rule_tac S' = "(U \<inter> f -` {0<..})" and T' = "(U \<inter> f -` {..<0})" in that)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. openin (top_of_set U) (U \<inter> f -` {0<..})
 2. openin (top_of_set U) (U \<inter> f -` {..<0})
 3. S \<subseteq> U \<inter> f -` {0<..}
 4. T \<subseteq> U \<inter> f -` {..<0}
 5. U \<inter> f -` {0<..} \<inter> (U \<inter> f -` {..<0}) = {}
[PROOF STEP]
show "(U \<inter> f -` {0<..}) \<inter> (U \<inter> f -` {..<0}) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. U \<inter> f -` {0<..} \<inter> (U \<inter> f -` {..<0}) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
U \<inter> f -` {0<..} \<inter> (U \<inter> f -` {..<0}) = {}

goal (4 subgoals):
 1. openin (top_of_set U) (U \<inter> f -` {0<..})
 2. openin (top_of_set U) (U \<inter> f -` {..<0})
 3. S \<subseteq> U \<inter> f -` {0<..}
 4. T \<subseteq> U \<inter> f -` {..<0}
[PROOF STEP]
show "openin (top_of_set U) (U \<inter> f -` {0<..})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set U) (U \<inter> f -` {0<..})
[PROOF STEP]
by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf)
[PROOF STATE]
proof (state)
this:
openin (top_of_set U) (U \<inter> f -` {0<..})

goal (3 subgoals):
 1. openin (top_of_set U) (U \<inter> f -` {..<0})
 2. S \<subseteq> U \<inter> f -` {0<..}
 3. T \<subseteq> U \<inter> f -` {..<0}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. openin (top_of_set U) (U \<inter> f -` {..<0})
 2. S \<subseteq> U \<inter> f -` {0<..}
 3. T \<subseteq> U \<inter> f -` {..<0}
[PROOF STEP]
show "openin (top_of_set U) (U \<inter> f -` {..<0})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. openin (top_of_set U) (U \<inter> f -` {..<0})
[PROOF STEP]
by (rule continuous_openin_preimage [where T=UNIV]) (simp_all add: contf)
[PROOF STATE]
proof (state)
this:
openin (top_of_set U) (U \<inter> f -` {..<0})

goal (2 subgoals):
 1. S \<subseteq> U \<inter> f -` {0<..}
 2. T \<subseteq> U \<inter> f -` {..<0}
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. S \<subseteq> U \<inter> f -` {0<..}
 2. T \<subseteq> U \<inter> f -` {..<0}
[PROOF STEP]
have "S \<subseteq> U" "T \<subseteq> U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. S \<subseteq> U &&& T \<subseteq> U
[PROOF STEP]
using closedin_imp_subset assms
[PROOF STATE]
proof (prove)
using this:
closedin (subtopology ?U ?S) ?T \<Longrightarrow> ?T \<subseteq> ?S
closedin (top_of_set U) S
closedin (top_of_set U) T
S \<inter> T = {}

goal (1 subgoal):
 1. S \<subseteq> U &&& T \<subseteq> U
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
S \<subseteq> U
T \<subseteq> U

goal (2 subgoals):
 1. S \<subseteq> U \<inter> f -` {0<..}
 2. T \<subseteq> U \<inter> f -` {..<0}
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
S \<subseteq> U
T \<subseteq> U
[PROOF STEP]
show "S \<subseteq> U \<inter> f -` {0<..}" "T \<subseteq> U \<inter> f -` {..<0}"
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> U
T \<subseteq> U

goal (1 subgoal):
 1. S \<subseteq> U \<inter> f -` {0<..} &&& T \<subseteq> U \<inter> f -` {..<0}
[PROOF STEP]
using assms False
[PROOF STATE]
proof (prove)
using this:
S \<subseteq> U
T \<subseteq> U
closedin (top_of_set U) S
closedin (top_of_set U) T
S \<inter> T = {}
\<not> (S = {} \<or> T = {})

goal (1 subgoal):
 1. S \<subseteq> U \<inter> f -` {0<..} &&& T \<subseteq> U \<inter> f -` {..<0}
[PROOF STEP]
by (force simp add: f_def setdist_sing_in_set intro!: setdist_gt_0_closedin)+
[PROOF STATE]
proof (state)
this:
S \<subseteq> U \<inter> f -` {0<..}
T \<subseteq> U \<inter> f -` {..<0}

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma f_expand_length[simp]: "length (xs \<odot>\<^sub>f k) = length xs * k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (xs \<odot> k) = length xs * k
[PROOF STEP]
apply (case_tac k, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>nat. k = Suc nat \<Longrightarrow> length (xs \<odot> k) = length xs * k
[PROOF STEP]
apply (simp add: f_expand_gr0_f_expand_Suc)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in group) inv_eq_1_iff [simp]:
  assumes "x \<in> carrier G" shows "inv\<^bsub>G\<^esub> x = \<one>\<^bsub>G\<^esub> \<longleftrightarrow> x = \<one>\<^bsub>G\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (inv x = \<one>) = (x = \<one>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (inv x = \<one>) = (x = \<one>)
[PROOF STEP]
have "x = \<one>" if "inv x = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x = \<one>
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. x = \<one>
[PROOF STEP]
have "inv x \<otimes> x = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inv x \<otimes> x = \<one>
[PROOF STEP]
using assms l_inv
[PROOF STATE]
proof (prove)
using this:
x \<in> carrier G
?x \<in> carrier G \<Longrightarrow> inv ?x \<otimes> ?x = \<one>

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

goal (1 subgoal):
 1. x = \<one>
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv x \<otimes> x = \<one>
[PROOF STEP]
show "x = \<one>"
[PROOF STATE]
proof (prove)
using this:
inv x \<otimes> x = \<one>

goal (1 subgoal):
 1. x = \<one>
[PROOF STEP]
using that assms
[PROOF STATE]
proof (prove)
using this:
inv x \<otimes> x = \<one>
inv x = \<one>
x \<in> carrier G

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
inv x = \<one> \<Longrightarrow> x = \<one>

goal (1 subgoal):
 1. (inv x = \<one>) = (x = \<one>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
inv x = \<one> \<Longrightarrow> x = \<one>
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
inv x = \<one> \<Longrightarrow> x = \<one>

goal (1 subgoal):
 1. (inv x = \<one>) = (x = \<one>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(inv x = \<one>) = (x = \<one>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nn_integral_nonneg_infinite:
  fixes f::"'a \<Rightarrow> real"
  assumes "f \<in> borel_measurable M" "\<not> integrable M f" "AE x in M. f x \<ge> 0"
  shows "(\<integral>\<^sup>+x. f x \<partial>M) = \<infinity>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>M = \<infinity>
[PROOF STEP]
using assms integrableI_real_bounded less_top
[PROOF STATE]
proof (prove)
using this:
f \<in> borel_measurable M
\<not> integrable M f
AE x in M. 0 \<le> f x
\<lbrakk>?f \<in> borel_measurable ?M; AE x in ?M. 0 \<le> ?f x; \<integral>\<^sup>+ x. ennreal (?f x) \<partial>?M < \<infinity>\<rbrakk> \<Longrightarrow> integrable ?M ?f
(?a \<noteq> top) = (?a < top)

goal (1 subgoal):
 1. \<integral>\<^sup>+ x. ennreal (f x) \<partial>M = \<infinity>
[PROOF STEP]
by auto


[STATEMENT]
lemma is_inverse\<^sub>L_compose:
  assumes "invertible\<^sub>L f" "invertible\<^sub>L g"
  shows "is_inverse\<^sub>L (f o\<^sub>L g) (inv\<^sub>L g o\<^sub>L inv\<^sub>L f)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_inverse\<^sub>L (f o\<^sub>L g) (inv\<^sub>L g o\<^sub>L inv\<^sub>L f)
[PROOF STEP]
by (auto intro!: blinfun_eqI is_inverse\<^sub>L_I[of _ "inv\<^sub>L g o\<^sub>L inv\<^sub>L f"]
      simp: inv_app2'[OF assms(1)] inv_app2'[OF assms(2)] inv_app1'[OF assms(1)] inv_app1'[OF assms(2)])


[STATEMENT]
lemma DirProd_subgroups :
  assumes "group G"
    and "subgroup H G"
    and "group K"
    and "subgroup I K"
  shows "subgroup (H \<times> I) (G \<times>\<times> K)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subgroup (H \<times> I) (G \<times>\<times> K)
[PROOF STEP]
proof (intro group.group_incl_imp_subgroup[OF DirProd_group[OF assms(1)assms(3)]])
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. H \<times> I \<subseteq> carrier (G \<times>\<times> K)
 2. Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)
[PROOF STEP]
have "H \<subseteq> carrier G" "I \<subseteq> carrier K"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H \<subseteq> carrier G &&& I \<subseteq> carrier K
[PROOF STEP]
using subgroup.subset assms
[PROOF STATE]
proof (prove)
using this:
subgroup ?H ?G \<Longrightarrow> ?H \<subseteq> carrier ?G
Group.group G
subgroup H G
Group.group K
subgroup I K

goal (1 subgoal):
 1. H \<subseteq> carrier G &&& I \<subseteq> carrier K
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
H \<subseteq> carrier G
I \<subseteq> carrier K

goal (2 subgoals):
 1. H \<times> I \<subseteq> carrier (G \<times>\<times> K)
 2. Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)
[PROOF STEP]
thus "(H \<times> I) \<subseteq> carrier (G \<times>\<times> K)"
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> carrier G
I \<subseteq> carrier K

goal (1 subgoal):
 1. H \<times> I \<subseteq> carrier (G \<times>\<times> K)
[PROOF STEP]
unfolding DirProd_def
[PROOF STATE]
proof (prove)
using this:
H \<subseteq> carrier G
I \<subseteq> carrier K

goal (1 subgoal):
 1. H \<times> I \<subseteq> carrier \<lparr>carrier = carrier G \<times> carrier K, mult = \<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>K\<^esub> h'), one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>K\<^esub>)\<rparr>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H \<times> I \<subseteq> carrier (G \<times>\<times> K)

goal (1 subgoal):
 1. Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)
[PROOF STEP]
have "Group.group ((G\<lparr>carrier := H\<rparr>) \<times>\<times> (K\<lparr>carrier := I\<rparr>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr>)
[PROOF STEP]
using DirProd_group[OF subgroup.subgroup_is_group[OF assms(2)assms(1)]
        subgroup.subgroup_is_group[OF assms(4)assms(3)]]
[PROOF STATE]
proof (prove)
using this:
Group.group (G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr>)

goal (1 subgoal):
 1. Group.group (G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr>)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
Group.group (G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr>)

goal (1 subgoal):
 1. Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
Group.group (G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr>)

goal (1 subgoal):
 1. Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)
[PROOF STEP]
have "((G\<lparr>carrier := H\<rparr>) \<times>\<times> (K\<lparr>carrier := I\<rparr>)) = ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr> = (G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>
[PROOF STEP]
unfolding DirProd_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lparr>carrier = carrier (G\<lparr>carrier := H\<rparr>) \<times> carrier (K\<lparr>carrier := I\<rparr>), mult = \<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> g', h \<otimes>\<^bsub>K\<lparr>carrier := I\<rparr>\<^esub> h'), one = (\<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>, \<one>\<^bsub>K\<lparr>carrier := I\<rparr>\<^esub>)\<rparr> = \<lparr>carrier = carrier G \<times> carrier K, mult = \<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>K\<^esub> h'), one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>K\<^esub>)\<rparr>\<lparr>carrier := H \<times> I\<rparr>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
Group.group G
subgroup H G
Group.group K
subgroup I K

goal (1 subgoal):
 1. \<lparr>carrier = carrier (G\<lparr>carrier := H\<rparr>) \<times> carrier (K\<lparr>carrier := I\<rparr>), mult = \<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub> g', h \<otimes>\<^bsub>K\<lparr>carrier := I\<rparr>\<^esub> h'), one = (\<one>\<^bsub>G\<lparr>carrier := H\<rparr>\<^esub>, \<one>\<^bsub>K\<lparr>carrier := I\<rparr>\<^esub>)\<rparr> = \<lparr>carrier = carrier G \<times> carrier K, mult = \<lambda>(g, h) (g', h'). (g \<otimes>\<^bsub>G\<^esub> g', h \<otimes>\<^bsub>K\<^esub> h'), one = (\<one>\<^bsub>G\<^esub>, \<one>\<^bsub>K\<^esub>)\<rparr>\<lparr>carrier := H \<times> I\<rparr>
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr> = (G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>

goal (1 subgoal):
 1. Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
Group.group (G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr>)
G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr> = (G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>
[PROOF STEP]
show "Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)"
[PROOF STATE]
proof (prove)
using this:
Group.group (G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr>)
G\<lparr>carrier := H\<rparr> \<times>\<times> K\<lparr>carrier := I\<rparr> = (G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>

goal (1 subgoal):
 1. Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Group.group ((G \<times>\<times> K)\<lparr>carrier := H \<times> I\<rparr>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma to_fun_monom:
  assumes "c \<in> carrier R"
  assumes "x \<in> carrier R"
  shows "to_fun (monom P c n) x = c \<otimes> x [^] n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_fun (monom P c n) x = c \<otimes> x [^] n
[PROOF STEP]
by (smt P_def R.m_comm R.nat_pow_closed UP_cring.to_poly_nat_pow UP_cring_axioms assms(1)
      assms(2) monom_is_UP_monom(1) sub_monom(1) to_fun_smult to_fun_sub_monom to_fun_to_poly
      to_poly_closed to_poly_mult_simp(2))


[STATEMENT]
lemma (in group) r_coset_is_image: "H #> a = (\<lambda> x. x \<otimes> a) ` H"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. H #> a = (\<lambda>x. x \<otimes> a) ` H
[PROOF STEP]
unfolding r_coset_def image_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Union> {y. \<exists>x\<in>H. y = {x \<otimes> a}} = {y. \<exists>x\<in>H. y = x \<otimes> a}
[PROOF STEP]
by blast


[STATEMENT]
lemma reachable_finite_sim:
      assumes "finite (b.E\<^sup>* `` b.V0)"
      assumes "\<And>b. b \<in> b.E\<^sup>* `` b.V0 \<Longrightarrow> finite (R\<inverse> `` {b})"
      shows "finite (a.E\<^sup>* `` a.V0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite a.reachable
[PROOF STEP]
apply (rule finite_subset[OF reachable_sim])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (R\<inverse> `` b.reachable)
[PROOF STEP]
apply (rule finite_ImageI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite b.reachable
 2. \<And>a. a \<in> b.reachable \<Longrightarrow> finite (R\<inverse> `` {a})
[PROOF STEP]
apply fact+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma connectedI:
  "(\<And>A B. open A \<Longrightarrow> open B \<Longrightarrow> A \<inter> U \<noteq> {} \<Longrightarrow> B \<inter> U \<noteq> {} \<Longrightarrow> A \<inter> B \<inter> U = {} \<Longrightarrow> U \<subseteq> A \<union> B \<Longrightarrow> False)
  \<Longrightarrow> connected U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A B. \<lbrakk>open A; open B; A \<inter> U \<noteq> {}; B \<inter> U \<noteq> {}; A \<inter> B \<inter> U = {}; U \<subseteq> A \<union> B\<rbrakk> \<Longrightarrow> False) \<Longrightarrow> connected U
[PROOF STEP]
by (auto simp: connected_def)


[STATEMENT]
lemma from_bool_eq_if':
  "((if P then 1 else 0) = from_bool Q) = (P = Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((if P then 1 else 0) = from_bool Q) = (P = Q)
[PROOF STEP]
by (cases Q) (simp_all add: from_bool_def)


[STATEMENT]
lemma bij_Abs: "bij_betw (Abs) {0..<int CARD('a)} (UNIV::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij_betw Abs {0..<int CARD('a)} UNIV
[PROOF STEP]
proof (unfold bij_betw_def, rule conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. inj_on Abs {0..<int CARD('a)}
 2. Abs ` {0..<int CARD('a)} = UNIV
[PROOF STEP]
show "inj_on Abs {0..<int CARD('a)}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj_on Abs {0..<int CARD('a)}
[PROOF STEP]
by (metis inj_on_inverseI type type_definition.Abs_inverse)
[PROOF STATE]
proof (state)
this:
inj_on Abs {0..<int CARD('a)}

goal (1 subgoal):
 1. Abs ` {0..<int CARD('a)} = UNIV
[PROOF STEP]
show "Abs ` {0..<int CARD('a)} = (UNIV::'a set)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Abs ` {0..<int CARD('a)} = UNIV
[PROOF STEP]
by (metis type type_definition.univ)
[PROOF STATE]
proof (state)
this:
Abs ` {0..<int CARD('a)} = UNIV

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in is_cf_adjunction) cf_adjunction_unit_NTMap_is_arr':
  assumes "x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>"
    and "a = x"
    and "b = \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>x\<rparr>\<rparr>"
    and "\<CC>' = \<CC>"
  shows "\<eta>\<^sub>C \<Phi>\<lparr>NTMap\<rparr>\<lparr>x\<rparr> : x \<mapsto>\<^bsub>\<CC>'\<^esub> b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<eta>\<^sub>C \<Phi>\<lparr>NTMap\<rparr>\<lparr>x\<rparr> : x \<mapsto>\<^bsub>\<CC>'\<^esub> b
[PROOF STEP]
using assms(1)
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<eta>\<^sub>C \<Phi>\<lparr>NTMap\<rparr>\<lparr>x\<rparr> : x \<mapsto>\<^bsub>\<CC>'\<^esub> b
[PROOF STEP]
unfolding assms(2-4)
[PROOF STATE]
proof (prove)
using this:
x \<in>\<^sub>\<circ> \<CC>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. \<eta>\<^sub>C \<Phi>\<lparr>NTMap\<rparr>\<lparr>x\<rparr> : x \<mapsto>\<^bsub>\<CC>\<^esub> \<GG>\<lparr>ObjMap\<rparr>\<lparr>\<FF>\<lparr>ObjMap\<rparr>\<lparr>x\<rparr>\<rparr>
[PROOF STEP]
by (rule cf_adjunction_unit_NTMap_is_arr)


[STATEMENT]
lemma wf_less_multiset: "wf {(M :: 'a multiset, N). M < N}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). M < N}
[PROOF STEP]
unfolding less_multiset_def multp_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. wf {(M, N). (M, N) \<in> mult {(x, y). x < y}}
[PROOF STEP]
by (auto intro: wf_mult wf)


[STATEMENT]
lemma fps_mult_right_inverse_unit_factor:
  fixes   f :: "'a::ring_1 fps"
  assumes "f $ subdegree f * y = 1"
  shows   "f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f
[PROOF STEP]
have
    "f * fps_right_inverse (unit_factor f) y =
      fps_X ^ subdegree f * (unit_factor f * fps_right_inverse (unit_factor f) y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f * (unit_factor f * fps_right_inverse (unit_factor f) y)
[PROOF STEP]
using fps_unit_factor_decompose'[of f]
[PROOF STATE]
proof (prove)
using this:
f = fps_X ^ subdegree f * unit_factor f

goal (1 subgoal):
 1. f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f * (unit_factor f * fps_right_inverse (unit_factor f) y)
[PROOF STEP]
by (simp add: mult.assoc[symmetric])
[PROOF STATE]
proof (state)
this:
f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f * (unit_factor f * fps_right_inverse (unit_factor f) y)

goal (1 subgoal):
 1. f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
f $ subdegree f * y = (1::'a)
f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f * (unit_factor f * fps_right_inverse (unit_factor f) y)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
f $ subdegree f * y = (1::'a)
f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f * (unit_factor f * fps_right_inverse (unit_factor f) y)

goal (1 subgoal):
 1. f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f
[PROOF STEP]
by (simp add: fps_right_inverse)
[PROOF STATE]
proof (state)
this:
f * fps_right_inverse (unit_factor f) y = fps_X ^ subdegree f

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sum_left_div_distrib:
  fixes f :: "'i \<Rightarrow> real"
  shows "(\<Sum>i \<in> I. f i / x) = sum f I / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
have "(\<Sum>i \<in> I. f i / x) = (\<Sum>i \<in> I. f i * (1 / x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = (\<Sum>i\<in>I. f i * (1 / x))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. f i / x) = (\<Sum>i\<in>I. f i * (1 / x))

goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. f i / x) = (\<Sum>i\<in>I. f i * (1 / x))

goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
have "\<dots> = sum f I * (1 / x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i * (1 / x)) = sum f I * (1 / x)
[PROOF STEP]
by (rule sum_distrib_right[symmetric])
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. f i * (1 / x)) = sum f I * (1 / x)

goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. f i * (1 / x)) = sum f I * (1 / x)

goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
have "\<dots> = sum f I / x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum f I * (1 / x) = sum f I / x
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
sum f I * (1 / x) = sum f I / x

goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>I. f i / x) = sum f I / x

goal (1 subgoal):
 1. (\<Sum>i\<in>I. f i / x) = sum f I / x
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>I. f i / x) = sum f I / x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma emeasure_lborel_Icc[simp]:
  fixes l u :: real
  assumes [simp]: "l \<le> u"
  shows "emeasure lborel {l .. u} = u - l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure lborel {l..u} = ennreal (u - l)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. emeasure lborel {l..u} = ennreal (u - l)
[PROOF STEP]
have "((\<lambda>f. f 1) -` {l..u} \<inter> space (Pi\<^sub>M {1} (\<lambda>b. interval_measure (\<lambda>x. x)))) = {1::real} \<rightarrow>\<^sub>E {l..u}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>f. f 1) -` {l..u} \<inter> space (Pi\<^sub>M {1} (\<lambda>b. interval_measure (\<lambda>x. x))) = {1} \<rightarrow>\<^sub>E {l..u}
[PROOF STEP]
by (auto simp: space_PiM)
[PROOF STATE]
proof (state)
this:
(\<lambda>f. f 1) -` {l..u} \<inter> space (Pi\<^sub>M {1} (\<lambda>b. interval_measure (\<lambda>x. x))) = {1} \<rightarrow>\<^sub>E {l..u}

goal (1 subgoal):
 1. emeasure lborel {l..u} = ennreal (u - l)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<lambda>f. f 1) -` {l..u} \<inter> space (Pi\<^sub>M {1} (\<lambda>b. interval_measure (\<lambda>x. x))) = {1} \<rightarrow>\<^sub>E {l..u}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<lambda>f. f 1) -` {l..u} \<inter> space (Pi\<^sub>M {1} (\<lambda>b. interval_measure (\<lambda>x. x))) = {1} \<rightarrow>\<^sub>E {l..u}

goal (1 subgoal):
 1. emeasure lborel {l..u} = ennreal (u - l)
[PROOF STEP]
by (simp add: lborel_def emeasure_distr emeasure_PiM emeasure_interval_measure_Icc)
[PROOF STATE]
proof (state)
this:
emeasure lborel {l..u} = ennreal (u - l)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma fds_exp_numeral [simp]: "fds_exp (numeral n) = fds_const (exp (numeral n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_exp (numeral n) = fds_const (exp (numeral n))
[PROOF STEP]
using fds_exp_const[of "numeral n :: 'a"]
[PROOF STATE]
proof (prove)
using this:
fds_exp (fds_const (numeral n)) = fds_const (exp (numeral n))

goal (1 subgoal):
 1. fds_exp (numeral n) = fds_const (exp (numeral n))
[PROOF STEP]
by (simp del: fds_exp_const add: numeral_fds)


[STATEMENT]
lemma winding_number_join:
  assumes \<gamma>1: "path \<gamma>1" "z \<notin> path_image \<gamma>1"
      and \<gamma>2: "path \<gamma>2" "z \<notin> path_image \<gamma>2"
      and "pathfinish \<gamma>1 = pathstart \<gamma>2"
    shows "winding_number(\<gamma>1 +++ \<gamma>2) z = winding_number \<gamma>1 z + winding_number \<gamma>2 z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. winding_number (\<gamma>1 +++ \<gamma>2) z = winding_number \<gamma>1 z + winding_number \<gamma>2 z
[PROOF STEP]
proof (rule winding_number_unique)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. path (\<gamma>1 +++ \<gamma>2)
 2. z \<notin> path_image (\<gamma>1 +++ \<gamma>2)
 3. \<And>e. 0 < e \<Longrightarrow> \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
show "\<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p
              (winding_number \<gamma>1 z + winding_number \<gamma>2 z)" if "e > 0" for e
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
obtain p1 where "winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p1. winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>0 < e\<close> \<gamma>1 winding_number
[PROOF STATE]
proof (prove)
using this:
0 < e
path \<gamma>1
z \<notin> path_image \<gamma>1
\<lbrakk>path ?\<gamma>; ?z \<notin> path_image ?\<gamma>; 0 < ?e\<rbrakk> \<Longrightarrow> \<exists>p. winding_number_prop ?\<gamma> ?z ?e p (winding_number ?\<gamma> ?z)

goal (1 subgoal):
 1. (\<And>p1. winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z)

goal (1 subgoal):
 1. \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z)

goal (1 subgoal):
 1. \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
obtain p2 where "winding_number_prop \<gamma>2 z e p2 (winding_number \<gamma>2 z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p2. winding_number_prop \<gamma>2 z e p2 (winding_number \<gamma>2 z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using \<open>0 < e\<close> \<gamma>2 winding_number
[PROOF STATE]
proof (prove)
using this:
0 < e
path \<gamma>2
z \<notin> path_image \<gamma>2
\<lbrakk>path ?\<gamma>; ?z \<notin> path_image ?\<gamma>; 0 < ?e\<rbrakk> \<Longrightarrow> \<exists>p. winding_number_prop ?\<gamma> ?z ?e p (winding_number ?\<gamma> ?z)

goal (1 subgoal):
 1. (\<And>p2. winding_number_prop \<gamma>2 z e p2 (winding_number \<gamma>2 z) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
winding_number_prop \<gamma>2 z e p2 (winding_number \<gamma>2 z)

goal (1 subgoal):
 1. \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z)
winding_number_prop \<gamma>2 z e p2 (winding_number \<gamma>2 z)
[PROOF STEP]
have "winding_number_prop (\<gamma>1+++\<gamma>2) z e (p1+++p2) (winding_number \<gamma>1 z + winding_number \<gamma>2 z)"
[PROOF STATE]
proof (prove)
using this:
winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z)
winding_number_prop \<gamma>2 z e p2 (winding_number \<gamma>2 z)

goal (1 subgoal):
 1. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e (p1 +++ p2) (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
winding_number_prop \<gamma>1 z e p1 (winding_number \<gamma>1 z)
winding_number_prop \<gamma>2 z e p2 (winding_number \<gamma>2 z)
path \<gamma>1
z \<notin> path_image \<gamma>1
path \<gamma>2
z \<notin> path_image \<gamma>2
pathfinish \<gamma>1 = pathstart \<gamma>2

goal (1 subgoal):
 1. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e (p1 +++ p2) (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
apply (simp add: winding_number_prop_def not_in_path_image_join contour_integrable_inversediff algebra_simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>valid_path p1 \<and> z \<notin> path_image p1 \<and> pathstart p1 = pathstart \<gamma>1 \<and> pathfinish p1 = pathstart \<gamma>2 \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma>1 t - p1 t) < e) \<and> contour_integral p1 (\<lambda>w. 1 / (w - z)) = \<i> * (complex_of_real pi * (2 * winding_number \<gamma>1 z)); valid_path p2 \<and> z \<notin> path_image p2 \<and> pathstart p2 = pathstart \<gamma>2 \<and> pathfinish p2 = pathfinish \<gamma>2 \<and> (\<forall>t\<in>{0..1}. cmod (\<gamma>2 t - p2 t) < e) \<and> contour_integral p2 (\<lambda>w. 1 / (w - z)) = \<i> * (complex_of_real pi * (2 * winding_number \<gamma>2 z)); path \<gamma>1; z \<notin> path_image \<gamma>1; path \<gamma>2; z \<notin> path_image \<gamma>2; pathfinish \<gamma>1 = pathstart \<gamma>2\<rbrakk> \<Longrightarrow> \<forall>t\<in>{0..1}. cmod ((\<gamma>1 +++ \<gamma>2) t - (p1 +++ p2) t) < e
[PROOF STEP]
apply (auto simp: joinpaths_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
winding_number_prop (\<gamma>1 +++ \<gamma>2) z e (p1 +++ p2) (winding_number \<gamma>1 z + winding_number \<gamma>2 z)

goal (1 subgoal):
 1. \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
winding_number_prop (\<gamma>1 +++ \<gamma>2) z e (p1 +++ p2) (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
winding_number_prop (\<gamma>1 +++ \<gamma>2) z e (p1 +++ p2) (winding_number \<gamma>1 z + winding_number \<gamma>2 z)

goal (1 subgoal):
 1. \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
0 < ?e \<Longrightarrow> \<exists>p. winding_number_prop (\<gamma>1 +++ \<gamma>2) z ?e p (winding_number \<gamma>1 z + winding_number \<gamma>2 z)

goal (2 subgoals):
 1. path (\<gamma>1 +++ \<gamma>2)
 2. z \<notin> path_image (\<gamma>1 +++ \<gamma>2)
[PROOF STEP]
qed (use assms in \<open>auto simp: not_in_path_image_join\<close>)


[STATEMENT]
lemma zero_le_dist [simp]: "0 \<le> dist x y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> dist x y
[PROOF STEP]
using dist_triangle2 [of x x y]
[PROOF STATE]
proof (prove)
using this:
dist x x \<le> dist x y + dist x y

goal (1 subgoal):
 1. 0 \<le> dist x y
[PROOF STEP]
by simp


[STATEMENT]
lemma has_prod_prod: "(\<And>i. i \<in> I \<Longrightarrow> (f i) has_prod (x i)) \<Longrightarrow> (\<lambda>n. \<Prod>i\<in>I. f i n) has_prod (\<Prod>i\<in>I. x i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>i. i \<in> I \<Longrightarrow> f i has_prod x i) \<Longrightarrow> (\<lambda>n. \<Prod>i\<in>I. f i n) has_prod prod x I
[PROOF STEP]
by (induct I rule: infinite_finite_induct) (auto intro!: has_prod_mult)


[STATEMENT]
lemma l_distributive_matrix:
 assumes
  "l_distributive fmul fadd"
  "associative fadd"
  "commutative fadd"
  "fadd 0 0 = 0"
  "\<forall>a. fmul a 0 = 0"
  "\<forall>a. fmul 0 a = 0"
 shows "l_distributive (mult_matrix fmul fadd) (combine_matrix fadd)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. l_distributive (mult_matrix fmul fadd) (combine_matrix fadd)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. l_distributive (mult_matrix fmul fadd) (combine_matrix fadd)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
l_distributive fmul fadd
associative fadd
commutative fadd
fadd (0::'a) (0::'a) = (0::'a)
\<forall>a. fmul a (0::'b) = (0::'a)
\<forall>a. fmul (0::'a) a = (0::'a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
l_distributive fmul fadd
associative fadd
commutative fadd
fadd (0::'a) (0::'a) = (0::'a)
\<forall>a. fmul a (0::'b) = (0::'a)
\<forall>a. fmul (0::'a) a = (0::'a)

goal (1 subgoal):
 1. l_distributive (mult_matrix fmul fadd) (combine_matrix fadd)
[PROOF STEP]
apply (simp add: l_distributive_def mult_matrix_def, auto)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a u v. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a u v. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)
[PROOF STEP]
fix a::"'b matrix"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a u v. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)
[PROOF STEP]
fix u::"'a matrix"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a u v. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)
[PROOF STEP]
fix v::"'a matrix"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a u v. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)
[PROOF STEP]
let ?mx = "max (nrows a) (max (ncols u) (ncols v))"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a u v. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
l_distributive fmul fadd
associative fadd
commutative fadd
fadd (0::'a) (0::'a) = (0::'a)
\<forall>a. fmul a (0::'b) = (0::'a)
\<forall>a. fmul (0::'a) a = (0::'a)
[PROOF STEP]
show "mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a =
               combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)"
[PROOF STATE]
proof (prove)
using this:
l_distributive fmul fadd
associative fadd
commutative fadd
fadd (0::'a) (0::'a) = (0::'a)
\<forall>a. fmul a (0::'b) = (0::'a)
\<forall>a. fmul (0::'a) a = (0::'a)

goal (1 subgoal):
 1. mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)
[PROOF STEP]
apply (subst mult_matrix_nm[of v _ _ ?mx fadd fmul])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> ncols v \<le> max (ncols v) (nrows a)
 2. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> nrows a \<le> max (ncols v) (nrows a)
 3. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> ncols v \<le> max (nrows a) (max (ncols u) (ncols v))
 4. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> nrows a \<le> max (nrows a) (max (ncols u) (ncols v))
 5. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (0::'a) (0::'a) = (0::'a)
 6. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fmul (0::'a) (0::'b) = (0::'a)
 7. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd v a)
[PROOF STEP]
apply (simp add: max1 max2 combine_nrows combine_ncols)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd v a)
[PROOF STEP]
apply (subst mult_matrix_nm[of u _ _ ?mx fadd fmul])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> ncols u \<le> max (ncols u) (nrows a)
 2. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> nrows a \<le> max (ncols u) (nrows a)
 3. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> ncols u \<le> max (nrows a) (max (ncols u) (ncols v))
 4. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> nrows a \<le> max (nrows a) (max (ncols u) (ncols v))
 5. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (0::'a) (0::'a) = (0::'a)
 6. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fmul (0::'a) (0::'b) = (0::'a)
 7. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd u a) (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd v a)
[PROOF STEP]
apply (simp add: max1 max2 combine_nrows combine_ncols)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd u a) (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd v a)
[PROOF STEP]
apply (subst mult_matrix_nm[of _ _ _ ?mx fadd fmul])
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> ncols (combine_matrix fadd u v) \<le> max (ncols (combine_matrix fadd u v)) (nrows a)
 2. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> nrows a \<le> max (ncols (combine_matrix fadd u v)) (nrows a)
 3. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> ncols (combine_matrix fadd u v) \<le> max (nrows a) (max (ncols u) (ncols v))
 4. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> nrows a \<le> max (nrows a) (max (ncols u) (ncols v))
 5. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (0::'a) (0::'a) = (0::'a)
 6. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fmul (0::'a) (0::'b) = (0::'a)
 7. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd u a) (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd v a)
[PROOF STEP]
apply (simp add: max1 max2 combine_nrows combine_ncols)+
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>l_distributive fmul fadd; associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd u a) (mult_matrix_n (max (nrows a) (max (ncols u) (ncols v))) fmul fadd v a)
[PROOF STEP]
apply (simp add: mult_matrix_n_def l_distributive_def foldseq_distr[of fadd])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> Abs_matrix (\<lambda>j i. fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) = combine_matrix fadd (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))))
[PROOF STEP]
apply (simp add: combine_matrix_def combine_infmatrix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> Abs_matrix (\<lambda>j i. fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) = Abs_matrix (\<lambda>j i. fadd (Rep_matrix (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) j i) (Rep_matrix (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) j i))
[PROOF STEP]
apply (rule comb[of "Abs_matrix" "Abs_matrix"], simp, (rule ext)+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) = fadd (Rep_matrix (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) j i) (Rep_matrix (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) j i)
[PROOF STEP]
apply (simplesubst RepAbs_matrix)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>j i. m \<le> j \<longrightarrow> foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
 2. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>n. \<forall>j i. n \<le> i \<longrightarrow> foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
 3. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) = fadd (Rep_matrix (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) j i) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))
[PROOF STEP]
apply (simp, auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>j\<ge>m. \<forall>i. foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
 2. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>n. \<forall>j i. n \<le> i \<longrightarrow> foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
 3. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) = fadd (Rep_matrix (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) j i) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))
[PROOF STEP]
apply (rule exI[of _ "nrows v"], simp add: nrows_le foldseq_zero)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>n. \<forall>j i. n \<le> i \<longrightarrow> foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
 2. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) = fadd (Rep_matrix (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) j i) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))
[PROOF STEP]
apply (rule exI[of _ "ncols a"], simp add: ncols_le foldseq_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) = fadd (Rep_matrix (Abs_matrix (\<lambda>j i. foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))) j i) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))
[PROOF STEP]
apply (subst RepAbs_matrix)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>j i. m \<le> j \<longrightarrow> foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
 2. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>n. \<forall>j i. n \<le> i \<longrightarrow> foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
 3. \<And>j i. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) = fadd (foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v)))) (foldseq fadd (\<lambda>k. fmul (Rep_matrix v j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))))
[PROOF STEP]
apply (simp, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>m. \<forall>j\<ge>m. \<forall>i. foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
 2. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>n. \<forall>j i. n \<le> i \<longrightarrow> foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
[PROOF STEP]
apply (rule exI[of _ "nrows u"], simp add: nrows_le foldseq_zero)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>a u v. fmul (fadd u v) a = fadd (fmul u a) (fmul v a); associative fadd; commutative fadd; fadd (0::'a) (0::'a) = (0::'a); \<forall>a. fmul a (0::'b) = (0::'a); \<forall>a. fmul (0::'a) a = (0::'a)\<rbrakk> \<Longrightarrow> \<exists>n. \<forall>j i. n \<le> i \<longrightarrow> foldseq fadd (\<lambda>k. fmul (Rep_matrix u j k) (Rep_matrix a k i)) (max (nrows a) (max (ncols u) (ncols v))) = (0::'a)
[PROOF STEP]
apply (rule exI[of _ "ncols a"], simp add: ncols_le foldseq_zero)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
mult_matrix_n (max (ncols (combine_matrix fadd u v)) (nrows a)) fmul fadd (combine_matrix fadd u v) a = combine_matrix fadd (mult_matrix_n (max (ncols u) (nrows a)) fmul fadd u a) (mult_matrix_n (max (ncols v) (nrows a)) fmul fadd v a)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
l_distributive (mult_matrix fmul fadd) (combine_matrix fadd)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma prob_space_PiM:
  assumes M: "\<And>i. i \<in> I \<Longrightarrow> prob_space (M i)" shows "prob_space (PiM I M)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
let ?M = "\<lambda>i. if i \<in> I then M i else count_space {undefined}"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
interpret M': prob_space "?M i" for i
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (if i \<in> I then M i else count_space {undefined})
[PROOF STEP]
using M
[PROOF STATE]
proof (prove)
using this:
?i \<in> I \<Longrightarrow> prob_space (M ?i)

goal (1 subgoal):
 1. prob_space (if i \<in> I then M i else count_space {undefined})
[PROOF STEP]
by (cases "i \<in> I") (auto intro!: prob_spaceI)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
interpret product_prob_space ?M I
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. product_prob_space (\<lambda>i. if i \<in> I then M i else count_space {undefined})
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
have "prob_space (\<Pi>\<^sub>M i\<in>I. ?M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I (\<lambda>i. if i \<in> I then M i else count_space {undefined}))
[PROOF STEP]
by unfold_locales
[PROOF STATE]
proof (state)
this:
prob_space (Pi\<^sub>M I (\<lambda>i. if i \<in> I then M i else count_space {undefined}))

goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
prob_space (Pi\<^sub>M I (\<lambda>i. if i \<in> I then M i else count_space {undefined}))

goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
have "(\<Pi>\<^sub>M i\<in>I. ?M i) = (\<Pi>\<^sub>M i\<in>I. M i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Pi\<^sub>M I (\<lambda>i. if i \<in> I then M i else count_space {undefined}) = Pi\<^sub>M I M
[PROOF STEP]
by (intro PiM_cong) auto
[PROOF STATE]
proof (state)
this:
Pi\<^sub>M I (\<lambda>i. if i \<in> I then M i else count_space {undefined}) = Pi\<^sub>M I M

goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
prob_space (Pi\<^sub>M I M)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
prob_space (Pi\<^sub>M I M)

goal (1 subgoal):
 1. prob_space (Pi\<^sub>M I M)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
prob_space (Pi\<^sub>M I M)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma halt_lemma2:
  "\<lbrakk>wf LE;
    Q (f 0); \<not> P (f 0);
    \<forall> n. ((\<not> P (f n) \<and> Q (f n)) \<longrightarrow> (Q (f (Suc n)) \<and> (f (Suc n), (f n)) \<in> LE))\<rbrakk>
  \<Longrightarrow> \<exists> n. P (f n) \<and> Q (f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> Q (f n)
[PROOF STEP]
apply(insert halt_lemma2' [of LE P f Q], simp, erule_tac exE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n)\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> Q (f n)
[PROOF STEP]
apply(subgoal_tac "\<exists> n. (P (f n) \<and> (\<forall> i < n. \<not> P (f i)))")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n); \<exists>n. P (f n) \<and> (\<forall>i<n. \<not> P (f i))\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> Q (f n)
 2. \<And>n. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n)\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> (\<forall>i<n. \<not> P (f i))
[PROOF STEP]
apply(erule_tac exE)+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n na. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n); P (f na) \<and> (\<forall>i<na. \<not> P (f i))\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> Q (f n)
 2. \<And>n. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n)\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> (\<forall>i<n. \<not> P (f i))
[PROOF STEP]
apply(rename_tac n na)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n na. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n); P (f na) \<and> (\<forall>i<na. \<not> P (f i))\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> Q (f n)
 2. \<And>n. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n)\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> (\<forall>i<n. \<not> P (f i))
[PROOF STEP]
apply(rule_tac x = na in exI, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n na. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n); P (f na); \<forall>i<na. \<not> P (f i)\<rbrakk> \<Longrightarrow> Q (f na)
 2. \<And>n. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n)\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> (\<forall>i<n. \<not> P (f i))
[PROOF STEP]
apply(rule halt_lemma2''', simp, simp, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. \<lbrakk>wf LE; Q (f 0); \<not> P (f 0); \<forall>n. \<not> P (f n) \<and> Q (f n) \<longrightarrow> Q (f (Suc n)) \<and> (f (Suc n), f n) \<in> LE; P (f n)\<rbrakk> \<Longrightarrow> \<exists>n. P (f n) \<and> (\<forall>i<n. \<not> P (f i))
[PROOF STEP]
apply(erule_tac halt_lemma2'', simp)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma subspace_imp_convex: "subspace s \<Longrightarrow> convex s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subspace s \<Longrightarrow> convex s
[PROOF STEP]
using subspace_imp_affine affine_imp_convex
[PROOF STATE]
proof (prove)
using this:
subspace ?s \<Longrightarrow> affine ?s
affine ?s \<Longrightarrow> convex ?s

goal (1 subgoal):
 1. subspace s \<Longrightarrow> convex s
[PROOF STEP]
by auto


[STATEMENT]
lemma p_unique:
  "(\<forall>x . x \<sqinter> y = bot \<longleftrightarrow> x \<le> z) \<Longrightarrow> z = -y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x. (x \<sqinter> y = bot) = (x \<le> z) \<Longrightarrow> z = - y
[PROOF STEP]
using inf.order_eq_iff pseudo_complement
[PROOF STATE]
proof (prove)
using this:
(?x = ?y) = (?y \<le> ?x \<and> ?x \<le> ?y)
(?x \<sqinter> ?y = bot) = (?x \<le> - ?y)

goal (1 subgoal):
 1. \<forall>x. (x \<sqinter> y = bot) = (x \<le> z) \<Longrightarrow> z = - y
[PROOF STEP]
by auto


[STATEMENT]
lemma times_sqmatrix_def' [simp]:
  "SqMatrix A * SqMatrix B = SqMatrix (\<lambda>i j. sum (\<lambda>k. A i k * B k j) (UNIV::'k atMost set))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. SqMatrix A \<cdot> SqMatrix B = SqMatrix (\<lambda>i j. \<Sum>k\<in>UNIV. A i k \<cdot> B k j)
[PROOF STEP]
by (simp add: times_sqmatrix_def)


[STATEMENT]
lemma singleton_list_cong_eq_iff[simp]:
  "({xs::'a list} // {\<cong>} = {ys} // {\<cong>}) = (xs \<cong> ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({xs} // {\<cong>} = {ys} // {\<cong>}) = xs \<cong> ys
[PROOF STEP]
by(simp add: eq_equiv_class_iff2[OF equiv_EqF])


[STATEMENT]
lemma inverse_ms_aux_MSLCons: "inverse_ms_aux (MSLCons (C, e) xs) =
   scale_shift_ms_aux (inverse C, - e)
     (powser_ms_aux' (mssalternate 1 (- 1))
       (scale_shift_ms_aux (inverse C, - e)
         xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverse_ms_aux (MSLCons (C, e) xs) = scale_shift_ms_aux (inverse C, - e) (powser_ms_aux' (mssalternate 1 (- 1)) (scale_shift_ms_aux (inverse C, - e) xs))
[PROOF STEP]
by (simp add: Let_def inverse_ms_aux.simps powser_ms_aux'_def)


[STATEMENT]
lemma util_fun_def_holds: "i \<in> agents \<Longrightarrow> x \<succeq>[Pr[i]] y \<longleftrightarrow> U[i] x \<ge> U[i] y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. i \<in> agents \<Longrightarrow> x \<succeq>[Pr[i]] y = (U[i] y \<le> U[i] x)
[PROOF STEP]
by (meson agent_props all_larger_zero_in_csset eucl_ordinal_utility_def ordinal_utility_def)


[STATEMENT]
lemma finite_imp_finite_component_Keys:
  assumes "finite F"
  shows "finite (component_of_term ` Keys F)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (component_of_term ` Keys F)
[PROOF STEP]
by (rule finite_imageI, rule finite_Keys, fact)


[STATEMENT]
lemma (in is_dghm) is_dghm_op'[dg_op_intros]:
  assumes "\<AA>' = op_dg \<AA>" and "\<BB>' = op_dg \<BB>" and "\<alpha>' = \<alpha>"
  shows "op_dghm \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>'\<^esub> \<BB>'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_dghm \<FF> : \<AA>' \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>'\<^esub> \<BB>'
[PROOF STEP]
unfolding assms
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_dghm \<FF> : op_dg \<AA> \<mapsto>\<mapsto>\<^sub>D\<^sub>G\<^bsub>\<alpha>\<^esub> op_dg \<BB>
[PROOF STEP]
by (rule is_dghm_op)


[STATEMENT]
lemma nth_map_eq':
  "length xs = length ys \<Longrightarrow> map f xs = map g ys \<Longrightarrow> i < length xs \<Longrightarrow> f (xs ! i) = g (ys ! i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length xs = length ys; map f xs = map g ys; i < length xs\<rbrakk> \<Longrightarrow> f (xs ! i) = g (ys ! i)
[PROOF STEP]
apply(induct xs ys rule: list_induct2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>map f [] = map g []; i < length []\<rbrakk> \<Longrightarrow> f ([] ! i) = g ([] ! i)
 2. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>map f xs = map g ys; i < length xs\<rbrakk> \<Longrightarrow> f (xs ! i) = g (ys ! i); map f (x # xs) = map g (y # ys); i < length (x # xs)\<rbrakk> \<Longrightarrow> f ((x # xs) ! i) = g ((y # ys) ! i)
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>map f xs = map g ys; i < length xs\<rbrakk> \<Longrightarrow> f (xs ! i) = g (ys ! i); map f (x # xs) = map g (y # ys); i < length (x # xs)\<rbrakk> \<Longrightarrow> f ((x # xs) ! i) = g ((y # ys) ! i)
[PROOF STEP]
apply(case_tac i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x xs y ys. \<lbrakk>length xs = length ys; \<lbrakk>map f xs = map g ys; i < length xs\<rbrakk> \<Longrightarrow> f (xs ! i) = g (ys ! i); map f (x # xs) = map g (y # ys); i < length (x # xs); i = 0\<rbrakk> \<Longrightarrow> f ((x # xs) ! i) = g ((y # ys) ! i)
 2. \<And>x xs y ys nat. \<lbrakk>length xs = length ys; \<lbrakk>map f xs = map g ys; i < length xs\<rbrakk> \<Longrightarrow> f (xs ! i) = g (ys ! i); map f (x # xs) = map g (y # ys); i < length (x # xs); i = Suc nat\<rbrakk> \<Longrightarrow> f ((x # xs) ! i) = g ((y # ys) ! i)
[PROOF STEP]
apply force
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xs y ys nat. \<lbrakk>length xs = length ys; \<lbrakk>map f xs = map g ys; i < length xs\<rbrakk> \<Longrightarrow> f (xs ! i) = g (ys ! i); map f (x # xs) = map g (y # ys); i < length (x # xs); i = Suc nat\<rbrakk> \<Longrightarrow> f ((x # xs) ! i) = g ((y # ys) ! i)
[PROOF STEP]
by (metis length_map nth_map)


[STATEMENT]
lemma strongly_accepts_subset: "\<lbrakk>strongly_accepts \<F> S M; N \<subseteq> M\<rbrakk> \<Longrightarrow> strongly_accepts \<F> S N"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>strongly_accepts \<F> S M; N \<subseteq> M\<rbrakk> \<Longrightarrow> strongly_accepts \<F> S N
[PROOF STEP]
by (auto simp: strongly_accepts_def)


[STATEMENT]
lemma connectedI:
  "(\<And>A B. open A \<Longrightarrow> open B \<Longrightarrow> A \<inter> U \<noteq> {} \<Longrightarrow> B \<inter> U \<noteq> {} \<Longrightarrow> A \<inter> B \<inter> U = {} \<Longrightarrow> U \<subseteq> A \<union> B \<Longrightarrow> False)
  \<Longrightarrow> connected U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>A B. \<lbrakk>open A; open B; A \<inter> U \<noteq> {}; B \<inter> U \<noteq> {}; A \<inter> B \<inter> U = {}; U \<subseteq> A \<union> B\<rbrakk> \<Longrightarrow> False) \<Longrightarrow> connected U
[PROOF STEP]
by (auto simp: connected_def)


[STATEMENT]
lemma supp_list_member:
  fixes x::"'a::fs" and l::"'a list"
  assumes "x \<in> set l"
  shows "supp x \<subseteq> supp l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. supp x \<subseteq> supp l
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x \<in> set l

goal (1 subgoal):
 1. supp x \<subseteq> supp l
[PROOF STEP]
apply(induct l, auto)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>la xa. \<lbrakk>x \<in> set la \<Longrightarrow> supp x \<subseteq> supp la; x \<in> set l; xa \<in> supp x\<rbrakk> \<Longrightarrow> xa \<in> supp (x # la)
 2. \<And>a la xa. \<lbrakk>supp x \<subseteq> supp la; x \<in> set l; xa \<in> supp x; x \<in> set la\<rbrakk> \<Longrightarrow> xa \<in> supp (a # la)
[PROOF STEP]
using supp_Cons
[PROOF STATE]
proof (prove)
using this:
supp (?x # ?xs) = supp ?x \<union> supp ?xs

goal (2 subgoals):
 1. \<And>la xa. \<lbrakk>x \<in> set la \<Longrightarrow> supp x \<subseteq> supp la; x \<in> set l; xa \<in> supp x\<rbrakk> \<Longrightarrow> xa \<in> supp (x # la)
 2. \<And>a la xa. \<lbrakk>supp x \<subseteq> supp la; x \<in> set l; xa \<in> supp x; x \<in> set la\<rbrakk> \<Longrightarrow> xa \<in> supp (a # la)
[PROOF STEP]
by auto


[STATEMENT]
lemma dg_prod_3_is_arrI'[dg_prod_cs_intros]:
  assumes "F = [f, f', f'']\<^sub>\<circ>"
    and "A = [a, a', a'']\<^sub>\<circ>"
    and "B = [b, b', b'']\<^sub>\<circ>"
    and "f : a \<mapsto>\<^bsub>\<AA>\<^esub> b"
    and "f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'"
    and "f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''"
  shows "F : A \<mapsto>\<^bsub>\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>\<^esub> B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F : A \<mapsto>\<^bsub>\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>\<^esub> B
[PROOF STEP]
using assms(4,5,6)
[PROOF STATE]
proof (prove)
using this:
f : a \<mapsto>\<^bsub>\<AA>\<^esub> b
f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'
f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''

goal (1 subgoal):
 1. F : A \<mapsto>\<^bsub>\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>\<^esub> B
[PROOF STEP]
unfolding assms(1,2,3)
[PROOF STATE]
proof (prove)
using this:
f : a \<mapsto>\<^bsub>\<AA>\<^esub> b
f' : a' \<mapsto>\<^bsub>\<BB>\<^esub> b'
f'' : a'' \<mapsto>\<^bsub>\<CC>\<^esub> b''

goal (1 subgoal):
 1. [f, f', f'']\<^sub>\<circ> : [a, a', a'']\<^sub>\<circ> \<mapsto>\<^bsub>\<AA> \<times>\<^sub>D\<^sub>G\<^sub>3 \<BB> \<times>\<^sub>D\<^sub>G\<^sub>3 \<CC>\<^esub> [b, b', b'']\<^sub>\<circ>
[PROOF STEP]
by (rule dg_prod_3_is_arrI)


[STATEMENT]
lemma spans_image: "V \<subseteq> m1.span B \<Longrightarrow> f ` V \<subseteq> m2.span (f ` B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. V \<subseteq> m1.span B \<Longrightarrow> f ` V \<subseteq> m2.span (f ` B)
[PROOF STEP]
by (metis image_mono span_image)


[STATEMENT]
lemma empty_set_less_eq_aux [simp]: "{} \<sqsubseteq>' A \<longleftrightarrow> finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({} \<sqsubseteq>' A) = finite A
[PROOF STEP]
by(auto simp add: set_less_eq_aux_def finite_complement_partition)


[STATEMENT]
lemma atLeastLessThan_empty_iff2[simp]: "{} = {a\<le>\<^sub>a..<\<^sub>ab} \<longleftrightarrow> (\<not> a <\<^sub>a b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({} = {a\<le>\<^sub>a..<\<^sub>ab}) = (\<not> a <\<^sub>a b)
[PROOF STEP]
unfolding interval_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ({} = {a\<le>\<^sub>a..} \<inter> {..<\<^sub>ab}) = (\<not> a <\<^sub>a b)
[PROOF STEP]
by (auto simp: le_less_trans ord.lessThan_iff)


[STATEMENT]
lemma limit1: "filterlim (\<lambda>x::real. sqrt (4/x - 1) / (x - 4)) at_bot (at_left 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_left 4. sqrt (4 / x - 1) / (x - 4) :> at_bot
[PROOF STEP]
proof (rule lhopital_left)
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. ((\<lambda>x. sqrt (4 / x - 1)) \<longlongrightarrow> 0) (at_left 4)
 2. ((\<lambda>x. x - 4) \<longlongrightarrow> 0) (at_left 4)
 3. \<forall>\<^sub>F x in at_left 4. x - 4 \<noteq> 0
 4. \<forall>\<^sub>F x in at_left 4. ?g' x \<noteq> 0
 5. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. sqrt (4 / x - 1)) has_real_derivative ?f' x) (at x)
 6. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. x - 4) has_real_derivative ?g' x) (at x)
 7. LIM x at_left 4. ?f' x / ?g' x :> at_bot
[PROOF STEP]
show "((\<lambda>x::real. sqrt (4 / x - 1)) \<longlongrightarrow> 0) (at_left 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sqrt (4 / x - 1)) \<longlongrightarrow> 0) (at_left 4)
[PROOF STEP]
by (force intro: tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sqrt (4 / x - 1)) \<longlongrightarrow> 0) (at_left 4)

goal (6 subgoals):
 1. ((\<lambda>x. x - 4) \<longlongrightarrow> 0) (at_left 4)
 2. \<forall>\<^sub>F x in at_left 4. x - 4 \<noteq> 0
 3. \<forall>\<^sub>F x in at_left 4. ?g' x \<noteq> 0
 4. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. sqrt (4 / x - 1)) has_real_derivative ?f' x) (at x)
 5. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. x - 4) has_real_derivative ?g' x) (at x)
 6. LIM x at_left 4. ?f' x / ?g' x :> at_bot
[PROOF STEP]
show "((\<lambda>x::real. x - 4) \<longlongrightarrow> 0) (at_left 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. x - 4) \<longlongrightarrow> 0) (at_left 4)
[PROOF STEP]
by (force intro: tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. x - 4) \<longlongrightarrow> 0) (at_left 4)

goal (5 subgoals):
 1. \<forall>\<^sub>F x in at_left 4. x - 4 \<noteq> 0
 2. \<forall>\<^sub>F x in at_left 4. ?g' x \<noteq> 0
 3. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. sqrt (4 / x - 1)) has_real_derivative ?f' x) (at x)
 4. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. x - 4) has_real_derivative ?g' x) (at x)
 5. LIM x at_left 4. ?f' x / ?g' x :> at_bot
[PROOF STEP]
show "\<forall>\<^sub>F x in at_left 4. ((\<lambda>x. x - 4) has_real_derivative 1) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. x - 4) has_real_derivative 1) (at x)
[PROOF STEP]
by (intro always_eventually) (auto intro!: derivative_eq_intros)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_left 4. ((\<lambda>x. x - 4) has_real_derivative 1) (at x)

goal (4 subgoals):
 1. \<forall>\<^sub>F x in at_left 4. x - 4 \<noteq> 0
 2. \<forall>\<^sub>F x in at_left 4. 1 \<noteq> 0
 3. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. sqrt (4 / x - 1)) has_real_derivative ?f' x) (at x)
 4. LIM x at_left 4. ?f' x / 1 :> at_bot
[PROOF STEP]
show "\<forall>\<^sub>F x in at_left 4. ((\<lambda>x. sqrt (4/x - 1)) has_real_derivative
          -2 / (sqrt (4/x - 1) * x^2)) (at x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in at_left 4. ((\<lambda>x. sqrt (4 / x - 1)) has_real_derivative - 2 / (sqrt (4 / x - 1) * x\<^sup>2)) (at x)
[PROOF STEP]
by (intro eventually_at_leftI[of 0])
       (auto intro!: derivative_eq_intros simp: field_simps power2_eq_square)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in at_left 4. ((\<lambda>x. sqrt (4 / x - 1)) has_real_derivative - 2 / (sqrt (4 / x - 1) * x\<^sup>2)) (at x)

goal (3 subgoals):
 1. \<forall>\<^sub>F x in at_left 4. x - 4 \<noteq> 0
 2. \<forall>\<^sub>F x in at_left 4. 1 \<noteq> 0
 3. LIM x at_left 4. - 2 / (sqrt (4 / x - 1) * x\<^sup>2) / 1 :> at_bot
[PROOF STEP]
have *: "((\<lambda>x::real. sqrt (4 / x - 1) * x\<^sup>2) \<longlongrightarrow> 0) (at_left 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. sqrt (4 / x - 1) * x\<^sup>2) \<longlongrightarrow> 0) (at_left 4)
[PROOF STEP]
by (force intro!: tendsto_eq_intros)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. sqrt (4 / x - 1) * x\<^sup>2) \<longlongrightarrow> 0) (at_left 4)

goal (3 subgoals):
 1. \<forall>\<^sub>F x in at_left 4. x - 4 \<noteq> 0
 2. \<forall>\<^sub>F x in at_left 4. 1 \<noteq> 0
 3. LIM x at_left 4. - 2 / (sqrt (4 / x - 1) * x\<^sup>2) / 1 :> at_bot
[PROOF STEP]
have "filterlim (\<lambda>x. - (2 / (sqrt (4 / x - 1) * x\<^sup>2))) at_bot (at_left 4)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_left 4. - (2 / (sqrt (4 / x - 1) * x\<^sup>2)) :> at_bot
[PROOF STEP]
unfolding filterlim_uminus_at_top [symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. LIM x at_left 4. 2 / (sqrt (4 / x - 1) * x\<^sup>2) :> at_top
[PROOF STEP]
by (rule LIM_at_top_divide tendsto_const eventually_at_leftI[of 0] * | simp)+
[PROOF STATE]
proof (state)
this:
LIM x at_left 4. - (2 / (sqrt (4 / x - 1) * x\<^sup>2)) :> at_bot

goal (3 subgoals):
 1. \<forall>\<^sub>F x in at_left 4. x - 4 \<noteq> 0
 2. \<forall>\<^sub>F x in at_left 4. 1 \<noteq> 0
 3. LIM x at_left 4. - 2 / (sqrt (4 / x - 1) * x\<^sup>2) / 1 :> at_bot
[PROOF STEP]
thus "filterlim (\<lambda>x::real. - 2 / (sqrt (4 / x - 1) * x\<^sup>2) / 1) at_bot (at_left 4)"
[PROOF STATE]
proof (prove)
using this:
LIM x at_left 4. - (2 / (sqrt (4 / x - 1) * x\<^sup>2)) :> at_bot

goal (1 subgoal):
 1. LIM x at_left 4. - 2 / (sqrt (4 / x - 1) * x\<^sup>2) / 1 :> at_bot
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
LIM x at_left 4. - 2 / (sqrt (4 / x - 1) * x\<^sup>2) / 1 :> at_bot

goal (2 subgoals):
 1. \<forall>\<^sub>F x in at_left 4. x - 4 \<noteq> 0
 2. \<forall>\<^sub>F x in at_left 4. 1 \<noteq> 0
[PROOF STEP]
qed (auto intro: eventually_at_leftI[of 0])


[STATEMENT]
lemma is_distinguishing_formula_eqvt (*[eqvt]*):
    assumes "x distinguishes P from Q" shows "(p \<bullet> x) distinguishes (p \<bullet> P) from (p \<bullet> Q)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (p \<bullet> x) distinguishes (p \<bullet> P) from (p \<bullet> Q)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x distinguishes P from Q

goal (1 subgoal):
 1. (p \<bullet> x) distinguishes (p \<bullet> P) from (p \<bullet> Q)
[PROOF STEP]
unfolding is_distinguishing_formula_def
[PROOF STATE]
proof (prove)
using this:
P \<Turnstile> x \<and> \<not> Q \<Turnstile> x

goal (1 subgoal):
 1. p \<bullet> P \<Turnstile> p \<bullet> x \<and> \<not> p \<bullet> Q \<Turnstile> p \<bullet> x
[PROOF STEP]
by (metis permute_minus_cancel(2) FL_valid_eqvt)


[STATEMENT]
lemma pre_to_univ_poly_inv_hom_pvar_0:
  assumes "i < Suc n"
  assumes "j < i"
  shows "pre_to_univ_poly_inv_hom (Suc n) i (pvar R j) =
            pvar R j"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. pre_to_univ_poly_inv_hom (Suc n) i (pvar R j) = pvar R j
[PROOF STEP]
unfolding pre_to_univ_poly_inv_hom_def coord_ring_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R.relabel_vars {..<Suc n - 1} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (pvar R j) = pvar R j
[PROOF STEP]
using R.relabel_vars_is_morphism(2)[of "\<lambda>j. if j < i then j else j + 1" "{..<n}" "{..< Suc n}" j]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>(\<lambda>j. if j < i then j else j + 1) \<in> {..<n} \<rightarrow> {..<Suc n}; j \<in> {..<n}\<rbrakk> \<Longrightarrow> R.relabel_vars {..<n} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (pvar R j) = pvar R (if j < i then j else j + 1)

goal (1 subgoal):
 1. R.relabel_vars {..<Suc n - 1} {..<Suc n} (\<lambda>j. if j < i then j else j + 1) (pvar R j) = pvar R j
[PROOF STEP]
by (smt Pi_I add.commute add_diff_cancel_left' assms(1) assms(2)
      lessThan_iff less_Suc_eq less_trans_Suc not_less_eq plus_1_eq_Suc)