[STATEMENT]
theorem (*9*) chain4_alt:
  assumes path_Q: "Q \<in> \<P>"
      and abcd_inQ: "{a,b,c,d} \<subseteq> Q"
      and abcd_distinct: "card {a,b,c,d} = 4"
    shows "ch {a,b,c,d}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ch {a, b, c, d}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ch {a, b, c, d}
[PROOF STEP]
have abcd_neq: "a \<noteq> b \<and> a \<noteq> c \<and> a \<noteq> d \<and> b \<noteq> c \<and> b \<noteq> d \<and> c \<noteq> d"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<noteq> b \<and> a \<noteq> c \<and> a \<noteq> d \<and> b \<noteq> c \<and> b \<noteq> d \<and> c \<noteq> d
[PROOF STEP]
using abcd_distinct numeral_3_eq_3
[PROOF STATE]
proof (prove)
using this:
card {a, b, c, d} = 4
3 = Suc (Suc (Suc 0))

goal (1 subgoal):
 1. a \<noteq> b \<and> a \<noteq> c \<and> a \<noteq> d \<and> b \<noteq> c \<and> b \<noteq> d \<and> c \<noteq> d
[PROOF STEP]
by (smt (z3) card_1_singleton_iff card_2_iff card_3_dist insert_absorb2 insert_commute numeral_1_eq_Suc_0 numeral_eq_iff semiring_norm(85) semiring_norm(88) verit_eq_simplify(8))
[PROOF STATE]
proof (state)
this:
a \<noteq> b \<and> a \<noteq> c \<and> a \<noteq> d \<and> b \<noteq> c \<and> b \<noteq> d \<and> c \<noteq> d

goal (1 subgoal):
 1. ch {a, b, c, d}
[PROOF STEP]
have inQ: "a \<in> Q" "b \<in> Q" "c \<in> Q" "d \<in> Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a \<in> Q &&& b \<in> Q) &&& c \<in> Q &&& d \<in> Q
[PROOF STEP]
using abcd_inQ
[PROOF STATE]
proof (prove)
using this:
{a, b, c, d} \<subseteq> Q

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

goal (1 subgoal):
 1. ch {a, b, c, d}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ch {a, b, c, d}
[PROOF STEP]
using chain4[OF assms(1) inQ] abcd_neq
[PROOF STATE]
proof (prove)
using this:
a \<noteq> b \<and> a \<noteq> c \<and> a \<noteq> d \<and> b \<noteq> c \<and> b \<noteq> d \<and> c \<noteq> d \<Longrightarrow> ch {a, b, c, d}
a \<noteq> b \<and> a \<noteq> c \<and> a \<noteq> d \<and> b \<noteq> c \<and> b \<noteq> d \<and> c \<noteq> d

goal (1 subgoal):
 1. ch {a, b, c, d}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ch {a, b, c, d}

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma matrix_to_iarray_Hermite_reduce_above:
  fixes A::"'a::{unique_euclidean_ring}^'cols::{mod_type}^'rows::{mod_type}"
  assumes "n<nrows A"
  shows "matrix_to_iarray (Hermite_reduce_above A n i j res)
  = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (to_nat i) (to_nat j) res"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
n < nrows A

goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
proof (induct n arbitrary: A)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>A. 0 < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A 0 i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) 0 (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
 2. \<And>n A. \<lbrakk>\<And>A. n < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res; Suc n < nrows A\<rbrakk> \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
0 < nrows A

goal (2 subgoals):
 1. \<And>A. 0 < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A 0 i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) 0 (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
 2. \<And>n A. \<lbrakk>\<And>A. n < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res; Suc n < nrows A\<rbrakk> \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
0 < nrows A

goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above A 0 i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) 0 (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
matrix_to_iarray (Hermite_reduce_above A 0 i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) 0 (mod_type_class.to_nat i) (mod_type_class.to_nat j) res

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. n < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res; Suc n < nrows A\<rbrakk> \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. n < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res; Suc n < nrows A\<rbrakk> \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
n < nrows ?A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above ?A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray ?A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
Suc n < nrows A

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. n < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res; Suc n < nrows A\<rbrakk> \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
have n: "n<nrows A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n < nrows A
[PROOF STEP]
using Suc.prems
[PROOF STATE]
proof (prove)
using this:
Suc n < nrows A

goal (1 subgoal):
 1. n < nrows A
[PROOF STEP]
unfolding nrows_def
[PROOF STATE]
proof (prove)
using this:
Suc n < CARD('rows)

goal (1 subgoal):
 1. n < CARD('rows)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
n < nrows A

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. n < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res; Suc n < nrows A\<rbrakk> \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
obtain a::'rows where n_tna: "n = to_nat a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>a. n = mod_type_class.to_nat a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (metis Suc.prems Suc_lessD nrows_def to_nat_from_nat_id)
[PROOF STATE]
proof (state)
this:
n = mod_type_class.to_nat a

goal (1 subgoal):
 1. \<And>n A. \<lbrakk>\<And>A. n < nrows A \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res; Suc n < nrows A\<rbrakk> \<Longrightarrow> matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
unfolding Hermite_reduce_above.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (let i' = mod_type_class.from_nat n; Aij = A $ i $ j; Ai'j = A $ i' $ j in Hermite_reduce_above (row_add A i' i ((res Aij Ai'j - Ai'j) div Aij)) n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
unfolding Hermite_reduce_above_iarrays.simps
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (let i' = mod_type_class.from_nat n; Aij = A $ i $ j; Ai'j = A $ i' $ j in Hermite_reduce_above (row_add A i' i ((res Aij Ai'j - Ai'j) div Aij)) n i j res) = (let i' = n; Aij = matrix_to_iarray A !! mod_type_class.to_nat i !! mod_type_class.to_nat j; Ai'j = matrix_to_iarray A !! i' !! mod_type_class.to_nat j in Hermite_reduce_above_iarrays (row_add_iarray (matrix_to_iarray A) i' (mod_type_class.to_nat i) ((res Aij Ai'j - Ai'j) div Aij)) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res)
[PROOF STEP]
unfolding Let_def sub_def[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above (row_add A (mod_type_class.from_nat n) i ((res (A $ i $ j) (A $ mod_type_class.from_nat n $ j) - A $ mod_type_class.from_nat n $ j) div A $ i $ j)) n i j res) = Hermite_reduce_above_iarrays (row_add_iarray (matrix_to_iarray A) n (mod_type_class.to_nat i) ((res (matrix_to_iarray A !! mod_type_class.to_nat i !! mod_type_class.to_nat j) (matrix_to_iarray A !! n !! mod_type_class.to_nat j) - matrix_to_iarray A !! n !! mod_type_class.to_nat j) div matrix_to_iarray A !! mod_type_class.to_nat i !! mod_type_class.to_nat j)) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
unfolding n_tna
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above (row_add A (mod_type_class.from_nat (mod_type_class.to_nat a)) i ((res (A $ i $ j) (A $ mod_type_class.from_nat (mod_type_class.to_nat a) $ j) - A $ mod_type_class.from_nat (mod_type_class.to_nat a) $ j) div A $ i $ j)) (mod_type_class.to_nat a) i j res) = Hermite_reduce_above_iarrays (row_add_iarray (matrix_to_iarray A) (mod_type_class.to_nat a) (mod_type_class.to_nat i) ((res (matrix_to_iarray A !! mod_type_class.to_nat i !! mod_type_class.to_nat j) (matrix_to_iarray A !! mod_type_class.to_nat a !! mod_type_class.to_nat j) - matrix_to_iarray A !! mod_type_class.to_nat a !! mod_type_class.to_nat j) div matrix_to_iarray A !! mod_type_class.to_nat i !! mod_type_class.to_nat j)) (mod_type_class.to_nat a) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
unfolding matrix_to_iarray_row_add[symmetric] from_nat_to_nat_id
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above (row_add A a i ((res (A $ i $ j) (A $ a $ j) - A $ a $ j) div A $ i $ j)) (mod_type_class.to_nat a) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray (row_add A a i ((res (matrix_to_iarray A !! mod_type_class.to_nat i !! mod_type_class.to_nat j) (matrix_to_iarray A !! mod_type_class.to_nat a !! mod_type_class.to_nat j) - matrix_to_iarray A !! mod_type_class.to_nat a !! mod_type_class.to_nat j) div matrix_to_iarray A !! mod_type_class.to_nat i !! mod_type_class.to_nat j))) (mod_type_class.to_nat a) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
unfolding matrix_to_iarray_nth
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above (row_add A a i ((res (A $ i $ j) (A $ a $ j) - A $ a $ j) div A $ i $ j)) (mod_type_class.to_nat a) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray (row_add A a i ((res (A $ i $ j) (A $ a $ j) - A $ a $ j) div A $ i $ j))) (mod_type_class.to_nat a) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
unfolding n_tna[symmetric]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. matrix_to_iarray (Hermite_reduce_above (row_add A a i ((res (A $ i $ j) (A $ a $ j) - A $ a $ j) div A $ i $ j)) n i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray (row_add A a i ((res (A $ i $ j) (A $ a $ j) - A $ a $ j) div A $ i $ j))) n (mod_type_class.to_nat i) (mod_type_class.to_nat j) res
[PROOF STEP]
by (rule Suc.hyps, auto simp add: nrows_def n[unfolded nrows_def])
[PROOF STATE]
proof (state)
this:
matrix_to_iarray (Hermite_reduce_above A (Suc n) i j res) = Hermite_reduce_above_iarrays (matrix_to_iarray A) (Suc n) (mod_type_class.to_nat i) (mod_type_class.to_nat j) res

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma app_vconverseD[sym, dest]:
  assumes "\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ>"
  shows "\<langle>b, a\<rangle> \<in>\<^sub>\<circ> r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<langle>b, a\<rangle> \<in>\<^sub>\<circ> r
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<langle>a, b\<rangle> \<in>\<^sub>\<circ> r\<inverse>\<^sub>\<circ>

