[STATEMENT]
lemma cindex_pathE_subpath_combine:
  assumes g:"finite_ReZ_segments g z"and "path g" and
     "0\<le>a" "a\<le>b" "b\<le>c" "c\<le>1"
  shows "cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z
          = cindex_pathE (subpath a c g) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
define f where "f = (\<lambda>t. Im (g t - z) / Re (g t - z))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>t. Im (g t - z) / Re (g t - z))

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have ?thesis when "a=b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have "cindex_pathE (subpath a b g) z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z = 0
[PROOF STEP]
apply (rule cindex_pathE_constI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t; t < 1\<rbrakk> \<Longrightarrow> subpath a b g t = ?c
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t; t < 1\<rbrakk> \<Longrightarrow> subpath a b g t = ?c
[PROOF STEP]
unfolding subpath_def
[PROOF STATE]
proof (prove)
using this:
a = b

goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t; t < 1\<rbrakk> \<Longrightarrow> g ((b - a) * t + a) = ?c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z = 0

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (subpath a b g) z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (subpath a b g) z = 0

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (subpath a b g) z = 0
a = b

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a = b \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
a = b \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have ?thesis when "b=c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have "cindex_pathE (subpath b c g) z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath b c g) z = 0
[PROOF STEP]
apply (rule cindex_pathE_constI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t; t < 1\<rbrakk> \<Longrightarrow> subpath b c g t = ?c
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
b = c

goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t; t < 1\<rbrakk> \<Longrightarrow> subpath b c g t = ?c
[PROOF STEP]
unfolding subpath_def
[PROOF STATE]
proof (prove)
using this:
b = c

goal (1 subgoal):
 1. \<And>t. \<lbrakk>0 < t; t < 1\<rbrakk> \<Longrightarrow> g ((c - b) * t + b) = ?c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath b c g) z = 0

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (subpath b c g) z = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (subpath b c g) z = 0

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (subpath b c g) z = 0
b = c

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
b = c \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
b = c \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have ?thesis when "a\<noteq>b" "b\<noteq>c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have  [simp]:"a<b" "b<c" "a<c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a < b &&& b < c &&& a < c
[PROOF STEP]
using that \<open>a\<le>b\<close> \<open>b\<le>c\<close>
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b
b \<noteq> c
a \<le> b
b \<le> c

goal (1 subgoal):
 1. a < b &&& b < c &&& a < c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a < b
b < c
a < c

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have "cindex_pathE (subpath a b g) z = cindexE a b f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z = cindexE a b f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z = cindexE a b f
[PROOF STEP]
have "cindex_pathE (subpath a b g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (b - a) * x + a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (b - a) * x + a))
[PROOF STEP]
unfolding cindex_pathE_def f_def comp_def subpath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (g ((b - a) * t + a) - z) / Re (g ((b - a) * t + a) - z)) = cindexE 0 1 (\<lambda>x. Im (g ((b - a) * x + a) - z) / Re (g ((b - a) * x + a) - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (b - a) * x + a))

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z = cindexE a b f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (b - a) * x + a))

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z = cindexE a b f
[PROOF STEP]
have "... =  cindexE a b f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. (b - a) * x + a)) = cindexE a b f
[PROOF STEP]
using cindexE_linear_comp[of "b-a" 0 1 f a,simplified] that(1)
[PROOF STATE]
proof (prove)
using this:
b \<noteq> a \<Longrightarrow> cindexE 0 1 (f \<circ> (\<lambda>x. (b - a) * x + a)) = cindexE a b f
a \<noteq> b

goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. (b - a) * x + a)) = cindexE a b f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. (b - a) * x + a)) = cindexE a b f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z = cindexE a b f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (subpath a b g) z = cindexE a b f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (subpath a b g) z = cindexE a b f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z = cindexE a b f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z = cindexE a b f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z = cindexE a b f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z = cindexE a b f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have "cindex_pathE (subpath b c g) z = cindexE b c f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath b c g) z = cindexE b c f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (subpath b c g) z = cindexE b c f
[PROOF STEP]
have "cindex_pathE (subpath b c g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (c - b) * x + b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath b c g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (c - b) * x + b))
[PROOF STEP]
unfolding cindex_pathE_def f_def comp_def subpath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (g ((c - b) * t + b) - z) / Re (g ((c - b) * t + b) - z)) = cindexE 0 1 (\<lambda>x. Im (g ((c - b) * x + b) - z) / Re (g ((c - b) * x + b) - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath b c g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (c - b) * x + b))

goal (1 subgoal):
 1. cindex_pathE (subpath b c g) z = cindexE b c f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath b c g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (c - b) * x + b))

goal (1 subgoal):
 1. cindex_pathE (subpath b c g) z = cindexE b c f
[PROOF STEP]
have "... =  cindexE b c f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. (c - b) * x + b)) = cindexE b c f
[PROOF STEP]
using cindexE_linear_comp[of "c-b" 0 1 f b,simplified] that(2)
[PROOF STATE]
proof (prove)
using this:
c \<noteq> b \<Longrightarrow> cindexE 0 1 (f \<circ> (\<lambda>x. (c - b) * x + b)) = cindexE b c f
b \<noteq> c

goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. (c - b) * x + b)) = cindexE b c f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. (c - b) * x + b)) = cindexE b c f

goal (1 subgoal):
 1. cindex_pathE (subpath b c g) z = cindexE b c f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (subpath b c g) z = cindexE b c f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (subpath b c g) z = cindexE b c f

goal (1 subgoal):
 1. cindex_pathE (subpath b c g) z = cindexE b c f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath b c g) z = cindexE b c f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath b c g) z = cindexE b c f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath b c g) z = cindexE b c f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have "cindex_pathE (subpath a c g) z = cindexE a c f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a c g) z = cindexE a c f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (subpath a c g) z = cindexE a c f
[PROOF STEP]
have "cindex_pathE (subpath a c g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (c - a) * x + a))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (subpath a c g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (c - a) * x + a))
[PROOF STEP]
unfolding cindex_pathE_def f_def comp_def subpath_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (g ((c - a) * t + a) - z) / Re (g ((c - a) * t + a) - z)) = cindexE 0 1 (\<lambda>x. Im (g ((c - a) * x + a) - z) / Re (g ((c - a) * x + a) - z))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a c g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (c - a) * x + a))

