[STATEMENT]
lemma list_nth_append3:
assumes h1:"\<not> i < Suc (length x)"
       and "i - Suc (length x) < Suc (length y)"
shows "(a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
proof (cases i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
 2. \<And>nat. i = Suc nat \<Longrightarrow> (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
assume "i=0"
[PROOF STATE]
proof (state)
this:
i = 0

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
 2. \<And>nat. i = Suc nat \<Longrightarrow> (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
with h1
[PROOF STATE]
proof (chain)
picking this:
\<not> i < Suc (length x)
i = 0
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> i < Suc (length x)
i = 0

goal (1 subgoal):
 1. (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
by (simp add: nth_append)
[PROOF STATE]
proof (state)
this:
(a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
fix ii
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
assume "i = Suc ii"
[PROOF STATE]
proof (state)
this:
i = Suc ii

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
with h1
[PROOF STATE]
proof (chain)
picking this:
\<not> i < Suc (length x)
i = Suc ii
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
\<not> i < Suc (length x)
i = Suc ii

goal (1 subgoal):
 1. (a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i
[PROOF STEP]
by (simp add: nth_append)
[PROOF STATE]
proof (state)
this:
(a # y) ! (i - Suc (length x)) = (b # x @ a # y) ! i

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma poly_mult_normalize:
  assumes "set p1 \<subseteq> carrier R" "set p2 \<subseteq> carrier R"
  shows "poly_mult p1 p2 = poly_mult (normalize p1) p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mult p1 p2 = poly_mult (local.normalize p1) p2
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_mult p1 p2 = poly_mult (local.normalize p1) p2
[PROOF STEP]
let ?replicate = "replicate (length p1 - length (normalize p1)) \<zero>"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. poly_mult p1 p2 = poly_mult (local.normalize p1) p2
[PROOF STEP]
have "poly_mult p1 p2 = poly_mult (?replicate @ (normalize p1)) p2"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. poly_mult p1 p2 = poly_mult (replicate (length p1 - length (local.normalize p1)) \<zero> @ local.normalize p1) p2
[PROOF STEP]
using normalize_def'[of p1]
[PROOF STATE]
proof (prove)
using this:
p1 = replicate (length p1 - length (local.normalize p1)) \<zero> @ drop (length p1 - length (local.normalize p1)) p1
local.normalize p1 = drop (length p1 - length (local.normalize p1)) p1

goal (1 subgoal):
 1. poly_mult p1 p2 = poly_mult (replicate (length p1 - length (local.normalize p1)) \<zero> @ local.normalize p1) p2
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
poly_mult p1 p2 = poly_mult (replicate (length p1 - length (local.normalize p1)) \<zero> @ local.normalize p1) p2

goal (1 subgoal):
 1. poly_mult p1 p2 = poly_mult (local.normalize p1) p2
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
poly_mult p1 p2 = poly_mult (replicate (length p1 - length (local.normalize p1)) \<zero> @ local.normalize p1) p2

goal (1 subgoal):
 1. poly_mult p1 p2 = poly_mult (local.normalize p1) p2
[PROOF STEP]
using poly_mult_prepend_replicate_zero normalize_in_carrier assms
[PROOF STATE]
proof (prove)
using this:
poly_mult p1 p2 = poly_mult (replicate (length p1 - length (local.normalize p1)) \<zero> @ local.normalize p1) p2
\<lbrakk>set ?p1.0 \<subseteq> carrier R; set ?p2.0 \<subseteq> carrier R\<rbrakk> \<Longrightarrow> poly_mult ?p1.0 ?p2.0 = poly_mult (replicate ?n \<zero> @ ?p1.0) ?p2.0
set ?p \<subseteq> carrier R \<Longrightarrow> set (local.normalize ?p) \<subseteq> carrier R
set p1 \<subseteq> carrier R
set p2 \<subseteq> carrier R

goal (1 subgoal):
 1. poly_mult p1 p2 = poly_mult (local.normalize p1) p2
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
poly_mult p1 p2 = poly_mult (local.normalize p1) p2

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma kronecker_invertible:
  assumes "invertible_mat (A :: 'a :: comm_ring_1 mat)" "invertible_mat B"
  shows "invertible_mat (kronecker_product A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
obtain Ai where Ai: "inverts_mat A Ai" "inverts_mat Ai A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Ai. \<lbrakk>inverts_mat A Ai; inverts_mat Ai A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
invertible_mat A
invertible_mat B
invertible_mat ?A \<equiv> square_mat ?A \<and> (\<exists>B. inverts_mat ?A B \<and> inverts_mat B ?A)

goal (1 subgoal):
 1. (\<And>Ai. \<lbrakk>inverts_mat A Ai; inverts_mat Ai A\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inverts_mat A Ai
inverts_mat Ai A

goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
obtain Bi where Bi: "inverts_mat B Bi" "inverts_mat Bi B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>Bi. \<lbrakk>inverts_mat B Bi; inverts_mat Bi B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
invertible_mat A
invertible_mat B
invertible_mat ?A \<equiv> square_mat ?A \<and> (\<exists>B. inverts_mat ?A B \<and> inverts_mat B ?A)

goal (1 subgoal):
 1. (\<And>Bi. \<lbrakk>inverts_mat B Bi; inverts_mat Bi B\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
inverts_mat B Bi
inverts_mat Bi B

goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
have "square_mat (kronecker_product A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. square_mat (kronecker_product A B)
[PROOF STEP]
by (metis (no_types, lifting) assms(1) assms(2) dim_col_mat(1) dim_row_mat(1) invertible_mat_def kronecker_product_def square_mat.simps)
[PROOF STATE]
proof (state)
this:
square_mat (kronecker_product A B)

goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
square_mat (kronecker_product A B)

goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
have "inverts_mat (kronecker_product A B) (kronecker_product Ai Bi)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverts_mat (kronecker_product A B) (kronecker_product Ai Bi)
[PROOF STEP]
using Ai Bi
[PROOF STATE]
proof (prove)
using this:
inverts_mat A Ai
inverts_mat Ai A
inverts_mat B Bi
inverts_mat Bi B

goal (1 subgoal):
 1. inverts_mat (kronecker_product A B) (kronecker_product Ai Bi)
[PROOF STEP]
unfolding inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
A * Ai = 1\<^sub>m (dim_row A)
Ai * A = 1\<^sub>m (dim_row Ai)
B * Bi = 1\<^sub>m (dim_row B)
Bi * B = 1\<^sub>m (dim_row Bi)

goal (1 subgoal):
 1. kronecker_product A B * kronecker_product Ai Bi = 1\<^sub>m (dim_row (kronecker_product A B))
[PROOF STEP]
by (metis (no_types, lifting) dim_kronecker(1) index_mult_mat(3) index_one_mat(3) kronecker_of_mult kronecker_one)
[PROOF STATE]
proof (state)
this:
inverts_mat (kronecker_product A B) (kronecker_product Ai Bi)

goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
inverts_mat (kronecker_product A B) (kronecker_product Ai Bi)

goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
have "inverts_mat (kronecker_product Ai Bi) (kronecker_product A B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inverts_mat (kronecker_product Ai Bi) (kronecker_product A B)
[PROOF STEP]
using Ai Bi
[PROOF STATE]
proof (prove)
using this:
inverts_mat A Ai
inverts_mat Ai A
inverts_mat B Bi
inverts_mat Bi B

goal (1 subgoal):
 1. inverts_mat (kronecker_product Ai Bi) (kronecker_product A B)
[PROOF STEP]
unfolding inverts_mat_def
[PROOF STATE]
proof (prove)
using this:
A * Ai = 1\<^sub>m (dim_row A)
Ai * A = 1\<^sub>m (dim_row Ai)
B * Bi = 1\<^sub>m (dim_row B)
Bi * B = 1\<^sub>m (dim_row Bi)

goal (1 subgoal):
 1. kronecker_product Ai Bi * kronecker_product A B = 1\<^sub>m (dim_row (kronecker_product Ai Bi))
[PROOF STEP]
by (metis (no_types, lifting) dim_kronecker(1) index_mult_mat(3) index_one_mat(3) kronecker_of_mult kronecker_one)
[PROOF STATE]
proof (state)
this:
inverts_mat (kronecker_product Ai Bi) (kronecker_product A B)

goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
square_mat (kronecker_product A B)
inverts_mat (kronecker_product A B) (kronecker_product Ai Bi)
inverts_mat (kronecker_product Ai Bi) (kronecker_product A B)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
square_mat (kronecker_product A B)
inverts_mat (kronecker_product A B) (kronecker_product Ai Bi)
inverts_mat (kronecker_product Ai Bi) (kronecker_product A B)

goal (1 subgoal):
 1. invertible_mat (kronecker_product A B)
[PROOF STEP]
unfolding invertible_mat_def
[PROOF STATE]
proof (prove)
using this:
square_mat (kronecker_product A B)
inverts_mat (kronecker_product A B) (kronecker_product Ai Bi)
inverts_mat (kronecker_product Ai Bi) (kronecker_product A B)

goal (1 subgoal):
 1. square_mat (kronecker_product A B) \<and> (\<exists>Ba. inverts_mat (kronecker_product A B) Ba \<and> inverts_mat Ba (kronecker_product A B))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
invertible_mat (kronecker_product A B)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma gappend_is_Nil_conv[simp]: "(a @\<^sub>g b = FL []) = (a = FL [] \<and> b = FL [])"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (a @\<^sub>g b = FL []) = (a = FL [] \<and> b = FL [])
[PROOF STEP]
by (unfold gappend_def, case_tac a, case_tac b, simp+)


[STATEMENT]
lemma univalent_O_converse[simp]:
  assumes "univalent (converse R)"
  shows "R O converse R = Id_on (Domain R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. R O R\<inverse> = Id_on (Domain R)
[PROOF STEP]
using assms[unfolded univalent_char]
[PROOF STATE]
proof (prove)
using this:
(R\<inverse>)\<inverse> O R\<inverse> \<subseteq> Id

goal (1 subgoal):
 1. R O R\<inverse> = Id_on (Domain R)
[PROOF STEP]
by auto


[STATEMENT]
theorem c_snd_is_pr [prec]: "c_snd \<in> PrimRec1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_snd \<in> PrimRec1
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. c_snd \<in> PrimRec1
[PROOF STEP]
have S1: "c_snd = (\<lambda> u. (c_sum u) - (c_fst u))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. c_snd = (\<lambda>u. c_sum u - c_fst u)
[PROOF STEP]
by (simp add: c_snd_def ext)
[PROOF STATE]
proof (state)
this:
c_snd = (\<lambda>u. c_sum u - c_fst u)

goal (1 subgoal):
 1. c_snd \<in> PrimRec1
[PROOF STEP]
from c_sum_is_pr c_fst_is_pr
[PROOF STATE]
proof (chain)
picking this:
c_sum \<in> PrimRec1
c_fst \<in> PrimRec1
[PROOF STEP]
have S2: "(\<lambda> u. (c_sum u) - (c_fst u)) \<in> PrimRec1"
[PROOF STATE]
proof (prove)
using this:
c_sum \<in> PrimRec1
c_fst \<in> PrimRec1

goal (1 subgoal):
 1. (\<lambda>u. c_sum u - c_fst u) \<in> PrimRec1
[PROOF STEP]
by prec
[PROOF STATE]
proof (state)
this:
(\<lambda>u. c_sum u - c_fst u) \<in> PrimRec1

goal (1 subgoal):
 1. c_snd \<in> PrimRec1
[PROOF STEP]
from S1 this
[PROOF STATE]
proof (chain)
picking this:
c_snd = (\<lambda>u. c_sum u - c_fst u)
(\<lambda>u. c_sum u - c_fst u) \<in> PrimRec1
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
c_snd = (\<lambda>u. c_sum u - c_fst u)
(\<lambda>u. c_sum u - c_fst u) \<in> PrimRec1

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma minus_fract_cancel [simp]: "Fract (- a) (- b) = Fract a b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Fract (- a) (- b) = Fract a b
[PROOF STEP]
by (cases "b = 0") (simp_all add: eq_fract)


[STATEMENT]
lemma inessential_spheremap_2_aux:
  fixes f :: "'a::euclidean_space \<Rightarrow> complex"
  assumes 2: "2 < DIM('a)" and contf: "continuous_on (sphere a r) f"
      and fim: "f `(sphere a r) \<subseteq> (sphere 0 1)"
  obtains c where "homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) f (\<lambda>x. c)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) f (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) f (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
obtain g where contg: "continuous_on (sphere a r) g"
             and feq: "\<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp(g x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof (rule continuous_logarithm_on_simply_connected [OF contf])
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. (\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> simply_connected (sphere a r)
 2. (\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> locally path_connected (sphere a r)
 3. \<And>z. \<lbrakk>\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis; z \<in> sphere a r\<rbrakk> \<Longrightarrow> f z \<noteq> 0
 4. \<And>g. \<lbrakk>\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis; continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "simply_connected (sphere a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. simply_connected (sphere a r)
[PROOF STEP]
using 2
[PROOF STATE]
proof (prove)
using this:
2 < DIM('a)

goal (1 subgoal):
 1. simply_connected (sphere a r)
[PROOF STEP]
by (simp add: simply_connected_sphere_eq)
[PROOF STATE]
proof (state)
this:
simply_connected (sphere a r)

goal (3 subgoals):
 1. (\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> locally path_connected (sphere a r)
 2. \<And>z. \<lbrakk>\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis; z \<in> sphere a r\<rbrakk> \<Longrightarrow> f z \<noteq> 0
 3. \<And>g. \<lbrakk>\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis; continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "locally path_connected (sphere a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. locally path_connected (sphere a r)
[PROOF STEP]
by (simp add: locally_path_connected_sphere)
[PROOF STATE]
proof (state)
this:
locally path_connected (sphere a r)

goal (2 subgoals):
 1. \<And>z. \<lbrakk>\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis; z \<in> sphere a r\<rbrakk> \<Longrightarrow> f z \<noteq> 0
 2. \<And>g. \<lbrakk>\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis; continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
show "\<And>z.  z \<in> sphere a r \<Longrightarrow> f z \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>z. z \<in> sphere a r \<Longrightarrow> f z \<noteq> 0
[PROOF STEP]
using fim
[PROOF STATE]
proof (prove)
using this:
f ` sphere a r \<subseteq> sphere 0 1

goal (1 subgoal):
 1. \<And>z. z \<in> sphere a r \<Longrightarrow> f z \<noteq> 0
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
?z \<in> sphere a r \<Longrightarrow> f ?z \<noteq> 0

goal (1 subgoal):
 1. \<And>g. \<lbrakk>\<And>g. \<lbrakk>continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis; continuous_on (sphere a r) g; \<And>x. x \<in> sphere a r \<Longrightarrow> f x = exp (g x)\<rbrakk> \<Longrightarrow> thesis
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
continuous_on (sphere a r) g
?x \<in> sphere a r \<Longrightarrow> f ?x = exp (g ?x)

goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) f (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
have "\<exists>g. continuous_on (sphere a r) g \<and> (\<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real (g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>g. continuous_on (sphere a r) g \<and> (\<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
proof (intro exI conjI)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. continuous_on (sphere a r) ?g
 2. \<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real (?g x))
[PROOF STEP]
show "continuous_on (sphere a r) (Im \<circ> g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. continuous_on (sphere a r) (Im \<circ> g)
[PROOF STEP]
by (intro contg continuous_intros continuous_on_compose)
[PROOF STATE]
proof (state)
this:
continuous_on (sphere a r) (Im \<circ> g)

goal (1 subgoal):
 1. \<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real ((Im \<circ> g) x))
[PROOF STEP]
show "\<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real ((Im \<circ> g) x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real ((Im \<circ> g) x))
[PROOF STEP]
using exp_eq_polar feq fim norm_exp_eq_Re
[PROOF STATE]
proof (prove)
using this:
exp ?z = complex_of_real (exp (Re ?z)) * cis (Im ?z)
?x \<in> sphere a r \<Longrightarrow> f ?x = exp (g ?x)
f ` sphere a r \<subseteq> sphere 0 1
cmod (exp ?z) = exp (Re ?z)

goal (1 subgoal):
 1. \<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real ((Im \<circ> g) x))
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real ((Im \<circ> g) x))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>g. continuous_on (sphere a r) g \<and> (\<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real (g x)))

goal (1 subgoal):
 1. (\<And>c. homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) f (\<lambda>x. c) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
with inessential_eq_continuous_logarithm_circle that
[PROOF STATE]
proof (chain)
picking this:
(\<exists>a. homotopic_with_canon (\<lambda>h. True) ?S (sphere 0 1) ?f (\<lambda>t. a)) = (\<exists>g. continuous_on ?S g \<and> (\<forall>x\<in>?S. ?f x = exp (\<i> * complex_of_real (g x))))
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) f (\<lambda>x. ?c) \<Longrightarrow> thesis
\<exists>g. continuous_on (sphere a r) g \<and> (\<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real (g x)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(\<exists>a. homotopic_with_canon (\<lambda>h. True) ?S (sphere 0 1) ?f (\<lambda>t. a)) = (\<exists>g. continuous_on ?S g \<and> (\<forall>x\<in>?S. ?f x = exp (\<i> * complex_of_real (g x))))
homotopic_with_canon (\<lambda>z. True) (sphere a r) (sphere 0 1) f (\<lambda>x. ?c) \<Longrightarrow> thesis
\<exists>g. continuous_on (sphere a r) g \<and> (\<forall>x\<in>sphere a r. f x = exp (\<i> * complex_of_real (g x)))

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

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma (in Module) l_comb_jointfun_fj:"\<lbrakk>H \<subseteq> carrier M; ideal R A;
        s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> (n::nat)} \<rightarrow> H;
        g \<in> {j. j \<le> (m::nat)} \<rightarrow> H\<rbrakk> \<Longrightarrow>
        nsum M (\<lambda>j. s j \<cdot>\<^sub>s (jointfun n f m g) j) n =
        nsum M (\<lambda>j. s j \<cdot>\<^sub>s f j) n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> H; g \<in> {j. j \<le> m} \<rightarrow> H\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M (\<lambda>j. s j \<cdot>\<^sub>s jointfun n f m g j) n = \<Sigma>\<^sub>e M (\<lambda>j. s j \<cdot>\<^sub>s f j) n
[PROOF STEP]
apply (cut_tac sc_Ring)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> H; g \<in> {j. j \<le> m} \<rightarrow> H; Ring R\<rbrakk> \<Longrightarrow> \<Sigma>\<^sub>e M (\<lambda>j. s j \<cdot>\<^sub>s jointfun n f m g j) n = \<Sigma>\<^sub>e M (\<lambda>j. s j \<cdot>\<^sub>s f j) n
[PROOF STEP]
apply (rule nsum_eq)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> H; g \<in> {j. j \<le> m} \<rightarrow> H; Ring R\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. s j \<cdot>\<^sub>s jointfun n f m g j \<in> carrier M
 2. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> H; g \<in> {j. j \<le> m} \<rightarrow> H; Ring R\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. s j \<cdot>\<^sub>s f j \<in> carrier M
 3. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> H; g \<in> {j. j \<le> m} \<rightarrow> H; Ring R\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. s j \<cdot>\<^sub>s jointfun n f m g j = s j \<cdot>\<^sub>s f j
[PROOF STEP]
apply (rule allI, rule impI, simp add:jointfun_def,
        rule sc_mem,
        simp add:Pi_def Ring.ideal_subset,
        simp add:Pi_def subsetD)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> H; g \<in> {j. j \<le> m} \<rightarrow> H; Ring R\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. s j \<cdot>\<^sub>s f j \<in> carrier M
 2. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> H; g \<in> {j. j \<le> m} \<rightarrow> H; Ring R\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. s j \<cdot>\<^sub>s jointfun n f m g j = s j \<cdot>\<^sub>s f j
[PROOF STEP]
apply (rule allI, rule impI,
        rule sc_mem,
        simp add:Pi_def Ring.ideal_subset,
        simp add:Pi_def subsetD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>H \<subseteq> carrier M; ideal R A; s \<in> {j. j \<le> Suc (n + m)} \<rightarrow> A; f \<in> {j. j \<le> n} \<rightarrow> H; g \<in> {j. j \<le> m} \<rightarrow> H; Ring R\<rbrakk> \<Longrightarrow> \<forall>j\<le>n. s j \<cdot>\<^sub>s jointfun n f m g j = s j \<cdot>\<^sub>s f j
[PROOF STEP]
apply (rule allI, simp add:jointfun_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma norm_divide: "norm (a / b) = norm a / norm b"
  for a b :: "'a::{real_normed_field,field}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. norm (a / b) = norm a / norm b
[PROOF STEP]
by (simp add: divide_inverse norm_mult norm_inverse)


[STATEMENT]
lemma quasinorm_of:
  fixes N::"('a::real_vector) \<Rightarrow> ennreal" and C::real
  assumes "quasinorm_on UNIV C N"
  shows "eNorm (quasinorm_of (C,N)) x = N x"
        "defect (quasinorm_of (C,N)) = C"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. eNorm (quasinorm_of (C, N)) x = N x &&& defect (quasinorm_of (C, N)) = C
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
quasinorm_on UNIV C N

goal (1 subgoal):
 1. eNorm (quasinorm_of (C, N)) x = N x &&& defect (quasinorm_of (C, N)) = C
[PROOF STEP]
unfolding eNorm_def defect_def quasinorm_on_def
[PROOF STATE]
proof (prove)
using this:
(\<forall>x y. x \<in> UNIV \<and> y \<in> UNIV \<longrightarrow> x + y \<in> UNIV \<and> N (x + y) \<le> ennreal C * N x + ennreal C * N y) \<and> (\<forall>c x. x \<in> UNIV \<longrightarrow> c *\<^sub>R x \<in> UNIV \<and> N (c *\<^sub>R x) = ennreal \<bar>c\<bar> * N x) \<and> 1 \<le> C \<and> (0::'a) \<in> UNIV

goal (1 subgoal):
 1. snd (Rep_quasinorm (quasinorm_of (C, N))) x = N x &&& fst (Rep_quasinorm (quasinorm_of (C, N))) = C
[PROOF STEP]
by (auto simp add: quasinorm_of_inverse)


[STATEMENT]
lemma powr_less256:
assumes "0<l" "l<256"
shows "(3844::fin7681 mod_ring)^l \<noteq> 1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. 3844 ^ l \<noteq> 1
[PROOF STEP]
using fast_exp_7681_less256[OF assms]
[PROOF STATE]
proof (prove)
using this:
fast_exp_7681 3844 l \<noteq> 1

goal (1 subgoal):
 1. 3844 ^ l \<noteq> 1
[PROOF STEP]
unfolding fast_exp_7681_to_mod_ring
[PROOF STATE]
proof (prove)
using this:
to_int_mod_ring (of_int_mod_ring 3844 ^ l) \<noteq> 1

goal (1 subgoal):
 1. 3844 ^ l \<noteq> 1
[PROOF STEP]
by (metis of_int_numeral of_int_of_int_mod_ring to_int_mod_ring_hom.hom_one)


[STATEMENT]
theorem diff_times_axiom_valid: "valid diff_times_axiom"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. valid diff_times_axiom
[PROOF STEP]
apply(auto simp add: diff_times_axiom_def valid_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>I a b. is_interp I \<Longrightarrow> directional_derivative I (Times (state_fun fid1) (state_fun fid2)) (a, b) = directional_derivative I (state_fun fid1) (a, b) * dterm_sem I (state_fun fid2) (a, b) + dterm_sem I (state_fun fid1) (a, b) * directional_derivative I (state_fun fid2) (a, b)
[PROOF STEP]
subgoal for I a b
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. is_interp I \<Longrightarrow> directional_derivative I (Times (state_fun fid1) (state_fun fid2)) (a, b) = directional_derivative I (state_fun fid1) (a, b) * dterm_sem I (state_fun fid2) (a, b) + dterm_sem I (state_fun fid1) (a, b) * directional_derivative I (state_fun fid2) (a, b)
[PROOF STEP]
using frechet_correctness[of I "(Times (state_fun fid1) (state_fun fid2))" b]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_interp I; dfree (Times (state_fun fid1) (state_fun fid2))\<rbrakk> \<Longrightarrow> (sterm_sem I (Times (state_fun fid1) (state_fun fid2)) has_derivative frechet I (Times (state_fun fid1) (state_fun fid2)) b) (at b)

goal (1 subgoal):
 1. is_interp I \<Longrightarrow> directional_derivative I (Times (state_fun fid1) (state_fun fid2)) (a, b) = directional_derivative I (state_fun fid1) (a, b) * dterm_sem I (state_fun fid2) (a, b) + dterm_sem I (state_fun fid1) (a, b) * directional_derivative I (state_fun fid2) (a, b)
[PROOF STEP]
unfolding state_fun_def
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>is_interp I; dfree (Times ($f fid1 Var) ($f fid2 Var))\<rbrakk> \<Longrightarrow> (sterm_sem I (Times ($f fid1 Var) ($f fid2 Var)) has_derivative frechet I (Times ($f fid1 Var) ($f fid2 Var)) b) (at b)

goal (1 subgoal):
 1. is_interp I \<Longrightarrow> directional_derivative I (Times ($f fid1 Var) ($f fid2 Var)) (a, b) = directional_derivative I ($f fid1 Var) (a, b) * dterm_sem I ($f fid2 Var) (a, b) + dterm_sem I ($f fid1 Var) (a, b) * directional_derivative I ($f fid2 Var) (a, b)
[PROOF STEP]
apply (auto intro: dfree.intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_interp I; (sterm_sem I (Times ($f fid1 Var) ($f fid2 Var)) has_derivative (\<lambda>v'. Functions I fid1 b * (THE f'. \<forall>x. (Functions I fid2 has_derivative f' x) (at x)) b (\<chi>i. v' \<bullet> axis i 1) + (THE f'. \<forall>x. (Functions I fid1 has_derivative f' x) (at x)) b (\<chi>i. v' \<bullet> axis i 1) * Functions I fid2 b)) (at b)\<rbrakk> \<Longrightarrow> directional_derivative I (Times ($f fid1 Var) ($f fid2 Var)) (a, b) = directional_derivative I ($f fid1 Var) (a, b) * Functions I fid2 a + Functions I fid1 a * directional_derivative I ($f fid2 Var) (a, b)
[PROOF STEP]
unfolding directional_derivative_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_interp I; (sterm_sem I (Times ($f fid1 Var) ($f fid2 Var)) has_derivative (\<lambda>v'. Functions I fid1 b * (THE f'. \<forall>x. (Functions I fid2 has_derivative f' x) (at x)) b (\<chi>i. v' \<bullet> axis i 1) + (THE f'. \<forall>x. (Functions I fid1 has_derivative f' x) (at x)) b (\<chi>i. v' \<bullet> axis i 1) * Functions I fid2 b)) (at b)\<rbrakk> \<Longrightarrow> frechet I (Times ($f fid1 Var) ($f fid2 Var)) (fst (a, b)) (snd (a, b)) = frechet I ($f fid1 Var) (fst (a, b)) (snd (a, b)) * Functions I fid2 a + Functions I fid1 a * frechet I ($f fid2 Var) (fst (a, b)) (snd (a, b))
[PROOF STEP]
by auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma comm_group_mat: "comm_group (monoid_mat TYPE('a :: ab_group_add) nr nc)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. comm_group (monoid_mat TYPE('a) nr nc)
[PROOF STEP]
by (unfold_locales, insert add_inv_exists_mat, auto simp: monoid_mat_def ac_simps Units_def)


[STATEMENT]
lemma extend_set_inv:
     "bij h
      ==> extend_set (%(x,u::'c). inv h x) = project_set (%(x,u::'c). h x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. bij h \<Longrightarrow> extend_set (\<lambda>(x, u). inv h x) = project_set (\<lambda>(x, u). h x)
[PROOF STEP]
apply (unfold bij_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. inj h \<and> surj h \<Longrightarrow> extend_set (\<lambda>(x, u). inv h x) = project_set (\<lambda>(x, u). h x)
[PROOF STEP]
apply (rule ext)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. inj h \<and> surj h \<Longrightarrow> extend_set (\<lambda>(x, u). inv h x) x = project_set (\<lambda>(x, u). h x) x
[PROOF STEP]
apply (force simp add: extend_set_def project_set_def surj_f_inv_f)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma "rec_eval plus_2 [2] = 4"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval plus_2 [2] = 4
[PROOF STEP]
unfolding plus_2_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. rec_eval (CN S [S]) [2] = 4
[PROOF STEP]
by auto


[STATEMENT]
lemma is_binqueue_min_Min_prios:
  assumes "is_binqueue l xs"
  and "normalized xs"
  and "xs \<noteq> []"
  shows "min xs = Some (Min (set (prios xs)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Binomial_Queue.min xs = Some (Min (set (prios xs)))
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
is_binqueue l xs
normalized xs
xs \<noteq> []

goal (1 subgoal):
 1. Binomial_Queue.min xs = Some (Min (set (prios xs)))
[PROOF STEP]
proof (induct xs)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>l. \<lbrakk>normalized []; [] \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min [] = Some (Min (set (prios [])))
 2. \<And>l xs. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); normalized (None # xs); None # xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (None # xs) = Some (Min (set (prios (None # xs))))
 3. \<And>l xs t. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children t); is_heap_list (priority t) (children t); normalized (Some t # xs); Some t # xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some t # xs) = Some (Min (set (prios (Some t # xs))))
[PROOF STEP]
case (Some l xs x)
[PROOF STATE]
proof (state)
this:
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []

goal (3 subgoals):
 1. \<And>l. \<lbrakk>normalized []; [] \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min [] = Some (Min (set (prios [])))
 2. \<And>l xs. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); normalized (None # xs); None # xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (None # xs) = Some (Min (set (prios (None # xs))))
 3. \<And>l xs t. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children t); is_heap_list (priority t) (children t); normalized (Some t # xs); Some t # xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some t # xs) = Some (Min (set (prios (Some t # xs))))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []

goal (1 subgoal):
 1. Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
proof (cases "xs \<noteq> []")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
 2. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; \<not> xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> xs \<noteq> []

goal (2 subgoals):
 1. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
 2. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; \<not> xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
with Some
[PROOF STATE]
proof (chain)
picking this:
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
\<not> xs \<noteq> []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
\<not> xs \<noteq> []

goal (1 subgoal):
 1. Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
using bt_dfs_Min_priority[of x]
[PROOF STATE]
proof (prove)
using this:
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
\<not> xs \<noteq> []
is_heap_list (priority x) (children x) \<Longrightarrow> priority x = Min (set (bt_dfs priority x))

goal (1 subgoal):
 1. Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
by (simp add: min_single)
[PROOF STATE]
proof (state)
this:
Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))

goal (1 subgoal):
 1. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
xs \<noteq> []

goal (1 subgoal):
 1. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
note T = this Some
[PROOF STATE]
proof (state)
this:
xs \<noteq> []
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []

goal (1 subgoal):
 1. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
from T
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
[PROOF STEP]
have "normalized xs"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []

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

goal (1 subgoal):
 1. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
with \<open>xs \<noteq> []\<close>
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
normalized xs
[PROOF STEP]
have "prios xs \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
normalized xs

goal (1 subgoal):
 1. prios xs \<noteq> []
[PROOF STEP]
by (induct xs) (simp_all add: bt_dfs_simp)
[PROOF STATE]
proof (state)
this:
prios xs \<noteq> []

goal (1 subgoal):
 1. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); is_bintree_list l (children x); is_heap_list (priority x) (children x); normalized (Some x # xs); Some x # xs \<noteq> []; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
with T
[PROOF STATE]
proof (chain)
picking this:
xs \<noteq> []
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
prios xs \<noteq> []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
prios xs \<noteq> []

goal (1 subgoal):
 1. Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
using Min_Un[of "set (bt_dfs priority x)" "set (prios xs)"]
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
prios xs \<noteq> []
\<lbrakk>finite (set (bt_dfs priority x)); set (bt_dfs priority x) \<noteq> {}; finite (set (prios xs)); set (prios xs) \<noteq> {}\<rbrakk> \<Longrightarrow> Min (set (bt_dfs priority x) \<union> set (prios xs)) = ord_class.min (Min (set (bt_dfs priority x))) (Min (set (prios xs)))

goal (1 subgoal):
 1. Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
using bt_dfs_Min_priority[of x]
[PROOF STATE]
proof (prove)
using this:
xs \<noteq> []
is_binqueue (Suc l) xs
\<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs)))
is_bintree_list l (children x)
is_heap_list (priority x) (children x)
normalized (Some x # xs)
Some x # xs \<noteq> []
prios xs \<noteq> []
\<lbrakk>finite (set (bt_dfs priority x)); set (bt_dfs priority x) \<noteq> {}; finite (set (prios xs)); set (prios xs) \<noteq> {}\<rbrakk> \<Longrightarrow> Min (set (bt_dfs priority x) \<union> set (prios xs)) = ord_class.min (Min (set (bt_dfs priority x))) (Min (set (prios xs)))
is_heap_list (priority x) (children x) \<Longrightarrow> priority x = Min (set (bt_dfs priority x))

goal (1 subgoal):
 1. Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))
[PROOF STEP]
by (auto simp add: bt_dfs_simp ord_class.min_def)
[PROOF STATE]
proof (state)
this:
Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
Binomial_Queue.min (Some x # xs) = Some (Min (set (prios (Some x # xs))))

goal (2 subgoals):
 1. \<And>l. \<lbrakk>normalized []; [] \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min [] = Some (Min (set (prios [])))
 2. \<And>l xs. \<lbrakk>is_binqueue (Suc l) xs; \<lbrakk>normalized xs; xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min xs = Some (Min (set (prios xs))); normalized (None # xs); None # xs \<noteq> []\<rbrakk> \<Longrightarrow> Binomial_Queue.min (None # xs) = Some (Min (set (prios (None # xs))))
[PROOF STEP]
qed simp_all


[STATEMENT]
lemma INF_of_enat_infty_iff2:
  "\<infinity> = (INF x \<in> A. enat (f x)) \<longleftrightarrow> A={}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<infinity> = (INF x\<in>A. enat (f x))) = (A = {})
[PROOF STEP]
by (metis INF_of_enat_infty_iff1)


[STATEMENT]
lemma setdist_ltE:
  assumes "setdist S T < b" "S \<noteq> {}" "T \<noteq> {}"
    obtains x y where "x \<in> S" "y \<in> T" "dist x y < b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> S; y \<in> T; dist x y < b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
setdist S T < b
S \<noteq> {}
T \<noteq> {}

goal (1 subgoal):
 1. (\<And>x y. \<lbrakk>x \<in> S; y \<in> T; dist x y < b\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (auto simp: not_le [symmetric] le_setdist_iff)


[STATEMENT]
lemma nat_power_functions:
  shows "nat_power n \<in> carrier (Fun R)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. nat_power n \<in> carrier (function_ring (carrier R) R)
[PROOF STEP]
apply(rule function_ring_car_memI)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>a. a \<in> carrier R \<Longrightarrow> nat_power n a \<in> carrier R
 2. \<And>a. a \<notin> carrier R \<Longrightarrow> nat_power n a = undefined
[PROOF STEP]
using  nat_power_def
[PROOF STATE]
proof (prove)
using this:
nat_power = (\<lambda>n. \<lambda>a\<in>carrier R. a [^] n)

goal (2 subgoals):
 1. \<And>a. a \<in> carrier R \<Longrightarrow> nat_power n a \<in> carrier R
 2. \<And>a. a \<notin> carrier R \<Longrightarrow> nat_power n a = undefined
[PROOF STEP]
apply simp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a. a \<notin> carrier R \<Longrightarrow> nat_power n a = undefined
[PROOF STEP]
by (simp add: nat_power_def)


[STATEMENT]
lemma fds_nth_scaleR [simp]: "fds_nth (c *\<^sub>R f) = (\<lambda>n. c *\<^sub>R fds_nth f n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fds_nth (c *\<^sub>R f) = (\<lambda>n. c *\<^sub>R fds_nth f n)
[PROOF STEP]
by (simp add: scaleR_fds_def fun_eq_iff fds_nth_fds)


[STATEMENT]
lemma rat_real_conversion: assumes "finite cs"
  shows "(\<exists> v :: rat valuation. v \<Turnstile>\<^sub>c\<^sub>s cs) \<longleftrightarrow> (\<exists> v :: real valuation. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs) = (\<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs
 2. \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs
[PROOF STEP]
show "\<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs
[PROOF STEP]
using of_rat_val_constraint
[PROOF STATE]
proof (prove)
using this:
of_rat_val ?v \<Turnstile>\<^sub>c ?c = ?v \<Turnstile>\<^sub>c ?c

goal (1 subgoal):
 1. \<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs

goal (1 subgoal):
 1. \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs
[PROOF STEP]
assume "\<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs"
[PROOF STATE]
proof (state)
this:
\<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs

goal (1 subgoal):
 1. \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs
[PROOF STEP]
obtain v where *: "v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs"
[PROOF STATE]
proof (prove)
using this:
\<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs

goal (1 subgoal):
 1. (\<And>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs

goal (1 subgoal):
 1. \<exists>v. v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs \<Longrightarrow> \<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs
[PROOF STEP]
show "\<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs
[PROOF STEP]
proof (rule ccontr)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
assume "\<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs"
[PROOF STATE]
proof (state)
this:
\<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
from farkas_coefficients[OF assms] this
[PROOF STATE]
proof (chain)
picking this:
(\<exists>C. farkas_coefficients cs C) = (\<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs)
\<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs
[PROOF STEP]
obtain C where "farkas_coefficients cs C"
[PROOF STATE]
proof (prove)
using this:
(\<exists>C. farkas_coefficients cs C) = (\<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs)
\<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs

goal (1 subgoal):
 1. (\<And>C. farkas_coefficients cs C \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
farkas_coefficients cs C

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
from this[unfolded farkas_coefficients_def]
[PROOF STATE]
proof (chain)
picking this:
\<exists>d rel. (\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0) \<and> (\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c)) = Le_Constraint rel 0 d \<and> (rel = Leq_Rel \<and> d < 0 \<or> rel = Lt_Rel \<and> d \<le> 0)
[PROOF STEP]
obtain d rel where
      isleq: "(\<forall>(r,c) \<in> set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0)" and
      leq: "(\<Sum> (r,c) \<leftarrow> C. lec_of_constraint (r *R c)) = Le_Constraint rel 0 d" and
      choice: "rel = Lt_Rel \<and> d \<le> 0 \<or> rel = Leq_Rel \<and> d < 0"
[PROOF STATE]
proof (prove)
using this:
\<exists>d rel. (\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0) \<and> (\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c)) = Le_Constraint rel 0 d \<and> (rel = Leq_Rel \<and> d < 0 \<or> rel = Lt_Rel \<and> d \<le> 0)

goal (1 subgoal):
 1. (\<And>rel d. \<lbrakk>\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0; (\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c)) = Le_Constraint rel 0 d; rel = Lt_Rel \<and> d \<le> 0 \<or> rel = Leq_Rel \<and> d < 0\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0
(\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c)) = Le_Constraint rel 0 d
rel = Lt_Rel \<and> d \<le> 0 \<or> rel = Leq_Rel \<and> d < 0

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0
(\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c)) = Le_Constraint rel 0 d
rel = Lt_Rel \<and> d \<le> 0 \<or> rel = Leq_Rel \<and> d < 0

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
fix r c
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
assume c: "(r,c) \<in> set C"
[PROOF STATE]
proof (state)
this:
(r, c) \<in> set C

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
from c * isleq
[PROOF STATE]
proof (chain)
picking this:
(r, c) \<in> set C
v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs
\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0
[PROOF STEP]
have "v \<Turnstile>\<^sub>c c"
[PROOF STATE]
proof (prove)
using this:
(r, c) \<in> set C
v \<Turnstile>\<^sub>r\<^sub>c\<^sub>s cs
\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0

goal (1 subgoal):
 1. v \<Turnstile>\<^sub>c c
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
v \<Turnstile>\<^sub>c c

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
hence v: "v \<Turnstile>\<^sub>c (r *R c)"
[PROOF STATE]
proof (prove)
using this:
v \<Turnstile>\<^sub>c c

goal (1 subgoal):
 1. v \<Turnstile>\<^sub>c (r *R c)
[PROOF STEP]
by (rule sat_scale_rat_real)
[PROOF STATE]
proof (state)
this:
v \<Turnstile>\<^sub>c (r *R c)

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
from c isleq
[PROOF STATE]
proof (chain)
picking this:
(r, c) \<in> set C
\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0
[PROOF STEP]
have "is_le (r *R c)"
[PROOF STATE]
proof (prove)
using this:
(r, c) \<in> set C
\<forall>(r, c)\<in>set C. c \<in> cs \<and> is_le (r *R c) \<and> r \<noteq> 0

goal (1 subgoal):
 1. is_le (r *R c)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
is_le (r *R c)

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
from lec_of_constraint_real[OF this] v
[PROOF STATE]
proof (chain)
picking this:
?v \<Turnstile>\<^sub>l\<^sub>e of_rat_lec (lec_of_constraint (r *R c)) = ?v \<Turnstile>\<^sub>c (r *R c)
v \<Turnstile>\<^sub>c (r *R c)
[PROOF STEP]
have "v \<Turnstile>\<^sub>l\<^sub>e of_rat_lec (lec_of_constraint (r *R c))"
[PROOF STATE]
proof (prove)
using this:
?v \<Turnstile>\<^sub>l\<^sub>e of_rat_lec (lec_of_constraint (r *R c)) = ?v \<Turnstile>\<^sub>c (r *R c)
v \<Turnstile>\<^sub>c (r *R c)

goal (1 subgoal):
 1. v \<Turnstile>\<^sub>l\<^sub>e of_rat_lec (lec_of_constraint (r *R c))
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
v \<Turnstile>\<^sub>l\<^sub>e of_rat_lec (lec_of_constraint (r *R c))

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
(?r2, ?c2) \<in> set C \<Longrightarrow> v \<Turnstile>\<^sub>l\<^sub>e of_rat_lec (lec_of_constraint (?r2 *R ?c2))

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
note v = this
[PROOF STATE]
proof (state)
this:
(?r2, ?c2) \<in> set C \<Longrightarrow> v \<Turnstile>\<^sub>l\<^sub>e of_rat_lec (lec_of_constraint (?r2 *R ?c2))

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
have "Le_Constraint rel 0 (of_rat d) = of_rat_lec (\<Sum> (r,c) \<leftarrow> C. lec_of_constraint (r *R c))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Le_Constraint rel 0 (real_of_rat d) = of_rat_lec (\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c))
[PROOF STEP]
unfolding leq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Le_Constraint rel 0 (real_of_rat d) = of_rat_lec (Le_Constraint rel 0 d)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Le_Constraint rel 0 (real_of_rat d) = of_rat_lec (\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c))

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
Le_Constraint rel 0 (real_of_rat d) = of_rat_lec (\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c))

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
have "\<dots> = (\<Sum> (r,c) \<leftarrow> C. of_rat_lec (lec_of_constraint (r *R c)))" (is "_ = ?sum")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. of_rat_lec (\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c)) = (\<Sum>(r, c)\<leftarrow>C. of_rat_lec (lec_of_constraint (r *R c)))
[PROOF STEP]
unfolding of_rat_lec_sum map_map o_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>x\<leftarrow>C. of_rat_lec (case x of (r, c) \<Rightarrow> lec_of_constraint (r *R c))) = (\<Sum>(r, c)\<leftarrow>C. of_rat_lec (lec_of_constraint (r *R c)))
[PROOF STEP]
by (rule arg_cong[of _ _ sum_list], auto)
[PROOF STATE]
proof (state)
this:
of_rat_lec (\<Sum>(r, c)\<leftarrow>C. lec_of_constraint (r *R c)) = (\<Sum>(r, c)\<leftarrow>C. of_rat_lec (lec_of_constraint (r *R c)))

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
Le_Constraint rel 0 (real_of_rat d) = (\<Sum>(r, c)\<leftarrow>C. of_rat_lec (lec_of_constraint (r *R c)))
[PROOF STEP]
have leq: "Le_Constraint rel 0 (of_rat d) = ?sum"
[PROOF STATE]
proof (prove)
using this:
Le_Constraint rel 0 (real_of_rat d) = (\<Sum>(r, c)\<leftarrow>C. of_rat_lec (lec_of_constraint (r *R c)))

goal (1 subgoal):
 1. Le_Constraint rel 0 (real_of_rat d) = (\<Sum>(r, c)\<leftarrow>C. of_rat_lec (lec_of_constraint (r *R c)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
Le_Constraint rel 0 (real_of_rat d) = (\<Sum>(r, c)\<leftarrow>C. of_rat_lec (lec_of_constraint (r *R c)))

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
have "v \<Turnstile>\<^sub>l\<^sub>e Le_Constraint rel 0 (of_rat d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<Turnstile>\<^sub>l\<^sub>e Le_Constraint rel 0 (real_of_rat d)
[PROOF STEP]
unfolding leq
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. v \<Turnstile>\<^sub>l\<^sub>e (\<Sum>(r, c)\<leftarrow>C. of_rat_lec (lec_of_constraint (r *R c)))
[PROOF STEP]
by (rule satisfies_sumlist_le_constraints, insert v, auto)
[PROOF STATE]
proof (state)
this:
v \<Turnstile>\<^sub>l\<^sub>e Le_Constraint rel 0 (real_of_rat d)

goal (1 subgoal):
 1. \<nexists>v. v \<Turnstile>\<^sub>c\<^sub>s cs \<Longrightarrow> False
[PROOF STEP]
with choice
[PROOF STATE]
proof (chain)
picking this:
rel = Lt_Rel \<and> d \<le> 0 \<or> rel = Leq_Rel \<and> d < 0
v \<Turnstile>\<^sub>l\<^sub>e Le_Constraint rel 0 (real_of_rat d)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
rel = Lt_Rel \<and> d \<le> 0 \<or> rel = Leq_Rel \<and> d < 0
v \<Turnstile>\<^sub>l\<^sub>e Le_Constraint rel 0 (real_of_rat d)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>v. v \<Turnstile>\<^sub>c\<^sub>s cs

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma nth_subdegree_mult [simp]:
  fixes f g :: "('a :: {mult_zero,comm_monoid_add}) fps"
  shows "(f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
let ?n = "subdegree f + subdegree g"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
have "(f * g) $ ?n = (\<Sum>i=0..?n. f$i * g$(?n-i))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = (\<Sum>i = 0..subdegree f + subdegree g. f $ i * g $ (subdegree f + subdegree g - i))
[PROOF STEP]
by (simp add: fps_mult_nth)
[PROOF STATE]
proof (state)
this:
(f * g) $ (subdegree f + subdegree g) = (\<Sum>i = 0..subdegree f + subdegree g. f $ i * g $ (subdegree f + subdegree g - i))

goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(f * g) $ (subdegree f + subdegree g) = (\<Sum>i = 0..subdegree f + subdegree g. f $ i * g $ (subdegree f + subdegree g - i))

goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
have "... = (\<Sum>i=0..?n. if i = subdegree f then f$i * g$(?n-i) else 0)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..subdegree f + subdegree g. f $ i * g $ (subdegree f + subdegree g - i)) = (\<Sum>i = 0..subdegree f + subdegree g. if i = subdegree f then f $ i * g $ (subdegree f + subdegree g - i) else (0::'a))
[PROOF STEP]
proof (intro sum.cong)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {0..subdegree f + subdegree g} = {0..subdegree f + subdegree g}
 2. \<And>x. x \<in> {0..subdegree f + subdegree g} \<Longrightarrow> f $ x * g $ (subdegree f + subdegree g - x) = (if x = subdegree f then f $ x * g $ (subdegree f + subdegree g - x) else (0::'a))
[PROOF STEP]
fix x
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. {0..subdegree f + subdegree g} = {0..subdegree f + subdegree g}
 2. \<And>x. x \<in> {0..subdegree f + subdegree g} \<Longrightarrow> f $ x * g $ (subdegree f + subdegree g - x) = (if x = subdegree f then f $ x * g $ (subdegree f + subdegree g - x) else (0::'a))
[PROOF STEP]
assume x: "x \<in> {0..?n}"
[PROOF STATE]
proof (state)
this:
x \<in> {0..subdegree f + subdegree g}

goal (2 subgoals):
 1. {0..subdegree f + subdegree g} = {0..subdegree f + subdegree g}
 2. \<And>x. x \<in> {0..subdegree f + subdegree g} \<Longrightarrow> f $ x * g $ (subdegree f + subdegree g - x) = (if x = subdegree f then f $ x * g $ (subdegree f + subdegree g - x) else (0::'a))
[PROOF STEP]
hence "x = subdegree f \<or> x < subdegree f \<or> ?n - x < subdegree g"
[PROOF STATE]
proof (prove)
using this:
x \<in> {0..subdegree f + subdegree g}

goal (1 subgoal):
 1. x = subdegree f \<or> x < subdegree f \<or> subdegree f + subdegree g - x < subdegree g
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
x = subdegree f \<or> x < subdegree f \<or> subdegree f + subdegree g - x < subdegree g

goal (2 subgoals):
 1. {0..subdegree f + subdegree g} = {0..subdegree f + subdegree g}
 2. \<And>x. x \<in> {0..subdegree f + subdegree g} \<Longrightarrow> f $ x * g $ (subdegree f + subdegree g - x) = (if x = subdegree f then f $ x * g $ (subdegree f + subdegree g - x) else (0::'a))
[PROOF STEP]
thus "f $ x * g $ (?n - x) = (if x = subdegree f then f $ x * g $ (?n - x) else 0)"
[PROOF STATE]
proof (prove)
using this:
x = subdegree f \<or> x < subdegree f \<or> subdegree f + subdegree g - x < subdegree g

goal (1 subgoal):
 1. f $ x * g $ (subdegree f + subdegree g - x) = (if x = subdegree f then f $ x * g $ (subdegree f + subdegree g - x) else (0::'a))
[PROOF STEP]
by (elim disjE conjE) auto
[PROOF STATE]
proof (state)
this:
f $ x * g $ (subdegree f + subdegree g - x) = (if x = subdegree f then f $ x * g $ (subdegree f + subdegree g - x) else (0::'a))

goal (1 subgoal):
 1. {0..subdegree f + subdegree g} = {0..subdegree f + subdegree g}
[PROOF STEP]
qed auto
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..subdegree f + subdegree g. f $ i * g $ (subdegree f + subdegree g - i)) = (\<Sum>i = 0..subdegree f + subdegree g. if i = subdegree f then f $ i * g $ (subdegree f + subdegree g - i) else (0::'a))

goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..subdegree f + subdegree g. f $ i * g $ (subdegree f + subdegree g - i)) = (\<Sum>i = 0..subdegree f + subdegree g. if i = subdegree f then f $ i * g $ (subdegree f + subdegree g - i) else (0::'a))

goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
have "... = f $ subdegree f * g $ subdegree g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Sum>i = 0..subdegree f + subdegree g. if i = subdegree f then f $ i * g $ (subdegree f + subdegree g - i) else (0::'a)) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<Sum>i = 0..subdegree f + subdegree g. if i = subdegree f then f $ i * g $ (subdegree f + subdegree g - i) else (0::'a)) = f $ subdegree f * g $ subdegree g

goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
(f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g

goal (1 subgoal):
 1. (f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
(f * g) $ (subdegree f + subdegree g) = f $ subdegree f * g $ subdegree g

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma squash_mult:
  shows "squash ((a::real) * b) = squash a * squash b"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. squash (a * b) = squash a * squash b
[PROOF STEP]
unfolding squash_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if 0 < a * b then 1 else if a * b < 0 then - 1 else 0) = (if 0 < a then 1 else if a < 0 then - 1 else 0) * (if 0 < b then 1 else if b < 0 then - 1 else 0)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>b < 0; a < 0; a * b < 0\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>a < 0; 0 < b\<rbrakk> \<Longrightarrow> a * b < 0
[PROOF STEP]
using less_not_sym mult_neg_neg
[PROOF STATE]
proof (prove)
using this:
?x < ?y \<Longrightarrow> \<not> ?y < ?x
\<lbrakk>?a < (0::?'a); ?b < (0::?'a)\<rbrakk> \<Longrightarrow> (0::?'a) < ?a * ?b

goal (2 subgoals):
 1. \<lbrakk>b < 0; a < 0; a * b < 0\<rbrakk> \<Longrightarrow> False
 2. \<lbrakk>a < 0; 0 < b\<rbrakk> \<Longrightarrow> a * b < 0
[PROOF STEP]
apply blast
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>a < 0; 0 < b\<rbrakk> \<Longrightarrow> a * b < 0
[PROOF STEP]
using mult_less_0_iff
[PROOF STATE]
proof (prove)
using this:
(?a * ?b < (0::?'a)) = ((0::?'a) < ?a \<and> ?b < (0::?'a) \<or> ?a < (0::?'a) \<and> (0::?'a) < ?b)

goal (1 subgoal):
 1. \<lbrakk>a < 0; 0 < b\<rbrakk> \<Longrightarrow> a * b < 0
[PROOF STEP]
by blast


[STATEMENT]
lemma holomorphic_fun_eq_const_on_connected:
  assumes holf: "f holomorphic_on S" and "open S"
      and cons: "connected S"
      and der: "\<And>n. 0 < n \<Longrightarrow> (deriv ^^ n) f z = 0"
      and "z \<in> S" "w \<in> S"
    shows "f w = f z"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. f w = f z
[PROOF STEP]
proof (rule holomorphic_fun_eq_0_on_connected [of "\<lambda>w. f w - f z" S z, simplified])
[PROOF STATE]
proof (state)
goal (6 subgoals):
 1. (\<lambda>w. f w - f z) holomorphic_on S
 2. open S
 3. connected S
 4. \<And>n. (deriv ^^ n) (\<lambda>w. f w - f z) z = 0
 5. z \<in> S
 6. w \<in> S
[PROOF STEP]
show "(\<lambda>w. f w - f z) holomorphic_on S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<lambda>w. f w - f z) holomorphic_on S
[PROOF STEP]
by (intro assms holomorphic_intros)
[PROOF STATE]
proof (state)
this:
(\<lambda>w. f w - f z) holomorphic_on S

goal (5 subgoals):
 1. open S
 2. connected S
 3. \<And>n. (deriv ^^ n) (\<lambda>w. f w - f z) z = 0
 4. z \<in> S
 5. w \<in> S
[PROOF STEP]
show "\<And>n. (deriv ^^ n) (\<lambda>w. f w - f z) z = 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. (deriv ^^ n) (\<lambda>w. f w - f z) z = 0
[PROOF STEP]
by (subst higher_deriv_diff) (use assms in \<open>auto intro: holomorphic_intros\<close>)
[PROOF STATE]
proof (state)
this:
(deriv ^^ ?n) (\<lambda>w. f w - f z) z = 0

goal (4 subgoals):
 1. open S
 2. connected S
 3. z \<in> S
 4. w \<in> S
[PROOF STEP]
qed (use assms in auto)


[STATEMENT]
lemma list_slice2_last: "
  \<lbrakk> length xs mod k > 0; m = length xs div k \<rbrakk> \<Longrightarrow>
  list_slice2 xs k ! m = xs \<up> (length xs div k * k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>0 < length xs mod k; m = length xs div k\<rbrakk> \<Longrightarrow> list_slice2 xs k ! m = xs \<up> (length xs div k * k)
[PROOF STEP]
by (simp add: list_slice2_def nth_append list_slice_length)


[STATEMENT]
lemma oFix_eq_self: "F a = a \<Longrightarrow> oFix F a = a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F a = a \<Longrightarrow> oFix F a = a
[PROOF STEP]
apply (unfold oFix_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F a = a \<Longrightarrow> oLimit (\<lambda>n. iter n F a) = a
[PROOF STEP]
apply (subgoal_tac "\<forall>n. iter n F a = a", simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. F a = a \<Longrightarrow> \<forall>n. iter n F a = a
[PROOF STEP]
apply (rule allI, induct_tac n, simp_all)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma prod_star_closure: "x \<le> z\<^sup>\<star> \<Longrightarrow> y \<le> z\<^sup>\<star> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>x \<le> z\<^sup>\<star>; y \<le> z\<^sup>\<star>\<rbrakk> \<Longrightarrow> x \<cdot> y \<le> z\<^sup>\<star>
[PROOF STEP]
by (metis mult_isol_var star_trans_eq)


[STATEMENT]
lemma subst_tm_HPair [simp]: "subst i x (HPair a b) = HPair (subst i x a) (subst i x b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. subst i x (HPair a b) = HPair (subst i x a) (subst i x b)
[PROOF STEP]
by (auto simp: HPair_def)


[STATEMENT]
lemma action_proj_inter: "action_proj (action_proj a vs1) vs2 = action_proj a (vs1 \<inter> vs2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. action_proj (action_proj a vs1) vs2 = action_proj a (vs1 \<inter> vs2)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. action_proj (action_proj a vs1) vs2 = action_proj a (vs1 \<inter> vs2)
[PROOF STEP]
have
    "fmrestrict_set vs2 (fmrestrict_set vs1 (fst a)) = fmrestrict_set (vs1 \<inter> vs2) (fst a)"
    "fmrestrict_set vs2 (fmrestrict_set vs1 (snd a)) = fmrestrict_set (vs1 \<inter> vs2) (snd a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. fmrestrict_set vs2 (fmrestrict_set vs1 (fst a)) = fmrestrict_set (vs1 \<inter> vs2) (fst a) &&& fmrestrict_set vs2 (fmrestrict_set vs1 (snd a)) = fmrestrict_set (vs1 \<inter> vs2) (snd a)
[PROOF STEP]
using inf_commute action_proj_inter_i
[PROOF STATE]
proof (prove)
using this:
inf ?x ?y = inf ?y ?x
fmrestrict_set ?V (fmrestrict_set ?W ?f) = fmrestrict_set (?V \<inter> ?W) ?f

goal (1 subgoal):
 1. fmrestrict_set vs2 (fmrestrict_set vs1 (fst a)) = fmrestrict_set (vs1 \<inter> vs2) (fst a) &&& fmrestrict_set vs2 (fmrestrict_set vs1 (snd a)) = fmrestrict_set (vs1 \<inter> vs2) (snd a)
[PROOF STEP]
by metis+
[PROOF STATE]
proof (state)
this:
fmrestrict_set vs2 (fmrestrict_set vs1 (fst a)) = fmrestrict_set (vs1 \<inter> vs2) (fst a)
fmrestrict_set vs2 (fmrestrict_set vs1 (snd a)) = fmrestrict_set (vs1 \<inter> vs2) (snd a)

goal (1 subgoal):
 1. action_proj (action_proj a vs1) vs2 = action_proj a (vs1 \<inter> vs2)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
fmrestrict_set vs2 (fmrestrict_set vs1 (fst a)) = fmrestrict_set (vs1 \<inter> vs2) (fst a)
fmrestrict_set vs2 (fmrestrict_set vs1 (snd a)) = fmrestrict_set (vs1 \<inter> vs2) (snd a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
fmrestrict_set vs2 (fmrestrict_set vs1 (fst a)) = fmrestrict_set (vs1 \<inter> vs2) (fst a)
fmrestrict_set vs2 (fmrestrict_set vs1 (snd a)) = fmrestrict_set (vs1 \<inter> vs2) (snd a)

goal (1 subgoal):
 1. action_proj (action_proj a vs1) vs2 = action_proj a (vs1 \<inter> vs2)
[PROOF STEP]
unfolding action_proj_def
[PROOF STATE]
proof (prove)
using this:
fmrestrict_set vs2 (fmrestrict_set vs1 (fst a)) = fmrestrict_set (vs1 \<inter> vs2) (fst a)
fmrestrict_set vs2 (fmrestrict_set vs1 (snd a)) = fmrestrict_set (vs1 \<inter> vs2) (snd a)

goal (1 subgoal):
 1. (fmrestrict_set vs2 (fst (fmrestrict_set vs1 (fst a), fmrestrict_set vs1 (snd a))), fmrestrict_set vs2 (snd (fmrestrict_set vs1 (fst a), fmrestrict_set vs1 (snd a)))) = (fmrestrict_set (vs1 \<inter> vs2) (fst a), fmrestrict_set (vs1 \<inter> vs2) (snd a))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
action_proj (action_proj a vs1) vs2 = action_proj a (vs1 \<inter> vs2)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma listset_ConsD : "x#xs \<in> listset (A # As) \<Longrightarrow> x \<in> A \<and> xs \<in> listset As"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x # xs \<in> listset (A # As) \<Longrightarrow> x \<in> A \<and> xs \<in> listset As
[PROOF STEP]
unfolding listset_def set_Cons_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. x # xs \<in> rec_list {[]} (\<lambda>A As Asa. {x # xs |x xs. x \<in> A \<and> xs \<in> Asa}) (A # As) \<Longrightarrow> x \<in> A \<and> xs \<in> rec_list {[]} (\<lambda>A As Asa. {x # xs |x xs. x \<in> A \<and> xs \<in> Asa}) As
[PROOF STEP]
by auto


[STATEMENT]
lemma Chernoff_ineq_nn_integral_le:
  assumes s: "s > 0" and [measurable]: "A \<in> sets M"
  assumes [measurable]: "f \<in> borel_measurable M"
  shows   "emeasure M {x\<in>A. f x \<le> a} \<le>
           ennreal (exp (s * a)) * nn_integral M (\<lambda>x. ennreal (exp (-s * f x)) * indicator A x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. emeasure M {x \<in> A. f x \<le> a} \<le> ennreal (exp (s * a)) * \<integral>\<^sup>+ x. ennreal (exp (- s * f x)) * indicator A x \<partial>M
[PROOF STEP]
using Chernoff_ineq_nn_integral_ge[of s A M "\<lambda>x. -f x" "-a"] assms
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < s; A \<in> sets M; (\<lambda>x. - f x * indicat_real A x) \<in> borel_measurable M\<rbrakk> \<Longrightarrow> emeasure M {x \<in> A. - a \<le> - f x} \<le> ennreal (exp (- s * - a)) * \<integral>\<^sup>+ x. ennreal (exp (s * - f x)) * indicator A x \<partial>M
0 < s
A \<in> sets M
f \<in> borel_measurable M

goal (1 subgoal):
 1. emeasure M {x \<in> A. f x \<le> a} \<le> ennreal (exp (s * a)) * \<integral>\<^sup>+ x. ennreal (exp (- s * f x)) * indicator A x \<partial>M
[PROOF STEP]
by simp


[STATEMENT]
lemma take_bit_Suc:
  \<open>take_bit (Suc n) a = take_bit n (a div 2) * 2 + a mod 2\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (Suc n) a = take_bit n (a div (2::'a)) * (2::'a) + a mod (2::'a)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. take_bit (Suc n) a = take_bit n (a div (2::'a)) * (2::'a) + a mod (2::'a)
[PROOF STEP]
have \<open>take_bit (Suc n) (a div 2 * 2 + of_bool (odd a)) = take_bit n (a div 2) * 2 + of_bool (odd a)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. take_bit (Suc n) (a div (2::'a) * (2::'a) + of_bool (odd a)) = take_bit n (a div (2::'a)) * (2::'a) + of_bool (odd a)
[PROOF STEP]
using even_succ_mod_exp [of \<open>2 * (a div 2)\<close> \<open>Suc n\<close>]
      mult_exp_mod_exp_eq [of 1 \<open>Suc n\<close> \<open>a div 2\<close>]
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>even ((2::'a) * (a div (2::'a))); 0 < Suc n\<rbrakk> \<Longrightarrow> ((1::'a) + (2::'a) * (a div (2::'a))) mod (2::'a) ^ Suc n = (1::'a) + (2::'a) * (a div (2::'a)) mod (2::'a) ^ Suc n
1 \<le> Suc n \<Longrightarrow> a div (2::'a) * (2::'a) ^ 1 mod (2::'a) ^ Suc n = a div (2::'a) mod (2::'a) ^ (Suc n - 1) * (2::'a) ^ 1

goal (1 subgoal):
 1. take_bit (Suc n) (a div (2::'a) * (2::'a) + of_bool (odd a)) = take_bit n (a div (2::'a)) * (2::'a) + of_bool (odd a)
[PROOF STEP]
by (auto simp add: take_bit_eq_mod ac_simps)
[PROOF STATE]
proof (state)
this:
take_bit (Suc n) (a div (2::'a) * (2::'a) + of_bool (odd a)) = take_bit n (a div (2::'a)) * (2::'a) + of_bool (odd a)

goal (1 subgoal):
 1. take_bit (Suc n) a = take_bit n (a div (2::'a)) * (2::'a) + a mod (2::'a)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
take_bit (Suc n) (a div (2::'a) * (2::'a) + of_bool (odd a)) = take_bit n (a div (2::'a)) * (2::'a) + of_bool (odd a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
take_bit (Suc n) (a div (2::'a) * (2::'a) + of_bool (odd a)) = take_bit n (a div (2::'a)) * (2::'a) + of_bool (odd a)

goal (1 subgoal):
 1. take_bit (Suc n) a = take_bit n (a div (2::'a)) * (2::'a) + a mod (2::'a)
[PROOF STEP]
using div_mult_mod_eq [of a 2]
[PROOF STATE]
proof (prove)
using this:
take_bit (Suc n) (a div (2::'a) * (2::'a) + of_bool (odd a)) = take_bit n (a div (2::'a)) * (2::'a) + of_bool (odd a)
a div (2::'a) * (2::'a) + a mod (2::'a) = a

goal (1 subgoal):
 1. take_bit (Suc n) a = take_bit n (a div (2::'a)) * (2::'a) + a mod (2::'a)
[PROOF STEP]
by (simp add: mod_2_eq_odd)
[PROOF STATE]
proof (state)
this:
take_bit (Suc n) a = take_bit n (a div (2::'a)) * (2::'a) + a mod (2::'a)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma continuous_max [continuous_intros]:
  fixes f :: "'a::t2_space \<Rightarrow> 'b::linorder_topology"
  shows "\<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. (max (f x) (g x)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>continuous F f; continuous F g\<rbrakk> \<Longrightarrow> continuous F (\<lambda>x. max (f x) (g x))
[PROOF STEP]
by (simp add: tendsto_max continuous_def)


[STATEMENT]
lemma PiE_dflt_empty_iff [simp]: "PiE_dflt A dflt B = {} \<longleftrightarrow> (\<exists>x\<in>A. B x = {})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Pi_pmf.PiE_dflt A dflt B = {}) = (\<exists>x\<in>A. B x = {})
[PROOF STEP]
by (simp add: dflt_image_PiE [symmetric] PiE_eq_empty_iff)


[STATEMENT]
lemma (in semiring_0) poly_cmult_distr: "a %* (p +++ q) = a %* p +++ a %* q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a %* (p +++ q) = a %* p +++ a %* q
[PROOF STEP]
proof (induct p arbitrary: q)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>q. a %* ([] +++ q) = a %* [] +++ a %* q
 2. \<And>aa p q. (\<And>q. a %* (p +++ q) = a %* p +++ a %* q) \<Longrightarrow> a %* (aa # p +++ q) = a %* (aa # p) +++ a %* q
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. \<And>q. a %* ([] +++ q) = a %* [] +++ a %* q
 2. \<And>aa p q. (\<And>q. a %* (p +++ q) = a %* p +++ a %* q) \<Longrightarrow> a %* (aa # p +++ q) = a %* (aa # p) +++ a %* q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a %* ([] +++ q) = a %* [] +++ a %* q
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
a %* ([] +++ q) = a %* [] +++ a %* q

goal (1 subgoal):
 1. \<And>aa p q. (\<And>q. a %* (p +++ q) = a %* p +++ a %* q) \<Longrightarrow> a %* (aa # p +++ q) = a %* (aa # p) +++ a %* q
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa p q. (\<And>q. a %* (p +++ q) = a %* p +++ a %* q) \<Longrightarrow> a %* (aa # p +++ q) = a %* (aa # p) +++ a %* q
[PROOF STEP]
case Cons
[PROOF STATE]
proof (state)
this:
a %* (p_ +++ ?q1) = a %* p_ +++ a %* ?q1

goal (1 subgoal):
 1. \<And>aa p q. (\<And>q. a %* (p +++ q) = a %* p +++ a %* q) \<Longrightarrow> a %* (aa # p +++ q) = a %* (aa # p) +++ a %* q
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a %* (p_ +++ ?q1) = a %* p_ +++ a %* ?q1
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
a %* (p_ +++ ?q1) = a %* p_ +++ a %* ?q1

goal (1 subgoal):
 1. a %* (a_ # p_ +++ q) = a %* (a_ # p_) +++ a %* q
[PROOF STEP]
by (cases q) (simp_all add: distrib_left)
[PROOF STATE]
proof (state)
this:
a %* (a_ # p_ +++ q) = a %* (a_ # p_) +++ a %* q

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma sparse_row_vector_addmult_spvec: "sparse_row_vector (addmult_spvec (y::'a::lattice_ring) a b) =
  (sparse_row_vector a) + (scalar_mult y (sparse_row_vector b))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sparse_row_vector (addmult_spvec y a b) = sparse_row_vector a + scalar_mult y (sparse_row_vector b)
[PROOF STEP]
apply (induct y a b rule: addmult_spvec.induct)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>y arr. sparse_row_vector (addmult_spvec y arr []) = sparse_row_vector arr + scalar_mult y (sparse_row_vector [])
 2. \<And>y v va. sparse_row_vector (addmult_spvec y [] (v # va)) = sparse_row_vector [] + scalar_mult y (sparse_row_vector (v # va))
 3. \<And>y i a arr j b brr. \<lbrakk>i < j \<Longrightarrow> sparse_row_vector (addmult_spvec y arr ((j, b) # brr)) = sparse_row_vector arr + scalar_mult y (sparse_row_vector ((j, b) # brr)); \<lbrakk>\<not> i < j; j < i\<rbrakk> \<Longrightarrow> sparse_row_vector (addmult_spvec y ((i, a) # arr) brr) = sparse_row_vector ((i, a) # arr) + scalar_mult y (sparse_row_vector brr); \<lbrakk>\<not> i < j; \<not> j < i\<rbrakk> \<Longrightarrow> sparse_row_vector (addmult_spvec y arr brr) = sparse_row_vector arr + scalar_mult y (sparse_row_vector brr)\<rbrakk> \<Longrightarrow> sparse_row_vector (addmult_spvec y ((i, a) # arr) ((j, b) # brr)) = sparse_row_vector ((i, a) # arr) + scalar_mult y (sparse_row_vector ((j, b) # brr))
[PROOF STEP]
apply (simp add: scalar_mult_add smult_spvec_cons sparse_row_vector_smult singleton_matrix_add)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done


[STATEMENT]
lemma slt_P_lower: "strict_lower_triangular_mat (P_lower d)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. strict_lower_triangular_mat (P_lower d)
[PROOF STEP]
unfolding strict_lower_triangular_mat_def P_lower_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i j. i \<le> j \<longrightarrow> (\<chi>i j. if j < i then P_dec d $ i $ j else 0) $ i $ j = 0
[PROOF STEP]
by auto


[STATEMENT]
lemma lcm_mult_distrib: "k * lcm a b = lcm (k * a) (k * b) * unit_factor k"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. k * lcm a b = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. k * lcm a b = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
have "normalize k * lcm a b = lcm (k * a) (k * b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. normalize k * lcm a b = lcm (k * a) (k * b)
[PROOF STEP]
by (simp add: lcm_mult_distrib')
[PROOF STATE]
proof (state)
this:
normalize k * lcm a b = lcm (k * a) (k * b)

goal (1 subgoal):
 1. k * lcm a b = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
normalize k * lcm a b = lcm (k * a) (k * b)
[PROOF STEP]
have "normalize k * lcm a b * unit_factor k = lcm (k * a) (k * b) * unit_factor k"
[PROOF STATE]
proof (prove)
using this:
normalize k * lcm a b = lcm (k * a) (k * b)

goal (1 subgoal):
 1. normalize k * lcm a b * unit_factor k = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
normalize k * lcm a b * unit_factor k = lcm (k * a) (k * b) * unit_factor k

goal (1 subgoal):
 1. k * lcm a b = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
normalize k * lcm a b * unit_factor k = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
have "normalize k * unit_factor k * lcm a b  = lcm (k * a) (k * b) * unit_factor k"
[PROOF STATE]
proof (prove)
using this:
normalize k * lcm a b * unit_factor k = lcm (k * a) (k * b) * unit_factor k

goal (1 subgoal):
 1. normalize k * unit_factor k * lcm a b = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
by (simp only: ac_simps)
[PROOF STATE]
proof (state)
this:
normalize k * unit_factor k * lcm a b = lcm (k * a) (k * b) * unit_factor k

goal (1 subgoal):
 1. k * lcm a b = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
normalize k * unit_factor k * lcm a b = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
normalize k * unit_factor k * lcm a b = lcm (k * a) (k * b) * unit_factor k

goal (1 subgoal):
 1. k * lcm a b = lcm (k * a) (k * b) * unit_factor k
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
k * lcm a b = lcm (k * a) (k * b) * unit_factor k

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma op_cf_commma_obj_flip_app[cat_comma_cs_simps]:
  assumes "A = [a, b, f]\<^sub>\<circ>" and "A \<in>\<^sub>\<circ> (\<GG> \<^sub>C\<^sub>F\<down>\<^sub>C\<^sub>F \<HH>)\<lparr>Obj\<rparr>"
  shows "op_cf_commma_obj_flip \<GG> \<HH>\<lparr>A\<rparr> = [b, a, f]\<^sub>\<circ>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. op_cf_commma_obj_flip \<GG> \<HH>\<lparr>A\<rparr> = [b, a, f]\<^sub>\<circ>
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
A = [a, b, f]\<^sub>\<circ>
A \<in>\<^sub>\<circ> \<GG> \<^sub>C\<^sub>F\<down>\<^sub>C\<^sub>F \<HH>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. op_cf_commma_obj_flip \<GG> \<HH>\<lparr>A\<rparr> = [b, a, f]\<^sub>\<circ>
[PROOF STEP]
unfolding op_cf_commma_obj_flip_def
[PROOF STATE]
proof (prove)
using this:
A = [a, b, f]\<^sub>\<circ>
A \<in>\<^sub>\<circ> \<GG> \<^sub>C\<^sub>F\<down>\<^sub>C\<^sub>F \<HH>\<lparr>Obj\<rparr>

goal (1 subgoal):
 1. (\<lambda>A\<in>\<^sub>\<circ>\<GG> \<^sub>C\<^sub>F\<down>\<^sub>C\<^sub>F \<HH>\<lparr>Obj\<rparr>. [A\<lparr>1\<^sub>\<nat>\<rparr>, A\<lparr>[]\<^sub>\<circ>\<rparr>, A\<lparr>2\<^sub>\<nat>\<rparr>]\<^sub>\<circ>)\<lparr>A\<rparr> = [b, a, f]\<^sub>\<circ>
[PROOF STEP]
by (simp add: nat_omega_simps)


[STATEMENT]
lemma least_bounded_gr:
  fixes P :: "nat \<Rightarrow> bool" and m :: nat
  assumes "\<exists>x. x < upper \<and> P x"
  shows "(LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x)
[PROOF STEP]
proof (induction m)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + 0 \<and> P x)
 2. \<And>m. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x) \<Longrightarrow> (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:

goal (2 subgoals):
 1. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + 0 \<and> P x)
 2. \<And>m. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x) \<Longrightarrow> (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + 0 \<and> P x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + 0 \<and> P x)

goal (1 subgoal):
 1. \<And>m. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x) \<Longrightarrow> (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>m. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x) \<Longrightarrow> (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
case (Suc m)
[PROOF STATE]
proof (state)
this:
(LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x)

goal (1 subgoal):
 1. \<And>m. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x) \<Longrightarrow> (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x)

goal (1 subgoal):
 1. \<And>m. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x) \<Longrightarrow> (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
have "\<exists>x. x < upper + m \<and> P x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>x<upper + m. P x
[PROOF STEP]
using assms trans_less_add1
[PROOF STATE]
proof (prove)
using this:
\<exists>x<upper. P x
?i < ?j \<Longrightarrow> ?i < ?j + ?m

goal (1 subgoal):
 1. \<exists>x<upper + m. P x
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
\<exists>x<upper + m. P x

goal (1 subgoal):
 1. \<And>m. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x) \<Longrightarrow> (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x)
\<exists>x<upper + m. P x
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
(LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x)
\<exists>x<upper + m. P x

goal (1 subgoal):
 1. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
using least_bounded_Suc
[PROOF STATE]
proof (prove)
using this:
(LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + m \<and> P x)
\<exists>x<upper + m. P x
\<exists>x<?upper. ?P x \<Longrightarrow> (LEAST x. x < ?upper \<and> ?P x) = (LEAST x. x < Suc ?upper \<and> ?P x)

goal (1 subgoal):
 1. (LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(LEAST x. x < upper \<and> P x) = (LEAST x. x < upper + Suc m \<and> P x)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma mat_mul_finsum_alt:
  assumes A: "A \<in> carrier_mat nr n" and B: "B \<in> carrier_mat n nc"
  shows "A * B = mat\<^sub>r nr nc (\<lambda> i. finsum_vec TYPE('a :: semiring_0) nc (\<lambda>k. A $$ (i,k) \<cdot>\<^sub>v row B k) {0 ..< n})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. A * B = mat\<^sub>r nr nc (\<lambda>i. finsum_vec TYPE('a) nc (\<lambda>k. A $$ (i, k) \<cdot>\<^sub>v row B k) {0..<n})
[PROOF STEP]
by (rule eq_matI, insert A B, auto, subst index_finsum_vec, auto simp: scalar_prod_def intro: sum.cong)


[STATEMENT]
lemma extract_src_dst_ips_length: "length (extract_src_dst_ips rs acc) = 2*length rs + length acc"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. length (extract_src_dst_ips rs acc) = 2 * length rs + length acc
[PROOF STEP]
proof(induction rs arbitrary: acc)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>acc. length (extract_src_dst_ips [] acc) = 2 * length [] + length acc
 2. \<And>a rs acc. (\<And>acc. length (extract_src_dst_ips rs acc) = 2 * length rs + length acc) \<Longrightarrow> length (extract_src_dst_ips (a # rs) acc) = 2 * length (a # rs) + length acc
[PROOF STEP]
case (Cons r rs)
[PROOF STATE]
proof (state)
this:
length (extract_src_dst_ips rs ?acc) = 2 * length rs + length ?acc

goal (2 subgoals):
 1. \<And>acc. length (extract_src_dst_ips [] acc) = 2 * length [] + length acc
 2. \<And>a rs acc. (\<And>acc. length (extract_src_dst_ips rs acc) = 2 * length rs + length acc) \<Longrightarrow> length (extract_src_dst_ips (a # rs) acc) = 2 * length (a # rs) + length acc
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length (extract_src_dst_ips rs ?acc) = 2 * length rs + length ?acc

goal (1 subgoal):
 1. length (extract_src_dst_ips (r # rs) acc) = 2 * length (r # rs) + length acc
[PROOF STEP]
by(cases r, simp)
[PROOF STATE]
proof (state)
this:
length (extract_src_dst_ips (r # rs) acc) = 2 * length (r # rs) + length acc

goal (1 subgoal):
 1. \<And>acc. length (extract_src_dst_ips [] acc) = 2 * length [] + length acc
[PROOF STEP]
qed(simp)


[STATEMENT]
lemma to_language_conc[simp]: "to_language (A @@ B) = Times (to_language A) (to_language B)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. to_language (A @@ B) = Times (to_language A) (to_language B)
[PROOF STEP]
by (coinduction arbitrary: A B rule: language_coinduct_upto_Plus)
    (auto simp: Deriv_def[symmetric])


[STATEMENT]
lemma app3_list:
  "toList (app3 t1 xs t2) = (toList t1) @ (nlistToList xs) @ (toList t2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. toList (app3 t1 xs t2) = toList t1 @ nlistToList xs @ toList t2
[PROOF STEP]
apply (induct t1 xs t2 rule: app3.induct)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>xs t. toList (app3 Empty xs t) = toList Empty @ nlistToList xs @ toList t
 2. \<And>v xs. toList (app3 (Single v) xs Empty) = toList (Single v) @ nlistToList xs @ toList Empty
 3. \<And>v va vb vc xs. toList (app3 (Deep v va vb vc) xs Empty) = toList (Deep v va vb vc) @ nlistToList xs @ toList Empty
 4. \<And>x xs v. toList (app3 (Single x) xs (Single v)) = toList (Single x) @ nlistToList xs @ toList (Single v)
 5. \<And>x xs v va vb vc. toList (app3 (Single x) xs (Deep v va vb vc)) = toList (Single x) @ nlistToList xs @ toList (Deep v va vb vc)
 6. \<And>v va vb vc xs x. toList (app3 (Deep v va vb vc) xs (Single x)) = toList (Deep v va vb vc) @ nlistToList xs @ toList (Single x)
 7. \<And>uu_ pr1 m1 sf1 ts uv_ pr2 m2 sf2. toList (app3 m1 (nodes (digitToNlist sf1 @ ts @ digitToNlist pr2)) m2) = toList m1 @ nlistToList (nodes (digitToNlist sf1 @ ts @ digitToNlist pr2)) @ toList m2 \<Longrightarrow> toList (app3 (Deep uu_ pr1 m1 sf1) ts (Deep uv_ pr2 m2 sf2)) = toList (Deep uu_ pr1 m1 sf1) @ nlistToList ts @ toList (Deep uv_ pr2 m2 sf2)
[PROOF STEP]
apply (simp_all add: nlistListLCons nlistListRCons nlcons_list nrcons_list)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>pr1 m1 sf1 ts pr2 m2 sf2. toList (app3 m1 (nodes (digitToNlist sf1 @ ts @ digitToNlist pr2)) m2) = toList m1 @ nlistToList (nodes (digitToNlist sf1 @ ts @ digitToNlist pr2)) @ toList m2 \<Longrightarrow> toList (deep pr1 (app3 m1 (nodes (digitToNlist sf1 @ ts @ digitToNlist pr2)) m2) sf2) = digitToList pr1 @ toList m1 @ digitToList sf1 @ nlistToList ts @ digitToList pr2 @ toList m2 @ digitToList sf2
[PROOF STEP]
apply (simp add: app3_list_lem1 deep_def)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done