goal (1 subgoal):
 1. \<langle>b, a\<rangle> \<in>\<^sub>\<circ> r
[PROOF STEP]
unfolding vconverse_def
[PROOF STATE]
proof (prove)
using this:
\<langle>a, b\<rangle> \<in>\<^sub>\<circ> (\<lambda>r\<in>\<^sub>\<circ>set {r}. set {\<langle>b, a\<rangle> |a b. \<langle>a, b\<rangle> \<in>\<^sub>\<circ> r})\<lparr>r\<rparr>

goal (1 subgoal):
 1. \<langle>b, a\<rangle> \<in>\<^sub>\<circ> r
[PROOF STEP]
by simp


[STATEMENT]
lemma deg_fun_superset:
  fixes A::"'a set"
  assumes "supp_fun s \<subseteq> A" and "finite A"
  shows "deg_fun s = (\<Sum>x\<in>A. s x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. deg_fun s = sum s A
[PROOF STEP]
unfolding deg_fun_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sum s (supp_fun s) = sum s A
[PROOF STEP]
proof (rule sum.mono_neutral_cong_left, fact, fact, rule)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> A - supp_fun s \<Longrightarrow> s i = (0::'b)
 2. \<And>x. x \<in> supp_fun s \<Longrightarrow> s x = s x
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i. i \<in> A - supp_fun s \<Longrightarrow> s i = (0::'b)
 2. \<And>x. x \<in> supp_fun s \<Longrightarrow> s x = s x
[PROOF STEP]
assume "x \<in> A - supp_fun s"
[PROOF STATE]
proof (state)
this:
x \<in> A - supp_fun s

goal (2 subgoals):
 1. \<And>i. i \<in> A - supp_fun s \<Longrightarrow> s i = (0::'b)
 2. \<And>x. x \<in> supp_fun s \<Longrightarrow> s x = s x
[PROOF STEP]
hence "x \<notin> supp_fun s"
[PROOF STATE]
proof (prove)
using this:
x \<in> A - supp_fun s

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

goal (2 subgoals):
 1. \<And>i. i \<in> A - supp_fun s \<Longrightarrow> s i = (0::'b)
 2. \<And>x. x \<in> supp_fun s \<Longrightarrow> s x = s x
[PROOF STEP]
thus "s x = 0"
[PROOF STATE]
proof (prove)
using this:
x \<notin> supp_fun s

goal (1 subgoal):
 1. s x = (0::'b)
[PROOF STEP]
by (simp add: supp_fun_def)
[PROOF STATE]
proof (state)
this:
s x = (0::'b)

goal (1 subgoal):
 1. \<And>x. x \<in> supp_fun s \<Longrightarrow> s x = s x
[PROOF STEP]
qed rule


[STATEMENT]
lemma directly_subsumes_transitive:
  assumes p1: "directly_subsumes e1 e2 s1 s2 t1 t2"
      and p2: "directly_subsumes e1 e2 s1 s2 t2 t3"
  shows "directly_subsumes e1 e2 s1 s2 t1 t3"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directly_subsumes e1 e2 s1 s2 t1 t3
[PROOF STEP]
text_raw\<open>}%endsnip\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. directly_subsumes e1 e2 s1 s2 t1 t3
[PROOF STEP]
using p1 p2
[PROOF STATE]
proof (prove)
using this:
directly_subsumes e1 e2 s1 s2 t1 t2
directly_subsumes e1 e2 s1 s2 t2 t3

goal (1 subgoal):
 1. directly_subsumes e1 e2 s1 s2 t1 t3
[PROOF STEP]
apply (simp add: directly_subsumes_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>c1 c2. (\<exists>t. obtains s1 c1 e1 0 <> t \<and> obtains s2 c2 e2 0 <> t) \<longrightarrow> subsumes t1 c2 t2; \<forall>c1 c2. (\<exists>t. obtains s1 c1 e1 0 <> t \<and> obtains s2 c2 e2 0 <> t) \<longrightarrow> subsumes t2 c2 t3\<rbrakk> \<Longrightarrow> \<forall>c1 c2. (\<exists>t. obtains s1 c1 e1 0 <> t \<and> obtains s2 c2 e2 0 <> t) \<longrightarrow> subsumes t1 c2 t3
[PROOF STEP]
using subsumes_transitive
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>subsumes ?t1.0 ?c ?t2.0; subsumes ?t2.0 ?c ?t3.0\<rbrakk> \<Longrightarrow> subsumes ?t1.0 ?c ?t3.0

goal (1 subgoal):
 1. \<lbrakk>\<forall>c1 c2. (\<exists>t. obtains s1 c1 e1 0 <> t \<and> obtains s2 c2 e2 0 <> t) \<longrightarrow> subsumes t1 c2 t2; \<forall>c1 c2. (\<exists>t. obtains s1 c1 e1 0 <> t \<and> obtains s2 c2 e2 0 <> t) \<longrightarrow> subsumes t2 c2 t3\<rbrakk> \<Longrightarrow> \<forall>c1 c2. (\<exists>t. obtains s1 c1 e1 0 <> t \<and> obtains s2 c2 e2 0 <> t) \<longrightarrow> subsumes t1 c2 t3
[PROOF STEP]
by blast


[STATEMENT]
lemma col_mat_of_cols_list [simp]:
  assumes "j < length l"
  shows "Matrix.col (mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)
[PROOF STEP]
define u where "u = Matrix.col (mat_of_cols_list (length (l ! j)) l) j"
[PROOF STATE]
proof (state)
this:
u = Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j

goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
u = Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j
[PROOF STEP]
have "dim_vec u = dim_vec (vec_of_list (l ! j))"
[PROOF STATE]
proof (prove)
using this:
u = Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j

goal (1 subgoal):
 1. dim_vec u = dim_vec (vec_of_list (l ! j))
[PROOF STEP]
by (auto simp: u_def mat_of_cols_list_def Matrix.col_def vec_of_list_def)
      (metis dim_vec_of_list vec_of_list.abs_eq)
[PROOF STATE]
proof (state)
this:
dim_vec u = dim_vec (vec_of_list (l ! j))

goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
dim_vec u = dim_vec (vec_of_list (l ! j))

goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)
[PROOF STEP]
have "\<forall>i<length(l ! j). u $ i = vec_of_list (l ! j) $ i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length (l ! j). u $ i = vec_of_list (l ! j) $ i
[PROOF STEP]
by (simp add: u_def vec_of_list_index mat_of_cols_list_def assms)
[PROOF STATE]
proof (state)
this:
\<forall>i<length (l ! j). u $ i = vec_of_list (l ! j) $ i

goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
dim_vec u = dim_vec (vec_of_list (l ! j))
\<forall>i<length (l ! j). u $ i = vec_of_list (l ! j) $ i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
dim_vec u = dim_vec (vec_of_list (l ! j))
\<forall>i<length (l ! j). u $ i = vec_of_list (l ! j) $ i

goal (1 subgoal):
 1. Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)
[PROOF STEP]
by(simp add: vec_eq_iff u_def)
[PROOF STATE]
proof (state)
this:
Matrix.col (Tensor.mat_of_cols_list (length (l ! j)) l) j = vec_of_list (l ! j)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma cindex_pathE_shiftpath:
  assumes "finite_ReZ_segments g z" "s\<in>{0..1}" "path g" and loop:"pathfinish g = pathstart g"
  shows "cindex_pathE (shiftpath s g) z = cindex_pathE g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
define f where "f=(\<lambda>g t. Im (g (t::real) - z) / Re (g t - z))"
[PROOF STATE]
proof (state)
this:
f = (\<lambda>g t. Im (g t - z) / Re (g t - z))

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
have "cindex_pathE (shiftpath s g) z = cindexE 0 1 (f (shiftpath s g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindexE 0 1 (f (shiftpath s g))
[PROOF STEP]
unfolding cindex_pathE_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (shiftpath s g t - z) / Re (shiftpath s g t - z)) = cindexE 0 1 (\<lambda>t. Im (shiftpath s g t - z) / Re (shiftpath s g t - z))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindex_pathE (shiftpath s g) z = cindexE 0 1 (f (shiftpath s g))

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindex_pathE (shiftpath s g) z = cindexE 0 1 (f (shiftpath s g))

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
have "... = cindexE 0 (1-s) (f (shiftpath s g)) + cindexE (1-s) 1 (f (shiftpath s g))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f (shiftpath s g)) = cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g))
[PROOF STEP]
proof (rule cindexE_combine)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite_jumpFs (f (shiftpath s g)) 0 1
 2. 0 \<le> 1 - s
 3. 1 - s \<le> 1
[PROOF STEP]
have "finite_ReZ_segments (shiftpath s g) z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_ReZ_segments (shiftpath s g) z
[PROOF STEP]
using finite_ReZ_segments_shiftpah[OF assms]
[PROOF STATE]
proof (prove)
using this:
finite_ReZ_segments (shiftpath s g) z

goal (1 subgoal):
 1. finite_ReZ_segments (shiftpath s g) z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
finite_ReZ_segments (shiftpath s g) z

goal (3 subgoals):
 1. finite_jumpFs (f (shiftpath s g)) 0 1
 2. 0 \<le> 1 - s
 3. 1 - s \<le> 1
[PROOF STEP]
from finite_ReZ_segments_imp_jumpFs[OF this] path_shiftpath[OF \<open>path g\<close> loop \<open>s\<in>{0..1}\<close>]
[PROOF STATE]
proof (chain)
picking this:
path (shiftpath s g) \<Longrightarrow> finite_jumpFs (\<lambda>t. Im (shiftpath s g t - z) / Re (shiftpath s g t - z)) 0 1
path (shiftpath s g)
[PROOF STEP]
show "finite_jumpFs (f (shiftpath s g)) 0 1"
[PROOF STATE]
proof (prove)
using this:
path (shiftpath s g) \<Longrightarrow> finite_jumpFs (\<lambda>t. Im (shiftpath s g t - z) / Re (shiftpath s g t - z)) 0 1
path (shiftpath s g)

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

goal (1 subgoal):
 1. finite_jumpFs (\<lambda>t. Im (shiftpath s g t - z) / Re (shiftpath s g t - z)) 0 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite_jumpFs (f (shiftpath s g)) 0 1

goal (2 subgoals):
 1. 0 \<le> 1 - s
 2. 1 - s \<le> 1
[PROOF STEP]
show "0 \<le> 1 - s" "1 - s \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> 1 - s &&& 1 - s \<le> 1
[PROOF STEP]
using \<open>s\<in>{0..1}\<close>
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..1}

goal (1 subgoal):
 1. 0 \<le> 1 - s &&& 1 - s \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> 1 - s
1 - s \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f (shiftpath s g)) = cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g))

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f (shiftpath s g)) = cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g))

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
have "... = cindexE 0 s (f g) + cindexE s 1 (f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)
[PROOF STEP]
have "cindexE 0 (1-s) (f (shiftpath s g)) = cindexE s 1 (f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
[PROOF STEP]
have "cindexE 0 (1-s) (f (shiftpath s g)) = cindexE 0 (1-s) ((f g) o (\<lambda>t. t+s))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE 0 (1 - s) (f g \<circ> (\<lambda>t. t + s))
[PROOF STEP]
apply (rule cindexE_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>0 < x; x < 1 - s; x \<notin> ?s\<rbrakk> \<Longrightarrow> f (shiftpath s g) x = (f g \<circ> (\<lambda>t. t + s)) x
[PROOF STEP]
unfolding shiftpath_def f_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>0 < x; x < 1 - s; x \<notin> ?s\<rbrakk> \<Longrightarrow> Im ((if s + x \<le> 1 then g (s + x) else g (s + x - 1)) - z) / Re ((if s + x \<le> 1 then g (s + x) else g (s + x - 1)) - z) = ((\<lambda>t. Im (g t - z) / Re (g t - z)) \<circ> (\<lambda>t. t + s)) x
[PROOF STEP]
using \<open>s\<in>{0..1}\<close>
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..1}

goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>0 < x; x < 1 - s; x \<notin> ?s\<rbrakk> \<Longrightarrow> Im ((if s + x \<le> 1 then g (s + x) else g (s + x - 1)) - z) / Re ((if s + x \<le> 1 then g (s + x) else g (s + x - 1)) - z) = ((\<lambda>t. Im (g t - z) / Re (g t - z)) \<circ> (\<lambda>t. t + s)) x
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE 0 (1 - s) (f g \<circ> (\<lambda>t. t + s))

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE 0 (1 - s) (f g \<circ> (\<lambda>t. t + s))

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
[PROOF STEP]
have "...= cindexE s 1 (f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 (1 - s) (f g \<circ> (\<lambda>t. t + s)) = cindexE s 1 (f g)
[PROOF STEP]
using cindexE_linear_comp[of 1 0 "1-s" "f g" s,simplified]
[PROOF STATE]
proof (prove)
using this:
cindexE 0 (1 - s) (f g \<circ> (\<lambda>x. x + s)) = cindexE s 1 (f g)

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f g \<circ> (\<lambda>t. t + s)) = cindexE s 1 (f g)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f g \<circ> (\<lambda>t. t + s)) = cindexE s 1 (f g)

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)
[PROOF STEP]
have "cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)
[PROOF STEP]
have "cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE (1-s) 1 ((f g) o (\<lambda>t. t+s-1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE (1 - s) 1 (f g \<circ> (\<lambda>t. t + s - 1))
[PROOF STEP]
apply (rule cindexE_cong)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>1 - s < x; x < 1; x \<notin> ?s\<rbrakk> \<Longrightarrow> f (shiftpath s g) x = (f g \<circ> (\<lambda>t. t + s - 1)) x
[PROOF STEP]
unfolding shiftpath_def f_def
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>1 - s < x; x < 1; x \<notin> ?s\<rbrakk> \<Longrightarrow> Im ((if s + x \<le> 1 then g (s + x) else g (s + x - 1)) - z) / Re ((if s + x \<le> 1 then g (s + x) else g (s + x - 1)) - z) = ((\<lambda>t. Im (g t - z) / Re (g t - z)) \<circ> (\<lambda>t. t + s - 1)) x
[PROOF STEP]
using \<open>s\<in>{0..1}\<close>
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..1}

goal (2 subgoals):
 1. finite ?s
 2. \<And>x. \<lbrakk>1 - s < x; x < 1; x \<notin> ?s\<rbrakk> \<Longrightarrow> Im ((if s + x \<le> 1 then g (s + x) else g (s + x - 1)) - z) / Re ((if s + x \<le> 1 then g (s + x) else g (s + x - 1)) - z) = ((\<lambda>t. Im (g t - z) / Re (g t - z)) \<circ> (\<lambda>t. t + s - 1)) x
[PROOF STEP]
by (auto simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE (1 - s) 1 (f g \<circ> (\<lambda>t. t + s - 1))

goal (1 subgoal):
 1. cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE (1 - s) 1 (f g \<circ> (\<lambda>t. t + s - 1))

goal (1 subgoal):
 1. cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)
[PROOF STEP]
have "... = cindexE 0 s (f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE (1 - s) 1 (f g \<circ> (\<lambda>t. t + s - 1)) = cindexE 0 s (f g)
[PROOF STEP]
using cindexE_linear_comp[of 1 "1-s" 1 "f g" "s-1",simplified]
[PROOF STATE]
proof (prove)
using this:
cindexE (1 - s) 1 (f g \<circ> (\<lambda>x. x + (s - 1))) = cindexE 0 s (f g)

goal (1 subgoal):
 1. cindexE (1 - s) 1 (f g \<circ> (\<lambda>t. t + s - 1)) = cindexE 0 s (f g)
[PROOF STEP]
by (simp add:algebra_simps)
[PROOF STATE]
proof (state)
this:
cindexE (1 - s) 1 (f g \<circ> (\<lambda>t. t + s - 1)) = cindexE 0 s (f g)

goal (1 subgoal):
 1. cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)

goal (1 subgoal):
 1. cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindexE 0 (1 - s) (f (shiftpath s g)) = cindexE s 1 (f g)
cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g)

goal (1 subgoal):
 1. cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 (1 - s) (f (shiftpath s g)) + cindexE (1 - s) 1 (f (shiftpath s g)) = cindexE 0 s (f g) + cindexE s 1 (f g)

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
have "... = cindexE 0 1 (f g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 s (f g) + cindexE s 1 (f g) = cindexE 0 1 (f g)
[PROOF STEP]
proof (rule cindexE_combine[symmetric])
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. finite_jumpFs (f g) 0 1
 2. 0 \<le> s
 3. s \<le> 1
[PROOF STEP]
show "finite_jumpFs (f g) 0 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite_jumpFs (f g) 0 1
[PROOF STEP]
using finite_ReZ_segments_imp_jumpFs[OF assms(1,3)]
[PROOF STATE]
proof (prove)
using this:
finite_jumpFs (\<lambda>t. Im (g t - z) / Re (g t - z)) 0 1

goal (1 subgoal):
 1. finite_jumpFs (f g) 0 1