goal (1 subgoal):
 1. cindex_pathE (subpath a c g) z = cindexE a c f
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a c g) z = cindexE 0 1 (f \<circ> (\<lambda>x. (c - a) * x + a))

goal (1 subgoal):
 1. cindex_pathE (subpath a c g) z = cindexE a c f
[PROOF STEP]
have "... =  cindexE a c f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. (c - a) * x + a)) = cindexE a c f
[PROOF STEP]
using cindexE_linear_comp[of "c-a" 0 1 f a,simplified] \<open>a<c\<close>
[PROOF STATE]
proof (prove)
using this:
c \<noteq> a \<Longrightarrow> cindexE 0 1 (f \<circ> (\<lambda>x. (c - a) * x + a)) = cindexE a c f
a < c

goal (1 subgoal):
 1. cindexE 0 1 (f \<circ> (\<lambda>x. (c - a) * x + a)) = cindexE a c f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f \<circ> (\<lambda>x. (c - a) * x + a)) = cindexE a c f

goal (1 subgoal):
 1. cindex_pathE (subpath a c g) z = cindexE a c f
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (subpath a c g) z = cindexE a c f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (subpath a c g) z = cindexE a c f

goal (1 subgoal):
 1. cindex_pathE (subpath a c g) z = cindexE a c f
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a c g) z = cindexE a c f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a c g) z = cindexE a c f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a c g) z = cindexE a c f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
have "cindexE a b f + cindexE b c f = cindexE a c f "
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE a b f + cindexE b c f = cindexE a c f
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE a b f + cindexE b c f = cindexE a c f
[PROOF STEP]
have "finite_jumpFs f a c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
using finite_ReZ_segments_imp_jumpFs[OF g \<open>path g\<close>] \<open>0\<le>a\<close> \<open>c\<le>1\<close>
[PROOF STATE]
proof (prove)
using this:
finite_jumpFs (\<lambda>t. Im (g t - z) / Re (g t - z)) 0 1
0 \<le> a
c \<le> 1

goal (1 subgoal):
 1. finite_jumpFs f a c
[PROOF STEP]
unfolding f_def
[PROOF STATE]
proof (prove)
using this:
finite_jumpFs (\<lambda>t. Im (g t - z) / Re (g t - z)) 0 1
0 \<le> a
c \<le> 1

goal (1 subgoal):
 1. finite_jumpFs (\<lambda>t. Im (g t - z) / Re (g t - z)) a c
[PROOF STEP]
by (elim finite_jumpFs_subE,auto)
[PROOF STATE]
proof (state)
this:
finite_jumpFs f a c

goal (1 subgoal):
 1. cindexE a b f + cindexE b c f = cindexE a c f
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite_jumpFs f a c
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
finite_jumpFs f a c

goal (1 subgoal):
 1. cindexE a b f + cindexE b c f = cindexE a c f
[PROOF STEP]
using cindexE_linear_comp cindexE_combine[OF _ \<open>a\<le>b\<close> \<open>b\<le>c\<close>]
[PROOF STATE]
proof (prove)
using this:
finite_jumpFs f a c
?c \<noteq> 0 \<Longrightarrow> cindexE ?lb ?ub (?f \<circ> (\<lambda>x. ?c * x + ?b)) = (if 0 < ?c then cindexE (?c * ?lb + ?b) (?c * ?ub + ?b) ?f else - cindexE (?c * ?ub + ?b) (?c * ?lb + ?b) ?f)
finite_jumpFs ?f a c \<Longrightarrow> cindexE a c ?f = cindexE a b ?f + cindexE b c ?f

goal (1 subgoal):
 1. cindexE a b f + cindexE b c f = cindexE a c f
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE a b f + cindexE b c f = cindexE a c f

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE a b f + cindexE b c f = cindexE a c f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (subpath a b g) z = cindexE a b f
cindex_pathE (subpath b c g) z = cindexE b c f
cindex_pathE (subpath a c g) z = cindexE a c f
cindexE a b f + cindexE b c f = cindexE a c f
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (subpath a b g) z = cindexE a b f
cindex_pathE (subpath b c g) z = cindexE b c f
cindex_pathE (subpath a c g) z = cindexE a c f
cindexE a b f + cindexE b c f = cindexE a c f

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lbrakk>a \<noteq> b; b \<noteq> c\<rbrakk> \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
a = b \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
b = c \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
\<lbrakk>a \<noteq> b; b \<noteq> c\<rbrakk> \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
a = b \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
b = c \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
\<lbrakk>a \<noteq> b; b \<noteq> c\<rbrakk> \<Longrightarrow> cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal (1 subgoal):
 1. cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
cindex_pathE (subpath a b g) z + cindex_pathE (subpath b c g) z = cindex_pathE (subpath a c g) z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma subdegree_power_eqI:
  fixes f :: "'a::semiring_1 fps"
  shows "(f $ subdegree f) ^ n \<noteq> 0 \<Longrightarrow> subdegree (f ^ n) = n * subdegree f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f $ subdegree f) ^ n \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ n) = n * subdegree f
[PROOF STEP]
proof (induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (f $ subdegree f) ^ 0 \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ 0) = 0 * subdegree f
 2. \<And>n. \<lbrakk>(f $ subdegree f) ^ n \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ n) = n * subdegree f; (f $ subdegree f) ^ Suc n \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> subdegree (f ^ Suc n) = Suc n * subdegree f
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
(f $ subdegree f) ^ n \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ n) = n * subdegree f
(f $ subdegree f) ^ Suc n \<noteq> (0::'a)

goal (2 subgoals):
 1. (f $ subdegree f) ^ 0 \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ 0) = 0 * subdegree f
 2. \<And>n. \<lbrakk>(f $ subdegree f) ^ n \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ n) = n * subdegree f; (f $ subdegree f) ^ Suc n \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> subdegree (f ^ Suc n) = Suc n * subdegree f