[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

goal (1 subgoal):
 1. finite_jumpFs (\<lambda>t. Im (g t - z) / Re (g t - z)) 0 1
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
finite_jumpFs (f g) 0 1

goal (2 subgoals):
 1. 0 \<le> s
 2. s \<le> 1
[PROOF STEP]
show "0 \<le> s" "s\<le>1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> s &&& s \<le> 1
[PROOF STEP]
using \<open>s\<in>{0..1}\<close>
[PROOF STATE]
proof (prove)
using this:
s \<in> {0..1}

goal (1 subgoal):
 1. 0 \<le> s &&& s \<le> 1
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> s
s \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
cindexE 0 s (f g) + cindexE s 1 (f g) = cindexE 0 1 (f g)

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
cindexE 0 s (f g) + cindexE s 1 (f g) = cindexE 0 1 (f g)

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
have "... = cindex_pathE g z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (f g) = cindex_pathE g z
[PROOF STEP]
unfolding cindex_pathE_def f_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. cindexE 0 1 (\<lambda>t. Im (g t - z) / Re (g t - z)) = cindexE 0 1 (\<lambda>t. Im (g t - z) / Re (g t - z))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
cindexE 0 1 (f g) = cindex_pathE g z

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
cindex_pathE (shiftpath s g) z = cindex_pathE g z

goal (1 subgoal):
 1. cindex_pathE (shiftpath s g) z = cindex_pathE g z
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
cindex_pathE (shiftpath s g) z = cindex_pathE g z

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma "0 \<le> (x::real) \<and> 0 \<le> y \<and> x * y = 1 \<longrightarrow> x * y * (x + y) \<le> x\<^sup>2 + y\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> x \<and> 0 \<le> y \<and> x * y = 1 \<longrightarrow> x * y * (x + y) \<le> x\<^sup>2 + y\<^sup>2
[PROOF STEP]
by (sos "(((A<0 * R<1) + (([~1*x + ~1*y + 1] * A=0) + (R<1 * ((R<1 * [~1/2*x + ~1/2*y + 1]^2) + (R<3/4 * [~1*x + y]^2))))))")


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


[STATEMENT]
lemma coll_sum_list: "(\<And>y. y \<in> set ys \<Longrightarrow> coll 0 x y) \<Longrightarrow> coll 0 x (sum_list ys)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>y. y \<in> set ys \<Longrightarrow> coll 0 x y) \<Longrightarrow> coll 0 x (sum_list ys)
[PROOF STEP]
by (induct ys) (auto intro!: coll_add)


[STATEMENT]
lemma seq_monosub:
  fixes s :: "nat \<Rightarrow> 'a::linorder"
  shows "\<exists>f. strict_mono f \<and> monoseq (\<lambda>n. (s (f n)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
proof (cases "\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
 2. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p

goal (2 subgoals):
 1. \<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
 2. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p
[PROOF STEP]
have "\<exists>f. \<forall>n. (\<forall>m\<ge>f n. s m \<le> s (f n)) \<and> f n < f (Suc n)"
[PROOF STATE]
proof (prove)
using this:
\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p

goal (1 subgoal):
 1. \<exists>f. \<forall>n. (\<forall>m\<ge>f n. s m \<le> s (f n)) \<and> f n < f (Suc n)
[PROOF STEP]
by (intro dependent_nat_choice) (auto simp: conj_commute)
[PROOF STATE]
proof (state)
this:
\<exists>f. \<forall>n. (\<forall>m\<ge>f n. s m \<le> s (f n)) \<and> f n < f (Suc n)

goal (2 subgoals):
 1. \<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
 2. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. \<forall>n. (\<forall>m\<ge>f n. s m \<le> s (f n)) \<and> f n < f (Suc n)
[PROOF STEP]
obtain f :: "nat \<Rightarrow> nat"
    where f: "strict_mono f" and mono: "\<And>n m. f n \<le> m \<Longrightarrow> s m \<le> s (f n)"
[PROOF STATE]
proof (prove)
using this:
\<exists>f. \<forall>n. (\<forall>m\<ge>f n. s m \<le> s (f n)) \<and> f n < f (Suc n)

goal (1 subgoal):
 1. (\<And>f. \<lbrakk>strict_mono f; \<And>n m. f n \<le> m \<Longrightarrow> s m \<le> s (f n)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: strict_mono_Suc_iff)
[PROOF STATE]
proof (state)
this:
strict_mono f
f ?n \<le> ?m \<Longrightarrow> s ?m \<le> s (f ?n)

goal (2 subgoals):
 1. \<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
 2. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
strict_mono f
f ?n \<le> ?m \<Longrightarrow> s ?m \<le> s (f ?n)
[PROOF STEP]
have "incseq f"
[PROOF STATE]
proof (prove)
using this:
strict_mono f
f ?n \<le> ?m \<Longrightarrow> s ?m \<le> s (f ?n)

goal (1 subgoal):
 1. incseq f
[PROOF STEP]
unfolding strict_mono_Suc_iff incseq_Suc_iff
[PROOF STATE]
proof (prove)
using this:
\<forall>n. f n < f (Suc n)
f ?n \<le> ?m \<Longrightarrow> s ?m \<le> s (f ?n)

goal (1 subgoal):
 1. \<forall>n. f n \<le> f (Suc n)
[PROOF STEP]
by (auto intro: less_imp_le)
[PROOF STATE]
proof (state)
this:
incseq f

goal (2 subgoals):
 1. \<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
 2. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
incseq f
[PROOF STEP]
have "monoseq (\<lambda>n. s (f n))"
[PROOF STATE]
proof (prove)
using this:
incseq f

goal (1 subgoal):
 1. monoseq (\<lambda>n. s (f n))
[PROOF STEP]
by (auto simp add: incseq_def intro!: mono monoI2)
[PROOF STATE]
proof (state)
this:
monoseq (\<lambda>n. s (f n))

goal (2 subgoals):
 1. \<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
 2. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
with f
[PROOF STATE]
proof (chain)
picking this:
strict_mono f
monoseq (\<lambda>n. s (f n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
strict_mono f
monoseq (\<lambda>n. s (f n))

goal (1 subgoal):
 1. \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p)

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p)
[PROOF STEP]
obtain N where N: "p > N \<Longrightarrow> \<exists>m>p. s p < s m" for p
[PROOF STATE]
proof (prove)
using this:
\<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p)

goal (1 subgoal):
 1. (\<And>N. (\<And>p. N < p \<Longrightarrow> \<exists>m>p. s p < s m) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (force simp: not_le le_less)
[PROOF STATE]
proof (state)
this:
N < ?p \<Longrightarrow> \<exists>m>?p. s ?p < s m

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
have "\<exists>f. \<forall>n. N < f n \<and> f n < f (Suc n) \<and> s (f n) \<le> s (f (Suc n))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>f. \<forall>n. N < f n \<and> f n < f (Suc n) \<and> s (f n) \<le> s (f (Suc n))
[PROOF STEP]
proof (intro dependent_nat_choice)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> s x \<le> s y
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> s x \<le> s y
[PROOF STEP]
assume "N < x"
[PROOF STATE]
proof (state)
this:
N < x

goal (2 subgoals):
 1. \<exists>x. N < x
 2. \<And>x n. N < x \<Longrightarrow> \<exists>y>N. x < y \<and> s x \<le> s y
[PROOF STEP]
with N[of x]
[PROOF STATE]
proof (chain)
picking this:
N < x \<Longrightarrow> \<exists>m>x. s x < s m
N < x
[PROOF STEP]
show "\<exists>y>N. x < y \<and> s x \<le> s y"
[PROOF STATE]
proof (prove)
using this:
N < x \<Longrightarrow> \<exists>m>x. s x < s m
N < x

goal (1 subgoal):
 1. \<exists>y>N. x < y \<and> s x \<le> s y
[PROOF STEP]
by (auto intro: less_trans)
[PROOF STATE]
proof (state)
this:
\<exists>y>N. x < y \<and> s x \<le> s y

goal (1 subgoal):
 1. \<exists>x. N < x
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
\<exists>f. \<forall>n. N < f n \<and> f n < f (Suc n) \<and> s (f n) \<le> s (f (Suc n))

goal (1 subgoal):
 1. \<not> (\<forall>n. \<exists>p>n. \<forall>m\<ge>p. s m \<le> s p) \<Longrightarrow> \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>f. \<forall>n. N < f n \<and> f n < f (Suc n) \<and> s (f n) \<le> s (f (Suc n))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<exists>f. \<forall>n. N < f n \<and> f n < f (Suc n) \<and> s (f n) \<le> s (f (Suc n))

goal (1 subgoal):
 1. \<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))