[PROOF STEP]
from Suc
[PROOF STATE]
proof (chain)
picking this:
(f $ subdegree f) ^ n \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ n) = n * subdegree f
(f $ subdegree f) ^ Suc n \<noteq> (0::'a)
[PROOF STEP]
have 1: "subdegree (f ^ n) = n * subdegree f"
[PROOF STATE]
proof (prove)
using this:
(f $ subdegree f) ^ n \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ n) = n * subdegree f
(f $ subdegree f) ^ Suc n \<noteq> (0::'a)

goal (1 subgoal):
 1. subdegree (f ^ n) = n * subdegree f
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
subdegree (f ^ n) = n * subdegree f

goal (2 subgoals):
 1. (f $ subdegree f) ^ 0 \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ 0) = 0 * subdegree f
 2. \<And>n. \<lbrakk>(f $ subdegree f) ^ n \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ n) = n * subdegree f; (f $ subdegree f) ^ Suc n \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> subdegree (f ^ Suc n) = Suc n * subdegree f
[PROOF STEP]
with Suc(2)
[PROOF STATE]
proof (chain)
picking this:
(f $ subdegree f) ^ Suc n \<noteq> (0::'a)
subdegree (f ^ n) = n * subdegree f
[PROOF STEP]
have "f $ subdegree f * f ^ n $ subdegree (f ^ n) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
(f $ subdegree f) ^ Suc n \<noteq> (0::'a)
subdegree (f ^ n) = n * subdegree f

goal (1 subgoal):
 1. f $ subdegree f * f ^ n $ subdegree (f ^ n) \<noteq> (0::'a)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f $ subdegree f * f ^ n $ subdegree (f ^ n) \<noteq> (0::'a)

goal (2 subgoals):
 1. (f $ subdegree f) ^ 0 \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ 0) = 0 * subdegree f
 2. \<And>n. \<lbrakk>(f $ subdegree f) ^ n \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ n) = n * subdegree f; (f $ subdegree f) ^ Suc n \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> subdegree (f ^ Suc n) = Suc n * subdegree f