[PROOF STEP]
by (auto simp: monoseq_iff incseq_Suc_iff strict_mono_Suc_iff)
[PROOF STATE]
proof (state)
this:
\<exists>f. strict_mono f \<and> monoseq (\<lambda>n. s (f n))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma image_inverse_permutations: "{inv p |p. p permutes S} = {p. p permutes S}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {inv p |p. p permutes S} = {p. p permutes S}
[PROOF STEP]
apply (rule set_eqI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (x \<in> {inv p |p. p permutes S}) = (x \<in> {p. p permutes S})
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>p. p permutes S \<Longrightarrow> inv p permutes S
 2. \<And>x. x permutes S \<Longrightarrow> \<exists>p. x = inv p \<and> p permutes S
[PROOF STEP]
using permutes_inv_inv permutes_inv
[PROOF STATE]
proof (prove)
using this:
?p permutes ?S \<Longrightarrow> inv (inv ?p) = ?p
?p permutes ?S \<Longrightarrow> inv ?p permutes ?S

goal (2 subgoals):
 1. \<And>p. p permutes S \<Longrightarrow> inv p permutes S
 2. \<And>x. x permutes S \<Longrightarrow> \<exists>p. x = inv p \<and> p permutes S
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x permutes S; \<And>p S. p permutes S \<Longrightarrow> inv (inv p) = p; \<And>p S. p permutes S \<Longrightarrow> inv p permutes S\<rbrakk> \<Longrightarrow> \<exists>p. x = inv p \<and> p permutes S
[PROOF STEP]
apply (rule_tac x="inv x" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x permutes S; \<And>p S. p permutes S \<Longrightarrow> inv (inv p) = p; \<And>p S. p permutes S \<Longrightarrow> inv p permutes S\<rbrakk> \<Longrightarrow> x = inv (inv x) \<and> inv x permutes S
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma (in group) generate_singleton_one:
  assumes "generate G {a} = {\<one>}"
  shows "a = \<one>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a = \<one>
[PROOF STEP]
using generate.incl[of a "{a}" G] assms
[PROOF STATE]
proof (prove)
using this:
a \<in> {a} \<Longrightarrow> a \<in> generate G {a}
generate G {a} = {\<one>}

goal (1 subgoal):
 1. a = \<one>
[PROOF STEP]
by auto


[STATEMENT]
lemma predicate_prob_positive:
  assumes "0\<^sub>m d d \<le>\<^sub>L P"
    and "\<rho> \<in> density_states"
  shows "0 \<le> trace (P * \<rho>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 0 \<le> trace (P * \<rho>)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. 0 \<le> trace (P * \<rho>)
[PROOF STEP]
have "trace (0\<^sub>m d d * \<rho>) \<le> trace (P * \<rho>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. trace (0\<^sub>m d d * \<rho>) \<le> trace (P * \<rho>)
[PROOF STEP]
apply (rule lowner_le_traceD)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. 0\<^sub>m d d \<in> carrier_mat ?n ?n
 2. P \<in> carrier_mat ?n ?n
 3. \<rho> \<in> carrier_mat ?n ?n
 4. 0\<^sub>m d d \<le>\<^sub>L P
 5. partial_density_operator \<rho>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
0\<^sub>m d d \<le>\<^sub>L P
\<rho> \<in> density_states

goal (5 subgoals):
 1. 0\<^sub>m d d \<in> carrier_mat ?n ?n
 2. P \<in> carrier_mat ?n ?n
 3. \<rho> \<in> carrier_mat ?n ?n
 4. 0\<^sub>m d d \<le>\<^sub>L P
 5. partial_density_operator \<rho>
[PROOF STEP]
unfolding lowner_le_def density_states_def
[PROOF STATE]
proof (prove)
using this:
dim_row (0\<^sub>m d d) = dim_row P \<and> dim_col (0\<^sub>m d d) = dim_col P \<and> positive (P - 0\<^sub>m d d)
\<rho> \<in> {\<rho> \<in> carrier_mat d d. partial_density_operator \<rho>}

goal (5 subgoals):
 1. 0\<^sub>m d d \<in> carrier_mat ?n ?n
 2. P \<in> carrier_mat ?n ?n
 3. \<rho> \<in> carrier_mat ?n ?n
 4. dim_row (0\<^sub>m d d) = dim_row P \<and> dim_col (0\<^sub>m d d) = dim_col P \<and> positive (P - 0\<^sub>m d d)
 5. partial_density_operator \<rho>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
trace (0\<^sub>m d d * \<rho>) \<le> trace (P * \<rho>)

goal (1 subgoal):
 1. 0 \<le> trace (P * \<rho>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
trace (0\<^sub>m d d * \<rho>) \<le> trace (P * \<rho>)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
trace (0\<^sub>m d d * \<rho>) \<le> trace (P * \<rho>)

goal (1 subgoal):
 1. 0 \<le> trace (P * \<rho>)
[PROOF STEP]
using assms(2) density_states_def
[PROOF STATE]
proof (prove)
using this:
trace (0\<^sub>m d d * \<rho>) \<le> trace (P * \<rho>)
\<rho> \<in> density_states
density_states = {\<rho> \<in> carrier_mat d d. partial_density_operator \<rho>}

goal (1 subgoal):
 1. 0 \<le> trace (P * \<rho>)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
0 \<le> trace (P * \<rho>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem JF2set_natural: "JF2set o (JF2map u) = image u o JF2set"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. JF2set \<circ> JF2map u = (`) u \<circ> JF2set
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (JF2set \<circ> JF2map u) x = ((`) u \<circ> JF2set) x
[PROOF STEP]
apply (rule trans[OF o_apply])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. JF2set (JF2map u x) = ((`) u \<circ> JF2set) x
[PROOF STEP]
apply (rule sym)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. ((`) u \<circ> JF2set) x = JF2set (JF2map u x)
[PROOF STEP]
apply (rule trans[OF o_apply])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. u ` JF2set x = JF2set (JF2map u x)
[PROOF STEP]
apply (rule trans[OF image_UN])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. (\<Union>xa. u ` JF2col xa x) = JF2set (JF2map u x)
[PROOF STEP]
apply (rule SUP_cong[OF refl])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> u ` JF2col xa x = JF2col xa (JF2map u x)
[PROOF STEP]
apply (rule conjunct2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x xa. xa \<in> UNIV \<Longrightarrow> ?P16 x xa \<and> u ` JF2col xa x = JF2col xa (JF2map u x)
[PROOF STEP]
apply (rule spec[OF spec[OF JFcol_natural]])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma of_int_ffact:
  "of_int (ffact n k) = ffact n (of_int k :: 'a :: comm_ring_1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (ffact n k) = ffact n (of_int k)
[PROOF STEP]
proof (induct n arbitrary: k)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>k. of_int (ffact 0 k) = ffact 0 (of_int k)
 2. \<And>n k. (\<And>k. of_int (ffact n k) = ffact n (of_int k)) \<Longrightarrow> of_int (ffact (Suc n) k) = ffact (Suc n) (of_int k)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>k. of_int (ffact 0 k) = ffact 0 (of_int k)
 2. \<And>n k. (\<And>k. of_int (ffact n k) = ffact n (of_int k)) \<Longrightarrow> of_int (ffact (Suc n) k) = ffact (Suc n) (of_int k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_int (ffact 0 k) = ffact 0 (of_int k)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
of_int (ffact 0 k) = ffact 0 (of_int k)

goal (1 subgoal):
 1. \<And>n k. (\<And>k. of_int (ffact n k) = ffact n (of_int k)) \<Longrightarrow> of_int (ffact (Suc n) k) = ffact (Suc n) (of_int k)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n k. (\<And>k. of_int (ffact n k) = ffact n (of_int k)) \<Longrightarrow> of_int (ffact (Suc n) k) = ffact (Suc n) (of_int k)
[PROOF STEP]
case (Suc n k)
[PROOF STATE]
proof (state)
this:
of_int (ffact n ?k) = ffact n (of_int ?k)

goal (1 subgoal):
 1. \<And>n k. (\<And>k. of_int (ffact n k) = ffact n (of_int k)) \<Longrightarrow> of_int (ffact (Suc n) k) = ffact (Suc n) (of_int k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_int (ffact n ?k) = ffact n (of_int ?k)
[PROOF STEP]
have "of_int (ffact n (k - 1)) = ffact n (of_int (k - 1) :: 'a)"
[PROOF STATE]
proof (prove)
using this:
of_int (ffact n ?k) = ffact n (of_int ?k)

goal (1 subgoal):
 1. of_int (ffact n (k - 1)) = ffact n (of_int (k - 1))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
of_int (ffact n (k - 1)) = ffact n (of_int (k - 1))

goal (1 subgoal):
 1. \<And>n k. (\<And>k. of_int (ffact n k) = ffact n (of_int k)) \<Longrightarrow> of_int (ffact (Suc n) k) = ffact (Suc n) (of_int k)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
of_int (ffact n (k - 1)) = ffact n (of_int (k - 1))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
of_int (ffact n (k - 1)) = ffact n (of_int (k - 1))

goal (1 subgoal):
 1. of_int (ffact (Suc n) k) = ffact (Suc n) (of_int k)
[PROOF STEP]
by (simp add: ffact_Suc_nat ffact_Suc)
[PROOF STATE]
proof (state)
this:
of_int (ffact (Suc n) k) = ffact (Suc n) (of_int k)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
theorem meet_join_absorb: "x \<sqinter> (x \<squnion> y) = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqinter> (x \<squnion> y) = x
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. x \<sqsubseteq> x
 2. x \<sqsubseteq> x \<squnion> y
 3. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> x \<squnion> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
show "x \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> x
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> x

goal (2 subgoals):
 1. x \<sqsubseteq> x \<squnion> y
 2. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> x \<squnion> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
show "x \<sqsubseteq> x \<squnion> y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x \<sqsubseteq> x \<squnion> y
[PROOF STEP]
..
[PROOF STATE]
proof (state)
this:
x \<sqsubseteq> x \<squnion> y

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> x \<squnion> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
fix z
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> x \<squnion> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
assume "z \<sqsubseteq> x" and "z \<sqsubseteq> x \<squnion> y"
[PROOF STATE]
proof (state)
this:
z \<sqsubseteq> x
z \<sqsubseteq> x \<squnion> y

goal (1 subgoal):
 1. \<And>z. \<lbrakk>z \<sqsubseteq> x; z \<sqsubseteq> x \<squnion> y\<rbrakk> \<Longrightarrow> z \<sqsubseteq> x
[PROOF STEP]
show "z \<sqsubseteq> x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. z \<sqsubseteq> x
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
z \<sqsubseteq> x

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma asymp_equivD_strong:
  assumes "f \<sim>[F] g" "eventually (\<lambda>x. f x \<noteq> 0 \<or> g x \<noteq> 0) F"
  shows   "((\<lambda>x. f x / g x) \<longlongrightarrow> 1) F"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
from assms(1)
[PROOF STATE]
proof (chain)
picking this:
f \<sim>[F] g
[PROOF STEP]
have "((\<lambda>x. if f x = 0 \<and> g x = 0 then 1 else f x / g x) \<longlongrightarrow> 1) F"
[PROOF STATE]
proof (prove)
using this:
f \<sim>[F] g

goal (1 subgoal):
 1. ((\<lambda>x. if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
by (rule asymp_equivD)
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) \<longlongrightarrow> (1::'b)) F

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) \<longlongrightarrow> (1::'b)) F

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
have "?this \<longleftrightarrow> ?thesis"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ((\<lambda>x. if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) \<longlongrightarrow> (1::'b)) F = ((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
by (intro filterlim_cong eventually_mono[OF assms(2)]) auto
[PROOF STATE]
proof (state)
this:
((\<lambda>x. if f x = (0::'b) \<and> g x = (0::'b) then 1::'b else f x / g x) \<longlongrightarrow> (1::'b)) F = ((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F

goal (1 subgoal):
 1. ((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
((\<lambda>x. f x / g x) \<longlongrightarrow> (1::'b)) F

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma inj_take:
assumes "n1 \<le> length al" and "n2 \<le> length al"
shows "take n1 al = take n2 al \<longleftrightarrow> n1 = n2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (take n1 al = take n2 al) = (n1 = n2)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (take n1 al = take n2 al) = (n1 = n2)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (take n1 al = take n2 al) = (n1 = n2)
[PROOF STEP]
assume "take n1 al = take n2 al"
[PROOF STATE]
proof (state)
this:
take n1 al = take n2 al

goal (1 subgoal):
 1. (take n1 al = take n2 al) = (n1 = n2)
[PROOF STEP]
hence "n1 = n2"
[PROOF STATE]
proof (prove)
using this:
take n1 al = take n2 al

goal (1 subgoal):
 1. n1 = n2
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
take n1 al = take n2 al
n1 \<le> length al
n2 \<le> length al

goal (1 subgoal):
 1. n1 = n2
[PROOF STEP]
proof(induct al arbitrary: n1 n2)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>n1 n2. \<lbrakk>take n1 [] = take n2 []; n1 \<le> length []; n2 \<le> length []\<rbrakk> \<Longrightarrow> n1 = n2
 2. \<And>a al n1 n2. \<lbrakk>\<And>n1 n2. \<lbrakk>take n1 al = take n2 al; n1 \<le> length al; n2 \<le> length al\<rbrakk> \<Longrightarrow> n1 = n2; take n1 (a # al) = take n2 (a # al); n1 \<le> length (a # al); n2 \<le> length (a # al)\<rbrakk> \<Longrightarrow> n1 = n2
[PROOF STEP]
case (Cons a al)
[PROOF STATE]
proof (state)
this:
\<lbrakk>take ?n1.0 al = take ?n2.0 al; ?n1.0 \<le> length al; ?n2.0 \<le> length al\<rbrakk> \<Longrightarrow> ?n1.0 = ?n2.0
take n1 (a # al) = take n2 (a # al)
n1 \<le> length (a # al)
n2 \<le> length (a # al)

goal (2 subgoals):
 1. \<And>n1 n2. \<lbrakk>take n1 [] = take n2 []; n1 \<le> length []; n2 \<le> length []\<rbrakk> \<Longrightarrow> n1 = n2
 2. \<And>a al n1 n2. \<lbrakk>\<And>n1 n2. \<lbrakk>take n1 al = take n2 al; n1 \<le> length al; n2 \<le> length al\<rbrakk> \<Longrightarrow> n1 = n2; take n1 (a # al) = take n2 (a # al); n1 \<le> length (a # al); n2 \<le> length (a # al)\<rbrakk> \<Longrightarrow> n1 = n2
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>take ?n1.0 al = take ?n2.0 al; ?n1.0 \<le> length al; ?n2.0 \<le> length al\<rbrakk> \<Longrightarrow> ?n1.0 = ?n2.0
take n1 (a # al) = take n2 (a # al)
n1 \<le> length (a # al)
n2 \<le> length (a # al)

goal (1 subgoal):
 1. n1 = n2
[PROOF STEP]
by (cases n1 n2 rule: nat.exhaust[case_product nat.exhaust]) auto
[PROOF STATE]
proof (state)
this:
n1 = n2

goal (1 subgoal):
 1. \<And>n1 n2. \<lbrakk>take n1 [] = take n2 []; n1 \<le> length []; n2 \<le> length []\<rbrakk> \<Longrightarrow> n1 = n2
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
n1 = n2

goal (1 subgoal):
 1. (take n1 al = take n2 al) = (n1 = n2)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
take n1 al = take n2 al \<Longrightarrow> n1 = n2

goal (1 subgoal):
 1. (take n1 al = take n2 al) = (n1 = n2)
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
take n1 al = take n2 al \<Longrightarrow> n1 = n2

goal (1 subgoal):
 1. (take n1 al = take n2 al) = (n1 = n2)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(take n1 al = take n2 al) = (n1 = n2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma infsetsum_Diff:
  assumes "f abs_summable_on B" "A \<subseteq> B"
  shows   "infsetsum f (B - A) = infsetsum f B - infsetsum f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsetsum f (B - A) = infsetsum f B - infsetsum f A
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. infsetsum f (B - A) = infsetsum f B - infsetsum f A
[PROOF STEP]
have "infsetsum f ((B - A) \<union> A) = infsetsum f (B - A) + infsetsum f A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. infsetsum f (B - A \<union> A) = infsetsum f (B - A) + infsetsum f A
[PROOF STEP]
using assms(2)
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B

goal (1 subgoal):
 1. infsetsum f (B - A \<union> A) = infsetsum f (B - A) + infsetsum f A
[PROOF STEP]
by (intro infsetsum_Un_disjoint abs_summable_on_subset[OF assms(1)]) auto
[PROOF STATE]
proof (state)
this:
infsetsum f (B - A \<union> A) = infsetsum f (B - A) + infsetsum f A

goal (1 subgoal):
 1. infsetsum f (B - A) = infsetsum f B - infsetsum f A
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
infsetsum f (B - A \<union> A) = infsetsum f (B - A) + infsetsum f A

goal (1 subgoal):
 1. infsetsum f (B - A) = infsetsum f B - infsetsum f A
[PROOF STEP]
from assms(2)
[PROOF STATE]
proof (chain)
picking this:
A \<subseteq> B
[PROOF STEP]
have "(B - A) \<union> A = B"
[PROOF STATE]
proof (prove)
using this:
A \<subseteq> B

goal (1 subgoal):
 1. B - A \<union> A = B
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
B - A \<union> A = B

goal (1 subgoal):
 1. infsetsum f (B - A) = infsetsum f B - infsetsum f A
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
infsetsum f (B - A \<union> A) = infsetsum f (B - A) + infsetsum f A
B - A \<union> A = B
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
infsetsum f (B - A \<union> A) = infsetsum f (B - A) + infsetsum f A
B - A \<union> A = B

goal (1 subgoal):
 1. infsetsum f (B - A) = infsetsum f B - infsetsum f A
[PROOF STEP]
by (simp add: algebra_simps)
[PROOF STATE]
proof (state)
this:
infsetsum f (B - A) = infsetsum f B - infsetsum f A

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma coprime_set_prod:
  fixes I:: "real poly set"
  shows "finite I \<Longrightarrow> ((\<forall> q \<in> I. (coprime p q)) \<longrightarrow> (coprime p (\<Prod> I)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. finite I \<Longrightarrow> (\<forall>q\<in>I. coprime p q) \<longrightarrow> coprime p (\<Prod>I)
[PROOF STEP]
proof (induct rule: finite_induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<forall>a\<in>{}. coprime p a) \<longrightarrow> coprime p (\<Prod>{})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)\<rbrakk> \<Longrightarrow> (\<forall>a\<in>insert x F. coprime p a) \<longrightarrow> coprime p (\<Prod>(insert x F))
[PROOF STEP]
case empty
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (\<forall>a\<in>{}. coprime p a) \<longrightarrow> coprime p (\<Prod>{})
 2. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)\<rbrakk> \<Longrightarrow> (\<forall>a\<in>insert x F. coprime p a) \<longrightarrow> coprime p (\<Prod>(insert x F))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<forall>a\<in>{}. coprime p a) \<longrightarrow> coprime p (\<Prod>{})
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<forall>a\<in>{}. coprime p a) \<longrightarrow> coprime p (\<Prod>{})

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)\<rbrakk> \<Longrightarrow> (\<forall>a\<in>insert x F. coprime p a) \<longrightarrow> coprime p (\<Prod>(insert x F))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)\<rbrakk> \<Longrightarrow> (\<forall>a\<in>insert x F. coprime p a) \<longrightarrow> coprime p (\<Prod>(insert x F))
[PROOF STEP]
case (insert x F)
[PROOF STATE]
proof (state)
this:
finite F
x \<notin> F
(\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)

goal (1 subgoal):
 1. \<And>x F. \<lbrakk>finite F; x \<notin> F; (\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)\<rbrakk> \<Longrightarrow> (\<forall>a\<in>insert x F. coprime p a) \<longrightarrow> coprime p (\<Prod>(insert x F))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
finite F
x \<notin> F
(\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)

goal (1 subgoal):
 1. (\<forall>a\<in>insert x F. coprime p a) \<longrightarrow> coprime p (\<Prod>(insert x F))
[PROOF STEP]
using coprime_mult_right_iff
[PROOF STATE]
proof (prove)
using this:
finite F
x \<notin> F
(\<forall>a\<in>F. coprime p a) \<longrightarrow> coprime p (\<Prod>F)
coprime ?c (?a * ?b) = (coprime ?c ?a \<and> coprime ?c ?b)

goal (1 subgoal):
 1. (\<forall>a\<in>insert x F. coprime p a) \<longrightarrow> coprime p (\<Prod>(insert x F))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<forall>a\<in>insert x F. coprime p a) \<longrightarrow> coprime p (\<Prod>(insert x F))

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma singleton_less_list_iff: "sorted xs \<Longrightarrow> [n] < xs \<longleftrightarrow> {..n} \<inter> list.set xs = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted xs \<Longrightarrow> ([n] < xs) = ({..n} \<inter> list.set xs = {})
[PROOF STEP]
apply (simp add: less_list_def disjoint_iff)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sorted xs \<Longrightarrow> (xs \<noteq> [] \<longrightarrow> n < hd xs) = (\<forall>x\<le>n. x \<notin> list.set xs)
[PROOF STEP]
by (metis empty_iff less_le_trans list.set(1) list.set_sel(1) not_le sorted_hd_le)


[STATEMENT]
lemma ceil_divide_floor_conv:
  assumes "b \<noteq> 0"
  shows "\<lceil>real_of_int a / real_of_int b\<rceil> =
    (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
proof (cases "b dvd a")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
 2. \<not> b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
b dvd a

goal (2 subgoals):
 1. b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
 2. \<not> b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
b dvd a
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
b dvd a

goal (1 subgoal):
 1. \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
by (simp add: ceiling_def floor_divide_of_int_eq dvd_neg_div
             flip: of_int_minus divide_minus_left)
[PROOF STATE]
proof (state)
this:
\<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)

goal (1 subgoal):
 1. \<not> b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> b dvd a

goal (1 subgoal):
 1. \<not> b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> b dvd a
[PROOF STEP]
have "a mod b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
\<not> b dvd a

goal (1 subgoal):
 1. a mod b \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
a mod b \<noteq> 0

goal (1 subgoal):
 1. \<not> b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a mod b \<noteq> 0
[PROOF STEP]
have ne: "real_of_int (a mod b) / real_of_int b \<noteq> 0"
[PROOF STATE]
proof (prove)
using this:
a mod b \<noteq> 0

goal (1 subgoal):
 1. real_of_int (a mod b) / real_of_int b \<noteq> 0
[PROOF STEP]
using \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
a mod b \<noteq> 0
b \<noteq> 0

goal (1 subgoal):
 1. real_of_int (a mod b) / real_of_int b \<noteq> 0
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
real_of_int (a mod b) / real_of_int b \<noteq> 0

goal (1 subgoal):
 1. \<not> b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
have "\<lceil>real_of_int a / real_of_int b\<rceil> = \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lceil>real_of_int a / real_of_int b\<rceil> = \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1
[PROOF STEP]
apply (rule ceiling_eq)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b
 2. real_of_int a / real_of_int b \<le> real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1
[PROOF STEP]
apply (auto simp flip: floor_divide_of_int_eq)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b
[PROOF STEP]
have "real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<le> real_of_int a / real_of_int b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<le> real_of_int a / real_of_int b
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<le> real_of_int a / real_of_int b

goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<le> real_of_int a / real_of_int b

goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b
[PROOF STEP]
have "real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<noteq> real_of_int a / real_of_int b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<noteq> real_of_int a / real_of_int b
[PROOF STEP]
apply (subst (2) real_of_int_div_aux)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<noteq> real_of_int (a div b) + real_of_int (a mod b) / real_of_int b
[PROOF STEP]
unfolding floor_divide_of_int_eq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. real_of_int (a div b) \<noteq> real_of_int (a div b) + real_of_int (a mod b) / real_of_int b
[PROOF STEP]
using ne \<open>b \<noteq> 0\<close>
[PROOF STATE]
proof (prove)
using this:
real_of_int (a mod b) / real_of_int b \<noteq> 0
b \<noteq> 0

goal (1 subgoal):
 1. real_of_int (a div b) \<noteq> real_of_int (a div b) + real_of_int (a mod b) / real_of_int b
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<noteq> real_of_int a / real_of_int b

goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<le> real_of_int a / real_of_int b
real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<noteq> real_of_int a / real_of_int b
[PROOF STEP]
show "real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b"
[PROOF STATE]
proof (prove)
using this:
real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<le> real_of_int a / real_of_int b
real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> \<noteq> real_of_int a / real_of_int b

goal (1 subgoal):
 1. real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b
[PROOF STEP]
by arith
[PROOF STATE]
proof (state)
this:
real_of_int \<lfloor>real_of_int a / real_of_int b\<rfloor> < real_of_int a / real_of_int b

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<lceil>real_of_int a / real_of_int b\<rceil> = \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1

goal (1 subgoal):
 1. \<not> b dvd a \<Longrightarrow> \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<lceil>real_of_int a / real_of_int b\<rceil> = \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lceil>real_of_int a / real_of_int b\<rceil> = \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1

goal (1 subgoal):
 1. \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
using \<open>\<not> b dvd a\<close>
[PROOF STATE]
proof (prove)
using this:
\<lceil>real_of_int a / real_of_int b\<rceil> = \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1
\<not> b dvd a

goal (1 subgoal):
 1. \<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<lceil>real_of_int a / real_of_int b\<rceil> = (if b dvd a then a div b else \<lfloor>real_of_int a / real_of_int b\<rfloor> + 1)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma has_fps_expansion_add [fps_expansion_intros]:
  assumes "f has_fps_expansion F" "g has_fps_expansion G"
  shows   "(\<lambda>x. f x + g x) has_fps_expansion F + G"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f has_fps_expansion F
g has_fps_expansion G
[PROOF STEP]
have "0 < min (fps_conv_radius F) (fps_conv_radius G)"
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F
g has_fps_expansion G

goal (1 subgoal):
 1. 0 < min (fps_conv_radius F) (fps_conv_radius G)
[PROOF STEP]
by (auto simp: has_fps_expansion_def)
[PROOF STATE]
proof (state)
this:
0 < min (fps_conv_radius F) (fps_conv_radius G)

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
0 < min (fps_conv_radius F) (fps_conv_radius G)

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
have "\<dots> \<le> fps_conv_radius (F + G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. min (fps_conv_radius F) (fps_conv_radius G) \<le> fps_conv_radius (F + G)
[PROOF STEP]
by (rule fps_conv_radius_add)
[PROOF STATE]
proof (state)
this:
min (fps_conv_radius F) (fps_conv_radius G) \<le> fps_conv_radius (F + G)

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
0 < fps_conv_radius (F + G)
[PROOF STEP]
have radius: "\<dots> > 0"
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius (F + G)

goal (1 subgoal):
 1. 0 < fps_conv_radius (F + G)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
0 < fps_conv_radius (F + G)

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
f has_fps_expansion F
g has_fps_expansion G
[PROOF STEP]
have "eventually (\<lambda>x. x \<in> eball 0 (fps_conv_radius F)) (nhds 0)"
                  "eventually (\<lambda>x. x \<in> eball 0 (fps_conv_radius G)) (nhds 0)"
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F
g has_fps_expansion G

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds (0::'b). x \<in> eball (0::'b) (fps_conv_radius F) &&& \<forall>\<^sub>F x in nhds (0::'c). x \<in> eball (0::'c) (fps_conv_radius G)
[PROOF STEP]
by (intro eventually_nhds_in_open; force simp: has_fps_expansion_def zero_ereal_def)+
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds (0::?'b1). x \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F x in nhds (0::?'c1). x \<in> eball (0::?'c1) (fps_conv_radius G)

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds (0::?'b1). x \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F x in nhds (0::?'c1). x \<in> eball (0::?'c1) (fps_conv_radius G)

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
have "eventually (\<lambda>x. eval_fps F x = f x) (nhds 0)"
            and "eventually (\<lambda>x. eval_fps G x = g x) (nhds 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x &&& \<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
f has_fps_expansion F
g has_fps_expansion G

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x &&& \<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x
[PROOF STEP]
by (auto simp: has_fps_expansion_def)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x
\<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
\<forall>\<^sub>F x in nhds (0::?'b1). x \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F x in nhds (0::?'c1). x \<in> eball (0::?'c1) (fps_conv_radius G)
\<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x
\<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x
[PROOF STEP]
have "eventually (\<lambda>x. eval_fps (F + G) x = f x + g x) (nhds 0)"
[PROOF STATE]
proof (prove)
using this:
\<forall>\<^sub>F x in nhds (0::?'b1). x \<in> eball (0::?'b1) (fps_conv_radius F)
\<forall>\<^sub>F x in nhds (0::?'c1). x \<in> eball (0::?'c1) (fps_conv_radius G)
\<forall>\<^sub>F x in nhds (0::'a). eval_fps F x = f x
\<forall>\<^sub>F x in nhds (0::'a). eval_fps G x = g x

goal (1 subgoal):
 1. \<forall>\<^sub>F x in nhds (0::'a). eval_fps (F + G) x = f x + g x
[PROOF STEP]
by eventually_elim (auto simp: eval_fps_add)
[PROOF STATE]
proof (state)
this:
\<forall>\<^sub>F x in nhds (0::'a). eval_fps (F + G) x = f x + g x

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
with radius
[PROOF STATE]
proof (chain)
picking this:
0 < fps_conv_radius (F + G)
\<forall>\<^sub>F x in nhds (0::'a). eval_fps (F + G) x = f x + g x
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
0 < fps_conv_radius (F + G)
\<forall>\<^sub>F x in nhds (0::'a). eval_fps (F + G) x = f x + g x

goal (1 subgoal):
 1. (\<lambda>x. f x + g x) has_fps_expansion F + G
[PROOF STEP]
by (auto simp: has_fps_expansion_def)
[PROOF STATE]
proof (state)
this:
(\<lambda>x. f x + g x) has_fps_expansion F + G

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma rel_list_all2_update_cong:
  "\<lbrakk> i<size xs; list_all2 (fun_of S) xs ys; (x,y) \<in> S \<rbrakk>
  \<Longrightarrow> list_all2 (fun_of S) (xs[i:=x]) (ys[i:=y])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; list_all2 (fun_of S) xs ys; (x, y) \<in> S\<rbrakk> \<Longrightarrow> list_all2 (fun_of S) (xs[i := x]) (ys[i := y])
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length xs; list_all2 (fun_of S) xs ys; (x, y) \<in> S\<rbrakk> \<Longrightarrow> list_all2 (fun_of S) (xs[i := x]) (ys[i := y])
[PROOF STEP]
by (simp add: list_all2_update_cong)


[STATEMENT]
lemma (in pre_digraph) app_iso_eq_conv:
  assumes "digraph_isomorphism hom"
  assumes "subgraph H1 G" "subgraph H2 G"
  shows "app_iso hom H1 = app_iso hom H2 \<longleftrightarrow> H1 = H2" (is "?L \<longleftrightarrow> ?R")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (app_iso hom H1 = app_iso hom H2) = (H1 = H2)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. app_iso hom H1 = app_iso hom H2 \<Longrightarrow> H1 = H2
 2. H1 = H2 \<Longrightarrow> app_iso hom H1 = app_iso hom H2
[PROOF STEP]
assume ?L
[PROOF STATE]
proof (state)
this:
app_iso hom H1 = app_iso hom H2

goal (2 subgoals):
 1. app_iso hom H1 = app_iso hom H2 \<Longrightarrow> H1 = H2
 2. H1 = H2 \<Longrightarrow> app_iso hom H1 = app_iso hom H2
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
app_iso hom H1 = app_iso hom H2
[PROOF STEP]
have "app_iso (inv_iso hom) (app_iso hom H1) = app_iso (inv_iso hom) (app_iso hom H2)"
[PROOF STATE]
proof (prove)
using this:
app_iso hom H1 = app_iso hom H2

goal (1 subgoal):
 1. app_iso (inv_iso hom) (app_iso hom H1) = app_iso (inv_iso hom) (app_iso hom H2)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
app_iso (inv_iso hom) (app_iso hom H1) = app_iso (inv_iso hom) (app_iso hom H2)

goal (2 subgoals):
 1. app_iso hom H1 = app_iso hom H2 \<Longrightarrow> H1 = H2
 2. H1 = H2 \<Longrightarrow> app_iso hom H1 = app_iso hom H2
[PROOF STEP]
with assms
[PROOF STATE]
proof (chain)
picking this:
digraph_isomorphism hom
subgraph H1 G
subgraph H2 G
app_iso (inv_iso hom) (app_iso hom H1) = app_iso (inv_iso hom) (app_iso hom H2)
[PROOF STEP]
show ?R
[PROOF STATE]
proof (prove)
using this:
digraph_isomorphism hom
subgraph H1 G
subgraph H2 G
app_iso (inv_iso hom) (app_iso hom H1) = app_iso (inv_iso hom) (app_iso hom H2)

goal (1 subgoal):
 1. H1 = H2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
H1 = H2

goal (1 subgoal):
 1. H1 = H2 \<Longrightarrow> app_iso hom H1 = app_iso hom H2
[PROOF STEP]
qed simp


[STATEMENT]
lemma topspace_nsphere_1:
  assumes "x \<in> topspace (nsphere n)" shows "(x k)\<^sup>2 \<le> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (x k)\<^sup>2 \<le> 1
[PROOF STEP]
proof (cases "k \<le> n")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
 2. \<not> k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
k \<le> n

goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
 2. \<not> k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
[PROOF STEP]
have "(\<Sum>i \<in> {..n} - {k}. (x i)\<^sup>2) = (\<Sum>i\<le>n. (x i)\<^sup>2) - (x k)\<^sup>2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i\<in>{..n} - {k}. (x i)\<^sup>2) = (\<Sum>i\<le>n. (x i)\<^sup>2) - (x k)\<^sup>2
[PROOF STEP]
using \<open>k \<le> n\<close>
[PROOF STATE]
proof (prove)
using this:
k \<le> n

goal (1 subgoal):
 1. (\<Sum>i\<in>{..n} - {k}. (x i)\<^sup>2) = (\<Sum>i\<le>n. (x i)\<^sup>2) - (x k)\<^sup>2
[PROOF STEP]
by (simp add: sum_diff)
[PROOF STATE]
proof (state)
this:
(\<Sum>i\<in>{..n} - {k}. (x i)\<^sup>2) = (\<Sum>i\<le>n. (x i)\<^sup>2) - (x k)\<^sup>2

goal (2 subgoals):
 1. k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
 2. \<not> k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
(\<Sum>i\<in>{..n} - {k}. (x i)\<^sup>2) = (\<Sum>i\<le>n. (x i)\<^sup>2) - (x k)\<^sup>2
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>{..n} - {k}. (x i)\<^sup>2) = (\<Sum>i\<le>n. (x i)\<^sup>2) - (x k)\<^sup>2

goal (1 subgoal):
 1. (x k)\<^sup>2 \<le> 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
(\<Sum>i\<in>{..n} - {k}. (x i)\<^sup>2) = (\<Sum>i\<le>n. (x i)\<^sup>2) - (x k)\<^sup>2
x \<in> topspace (nsphere n)

goal (1 subgoal):
 1. (x k)\<^sup>2 \<le> 1
[PROOF STEP]
apply (simp add: nsphere)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(\<Sum>i\<in>{..n} - {k}. (x i)\<^sup>2) = 1 - (x k)\<^sup>2; (\<Sum>i\<le>n. (x i)\<^sup>2) = 1 \<and> (\<forall>i>n. x i = 0)\<rbrakk> \<Longrightarrow> (x k)\<^sup>2 \<le> 1
[PROOF STEP]
by (metis diff_ge_0_iff_ge sum_nonneg zero_le_power2)
[PROOF STATE]
proof (state)
this:
(x k)\<^sup>2 \<le> 1

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> k \<le> n

goal (1 subgoal):
 1. \<not> k \<le> n \<Longrightarrow> (x k)\<^sup>2 \<le> 1
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<not> k \<le> n
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> k \<le> n

goal (1 subgoal):
 1. (x k)\<^sup>2 \<le> 1
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
\<not> k \<le> n
x \<in> topspace (nsphere n)

goal (1 subgoal):
 1. (x k)\<^sup>2 \<le> 1
[PROOF STEP]
by (simp add: nsphere)
[PROOF STATE]
proof (state)
this:
(x k)\<^sup>2 \<le> 1

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma component_of_connected_graph:
  "\<lbrakk>connected g; r\<in>nodes g\<rbrakk> \<Longrightarrow> component_of g r = g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g\<rbrakk> \<Longrightarrow> component_of g r = g
[PROOF STEP]
unfolding graph_eq_iff
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g\<rbrakk> \<Longrightarrow> nodes (component_of g r) = nodes g \<and> edges (component_of g r) = edges g
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>x. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; x \<in> nodes (component_of g r)\<rbrakk> \<Longrightarrow> x \<in> nodes g
 2. \<And>x. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; x \<in> nodes g\<rbrakk> \<Longrightarrow> x \<in> nodes (component_of g r)
 3. \<And>a b. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a, b) \<in> edges (component_of g r)\<rbrakk> \<Longrightarrow> (a, b) \<in> edges g
 4. \<And>a b. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a, b) \<in> edges g\<rbrakk> \<Longrightarrow> (a, b) \<in> edges (component_of g r)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; x_ \<in> nodes (component_of g r)\<rbrakk> \<Longrightarrow> x_ \<in> nodes g
[PROOF STEP]
by simp (metis Image_singleton_iff nodesI(2) reachable_nodes_def rtranclE)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; x \<in> nodes g\<rbrakk> \<Longrightarrow> x \<in> nodes (component_of g r)
 2. \<And>a b. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a, b) \<in> edges (component_of g r)\<rbrakk> \<Longrightarrow> (a, b) \<in> edges g
 3. \<And>a b. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a, b) \<in> edges g\<rbrakk> \<Longrightarrow> (a, b) \<in> edges (component_of g r)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; x_ \<in> nodes g\<rbrakk> \<Longrightarrow> x_ \<in> nodes (component_of g r)
[PROOF STEP]
by (simp add: connectedD reachable_nodes_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a b. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a, b) \<in> edges (component_of g r)\<rbrakk> \<Longrightarrow> (a, b) \<in> edges g
 2. \<And>a b. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a, b) \<in> edges g\<rbrakk> \<Longrightarrow> (a, b) \<in> edges (component_of g r)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a_, b_) \<in> edges (component_of g r)\<rbrakk> \<Longrightarrow> (a_, b_) \<in> edges g
[PROOF STEP]
by (simp add: component_of_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a b. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a, b) \<in> edges g\<rbrakk> \<Longrightarrow> (a, b) \<in> edges (component_of g r)
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>Undirected_Graph.connected g; r \<in> nodes g; (a_, b_) \<in> edges g\<rbrakk> \<Longrightarrow> (a_, b_) \<in> edges (component_of g r)
[PROOF STEP]
by (simp add: connectedD reachable_nodes_def reachable_nodes_step'(2))
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma mat_mult_assoc: "f \<otimes> (g \<otimes> h) = (f \<otimes> g) \<otimes> h"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
fix i j
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
have "(f \<otimes> (g \<otimes> h)) i j = \<Sum>{f i k1 \<cdot> \<Sum>{g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f \<otimes> (g \<otimes> h)) i j = \<Sum> {f i k1 \<cdot> \<Sum> {g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV}
[PROOF STEP]
by (simp only: mat_mult_def)
[PROOF STATE]
proof (state)
this:
(f \<otimes> (g \<otimes> h)) i j = \<Sum> {f i k1 \<cdot> \<Sum> {g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f \<otimes> (g \<otimes> h)) i j = \<Sum> {f i k1 \<cdot> \<Sum> {g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
have "... = \<Sum>{\<Sum>{f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {f i k1 \<cdot> \<Sum> {g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV} = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV}
[PROOF STEP]
by (simp only: fset_to_im sum_fun_distl finite_UNIV mult.assoc)
[PROOF STATE]
proof (state)
this:
\<Sum> {f i k1 \<cdot> \<Sum> {g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV} = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum> {f i k1 \<cdot> \<Sum> {g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV} = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
have "... = \<Sum>{\<Sum>{(f i k1 \<cdot> g k1 k2) \<cdot> h k2 j|k1. k1 \<in> UNIV} |k2. k2 \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV} = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k1. k1 \<in> UNIV} |k2. k2 \<in> UNIV}
[PROOF STEP]
by (rule mat_rearrange, auto simp add: finite_UNIV)
[PROOF STATE]
proof (state)
this:
\<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV} = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k1. k1 \<in> UNIV} |k2. k2 \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
\<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k2. k2 \<in> UNIV} |k1. k1 \<in> UNIV} = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k1. k1 \<in> UNIV} |k2. k2 \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
have "... = \<Sum>{\<Sum>{f i k1 \<cdot> g k1 k2 |k1. k1 \<in> UNIV} \<cdot> h k2 j |k2. k2 \<in> UNIV}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k1. k1 \<in> UNIV} |k2. k2 \<in> UNIV} = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 |k1. k1 \<in> UNIV} \<cdot> h k2 j |k2. k2 \<in> UNIV}
[PROOF STEP]
by (simp only: fset_to_im sum_fun_distr finite_UNIV)
[PROOF STATE]
proof (state)
this:
\<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 \<cdot> h k2 j |k1. k1 \<in> UNIV} |k2. k2 \<in> UNIV} = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 |k1. k1 \<in> UNIV} \<cdot> h k2 j |k2. k2 \<in> UNIV}

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f \<otimes> (g \<otimes> h)) i j = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 |k1. k1 \<in> UNIV} \<cdot> h k2 j |k2. k2 \<in> UNIV}
[PROOF STEP]
have "(f \<otimes> (g \<otimes> h)) i j  = ((f \<otimes> g) \<otimes> h) i j "
[PROOF STATE]
proof (prove)
using this:
(f \<otimes> (g \<otimes> h)) i j = \<Sum> {\<Sum> {f i k1 \<cdot> g k1 k2 |k1. k1 \<in> UNIV} \<cdot> h k2 j |k2. k2 \<in> UNIV}

goal (1 subgoal):
 1. (f \<otimes> (g \<otimes> h)) i j = (f \<otimes> g \<otimes> h) i j
[PROOF STEP]
by (simp only: mat_mult_def)
[PROOF STATE]
proof (state)
this:
(f \<otimes> (g \<otimes> h)) i j = (f \<otimes> g \<otimes> h) i j

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(f \<otimes> (g \<otimes> h)) ?i2 ?j2 = (f \<otimes> g \<otimes> h) ?i2 ?j2

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
(f \<otimes> (g \<otimes> h)) ?i2 ?j2 = (f \<otimes> g \<otimes> h) ?i2 ?j2

goal (1 subgoal):
 1. f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
f \<otimes> (g \<otimes> h) = f \<otimes> g \<otimes> h

goal:
No subgoals!
[PROOF STEP]
qed