[PROOF STEP]
with 1
[PROOF STATE]
proof (chain)
picking this:
subdegree (f ^ n) = n * subdegree f
f $ subdegree f * f ^ n $ subdegree (f ^ n) \<noteq> (0::'a)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
subdegree (f ^ n) = n * subdegree f
f $ subdegree f * f ^ n $ subdegree (f ^ n) \<noteq> (0::'a)

goal (1 subgoal):
 1. subdegree (f ^ Suc n) = Suc n * subdegree f
[PROOF STEP]
using subdegree_mult'[of f "f^n"]
[PROOF STATE]
proof (prove)
using this:
subdegree (f ^ n) = n * subdegree f
f $ subdegree f * f ^ n $ subdegree (f ^ n) \<noteq> (0::'a)
f $ subdegree f * f ^ n $ subdegree (f ^ n) \<noteq> (0::'a) \<Longrightarrow> subdegree (f * f ^ n) = subdegree f + subdegree (f ^ n)

goal (1 subgoal):
 1. subdegree (f ^ Suc n) = Suc n * subdegree f
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
subdegree (f ^ Suc n) = Suc n * subdegree f

goal (1 subgoal):
 1. (f $ subdegree f) ^ 0 \<noteq> (0::'a) \<Longrightarrow> subdegree (f ^ 0) = 0 * subdegree f
[PROOF STEP]
qed simp


[STATEMENT]
lemma midpoint_between:
  fixes a b :: "'a::euclidean_space"
  shows "b = midpoint a c \<longleftrightarrow> between (a,c) b \<and> dist a b = dist b c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)
[PROOF STEP]
proof (cases "a = c")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. a = c \<Longrightarrow> (b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)
 2. a \<noteq> c \<Longrightarrow> (b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
a \<noteq> c

goal (2 subgoals):
 1. a = c \<Longrightarrow> (b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)
 2. a \<noteq> c \<Longrightarrow> (b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)
[PROOF STEP]
using False between_imp_collinear between_midpoint(1) midpoint_collinear
[PROOF STATE]
proof (prove)
using this:
a \<noteq> c
between (?a, ?b) ?x \<Longrightarrow> collinear {?a, ?x, ?b}
between (?a, ?b) (midpoint ?a ?b)
?a \<noteq> ?c \<Longrightarrow> (?b = midpoint ?a ?c) = (collinear {?a, ?b, ?c} \<and> dist ?a ?b = dist ?b ?c)

goal (1 subgoal):
 1. (b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)

goal (1 subgoal):
 1. a = c \<Longrightarrow> (b = midpoint a c) = (between (a, c) b \<and> dist a b = dist b c)
[PROOF STEP]
qed (auto simp: dist_commute)


[STATEMENT]
lemma val_ring_nat_pow_closed:
  assumes "a \<in> \<O>\<^sub>p"
  shows "(a[^](n::nat)) \<in> \<O>\<^sub>p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a [^] n \<in> \<O>\<^sub>p
[PROOF STEP]
apply(induction n)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. a [^] 0 \<in> \<O>\<^sub>p
 2. \<And>n. a [^] n \<in> \<O>\<^sub>p \<Longrightarrow> a [^] Suc n \<in> \<O>\<^sub>p
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<one> \<in> \<O>\<^sub>p
 2. \<And>n. a [^] n \<in> \<O>\<^sub>p \<Longrightarrow> a [^] Suc n \<in> \<O>\<^sub>p
[PROOF STEP]
using Qp.inv_one Z\<^sub>p_mem
[PROOF STATE]
proof (prove)
using this:
inv \<one> = \<one>
?a \<in> carrier Q\<^sub>p \<Longrightarrow> ?a \<in> \<O>\<^sub>p \<or> inv ?a \<in> \<O>\<^sub>p

goal (2 subgoals):
 1. \<one> \<in> \<O>\<^sub>p
 2. \<And>n. a [^] n \<in> \<O>\<^sub>p \<Longrightarrow> a [^] Suc n \<in> \<O>\<^sub>p
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. a [^] n \<in> \<O>\<^sub>p \<Longrightarrow> a [^] Suc n \<in> \<O>\<^sub>p
[PROOF STEP]
by (metis Qp.nat_pow_Suc Qp.nat_pow_closed val_ring_memE assms image_eqI inc_of_prod to_Zp_closed to_Zp_inc to_Zp_mult)


[STATEMENT]
lemma (in Order) ord_inj_restrict_isom:"\<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D\<rbrakk>
    \<Longrightarrow> ord_isom (Iod D T) (Iod E (f ` T)) (restrict f T)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> ord_isom (Iod D T) (Iod E (f ` T)) (restrict f T)
[PROOF STEP]
apply (subst ord_isom_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> ord_inj (Iod D T) (Iod E (f ` T)) (restrict f T) \<and> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
(*  The following two lemmas are preliminaries. *)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D\<rbrakk> \<Longrightarrow> ord_inj (Iod D T) (Iod E (f ` T)) (restrict f T) \<and> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (frule ord_inj_func[of E f], assumption,
        frule image_sub[of f "carrier D" "carrier E" "T"], assumption+)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> ord_inj (Iod D T) (Iod E (f ` T)) (restrict f T) \<and> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> ord_inj (Iod D T) (Iod E (f ` T)) (restrict f T)
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (subst ord_inj_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> restrict f T \<in> extensional (carrier (Iod D T)) \<and> restrict f T \<in> carrier (Iod D T) \<rightarrow> carrier (Iod E (f ` T)) \<and> inj_on (restrict f T) (carrier (Iod D T)) \<and> (\<forall>a\<in>carrier (Iod D T). \<forall>b\<in>carrier (Iod D T). a \<prec>\<^bsub>Iod D T\<^esub> b = restrict f T a \<prec>\<^bsub>Iod E (f ` T)\<^esub> restrict f T b)
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (simp add:Iod_carrier Order.Iod_carrier)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> inj_on f T \<and> (\<forall>a\<in>T. \<forall>b\<in>T. a \<prec>\<^bsub>Iod D T\<^esub> b = f a \<prec>\<^bsub>Iod E (f ` T)\<^esub> f b)
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> inj_on f T
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> \<forall>a\<in>T. \<forall>b\<in>T. a \<prec>\<^bsub>Iod D T\<^esub> b = f a \<prec>\<^bsub>Iod E (f ` T)\<^esub> f b
 3. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (rule restrict_inj[of f "carrier D" "T"])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> inj_on f (carrier D)
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> T \<subseteq> carrier D
 3. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> \<forall>a\<in>T. \<forall>b\<in>T. a \<prec>\<^bsub>Iod D T\<^esub> b = f a \<prec>\<^bsub>Iod E (f ` T)\<^esub> f b
 4. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (simp add:ord_inj_def, assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> \<forall>a\<in>T. \<forall>b\<in>T. a \<prec>\<^bsub>Iod D T\<^esub> b = f a \<prec>\<^bsub>Iod E (f ` T)\<^esub> f b
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (rule ballI)+
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E; a \<in> T; b \<in> T\<rbrakk> \<Longrightarrow> a \<prec>\<^bsub>Iod D T\<^esub> b = f a \<prec>\<^bsub>Iod E (f ` T)\<^esub> f b
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (frule_tac x = a in elem_in_image2[of f "carrier D" "carrier E" T],
        assumption+,
        frule_tac x = b in elem_in_image2[of f "carrier D" "carrier E" T],
        assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E; a \<in> T; b \<in> T; f a \<in> f ` T; f b \<in> f ` T\<rbrakk> \<Longrightarrow> a \<prec>\<^bsub>Iod D T\<^esub> b = f a \<prec>\<^bsub>Iod E (f ` T)\<^esub> f b
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (simp add:Iod_less Order.Iod_less)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E; a \<in> T; b \<in> T\<rbrakk> \<Longrightarrow> a \<prec> b = f a \<prec>\<^bsub>E\<^esub> f b
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (frule_tac c = a in subsetD[of T "carrier D"], assumption+,
        frule_tac c = b in subsetD[of T "carrier D"], assumption+)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E; a \<in> T; b \<in> T; a \<in> carrier D; b \<in> carrier D\<rbrakk> \<Longrightarrow> a \<prec> b = f a \<prec>\<^bsub>E\<^esub> f b
 2. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (simp add:ord_inj_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> surj_to (restrict f T) (carrier (Iod D T)) (carrier (Iod E (f ` T)))
[PROOF STEP]
apply (subst surj_to_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Order E; ord_inj D E f; T \<subseteq> carrier D; f \<in> carrier D \<rightarrow> carrier E; f ` T \<subseteq> carrier E\<rbrakk> \<Longrightarrow> restrict f T ` carrier (Iod D T) = carrier (Iod E (f ` T))
[PROOF STEP]
apply (simp add:Iod_carrier Order.Iod_carrier)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma isDiagonal_diagonal_to_Smith:
  assumes d: "isDiagonal A"
  shows "isDiagonal (diagonal_to_Smith A bezout)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isDiagonal (diagonal_to_Smith A bezout)
[PROOF STEP]
unfolding diagonal_to_Smith_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. isDiagonal (diagonal_to_Smith_aux A [0..<min (nrows A) (ncols A) - 1] bezout)
[PROOF STEP]
by (rule isDiagonal_diagonal_to_Smith_aux_general[OF _ d], auto)


[STATEMENT]
lemma assoc_fun_over_sum:
  fixes X :: "'x set"
  fixes Y :: "'y set"
  shows "(\<Sum>j\<in>Y. \<Sum>i\<in>X. f i j *\<^sub>R C \<bullet> g j) = (\<Sum>j\<in>Y. (\<Sum>i\<in>X. f i j) *\<^sub>R C \<bullet> g j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>j\<in>Y. \<Sum>i\<in>X. f i j *\<^sub>R C \<bullet> g j) = (\<Sum>j\<in>Y. (\<Sum>i\<in>X. f i j) *\<^sub>R C \<bullet> g j)
[PROOF STEP]
by (simp add: inner_sum_left scaleR_left.sum)


[STATEMENT]
lemma fresh_finite_atom_set:
  fixes S::"atom set"
  assumes "finite S"
  shows "a \<sharp> S \<longleftrightarrow> a \<notin> S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<sharp> S = (a \<notin> S)
[PROOF STEP]
unfolding fresh_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<notin> supp S) = (a \<notin> S)
[PROOF STEP]
by (simp add: supp_finite_atom_set[OF assms])


[STATEMENT]
lemma counter_b_aux: "u 0 = 0 \<Longrightarrow> \<forall>n. (xa n \<longrightarrow> u (Suc n) = Suc (u n)) \<and> (\<not> xa n \<longrightarrow> u (Suc n) = u n) \<and> xb n = u (Suc n)
                \<Longrightarrow> count xa n = u (Suc n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>u 0 = 0; \<forall>n. (xa n \<longrightarrow> u (Suc n) = Suc (u n)) \<and> (\<not> xa n \<longrightarrow> u (Suc n) = u n) \<and> xb n = u (Suc n)\<rbrakk> \<Longrightarrow> count xa n = u (Suc n)
[PROOF STEP]
by (induction n, simp_all)


[STATEMENT]
lemma finite_vars_imp_finite_adapt_b :
  assumes "finite (Bexp.vars e)"
  shows   "finite (Bexp.vars (adapt_bexp e s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite (Bexp.vars (adapt_bexp e s))
[PROOF STEP]
unfolding adapt_bexp_vars
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite ((\<lambda>v. symvar v s) ` Bexp.vars e)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
finite (Bexp.vars e)

goal (1 subgoal):
 1. finite ((\<lambda>v. symvar v s) ` Bexp.vars e)
[PROOF STEP]
by auto


[STATEMENT]
lemma word_less_sub1: "x \<noteq> 0 \<Longrightarrow> 1 < x \<longleftrightarrow> 0 < x - 1"
  for x :: "'a::len word"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<noteq> 0 \<Longrightarrow> (1 < x) = (0 < x - 1)
[PROOF STEP]
by transfer (simp add: take_bit_decr_eq)


[STATEMENT]
lemma cong_3_swap_2:
  assumes "A B C Cong3 A' B' C'"
  shows "A C B Cong3 A' C' B'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A C B Cong3 A' C' B'
[PROOF STEP]
using assms Cong3_def cong_commutativity
[PROOF STATE]
proof (prove)
using this:
A B C Cong3 A' B' C'
?A ?B ?C Cong3 ?A' ?B' ?C' \<equiv> Cong ?A ?B ?A' ?B' \<and> Cong ?A ?C ?A' ?C' \<and> Cong ?B ?C ?B' ?C'
Cong ?A ?B ?C ?D \<Longrightarrow> Cong ?B ?A ?D ?C

goal (1 subgoal):
 1. A C B Cong3 A' C' B'
[PROOF STEP]
by blast


[STATEMENT]
lemma chain_ldropn_lmapI:
  assumes
    rel: "\<forall>j. j \<ge> i \<longrightarrow> enat (Suc j) < llength xs \<longrightarrow> R (f (lnth xs j)) (f (lnth xs (Suc j)))" and
    si_lt: "enat (Suc i) < llength xs"
  shows "chain R (ldropn i (lmap f xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain R (ldropn i (lmap f xs))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. chain R (ldropn i (lmap f xs))
[PROOF STEP]
have "chain R (lmap f (ldropn i xs))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. chain R (lmap f (ldropn i xs))
[PROOF STEP]
using chain_lmap[of "\<lambda>x y. R (f x) (f y)" R f, of "ldropn i xs"] chain_ldropnI[OF rel si_lt]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>\<forall>x y. R (f x) (f y) \<longrightarrow> R (f x) (f y); chain (\<lambda>x y. R (f x) (f y)) (ldropn i xs)\<rbrakk> \<Longrightarrow> chain R (lmap f (ldropn i xs))
chain (\<lambda>a b. R (f a) (f b)) (ldropn i xs)

goal (1 subgoal):
 1. chain R (lmap f (ldropn i xs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
chain R (lmap f (ldropn i xs))

goal (1 subgoal):
 1. chain R (ldropn i (lmap f xs))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
chain R (lmap f (ldropn i xs))

goal (1 subgoal):
 1. chain R (ldropn i (lmap f xs))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
chain R (ldropn i (lmap f xs))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma diagonalI:
  assumes "x = (take m x)@(take m x)"
  assumes "take m x \<in> carrier (R\<^bsup>m\<^esup>)"
  shows "x \<in> diagonal m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> diagonal m
[PROOF STEP]
unfolding diagonal_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<in> {x \<in> carrier (R\<^bsup>m + m\<^esup>). take m x = drop m x}
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
x = take m x @ take m x
take m x \<in> carrier (R\<^bsup>m\<^esup>)

goal (1 subgoal):
 1. x \<in> {x \<in> carrier (R\<^bsup>m + m\<^esup>). take m x = drop m x}
[PROOF STEP]
by (metis (mono_tags, lifting) append_eq_conv_conj cartesian_power_car_memE
      cartesian_power_car_memI'' length_append mem_Collect_eq)


[STATEMENT]
lemma ins3_Node[simp,code]:
  "ins3 n d x (Node l y r) =
  (case cmp x y of
     LT \<Rightarrow> let l' = ins3 n (d+1) x l in up3 y r False l' |
     EQ \<Rightarrow> Same2 |
     GT \<Rightarrow> let r' = ins3 n (d+1) x r in up3 y l True r')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ins3 n d x \<langle>l, y, r\<rangle> = (case cmp x y of LT \<Rightarrow> Let (ins3 n (d + 1) x l) (up3 y r False) | EQ \<Rightarrow> Same2 | GT \<Rightarrow> Let (ins3 n (d + 1) x r) (up3 y l True))
[PROOF STEP]
using val_cong[OF ins3_tm.simps(2)]
[PROOF STATE]
proof (prove)
using this:
Time_Monad.val (ins3_tm ?n1 ?d1 ?x1 \<langle>?l1, ?y1, ?r1\<rangle>) = Time_Monad.val ((case cmp ?x1 ?y1 of LT \<Rightarrow> ins3_tm ?n1 (?d1 + 1) ?x1 ?l1 \<bind> up3_tm ?y1 ?r1 False | EQ \<Rightarrow> return Same2 | GT \<Rightarrow> ins3_tm ?n1 (?d1 + 1) ?x1 ?r1 \<bind> up3_tm ?y1 ?l1 True) \<bind> tick)

goal (1 subgoal):
 1. ins3 n d x \<langle>l, y, r\<rangle> = (case cmp x y of LT \<Rightarrow> Let (ins3 n (d + 1) x l) (up3 y r False) | EQ \<Rightarrow> Same2 | GT \<Rightarrow> Let (ins3 n (d + 1) x r) (up3 y l True))
[PROOF STEP]
by(simp only: ins3_def up3_def val_simps cmp_val.case_distrib[of val])


[STATEMENT]
lemma set_zero_plus2: "0 \<in> A \<Longrightarrow> B \<subseteq> A + B"
  for A B :: "'a::comm_monoid_add set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (0::'a) \<in> A \<Longrightarrow> B \<subseteq> A + B
[PROOF STEP]
using set_plus_intro
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?a \<in> ?C; ?b \<in> ?D\<rbrakk> \<Longrightarrow> ?a + ?b \<in> ?C + ?D

goal (1 subgoal):
 1. (0::'a) \<in> A \<Longrightarrow> B \<subseteq> A + B
[PROOF STEP]
by fastforce


[STATEMENT]
lemma kernel_scaleC[simp]: "a\<noteq>0 \<Longrightarrow> kernel (a *\<^sub>C A) = kernel A"
  for a :: complex and A :: "(_,_) cblinfun"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> 0 \<Longrightarrow> kernel (a *\<^sub>C A) = kernel A
[PROOF STEP]
apply transfer
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a A. \<lbrakk>a \<noteq> 0; bounded_clinear A\<rbrakk> \<Longrightarrow> (\<lambda>x. a *\<^sub>C A x) -` {0::'d} = A -` {0::'d}
[PROOF STEP]
using complex_vector.scale_eq_0_iff
[PROOF STATE]
proof (prove)
using this:
(?a *\<^sub>C ?x = (0::?'a)) = (?a = 0 \<or> ?x = (0::?'a))

goal (1 subgoal):
 1. \<And>a A. \<lbrakk>a \<noteq> 0; bounded_clinear A\<rbrakk> \<Longrightarrow> (\<lambda>x. a *\<^sub>C A x) -` {0::'d} = A -` {0::'d}
[PROOF STEP]
by blast


[STATEMENT]
lemma equiv_quotient_no_empty_class: "Equiv_Relations.equiv A r \<Longrightarrow> {} \<notin> A // r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. equiv A r \<Longrightarrow> {} \<notin> A // r
[PROOF STEP]
by (auto simp: quotient_def refl_on_def sym_def Equiv_Relations.equiv_def)


[STATEMENT]
lemma primekeyrewrite:
  fixes p::nat shows "\<lbrakk>prime p; p dvd (a*b);~(p dvd a)\<rbrakk> \<Longrightarrow> p dvd b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>prime p; p dvd a * b; \<not> p dvd a\<rbrakk> \<Longrightarrow> p dvd b
[PROOF STEP]
apply (subst (asm) prime_dvd_mult_nat)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>\<not> p dvd a; prime p\<rbrakk> \<Longrightarrow> prime p
 2. \<lbrakk>prime p; p dvd a \<or> p dvd b; \<not> p dvd a\<rbrakk> \<Longrightarrow> p dvd b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma nat_list_from_sc:
  assumes L: "finite L"
  and l: "\<forall>l\<in>L. finite l"
  shows "set ` set (nat_list_from_sc (L :: nat set set)) = {{i . i \<in> l} | l. l \<in>  L}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ` set (nat_list_from_sc L) = {{i. i \<in> l} |l. l \<in> L}
[PROOF STEP]
unfolding nat_list_from_sc_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ` set (sorted_list_of_list_set (nat_list_from_vertex ` L)) = {{i. i \<in> l} |l. l \<in> L}
[PROOF STEP]
unfolding nat_list_from_vertex_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ` set (sorted_list_of_list_set (sorted_list_of_set ` L)) = {{i. i \<in> l} |l. l \<in> L}
[PROOF STEP]
unfolding set_sorted_list_of_list_set [OF finite_sorted_list_of_set [OF L]]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set ` sorted_list_of_set ` L = {{i. i \<in> l} |l. l \<in> L}
[PROOF STEP]
proof (safe)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa xb. xb \<in> L \<Longrightarrow> \<exists>l. set (sorted_list_of_set xb) = {i. i \<in> l} \<and> l \<in> L
 2. \<And>x l. l \<in> L \<Longrightarrow> {i. i \<in> l} \<in> set ` sorted_list_of_set ` L
[PROOF STEP]
fix x :: "nat set"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>x xa xb. xb \<in> L \<Longrightarrow> \<exists>l. set (sorted_list_of_set xb) = {i. i \<in> l} \<and> l \<in> L
 2. \<And>x l. l \<in> L \<Longrightarrow> {i. i \<in> l} \<in> set ` sorted_list_of_set ` L
[PROOF STEP]
assume xl: "x \<in> L"
[PROOF STATE]
proof (state)
this:
x \<in> L

goal (2 subgoals):
 1. \<And>x xa xb. xb \<in> L \<Longrightarrow> \<exists>l. set (sorted_list_of_set xb) = {i. i \<in> l} \<and> l \<in> L
 2. \<And>x l. l \<in> L \<Longrightarrow> {i. i \<in> l} \<in> set ` sorted_list_of_set ` L
[PROOF STEP]
hence fx: "finite x"
[PROOF STATE]
proof (prove)
using this:
x \<in> L

goal (1 subgoal):
 1. finite x
[PROOF STEP]
using l
[PROOF STATE]
proof (prove)
using this:
x \<in> L
\<forall>l\<in>L. finite l

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

goal (2 subgoals):
 1. \<And>x xa xb. xb \<in> L \<Longrightarrow> \<exists>l. set (sorted_list_of_set xb) = {i. i \<in> l} \<and> l \<in> L
 2. \<And>x l. l \<in> L \<Longrightarrow> {i. i \<in> l} \<in> set ` sorted_list_of_set ` L
[PROOF STEP]
show exl: "\<exists>l. set (sorted_list_of_set x) = {i. i \<in> l} \<and> l \<in> L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>l. set (sorted_list_of_set x) = {i. i \<in> l} \<and> l \<in> L
[PROOF STEP]
by (rule exI [of _ x], auto simp add: xl fx)
[PROOF STATE]
proof (state)
this:
\<exists>l. set (sorted_list_of_set x) = {i. i \<in> l} \<and> l \<in> L

goal (1 subgoal):
 1. \<And>x l. l \<in> L \<Longrightarrow> {i. i \<in> l} \<in> set ` sorted_list_of_set ` L
[PROOF STEP]
show "{i. i \<in> x} \<in> set ` sorted_list_of_set ` L"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {i. i \<in> x} \<in> set ` sorted_list_of_set ` L
[PROOF STEP]
by (metis Collect_mem_eq exl fx image_iff set_sorted_list_of_set)
[PROOF STATE]
proof (state)
this:
{i. i \<in> x} \<in> set ` sorted_list_of_set ` L

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma monom_times_poly_shift':
  assumes "poly_subdegree p \<ge> n"
  shows   "monom (1 :: 'a :: comm_semiring_1) n * poly_shift n p = p"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. monom (1::'a) n * poly_shift n p = p
[PROOF STEP]
by (simp add: monom_times_poly_shift[OF assms])


[STATEMENT]
lemma deriv_scaleR_right_id [simp]:
  "(deriv ((*\<^sub>R) k)) = (\<lambda>z. k *\<^sub>R 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deriv ((*\<^sub>R) k) = (\<lambda>z. k *\<^sub>R (1::'a))
[PROOF STEP]
using DERIV_imp_deriv has_field_derivative_scaleR_right DERIV_ident
[PROOF STATE]
proof (prove)
using this:
(?f has_field_derivative ?f') (at ?x) \<Longrightarrow> deriv ?f ?x = ?f'
(?f has_field_derivative ?D) ?F \<Longrightarrow> ((\<lambda>x. ?c *\<^sub>R ?f x) has_field_derivative ?c *\<^sub>R ?D) ?F
((\<lambda>x. x) has_field_derivative (1::?'a)) ?F

goal (1 subgoal):
 1. deriv ((*\<^sub>R) k) = (\<lambda>z. k *\<^sub>R (1::'a))
[PROOF STEP]
by blast


[STATEMENT]
lemma hyp_eq_minus_divide_eq [divide_simps]:
  fixes a b c :: "('a :: {inverse, comm_ring_1, division_ring}) hyperdual"
  shows "a = - (b / c) \<longleftrightarrow> (if Base c \<noteq> 0 then a * c = - b else a = 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a = - (b / c)) = (if Base c \<noteq> (0::'a) then a * c = - b else a = 0)
[PROOF STEP]
by (metis hyp_minus_divide_eq_eq)


[STATEMENT]
lemma not_trivial_limit_within: "\<not> trivial_limit (at x within S) = (x \<in> closure (S - {x}))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (at x within S = bot) \<noteq> (x \<in> closure (S - {x}))
[PROOF STEP]
using islimpt_in_closure
[PROOF STATE]
proof (prove)
using this:
?x islimpt ?S = (?x \<in> closure (?S - {?x}))

goal (1 subgoal):
 1. (at x within S = bot) \<noteq> (x \<in> closure (S - {x}))
[PROOF STEP]
by (metis trivial_limit_within)


[STATEMENT]
lemma non_empty_col_alt_def:
  assumes "j < dim_col M"
  shows "non_empty_col M j \<longleftrightarrow> (\<exists> i. i < dim_row M \<and> M $$ (i, j) \<noteq> 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. non_empty_col M j = (\<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a))
[PROOF STEP]
proof (intro iffI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. non_empty_col M j \<Longrightarrow> \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a)
 2. \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a) \<Longrightarrow> non_empty_col M j
[PROOF STEP]
show "non_empty_col M j \<Longrightarrow> \<exists>i<dim_row M. M $$ (i, j) \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. non_empty_col M j \<Longrightarrow> \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a)
[PROOF STEP]
by(metis assms index_col non_empty_col_obtains)
[PROOF STATE]
proof (state)
this:
non_empty_col M j \<Longrightarrow> \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a) \<Longrightarrow> non_empty_col M j
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a) \<Longrightarrow> non_empty_col M j
[PROOF STEP]
assume "\<exists>i<dim_row M. M $$ (i, j) \<noteq> 0"
[PROOF STATE]
proof (state)
this:
\<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a) \<Longrightarrow> non_empty_col M j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a)
[PROOF STEP]
obtain i where ilt: " i < dim_row M" and ne: "M $$ (i, j) \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<And>i. \<lbrakk>i < dim_row M; M $$ (i, j) \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
i < dim_row M
M $$ (i, j) \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a) \<Longrightarrow> non_empty_col M j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_row M
M $$ (i, j) \<noteq> (0::'a)
[PROOF STEP]
have ilt2: " i < dim_vec (col M j)"
[PROOF STATE]
proof (prove)
using this:
i < dim_row M
M $$ (i, j) \<noteq> (0::'a)

goal (1 subgoal):
 1. i < dim_vec (col M j)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
i < dim_vec (col M j)

goal (1 subgoal):
 1. \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a) \<Longrightarrow> non_empty_col M j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
i < dim_vec (col M j)
[PROOF STEP]
have "(col M j) $ i \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (col M j)

goal (1 subgoal):
 1. col M j $ i \<noteq> (0::'a)
[PROOF STEP]
using ne
[PROOF STATE]
proof (prove)
using this:
i < dim_vec (col M j)
M $$ (i, j) \<noteq> (0::'a)

goal (1 subgoal):
 1. col M j $ i \<noteq> (0::'a)
[PROOF STEP]
by (simp add: assms)
[PROOF STATE]
proof (state)
this:
col M j $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a) \<Longrightarrow> non_empty_col M j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
col M j $ i \<noteq> (0::'a)
[PROOF STEP]
obtain k where "(col M j) $ i = k" and "k \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
col M j $ i \<noteq> (0::'a)

goal (1 subgoal):
 1. (\<And>k. \<lbrakk>col M j $ i = k; k \<noteq> (0::'a)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
col M j $ i = k
k \<noteq> (0::'a)

goal (1 subgoal):
 1. \<exists>i<dim_row M. M $$ (i, j) \<noteq> (0::'a) \<Longrightarrow> non_empty_col M j
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
col M j $ i = k
k \<noteq> (0::'a)
[PROOF STEP]
show "non_empty_col M j "
[PROOF STATE]
proof (prove)
using this:
col M j $ i = k
k \<noteq> (0::'a)

goal (1 subgoal):
 1. non_empty_col M j
[PROOF STEP]
using non_empty_col_def
[PROOF STATE]
proof (prove)
using this:
col M j $ i = k
k \<noteq> (0::'a)
non_empty_col ?M ?j \<equiv> \<exists>k. k \<noteq> (0::?'a) \<and> k \<in>$ col ?M ?j

goal (1 subgoal):
 1. non_empty_col M j
[PROOF STEP]
by (metis ilt2 vec_setI)
[PROOF STATE]
proof (state)
this:
non_empty_col M j

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma star_mult_capped_omega:
  assumes "y \<le> u"
      and "u * v \<le> v"
    shows "y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
have "y * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. y * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
using assms unfold_capped_omega
[PROOF STATE]
proof (prove)
using this:
y \<le> u
u * v \<le> v
\<lbrakk>?y \<le> ?u; ?u * ?v \<le> ?v\<rbrakk> \<Longrightarrow> ?y * ?y\<^sup>\<omega>\<^sub>?v = ?y\<^sup>\<omega>\<^sub>?v

goal (1 subgoal):
 1. y * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
y * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v

goal (1 subgoal):
 1. y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
hence "y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v \<le> y\<^sup>\<omega>\<^sub>v"
[PROOF STATE]
proof (prove)
using this:
y * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v

goal (1 subgoal):
 1. y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v \<le> y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
by (simp add: star_left_induct_mult)
[PROOF STATE]
proof (state)
this:
y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v \<le> y\<^sup>\<omega>\<^sub>v

goal (1 subgoal):
 1. y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v \<le> y\<^sup>\<omega>\<^sub>v

goal (1 subgoal):
 1. y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v
[PROOF STEP]
by (metis sup_ge2 order.antisym star.circ_loop_fixpoint)
[PROOF STATE]
proof (state)
this:
y\<^sup>\<star> * y\<^sup>\<omega>\<^sub>v = y\<^sup>\<omega>\<^sub>v

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nn_integral_nats_reals:
  shows "(\<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV) = \<integral>\<^sup>+x\<in>{0::real..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
have "x < 1 + (floor x)"for x::real
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x < real_of_int (1 + \<lfloor>x\<rfloor>)
[PROOF STEP]
by linarith
[PROOF STATE]
proof (state)
this:
?x < real_of_int (1 + \<lfloor>?x\<rfloor>)

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
?x < real_of_int (1 + \<lfloor>?x\<rfloor>)
[PROOF STEP]
have "\<exists>n. real n \<le> x \<and> x < 1 + real n" if "x \<ge> 0" for x
[PROOF STATE]
proof (prove)
using this:
?x < real_of_int (1 + \<lfloor>?x\<rfloor>)

goal (1 subgoal):
 1. \<exists>n. real n \<le> x \<and> x < 1 + real n
[PROOF STEP]
using that of_nat_floor
[PROOF STATE]
proof (prove)
using this:
?x < real_of_int (1 + \<lfloor>?x\<rfloor>)
0 \<le> x
(0::?'a) \<le> ?r \<Longrightarrow> of_nat (nat \<lfloor>?r\<rfloor>) \<le> ?r

goal (1 subgoal):
 1. \<exists>n. real n \<le> x \<and> x < 1 + real n
[PROOF STEP]
by (intro exI[of _ "nat (floor x)"]) auto
[PROOF STATE]
proof (state)
this:
0 \<le> ?x \<Longrightarrow> \<exists>n. real n \<le> ?x \<and> ?x < 1 + real n

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
0 \<le> ?x \<Longrightarrow> \<exists>n. real n \<le> ?x \<and> ?x < 1 + real n
[PROOF STEP]
have "{0..} = (\<Union>n. {real n..<real (Suc n)})"
[PROOF STATE]
proof (prove)
using this:
0 \<le> ?x \<Longrightarrow> \<exists>n. real n \<le> ?x \<and> ?x < 1 + real n

goal (1 subgoal):
 1. {0..} = (\<Union>n. {real n..<real (Suc n)})
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
{0..} = (\<Union>n. {real n..<real (Suc n)})

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
{0..} = (\<Union>n. {real n..<real (Suc n)})
[PROOF STEP]
have "\<integral>\<^sup>+x\<in>{0::real..}. f (nat \<lfloor>x\<rfloor>)\<partial>lborel =
             (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel)"
[PROOF STATE]
proof (prove)
using this:
{0..} = (\<Union>n. {real n..<real (Suc n)})

goal (1 subgoal):
 1. \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel = (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel)
[PROOF STEP]
by (auto simp add: disjoint_family_on_def nn_integral_disjoint_family)
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel = (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel)

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel = (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel)

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
have "\<dots> = (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f n)\<partial>lborel)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel) = (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f n)\<partial>lborel)
[PROOF STEP]
by(subst suminf_cong,rule nn_integral_cong_AE)
      (auto intro!: eventuallyI  simp add: indicator_def floor_eq4)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel) = (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f n)\<partial>lborel)

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel) = (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f n)\<partial>lborel)

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
have "\<dots> = (\<Sum>n. ennreal (f n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f n)\<partial>lborel) = (\<Sum>n. ennreal (f n))
[PROOF STEP]
by (auto intro!: suminf_cong simp add: nn_integral_cmult)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f n)\<partial>lborel) = (\<Sum>n. ennreal (f n))

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>n. \<integral>\<^sup>+x\<in>{real n..<1 + real n}. ennreal (f n)\<partial>lborel) = (\<Sum>n. ennreal (f n))

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
have "\<dots> = (\<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>n. ennreal (f n)) = \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV
[PROOF STEP]
by (simp add: nn_integral_count_space_nat)
[PROOF STATE]
proof (state)
this:
(\<Sum>n. ennreal (f n)) = \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
\<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel = \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel = \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV

goal (1 subgoal):
 1. \<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<integral>\<^sup>+ i. ennreal (f i) \<partial>count_space UNIV = \<integral>\<^sup>+x\<in>{0..}. ennreal (f (nat \<lfloor>x\<rfloor>))\<partial>lborel

goal:
No subgoals!
[PROOF STEP]
qed